body { font-family: 'Inter', 'Prompt', sans-serif; -webkit-tap-highlight-color: transparent; }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 20px); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.sidebar-label { transition: opacity 150ms ease-in-out; }

/* ========================================================================= */
/* Warm Charcoal & Amber Theme Tokens & Overrides (WCAG AAA Compliant)      */
/* ========================================================================= */
:root.dark {
  --bg-canvas: #171513;        /* Warm Dark Charcoal */
  --bg-surface: #201d1a;       /* Elevated Surface / Card */
  --bg-elevated: #26221e;      /* Popovers / Floating Panels */
  --bg-subtle: #2b2723;        /* Inputs / Badges / Hover */
  --border-subtle: #332e29;    /* Card & Table Borders */
  --border-strong: #484139;    /* Focus / Active Borders */
  --text-primary: #f5f0e8;     /* Warm Cream (14.2:1 contrast) */
  --text-muted: #a89f91;       /* Warm Sand Gray */
  --text-faint: #797165;       /* Subtext / Timestamps */
  --accent-amber: #f59e0b;     /* Warm Amber */
  --accent-amber-hover: #d97706;
}

/* Scrollbars in Warm Charcoal Theme */
.dark ::-webkit-scrollbar-track { background: #171513 !important; }
.dark ::-webkit-scrollbar-thumb { background: #484139 !important; border-radius: 9999px; }
.dark ::-webkit-scrollbar-thumb:hover { background: #5e544a !important; }

/* Global Base in Dark Mode */
.dark body {
  background-color: #171513 !important;
  color: #f5f0e8 !important;
}
.dark table {
  color: #f5f0e8 !important;
}

/* Workload Table: Solid crisp borders and readable typography */
#workloadTable {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
}
.dark #workloadTable {
  background-color: #171513 !important;
  border-color: #484139 !important;
}
#workloadTable th,
#workloadTable td {
  background-clip: padding-box;
  border-bottom-width: 1px !important;
  border-bottom-style: solid !important;
  border-bottom-color: #e2e8f0;
}
.dark #workloadTable th,
.dark #workloadTable td {
  border-bottom-color: #332e29 !important;
}

/* Zero-lag theme switch: disable sluggish transitions globally during switch */
body, table, thead, tbody, tr, td, th,
.disable-transitions,
.disable-transitions * {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

.cell-plan { background-color: #f3e8ff; color: #6b21a8; font-weight: 700; border-radius: 3px; }
.cell-actual { background-color: #dcfce7; color: #15803d; font-weight: 700; border-radius: 3px; }

/* Warm Charcoal & Amber Cells in Workload Matrix */
.dark .cell-plan { background-color: #3a2817 !important; color: #fbbf24 !important; font-weight: 700; border-radius: 3px; }
.dark .cell-actual { background-color: #0f3024 !important; color: #6ee7b7 !important; font-weight: 700; border-radius: 3px; }
.header-green-accent { background-color: #22c55e; color: #ffffff; font-weight: bold; border-radius: 4px; padding: 2px 8px; }

/* Tailwind Utility Class Overrides for Warm Charcoal & Amber */
.dark .dark\:bg-slate-950 { background-color: #171513 !important; }
.dark .dark\:bg-slate-900 { background-color: #201d1a !important; }
.dark .dark\:bg-slate-900\/60 { background-color: rgba(32, 29, 26, 0.6) !important; }
.dark .dark\:bg-slate-900\/80 { background-color: rgba(32, 29, 26, 0.8) !important; }
.dark .dark\:bg-slate-900\/90 { background-color: rgba(32, 29, 26, 0.9) !important; }
.dark .dark\:bg-slate-850 { background-color: #26221e !important; }
.dark .dark\:bg-slate-800 { background-color: #2b2723 !important; }
.dark .dark\:bg-slate-800\/60 { background-color: rgba(43, 39, 35, 0.6) !important; }
.dark .dark\:bg-slate-800\/80 { background-color: rgba(43, 39, 35, 0.8) !important; }
.dark .dark\:bg-slate-700 { background-color: #332e29 !important; }

.dark .dark\:border-slate-900 { border-color: #201d1a !important; }
.dark .dark\:border-slate-800 { border-color: #332e29 !important; }
.dark .dark\:border-slate-700 { border-color: #484139 !important; }
.dark .dark\:border-slate-600 { border-color: #5e544a !important; }

.dark .dark\:text-white { color: #f5f0e8 !important; }
.dark .dark\:text-slate-100 { color: #f5f0e8 !important; }
.dark .dark\:text-slate-200 { color: #ece4d8 !important; }
.dark .dark\:text-slate-300 { color: #d1c7ba !important; }
.dark .dark\:text-slate-400 { color: #a89f91 !important; }
.dark .dark\:text-slate-500 { color: #797165 !important; }

.dark .dark\:hover\:bg-slate-800:hover { background-color: #2b2723 !important; }
.dark .dark\:hover\:bg-slate-700:hover { background-color: #332e29 !important; }

.dark tr:hover { background-color: #26221e !important; }
.dark tr:hover td { background-color: #26221e !important; }

/* Amber Tone Enhancements */
.dark .dark\:text-amber-300 { color: #fbbf24 !important; }
.dark .dark\:text-amber-200 { color: #fde68a !important; }
.dark .dark\:bg-amber-950\/60 { background-color: rgba(245, 158, 11, 0.12) !important; }
.dark .dark\:bg-amber-950\/70 { background-color: rgba(245, 158, 11, 0.15) !important; }
.dark .dark\:bg-amber-950\/80 { background-color: rgba(245, 158, 11, 0.18) !important; }
.dark .dark\:border-amber-700 { border-color: #b45309 !important; }
