/* ========================================
   CREDENCIADA STOCK MANAGEMENT PANEL
   ======================================== */

.ef-credenciada-stock-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Header ── */
.ef-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e0e0e0;
}

.ef-stock-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f1e5a;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* ── Toolbar ── */
.ef-stock-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ef-stock-toolbar button {
  background: #1B2F8A;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ef-stock-toolbar button:hover {
  background: #00AECC;
}

.ef-stock-toolbar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Stock Table ── */
.ef-stock-table-wrapper {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow-x: auto;
}

.ef-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ef-stock-table thead {
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
}

.ef-stock-table th {
  padding: 14px;
  text-align: left;
  font-weight: 700;
  color: #0f1e5a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.ef-stock-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}

.ef-stock-table tbody tr:hover {
  background: #f9f9f9;
}

.ef-sku-cell code {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: #666;
}

.ef-stock-table strong {
  font-weight: 700;
  color: #1B2F8A;
  font-size: 1.1rem;
}

/* Stock Status */
.ef-in-stock {
  display: inline-block;
  background: #E8F5E9;
  color: #2E7D32;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.ef-low-stock {
  display: inline-block;
  background: #FFEBEE;
  color: #C62828;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Actions */
.ef-actions {
  display: flex;
  gap: 8px;
}

.ef-stock-edit-btn,
.ef-stock-history-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  transition: transform 0.2s;
}

.ef-stock-edit-btn:hover,
.ef-stock-history-btn:hover {
  transform: scale(1.2);
}

/* ── No Data ── */
.ef-no-data {
  padding: 40px;
  text-align: center;
  color: #999;
  font-size: 1rem;
}

/* ── Modal ── */
.ef-stock-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ef-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.ef-modal-content {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.ef-modal-content.ef-modal-lg {
  max-width: 800px;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ef-modal-content h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f1e5a;
  margin: 0 0 20px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.ef-modal-content p {
  margin: 8px 0;
  color: #666;
  font-size: 0.95rem;
}

.ef-modal-content p strong {
  color: #0f1e5a;
  font-weight: 700;
}

/* ── Form ── */
.ef-stock-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.ef-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ef-form-group label {
  font-weight: 700;
  color: #0f1e5a;
  font-size: 0.95rem;
}

.ef-form-group input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.ef-form-group input:focus {
  outline: none;
  border-color: #00AECC;
  box-shadow: 0 0 0 3px rgba(0, 174, 204, 0.1);
}

.ef-form-group small {
  font-size: 0.8rem;
  color: #999;
}

.ef-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.ef-form-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ef-stock-save-btn {
  background: #1B2F8A;
  color: #fff;
}

.ef-stock-save-btn:hover {
  background: #00AECC;
}

.ef-modal-close {
  background: #ddd;
  color: #333;
}

.ef-modal-close:hover {
  background: #ccc;
}

/* ── History Table ── */
.ef-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ef-history-table thead {
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
}

.ef-history-table th {
  padding: 10px;
  text-align: left;
  font-weight: 700;
  color: #0f1e5a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.ef-history-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  color: #666;
}

.ef-plus {
  color: #2E7D32;
  font-weight: 700;
}

.ef-minus {
  color: #C62828;
  font-weight: 700;
}

/* ── Alerts ── */
.ef-alerts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.ef-alert-item {
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  border-left: 4px solid #F44336;
  border-radius: 6px;
  padding: 16px;
}

.ef-alert-item h4 {
  margin: 0 0 8px;
  color: #C62828;
  font-weight: 700;
}

.ef-alert-item p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: #666;
}

.ef-alert-shortage {
  background: rgba(244, 67, 54, 0.1);
  padding: 8px;
  border-radius: 4px;
  color: #C62828;
  font-weight: 600;
}

/* ── Toast ── */
.ef-stock-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 10000;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.ef-stock-toast.ef-success {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #81C784;
}

.ef-stock-toast.ef-error {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ef-credenciada-stock-panel {
    padding: 16px;
  }

  .ef-stock-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .ef-stock-toolbar {
    width: 100%;
  }

  .ef-stock-toolbar button {
    flex: 1;
    min-width: 0;
  }

  .ef-modal-content {
    max-width: 100%;
    padding: 20px;
  }

  .ef-stock-table {
    font-size: 0.8rem;
  }

  .ef-stock-table th,
  .ef-stock-table td {
    padding: 10px 8px;
  }

  .ef-history-table {
    font-size: 0.8rem;
  }

  .ef-alerts-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ef-credenciada-stock-panel {
    padding: 12px;
  }

  .ef-stock-header h2 {
    font-size: 1.3rem;
  }

  .ef-modal-content {
    padding: 16px;
  }

  .ef-stock-table th,
  .ef-stock-table td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }

  .ef-actions {
    gap: 4px;
  }

  .ef-stock-edit-btn,
  .ef-stock-history-btn {
    font-size: 1rem;
    padding: 4px;
  }
}
