/* Dark mode overrides — loaded after Tailwind so they win on utility classes. */
html.dark { color-scheme: dark; }
html:not(.dark) { color-scheme: light; }

/* Page + surfaces */
html.dark .bg-white,
html.dark .bg-white\/90,
html.dark .bg-slate-50,
html.dark .bg-slate-50\/70,
html.dark .bg-slate-100,
html.dark .bg-slate-200 { background-color: #111c2b !important; }
html.dark .bg-white\/10 { background-color: rgba(148, 163, 184, 0.12) !important; }
html.dark .bg-slate-800 { background-color: #334155 !important; }
html.dark .bg-slate-900 { background-color: #1e293b !important; }
html.dark .hover\:bg-slate-50:hover,
html.dark .hover\:bg-slate-200:hover { background-color: #1b2a3d !important; }
html.dark .hover\:bg-slate-800:hover { background-color: #334155 !important; }

/* Tinted surfaces */
html.dark .bg-blue-50,
html.dark .bg-blue-50\/40,
html.dark .bg-blue-50\/60,
html.dark .bg-blue-50\/70,
html.dark .bg-blue-100 { background-color: rgba(37, 99, 235, 0.24) !important; }
html.dark .hover\:bg-blue-50:hover,
html.dark .hover\:bg-blue-100:hover { background-color: rgba(37, 99, 235, 0.32) !important; }
html.dark .bg-emerald-50,
html.dark .bg-emerald-50\/40,
html.dark .bg-emerald-50\/60,
html.dark .bg-emerald-50\/70,
html.dark .bg-emerald-50\/80,
html.dark .bg-emerald-100 { background-color: rgba(5, 150, 105, 0.22) !important; }
html.dark .bg-amber-50\/80 { background-color: rgba(180, 83, 9, 0.24) !important; }
html.dark .bg-rose-50\/80 { background-color: rgba(190, 18, 60, 0.22) !important; }

/* Borders */
html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-200\/80 { border-color: #24364a !important; }
html.dark .border-slate-300 { border-color: #344960 !important; }
html.dark .border-blue-100,
html.dark .border-blue-200 { border-color: #1d4ed8 !important; }
html.dark .hover\:border-blue-300:hover { border-color: #3b82f6 !important; }
html.dark .border-emerald-200,
html.dark .border-emerald-300 { border-color: #047857 !important; }
html.dark .border-amber-200,
html.dark .border-amber-300 { border-color: #b45309 !important; }
html.dark .border-rose-300 { border-color: #be123c !important; }
html.dark .focus\:border-blue-500:focus { border-color: #60a5fa !important; }
html.dark .focus\:border-emerald-500:focus { border-color: #34d399 !important; }
html.dark .focus\:ring-blue-100:focus { --tw-ring-color: rgba(37, 99, 235, 0.45) !important; }
html.dark .focus\:ring-emerald-100:focus { --tw-ring-color: rgba(5, 150, 105, 0.45) !important; }

/* Text */
html.dark .text-slate-900 { color: #e6edf3 !important; }
html.dark .text-slate-800 { color: #d3e0e8 !important; }
html.dark .text-slate-700 { color: #b8c8d3 !important; }
html.dark .text-slate-600 { color: #9fb0bd !important; }
html.dark .text-slate-500 { color: #a9bcc8 !important; }
html.dark .text-slate-400 { color: #94a8b5 !important; }
html.dark .text-slate-300 { color: #cbd5e1 !important; }
html.dark .hover\:text-slate-900:hover { color: #f8fafc !important; }

html.dark .text-blue-400,
html.dark .text-blue-600,
html.dark .text-blue-700,
html.dark .text-blue-900,
html.dark .text-blue-950 { color: #93c5fd !important; }
html.dark .hover\:text-blue-700:hover,
html.dark .hover\:text-blue-800:hover { color: #bfdbfe !important; }

html.dark .text-emerald-400,
html.dark .text-emerald-600,
html.dark .text-emerald-700,
html.dark .text-emerald-800,
html.dark .text-emerald-900,
html.dark .text-emerald-950 { color: #6ee7b7 !important; }

html.dark .text-amber-600,
html.dark .text-amber-900,
html.dark .text-amber-950 { color: #fcd34d !important; }
html.dark .text-rose-800,
html.dark .text-rose-950 { color: #fda4af !important; }
html.dark .text-indigo-600 { color: #a5b4fc !important; }

/* Accent buttons stay vivid but readable */
html.dark .bg-blue-600 { background-color: #2563eb !important; }
html.dark .hover\:bg-blue-700:hover { background-color: #1d4ed8 !important; }
html.dark .bg-emerald-500 { background-color: #10b981 !important; }
html.dark .bg-emerald-600 { background-color: #059669 !important; }
html.dark .hover\:bg-emerald-700:hover { background-color: #047857 !important; }
html.dark .bg-amber-500 { background-color: #f59e0b !important; }
html.dark .bg-rose-600 { background-color: #e11d48 !important; }

/* Selection + scrollbar */
html.dark .selection\:bg-blue-100::selection { background-color: #1e40af !important; }
html.dark .selection\:text-blue-900::selection { color: #e0f2fe !important; }
html.dark ::-webkit-scrollbar-track { background: #0b1220; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Print always stays light and legible */
@media print {
  html.dark body { background: #fff !important; color: #000 !important; }
  html.dark .bg-white,
  html.dark .bg-white\/90,
  html.dark .bg-white\/10,
  html.dark .bg-slate-50,
  html.dark .bg-slate-50\/70,
  html.dark .bg-slate-100,
  html.dark .bg-slate-900,
  html.dark .bg-blue-50,
  html.dark .bg-blue-50\/60,
  html.dark .bg-blue-50\/70,
  html.dark .bg-emerald-50,
  html.dark .bg-emerald-50\/40,
  html.dark .bg-emerald-50\/60,
  html.dark .bg-emerald-50\/70,
  html.dark .bg-emerald-50\/80,
  html.dark .bg-emerald-100,
  html.dark .bg-amber-50\/80,
  html.dark .bg-rose-50\/80 { background-color: #fff !important; }

  html.dark .text-slate-900,
  html.dark .text-slate-800,
  html.dark .text-slate-700,
  html.dark .text-slate-600,
  html.dark .text-slate-500,
  html.dark .text-slate-400,
  html.dark .text-slate-300,
  html.dark .text-blue-400,
  html.dark .text-blue-600,
  html.dark .text-blue-700,
  html.dark .text-blue-900,
  html.dark .text-blue-950,
  html.dark .text-emerald-400,
  html.dark .text-emerald-600,
  html.dark .text-emerald-700,
  html.dark .text-emerald-800,
  html.dark .text-emerald-900,
  html.dark .text-emerald-950,
  html.dark .text-amber-600,
  html.dark .text-amber-900,
  html.dark .text-amber-950,
  html.dark .text-rose-800,
  html.dark .text-rose-950,
  html.dark .text-indigo-600 { color: #000 !important; }

  html.dark .border-slate-100,
  html.dark .border-slate-200,
  html.dark .border-slate-200\/80,
  html.dark .border-slate-300,
  html.dark .border-blue-100,
  html.dark .border-blue-200,
  html.dark .border-emerald-200,
  html.dark .border-emerald-300,
  html.dark .border-amber-200,
  html.dark .border-amber-300,
  html.dark .border-rose-300 { border-color: #d4d4d8 !important; }
}
