/* ==========================================================================
   Dark Theme
   (Token overrides for [data-theme="dark"])
   ========================================================================== */

[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-elevated: #1e293b;
  --bg-hover: #334155;
  --bg-active: #312e81;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-color: #334155;
  --border-strong: #475569;

  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-text-active: #a5b4fc;
  --sidebar-section: #64748b;
  --sidebar-hover: #334155;
  --sidebar-active: #312e81;

  --topbar-bg: #1e293b;
  --topbar-text: #cbd5e1;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

  --brand-primary-light: #312e81;
}

[data-theme="dark"] body { color-scheme: dark; }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .form-control::placeholder { color: var(--text-muted); }

[data-theme="dark"] .table { --bs-table-color: var(--text-primary); }
[data-theme="dark"] .table thead th {
  background-color: var(--bg-hover);
  color: var(--text-muted);
}

[data-theme="dark"] .dropdown-menu {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-content {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
}

[data-theme="dark"] .stat-card-icon-blue   { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
[data-theme="dark"] .stat-card-icon-purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
[data-theme="dark"] .stat-card-icon-orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
[data-theme="dark"] .stat-card-icon-red    { background: linear-gradient(135deg, #f87171, #ef4444); }
