/* ==================== Brand & Layout ==================== */
:root {
  --brand: #FF4B6E;
  --brand-light: #FF7A93;
  --brand-dark: #D93A5A;
  --sidebar-bg: #1e293b;
}

/* Smooth page transitions */
#page-content {
  animation: fadeIn 0.2s ease-in-out;
}

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

/* Sidebar nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  background: #fb7185;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.95);
}

.nav-item:hover {
  background: #334155;
  color: #e2e8f0;
}

.nav-item.active {
  background: #334155;
  color: #fff;
}

.nav-item .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ==================== Status badges ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.badge-pending   { background: #FEF3C7; color: #92400E; }
.badge-resolved  { background: #D1FAE5; color: #065F46; }
.badge-dismissed { background: #E5E7EB; color: #4B5563; }
.badge-active    { background: #D1FAE5; color: #065F46; }
.badge-suspended { background: #FEE2E2; color: #991B1B; }
.badge-admin     { background: #DBEAFE; color: #1E40AF; }
.badge-superadmin { background: #EDE9FE; color: #5B21B6; }

/* ==================== Toast ==================== */
.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease-out;
  max-width: 360px;
}

.toast-success { background: #065F46; color: #fff; }
.toast-error   { background: #991B1B; color: #fff; }
.toast-info    { background: #1E40AF; color: #fff; }

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

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

/* ==================== Modal ==================== */
#modal-overlay {
  transition: opacity 0.15s;
}

/* ==================== Tables ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button.active {
  color: #111827;
}

.sort-indicator {
  width: 0.875rem;
  height: 0.875rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.table-sort-button:hover .sort-indicator,
.table-sort-button.active .sort-indicator {
  color: var(--brand-dark);
}

.sort-indicator svg {
  display: block;
  width: 100%;
  height: 100%;
}

.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

/* ==================== Utility ==================== */
.btn-brand {
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-brand:hover { background: var(--brand-dark); }
.btn-brand:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover { background: #e5e7eb; }

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: #DC2626;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover { background: #B91C1C; }

.card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.journey-panel {
  background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
  border: 1px solid #eef2f7;
  border-radius: 0.875rem;
  padding: 1rem;
}

.journey-panel-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.875rem;
}

.journey-funnel-grid {
  display: grid;
  gap: 0.75rem;
}

.journey-step {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.875rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.journey-step-neutral {
  border-color: #e5e7eb;
}

.journey-step-warning {
  border-color: #fde68a;
  background: #fffdf5;
}

.journey-step-success {
  border-color: #bbf7d0;
  background: #f6fdf8;
}

.journey-step-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
}

.journey-step-value {
  font-size: 1.25rem;
  line-height: 1;
  color: #111827;
}

.journey-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
}

.journey-badge strong {
  color: #111827;
}

.journey-badge-neutral {
  border-color: #e5e7eb;
}

.journey-badge-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.journey-badge-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.journey-timeline {
  position: relative;
  display: grid;
  gap: 0.875rem;
}

.journey-timeline::before {
  content: '';
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.46875rem;
  width: 2px;
  background: linear-gradient(180deg, #fbcfe8 0%, #e5e7eb 100%);
}

.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.journey-dot {
  position: relative;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  margin-top: 0.5rem;
  border-radius: 9999px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(229, 231, 235, 0.9);
  background: #9ca3af;
}

.journey-dot-success {
  background: #22c55e;
}

.journey-dot-warning {
  background: #f59e0b;
}

.journey-dot-danger {
  background: #ef4444;
}

.journey-dot-neutral {
  background: #64748b;
}

.journey-card {
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.journey-source {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: 9999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Loading spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
}
