/* ============================================================
   LAB-OS Dark Mode — Galaxy Glassmorphism Theme
   Purple glow, space particles, frosted glass panels
   Applied via body.dark-mode class
   ============================================================ */

/* ===== CSS Variables Override ===== */
body.dark-mode {
  --dm-bg: #0a0a1a;
  --dm-bg-secondary: #0f0f2a;
  --dm-surface: rgba(255, 255, 255, 0.06);
  --dm-surface-hover: rgba(255, 255, 255, 0.1);
  --dm-surface-active: rgba(255, 255, 255, 0.14);
  --dm-border: rgba(255, 255, 255, 0.1);
  --dm-border-strong: rgba(255, 255, 255, 0.18);
  --dm-text: rgba(255, 255, 255, 0.92);
  --dm-text-secondary: rgba(255, 255, 255, 0.6);
  --dm-text-muted: rgba(255, 255, 255, 0.4);
  --dm-glow-purple: rgba(128, 42, 142, 0.5);
  --dm-glow-purple-strong: rgba(128, 42, 142, 0.8);
  --dm-glow-purple-subtle: rgba(128, 42, 142, 0.25);
  --dm-purple-accent: #a855f7;
  --dm-purple-bright: #c084fc;
  --dm-glass-blur: 12px;
  --dm-glass-bg: rgba(15, 15, 42, 0.7);
  --dm-glass-bg-light: rgba(15, 15, 42, 0.5);
  --dm-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(128, 42, 142, 0.1);

  /* Override base theme variables for dark mode */
  --primary: #c084fc;
}

/* Override base CSS variables so var(--gray-50) etc. auto-resolve dark */
body.dark-mode {
  --gray-50: rgba(255, 255, 255, 0.04);
  --gray-100: rgba(255, 255, 255, 0.06);
  --gray-200: rgba(255, 255, 255, 0.1);
  --gray-300: rgba(255, 255, 255, 0.15);
  --gray-400: rgba(255, 255, 255, 0.4);
  --gray-500: rgba(255, 255, 255, 0.5);
  --gray-600: rgba(255, 255, 255, 0.6);
  --gray-700: rgba(255, 255, 255, 0.75);
  --gray-800: rgba(255, 255, 255, 0.85);
  --gray-900: rgba(255, 255, 255, 0.92);
  --neutral-dark: rgba(255, 255, 255, 0.92);
  --neutral-light: var(--dm-bg);
  --white: rgba(15, 15, 42, 0.7);
  --sidebar-bg: var(--dm-glass-bg);
}

/* ===== Body & Background ===== */
body.dark-mode {
  background: var(--dm-bg);
  color: var(--dm-text);
}

/* Galaxy gradient orbs behind everything */
body.dark-mode::before,
body.dark-mode::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
}

body.dark-mode::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(128, 42, 142, 0.4), transparent 70%);
  top: -150px;
  left: -100px;
}

body.dark-mode::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
  bottom: -100px;
  right: -100px;
}

/* ===== Main Content ===== */
body.dark-mode .main-content {
  position: relative;
  z-index: 1;
}

/* ===== Top Header — Frosted Glass ===== */
body.dark-mode .top-header {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(var(--dm-glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) saturate(180%);
  border-bottom: 1px solid var(--dm-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(128, 42, 142, 0.15);
}

body.dark-mode .header-brand {
  color: var(--dm-text);
}

body.dark-mode .header-logo-img {
  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(168, 85, 247, 0.6)) drop-shadow(0 0 20px rgba(128, 42, 142, 0.4));
}

body.dark-mode .header-title {
  color: var(--dm-text);
}

body.dark-mode .header-subtitle {
  color: var(--dm-purple-bright);
  text-shadow: 0 0 10px rgba(128, 42, 142, 0.5);
}

body.dark-mode .header-icon-btn {
  color: var(--dm-text-secondary);
}

body.dark-mode .header-icon-btn:hover {
  color: var(--dm-purple-bright);
  background: var(--dm-surface-hover);
}

/* ===== Sidebar — Frosted Glass ===== */
body.dark-mode .sidebar {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(var(--dm-glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) saturate(180%);
  border-right: 1px solid var(--dm-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .sidebar-category-label {
  color: var(--dm-text-muted);
}

body.dark-mode .sidebar-item {
  color: var(--dm-text-secondary);
}

body.dark-mode .sidebar-item:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .sidebar-item.active {
  background: var(--dm-surface-active);
  color: var(--dm-purple-bright);
  border-left-color: var(--dm-purple-accent);
  box-shadow: inset 3px 0 10px rgba(128, 42, 142, 0.3);
}

body.dark-mode .sidebar-icon {
  color: inherit;
}

body.dark-mode .sidebar-badge {
  background: var(--dm-purple-accent);
  color: white;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

body.dark-mode .sidebar-user {
  border-top: 1px solid var(--dm-border);
}

body.dark-mode .sidebar-user-name {
  color: var(--dm-text);
}

body.dark-mode .sidebar-user-role {
  color: var(--dm-text-muted);
}

body.dark-mode .sidebar-user a {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sidebar-user a:hover {
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .sidebar-avatar {
  background: rgba(128, 42, 142, 0.3);
  color: var(--dm-purple-bright);
  border: 1px solid rgba(128, 42, 142, 0.4);
}

body.dark-mode .sidebar-collapse-btn,
body.dark-mode .sidebar-close-btn {
  color: var(--dm-text-secondary);
}

body.dark-mode .sidebar-collapse-btn:hover,
body.dark-mode .sidebar-close-btn:hover {
  color: var(--dm-text);
  background: var(--dm-surface-hover);
}

body.dark-mode .sidebar-chevron {
  color: var(--dm-text-muted);
}

body.dark-mode .sidebar-overlay {
  background: rgba(0, 0, 0, 0.6) !important;
}

/* ===== Cards — Glassmorphism ===== */
body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .widget-card,
body.dark-mode .dashboard-widget {
  background: var(--dm-surface) !important;
  backdrop-filter: blur(var(--dm-glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .card:hover {
  border-color: var(--dm-border-strong);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 25px rgba(128, 42, 142, 0.15);
}

/* ===== Page Headers ===== */
body.dark-mode .page-header h1,
body.dark-mode .page-header h2 {
  color: var(--dm-text);
}

body.dark-mode .page-header p {
  color: var(--dm-text-secondary);
}

/* ===== Buttons ===== */
body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #802a8e, #a855f7);
  border-color: transparent;
  box-shadow: 0 0 15px rgba(128, 42, 142, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white;
}

body.dark-mode .btn-primary:hover {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  box-shadow: 0 0 25px rgba(128, 42, 142, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

body.dark-mode .btn-secondary {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  color: var(--dm-text-secondary);
  backdrop-filter: blur(8px);
}

body.dark-mode .btn-secondary:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
  border-color: var(--dm-border-strong);
}

body.dark-mode .btn-success {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

body.dark-mode .btn-danger {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

body.dark-mode .btn-warning {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

body.dark-mode .btn-info {
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

/* ===== Form Controls — Glass ===== */
body.dark-mode .form-control,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode input[type="search"],
body.dark-mode input[type="url"],
body.dark-mode textarea,
body.dark-mode select {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--dm-border);
  color: var(--dm-text);
  backdrop-filter: blur(6px);
}

body.dark-mode .form-control:focus,
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  border-color: var(--dm-purple-accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25), 0 0 15px rgba(128, 42, 142, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .form-control::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--dm-text-muted);
}

body.dark-mode .form-label,
body.dark-mode label {
  color: var(--dm-text-secondary);
}

body.dark-mode .form-hint,
body.dark-mode small {
  color: var(--dm-text-muted);
}

body.dark-mode select option {
  background: #1a1a3a;
  color: var(--dm-text);
}

/* ===== Data Tables — Glass ===== */
body.dark-mode .data-table {
  background: transparent;
}

body.dark-mode .data-table thead th {
  background: rgba(128, 42, 142, 0.15);
  color: var(--dm-text-secondary);
  border-bottom: 1px solid var(--dm-border);
}

body.dark-mode .data-table tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--dm-text);
}

body.dark-mode .data-table tbody tr:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .data-table tbody tr:nth-child(even):hover {
  background: var(--dm-surface-hover);
}

/* ===== Modals & Popups — Glassmorphism ===== */
body.dark-mode .modal,
body.dark-mode .bug-report-modal {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

body.dark-mode .modal-content,
body.dark-mode .bug-report-content {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(128, 42, 142, 0.2);
  color: var(--dm-text);
}

body.dark-mode .modal-content h2,
body.dark-mode .modal-content h3,
body.dark-mode .bug-report-header h3 {
  color: var(--dm-text);
}

body.dark-mode .bug-report-header {
  border-bottom-color: var(--dm-border);
}

body.dark-mode .bug-report-footer {
  border-top-color: var(--dm-border);
}

body.dark-mode .bug-report-close {
  color: var(--dm-text-muted);
}

body.dark-mode .bug-report-close:hover {
  color: var(--dm-text);
}

body.dark-mode .bug-report-overlay {
  background: rgba(0, 0, 0, 0.5);
}

/* ===== Notification Panel — Glass ===== */
body.dark-mode .notif-panel {
  background: rgba(15, 15, 42, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(128, 42, 142, 0.15);
}

body.dark-mode .notif-panel-header {
  border-bottom-color: var(--dm-border);
  color: var(--dm-text);
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .notif-panel-header strong {
  color: var(--dm-text);
}

body.dark-mode .notif-clear-btn {
  color: #c084fc;
}
body.dark-mode .notif-clear-btn:hover {
  background: rgba(168, 85, 247, 0.15);
}

body.dark-mode .notif-panel-body {
  color: var(--dm-text-secondary);
}

body.dark-mode .notif-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
  color: var(--dm-text);
}

body.dark-mode .notif-item:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .notif-item.unread {
  background: rgba(168, 85, 247, 0.1);
}
body.dark-mode .notif-item.unread:hover {
  background: rgba(168, 85, 247, 0.18);
}

body.dark-mode .notif-title {
  color: var(--dm-text);
}

body.dark-mode .notif-msg {
  color: var(--dm-text-secondary);
}

body.dark-mode .notif-time {
  color: var(--dm-text-muted);
}

body.dark-mode .notif-icon.email { background: rgba(59, 130, 246, 0.2); }
body.dark-mode .notif-icon.booking { background: rgba(245, 158, 11, 0.2); }
body.dark-mode .notif-icon.registration { background: rgba(16, 185, 129, 0.2); }
body.dark-mode .notif-icon.staff { background: rgba(168, 85, 247, 0.2); }
body.dark-mode .notif-icon.action { background: rgba(236, 72, 153, 0.2); }
body.dark-mode .notif-icon.payment { background: rgba(16, 185, 129, 0.2); }
body.dark-mode .notif-icon.deadline { background: rgba(239, 68, 68, 0.2); }

body.dark-mode .notif-empty {
  color: var(--dm-text-muted);
}

body.dark-mode .notif-badge {
  background: var(--dm-purple-accent);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

/* ===== Quick Actions Panel — Glass ===== */
body.dark-mode .qa-panel {
  background: rgba(15, 15, 42, 0.95) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(128, 42, 142, 0.15);
}

body.dark-mode .qa-item {
  color: var(--dm-text);
}

body.dark-mode .qa-item:hover {
  background: rgba(168, 85, 247, 0.12);
  color: var(--dm-purple-bright);
}

body.dark-mode .qa-item svg,
body.dark-mode .qa-item img {
  color: var(--dm-text-secondary) !important;
  opacity: 0.85;
}

body.dark-mode .qa-item:hover svg,
body.dark-mode .qa-item:hover img {
  color: var(--dm-purple-bright) !important;
  opacity: 1;
}

/* ===== Quick Action Slide Panel ===== */
body.dark-mode #quickActionContent {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(128, 42, 142, 0.15) !important;
  border-left: 1px solid var(--dm-border);
}

body.dark-mode #quickActionContent h3,
body.dark-mode #quickActionContent label {
  color: var(--dm-text) !important;
}

body.dark-mode #quickActionContent div[style*="border-bottom"],
body.dark-mode #quickActionContent div[style*="border-top"] {
  border-color: var(--dm-border) !important;
}

/* ===== Status Badges — Glowing ===== */
body.dark-mode .status-badge {
  backdrop-filter: blur(4px);
}

body.dark-mode .badge-success,
body.dark-mode .status-badge.confirmed,
body.dark-mode .status-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

body.dark-mode .badge-danger,
body.dark-mode .status-badge.cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

body.dark-mode .badge-warning,
body.dark-mode .status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

body.dark-mode .badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== Footer — Glass ===== */
body.dark-mode .footer {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(var(--dm-glass-blur));
  -webkit-backdrop-filter: blur(var(--dm-glass-blur));
  border-top: 1px solid var(--dm-border);
  color: var(--dm-text-muted);
}

body.dark-mode .footer a,
body.dark-mode .social-link,
body.dark-mode .contact-item {
  color: var(--dm-text-muted);
}

body.dark-mode .footer a:hover,
body.dark-mode .social-link:hover,
body.dark-mode .contact-item:hover {
  color: var(--dm-purple-bright);
}

/* ===== Tabs & Filters ===== */
body.dark-mode .tab-bar,
body.dark-mode .filter-bar,
body.dark-mode .tabs {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  backdrop-filter: blur(8px);
}

body.dark-mode .tab-btn,
body.dark-mode .filter-btn {
  color: var(--dm-text-secondary);
}

body.dark-mode .tab-btn:hover,
body.dark-mode .filter-btn:hover {
  color: var(--dm-text);
  background: var(--dm-surface-hover);
}

body.dark-mode .tab-btn.active,
body.dark-mode .filter-btn.active {
  color: var(--dm-purple-bright);
  border-color: var(--dm-purple-accent);
  background: rgba(128, 42, 142, 0.15);
}

/* ===== Search / Filter Inputs ===== */
body.dark-mode .search-bar,
body.dark-mode .filter-input,
body.dark-mode [class*="search"] input {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

/* ===== Dropdowns ===== */
body.dark-mode .dropdown-menu,
body.dark-mode [class*="dropdown"] ul {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ===== Tooltips & Toasts ===== */
body.dark-mode .toast,
body.dark-mode .rc-sms-toast,
body.dark-mode .ai-toast,
body.dark-mode .ai-toast-summary {
  background: rgba(15, 15, 42, 0.95) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(128, 42, 142, 0.15);
  color: var(--dm-text);
}
body.dark-mode .ai-toast-title {
  color: var(--dm-text) !important;
}
body.dark-mode .ai-toast-meta {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .ai-toast-close {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .ai-toast-close:hover {
  color: var(--dm-text) !important;
}
body.dark-mode .ai-toast.overdue .ai-toast-icon {
  background: rgba(220, 38, 38, 0.2) !important;
}
body.dark-mode .ai-toast.today .ai-toast-icon {
  background: rgba(245, 158, 11, 0.2) !important;
}
body.dark-mode .ai-toast.tomorrow .ai-toast-icon {
  background: rgba(59, 130, 246, 0.2) !important;
}
body.dark-mode .ai-toast.overdue .ai-toast-label {
  color: #fca5a5 !important;
}
body.dark-mode .ai-toast.today .ai-toast-label {
  color: #fcd34d !important;
}
body.dark-mode .ai-toast.tomorrow .ai-toast-label {
  color: #93c5fd !important;
}

/* ===== Settings Page ===== */
body.dark-mode .settings-layout {
  background: transparent;
}

body.dark-mode .settings-nav {
  background: var(--dm-surface);
  border-right-color: var(--dm-border);
  backdrop-filter: blur(8px);
}

body.dark-mode .settings-nav-group-title {
  color: var(--dm-text-muted);
}

body.dark-mode .settings-nav-item {
  color: var(--dm-text-secondary);
}

body.dark-mode .settings-nav-item:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .settings-nav-item.active {
  background: rgba(128, 42, 142, 0.15);
  color: var(--dm-purple-bright);
  border-left-color: var(--dm-purple-accent);
}

body.dark-mode .settings-panel {
  color: var(--dm-text);
}

/* ===== Scrollbar ===== */
body.dark-mode ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(128, 42, 142, 0.4);
  border-radius: 4px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 42, 142, 0.6);
}

/* ===== Links ===== */
body.dark-mode a {
  color: var(--dm-purple-bright);
}

body.dark-mode a:hover {
  color: #d8b4fe;
}

/* ===== Dividers / Borders ===== */
body.dark-mode hr {
  border-color: var(--dm-border);
}

body.dark-mode [style*="border-bottom: 1px solid"],
body.dark-mode [style*="border-top: 1px solid"],
body.dark-mode [style*="border: 1px solid"] {
  border-color: var(--dm-border) !important;
}

/* ===== Admin Page ===== */
body.dark-mode .admin-page h1,
body.dark-mode .admin-page h2,
body.dark-mode .admin-page h3 {
  color: var(--dm-text);
}

body.dark-mode .admin-page p,
body.dark-mode .admin-page span {
  color: var(--dm-text-secondary);
}

/* ===== Stat Numbers / Highlights ===== */
body.dark-mode .stat-number,
body.dark-mode .widget-number {
  color: var(--dm-purple-bright);
  text-shadow: 0 0 20px rgba(128, 42, 142, 0.4);
}

body.dark-mode .stat-label,
body.dark-mode .widget-label {
  color: var(--dm-text-secondary);
}

/* ===== Empty States ===== */
body.dark-mode .empty-state {
  color: var(--dm-text-muted);
}

body.dark-mode .empty-state svg {
  opacity: 0.3;
}

/* ===== Inline code & pre ===== */
body.dark-mode code {
  background: rgba(128, 42, 142, 0.15);
  color: var(--dm-purple-bright);
  border: 1px solid rgba(128, 42, 142, 0.2);
}

body.dark-mode pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--dm-border);
  color: var(--dm-text);
}

/* ===== Progress Bars ===== */
body.dark-mode .progress-bar,
body.dark-mode [class*="progress"] {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

body.dark-mode .progress-fill {
  background: linear-gradient(90deg, #802a8e, #a855f7);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* ===== Checkboxes & Toggles ===== */
body.dark-mode input[type="checkbox"] {
  accent-color: var(--dm-purple-accent);
}

body.dark-mode input[type="radio"] {
  accent-color: var(--dm-purple-accent);
}

/* ===== Chat / Lab Assistant Widget ===== */
body.dark-mode .lab-panel {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 25px rgba(128, 42, 142, 0.15);
}

body.dark-mode .lab-fab {
  background: transparent;
  box-shadow: none;
}

body.dark-mode .lab-fab:hover {
  box-shadow: none;
}

body.dark-mode .lab-fab-img {
  filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.5));
}

/* ===== Reference Panel ===== */
body.dark-mode .ref-panel {
  background: var(--dm-glass-bg);
  border-left: 1px solid var(--dm-border);
}

/* ===== Dashboard Widgets ===== */
body.dark-mode .widget-header {
  border-bottom-color: var(--dm-border);
  color: var(--dm-text);
}

body.dark-mode .widget-body {
  color: var(--dm-text-secondary);
}

/* ===== Calendar ===== */
body.dark-mode .fc-theme-standard td,
body.dark-mode .fc-theme-standard th {
  border-color: var(--dm-border);
}

body.dark-mode .fc-theme-standard .fc-scrollgrid {
  border-color: var(--dm-border);
}

body.dark-mode .fc-daygrid-day {
  background: transparent;
}

body.dark-mode .fc-day-today {
  background: rgba(128, 42, 142, 0.1) !important;
}

body.dark-mode .fc-col-header-cell {
  background: rgba(128, 42, 142, 0.1);
  color: var(--dm-text-secondary);
}

/* ===== Strong / Bold text ===== */
body.dark-mode strong,
body.dark-mode b {
  color: var(--dm-text);
}

/* ===== Selection highlight ===== */
body.dark-mode ::selection {
  background: rgba(168, 85, 247, 0.3);
  color: white;
}

/* ===== Loading / Skeleton ===== */
body.dark-mode .skeleton,
body.dark-mode [class*="loading"] {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: dm-shimmer 1.5s ease-in-out infinite;
}

@keyframes dm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== What You Missed Modal ===== */
body.dark-mode #wymModal .wym-dialog {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
body.dark-mode .wym-body { color: var(--dm-text); }
body.dark-mode .wym-row { border-bottom-color: var(--dm-border); }
body.dark-mode .wym-row-text strong { color: var(--dm-text); }
body.dark-mode .wym-row-text p { color: var(--dm-text-muted); }
body.dark-mode .wym-row-count { color: #a29bfe; }
body.dark-mode .wym-row-icon.bookings { background: rgba(59,130,246,0.15); }
body.dark-mode .wym-row-icon.programs { background: rgba(139,92,246,0.15); }
body.dark-mode .wym-row-icon.camps { background: rgba(245,158,11,0.15); }
body.dark-mode .wym-row-icon.emails { background: rgba(16,185,129,0.15); }
body.dark-mode .wym-row-icon.deadline-passed { background: rgba(239,68,68,0.15); }
body.dark-mode .wym-row-icon.deadline-approaching { background: rgba(249,115,22,0.15); }
body.dark-mode .wym-deadline-list li { color: var(--dm-text-muted); }
body.dark-mode .wym-deadline-list li a { color: #a29bfe; }
body.dark-mode .wym-row a { color: #a29bfe; }
body.dark-mode .wym-footer { border-top-color: var(--dm-border); }

/* ===== Specific color overrides for inline styles ===== */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"] {
  background: var(--dm-surface) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: var(--dm-border) !important;
}

body.dark-mode [style*="color: var(--gray-500)"],
body.dark-mode [style*="color:var(--gray-500)"],
body.dark-mode [style*="color: var(--gray-600)"],
body.dark-mode [style*="color:var(--gray-600)"] {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode [style*="color: var(--gray-300)"],
body.dark-mode [style*="color:var(--gray-300)"],
body.dark-mode [style*="color: var(--gray-400)"],
body.dark-mode [style*="color:var(--gray-400)"] {
  color: var(--dm-text-muted) !important;
}

body.dark-mode [style*="background: var(--gray-50)"],
body.dark-mode [style*="background:var(--gray-50)"],
body.dark-mode [style*="background: var(--gray-100)"],
body.dark-mode [style*="background:var(--gray-100)"] {
  background: var(--dm-surface) !important;
}

/* ===== Pagination ===== */
body.dark-mode .pagination a,
body.dark-mode .pagination span {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .pagination a:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .pagination .active {
  background: rgba(128, 42, 142, 0.3);
  color: var(--dm-purple-bright);
  border-color: var(--dm-purple-accent);
}

/* ===== Alert / Status Messages ===== */
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"] {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"] {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"] {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ===== Dark Mode Toggle Card ===== */
.dark-mode-toggle-card {
  position: relative;
  overflow: hidden;
}

.dark-mode-toggle-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(128, 42, 142, 0.08), transparent 60%);
  pointer-events: none;
}

body.dark-mode .dark-mode-toggle-card::before {
  background: radial-gradient(circle at 30% 30%, rgba(128, 42, 142, 0.2), transparent 60%);
}

.dm-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dm-toggle-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.dm-toggle-info p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

body.dark-mode .dm-toggle-info p {
  color: var(--dm-text-secondary);
}

/* Fancy toggle switch */
.dm-switch {
  position: relative;
  width: 56px;
  height: 30px;
  flex-shrink: 0;
}

.dm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dm-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dm-switch-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dm-switch input:checked + .dm-switch-slider {
  background: linear-gradient(135deg, #802a8e, #a855f7);
  box-shadow: 0 0 15px rgba(128, 42, 142, 0.5);
}

.dm-switch input:checked + .dm-switch-slider::before {
  transform: translateX(26px);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Preview stars in toggle card */
.dm-preview-stars {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

.dm-star {
  width: 3px;
  height: 3px;
  background: var(--gray-400);
  border-radius: 50%;
  animation: dm-twinkle 3s ease-in-out infinite;
}

body.dark-mode .dm-star {
  background: var(--dm-purple-bright);
  box-shadow: 0 0 4px rgba(168, 85, 247, 0.6);
}

.dm-star:nth-child(2) { animation-delay: 0.5s; }
.dm-star:nth-child(3) { animation-delay: 1s; }
.dm-star:nth-child(4) { animation-delay: 1.5s; }
.dm-star:nth-child(5) { animation-delay: 2s; }
.dm-star:nth-child(6) { animation-delay: 0.3s; }
.dm-star:nth-child(7) { animation-delay: 1.2s; }
.dm-star:nth-child(8) { animation-delay: 2.5s; }

@keyframes dm-twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

/* ===== Driving Mode Dark Override ===== */
body.dark-mode .driving-panel {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px);
}

/* ===== Inventory / Kit Prep ===== */
body.dark-mode .kit-card,
body.dark-mode .inventory-card {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

/* ===== Compose Email Panel ===== */
body.dark-mode .compose-email-panel {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
}

/* ===== Compose Email Modal (global) — inline style overrides ===== */
body.dark-mode #composeEmailModal > div:nth-child(2) {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(128, 42, 142, 0.2) !important;
}

body.dark-mode #composeEmailModal h3 {
  color: var(--dm-text) !important;
}

body.dark-mode #composeEmailModal label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode #composeEmailModal > div:nth-child(2) > div {
  border-color: var(--dm-border) !important;
}

body.dark-mode #composeEmailModal button[onclick="closeComposeEmail()"] {
  color: var(--dm-text-muted) !important;
}

body.dark-mode #composeEmailModal button[onclick="closeComposeEmail()"]:hover {
  color: var(--dm-text) !important;
}

body.dark-mode #composeToDropdown {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode #composeToDropdown .compose-ac-item {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text);
}

body.dark-mode #composeToDropdown .compose-ac-item:hover {
  background: var(--dm-surface-hover) !important;
}

body.dark-mode #composeAIToggle {
  background: var(--dm-surface) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode #composeAIPanel {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode #composeDropZone {
  border-color: var(--dm-border) !important;
  background: transparent !important;
}

body.dark-mode #composeDropZone:hover {
  border-color: var(--dm-purple-accent) !important;
  background: var(--dm-surface) !important;
}

body.dark-mode #composeAttachPreviews > div {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text);
}

/* ═══════════════════════════════════════════════════════════════════
   SCHEDULE AGENDA — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .schedule-container {
  background: transparent;
}

body.dark-mode .schedule-header {
  background: var(--dm-surface);
  backdrop-filter: blur(var(--dm-glass-blur));
  -webkit-backdrop-filter: blur(var(--dm-glass-blur));
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
}

body.dark-mode .schedule-title-row h1 {
  color: var(--dm-purple-bright);
}

body.dark-mode .btn-export,
body.dark-mode .btn-availability {
  background: rgba(128, 42, 142, 0.2);
  color: var(--dm-purple-bright);
}

body.dark-mode .btn-export:hover,
body.dark-mode .btn-availability:hover {
  background: rgba(128, 42, 142, 0.3);
}

body.dark-mode .stat-item {
  background: var(--dm-surface);
}

body.dark-mode .stat-item .stat-label {
  color: var(--dm-text-muted);
}

body.dark-mode .month-nav h2 {
  color: var(--dm-text);
}

body.dark-mode .nav-btn {
  background: var(--dm-surface);
  color: var(--dm-text-secondary);
}

body.dark-mode .nav-btn:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .filter-btn {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .filter-btn:not(.active):hover {
  border-color: rgba(128, 42, 142, 0.4);
  color: var(--dm-text);
}

body.dark-mode .filter-btn.active {
  background: linear-gradient(135deg, #802a8e, #a855f7);
  border-color: transparent;
  color: white;
}

body.dark-mode .day-header {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .day-header:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .day-header.today {
  background: rgba(128, 42, 142, 0.2);
  border-left-color: var(--dm-purple-accent);
}

body.dark-mode .day-label {
  color: var(--dm-text);
}

body.dark-mode .day-header.today .day-label {
  color: var(--dm-purple-bright);
}

body.dark-mode .toggle-icon,
body.dark-mode .event-count {
  color: var(--dm-text-muted);
}

body.dark-mode .event-card {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .event-card.event-party,
body.dark-mode .event-card.event-birthday {
  background: rgba(249, 115, 22, 0.08);
}

body.dark-mode .event-card.event-show,
body.dark-mode .event-card.event-assembly {
  background: rgba(168, 85, 247, 0.08);
}

body.dark-mode .event-card.event-program {
  background: rgba(16, 185, 129, 0.08);
}

body.dark-mode .event-card.event-workshop {
  background: rgba(59, 130, 246, 0.08);
}

body.dark-mode .event-card.event-camp {
  background: rgba(239, 68, 68, 0.08);
}

body.dark-mode .event-card.event-public_event {
  background: rgba(20, 184, 166, 0.08);
}

body.dark-mode .event-card.event-google_calendar {
  background: rgba(158, 158, 158, 0.08);
}

body.dark-mode .event-time {
  color: var(--dm-text);
}

body.dark-mode .event-title {
  color: var(--dm-text);
}

body.dark-mode .event-subtitle,
body.dark-mode .event-location,
body.dark-mode .event-details {
  color: var(--dm-text-secondary);
}

body.dark-mode .shift-details {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .shift-detail-row {
  color: var(--dm-text-secondary);
}

body.dark-mode .shift-detail-row a {
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .bdm-link {
  color: var(--dm-purple-bright);
}

body.dark-mode .staff-badge {
  background: rgba(128, 42, 142, 0.2);
  color: var(--dm-purple-bright);
}

/* Event type badges */
body.dark-mode .event-type-party,
body.dark-mode .event-type-birthday {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

body.dark-mode .event-type-show,
body.dark-mode .event-type-assembly {
  background: rgba(168, 85, 247, 0.2);
  color: var(--dm-purple-bright);
}

body.dark-mode .event-type-program {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

body.dark-mode .event-type-workshop {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

body.dark-mode .event-type-camp {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark-mode .event-type-event,
body.dark-mode .event-type-public_event {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
}

body.dark-mode .event-type-google_calendar {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

/* Schedule action buttons */
body.dark-mode .btn-details {
  background: rgba(128, 42, 142, 0.2);
  color: var(--dm-purple-bright);
}

body.dark-mode .btn-details:hover {
  background: rgba(128, 42, 142, 0.35);
}

body.dark-mode .btn-attendance {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
}

body.dark-mode .btn-attendance:hover {
  background: rgba(217, 119, 6, 0.35);
}

body.dark-mode .btn-classlist,
body.dark-mode .btn-map {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

body.dark-mode .btn-classlist:hover,
body.dark-mode .btn-map:hover {
  background: rgba(37, 99, 235, 0.35);
}

body.dark-mode .btn-calendar {
  background: rgba(5, 150, 105, 0.2);
  color: #34d399;
}

body.dark-mode .btn-calendar:hover {
  background: rgba(5, 150, 105, 0.35);
}

/* Kit status badges in schedule */
body.dark-mode .kit-ready {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

body.dark-mode .kit-in-progress {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

body.dark-mode .kit-not-ready {
  background: var(--dm-surface);
  color: var(--dm-text-muted);
}

body.dark-mode .kit-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark-mode .kit-checklist-warning {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

body.dark-mode .kit-checklist-warning svg {
  color: #f87171;
}

body.dark-mode .kit-checklist-warning .issue-detail {
  color: #fca5a5;
}

body.dark-mode .kit-checklist-progress {
  color: var(--dm-text-muted);
}

/* Mini calendar */
body.dark-mode .mini-cal {
  background: var(--dm-surface);
  backdrop-filter: blur(var(--dm-glass-blur));
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
}

body.dark-mode .mini-cal-title {
  color: var(--dm-text);
}

body.dark-mode .mini-cal-nav button {
  background: var(--dm-surface);
  color: var(--dm-text-secondary);
}

body.dark-mode .mini-cal-nav button:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .mini-cal-day-header {
  color: var(--dm-text-muted);
}

body.dark-mode .mini-cal-day {
  color: var(--dm-text-secondary);
}

body.dark-mode .mini-cal-day:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .mini-cal-day.other-month {
  color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .mini-cal-day.selected {
  background: rgba(128, 42, 142, 0.2);
}

body.dark-mode .week-stats-card {
  background: var(--dm-surface);
  backdrop-filter: blur(var(--dm-glass-blur));
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
}

body.dark-mode .week-stats-card h3 {
  color: var(--dm-text);
}

body.dark-mode .week-stats-card .no-events {
  color: var(--dm-text-muted);
}

/* Booking detail modal */
body.dark-mode .booking-modal-content {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(128, 42, 142, 0.2);
}

body.dark-mode .booking-modal-header {
  background: rgba(128, 42, 142, 0.15);
  border-bottom-color: var(--dm-border);
}

body.dark-mode .booking-modal-header h2 {
  color: var(--dm-purple-bright);
}

body.dark-mode .booking-modal-close {
  color: var(--dm-text-muted);
}

body.dark-mode .booking-modal-close:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .bdm-section {
  background: var(--dm-surface);
  border-color: var(--dm-border);
}

body.dark-mode .bdm-section-title {
  color: var(--dm-text-muted);
}

body.dark-mode .bdm-label {
  color: var(--dm-text-muted);
}

body.dark-mode .bdm-value {
  color: var(--dm-text);
}

body.dark-mode .bdm-notes {
  color: var(--dm-text-secondary);
}

body.dark-mode .bdm-field + .bdm-field {
  border-top-color: var(--dm-border);
}

body.dark-mode .bdm-item-tag {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .bdm-staff-tag {
  background: rgba(128, 42, 142, 0.2);
  border-color: rgba(128, 42, 142, 0.3);
  color: var(--dm-purple-bright);
}

body.dark-mode .bdm-type {
  background: var(--dm-surface);
  color: var(--dm-text-muted);
}

body.dark-mode .bdm-status-pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
body.dark-mode .bdm-status-confirmed { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
body.dark-mode .bdm-status-completed { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
body.dark-mode .bdm-status-cancelled { background: rgba(239, 68, 68, 0.2); color: #f87171; }

body.dark-mode .bdm-btn-map {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

body.dark-mode .bdm-btn-map:hover {
  background: rgba(37, 99, 235, 0.35);
}

body.dark-mode .bdm-loading {
  color: var(--dm-text-muted);
}

body.dark-mode .bdm-spinner {
  border-color: var(--dm-border);
  border-top-color: var(--dm-purple-accent);
}

body.dark-mode .bdm-error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* ═══════════════════════════════════════════════════════════════════
   LAB ASSISTANT (GIZMO) — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .lab-panel {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 25px rgba(128, 42, 142, 0.15);
}

body.dark-mode .lab-widget-header {
  background: rgba(15, 15, 42, 0.8);
  color: var(--dm-text);
  border-bottom-color: var(--dm-border);
}

body.dark-mode .lab-widget-tts,
body.dark-mode .lab-widget-expand,
body.dark-mode .lab-widget-close {
  color: var(--dm-text-muted);
}

body.dark-mode .lab-widget-tts:hover,
body.dark-mode .lab-widget-expand:hover,
body.dark-mode .lab-widget-close:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .lab-suggested-questions {
  border-bottom-color: var(--dm-border);
}

body.dark-mode .lab-suggested-btn {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .lab-suggested-btn:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .lab-message-assistant .lab-message-content {
  background: var(--dm-surface);
  color: var(--dm-text);
}

body.dark-mode .lab-message-content strong {
  color: var(--dm-purple-bright);
}

body.dark-mode .lab-message-content table th {
  background: rgba(128, 42, 142, 0.15);
  color: var(--dm-text-secondary);
  border-color: var(--dm-border);
}

body.dark-mode .lab-message-content table td {
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--dm-text-secondary);
}

body.dark-mode .lab-message-content table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .lab-message-content table tr:hover td {
  background: rgba(128, 42, 142, 0.1);
}

body.dark-mode .lab-message-content .lab-link {
  color: #a78bfa;
}

body.dark-mode .lab-message-content .lab-link:hover {
  color: #c4b5fd;
}

body.dark-mode .lab-message-content .lab-highlight {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

body.dark-mode .lab-chat-input-area {
  border-top-color: var(--dm-border);
}

body.dark-mode .lab-chat-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

body.dark-mode .lab-chat-input:focus {
  border-color: var(--dm-purple-accent);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

body.dark-mode .lab-chat-input::placeholder {
  color: var(--dm-text-muted);
}

body.dark-mode .lab-chat-send {
  background: var(--dm-surface);
  border-color: var(--dm-border);
}

body.dark-mode .lab-chat-send:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .lab-action-confirmation {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

body.dark-mode .lab-action-text {
  color: #67e8f9;
}

body.dark-mode .lab-btn-cancel {
  background: var(--dm-surface);
  color: var(--dm-text-muted);
}

body.dark-mode .lab-btn-cancel:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .lab-speech-bubble {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(12px);
  border-color: var(--dm-border);
  color: var(--dm-text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .lab-speech-tail {
  background: var(--dm-glass-bg);
  border-color: var(--dm-border);
}

/* Expanded mode */
body.dark-mode .lab-widget.lab-expanded .lab-panel {
  background: var(--dm-bg-secondary);
}

body.dark-mode .lab-widget.lab-expanded .lab-widget-header {
  background: rgba(15, 15, 42, 0.9);
  border-bottom-color: var(--dm-border);
}

body.dark-mode .lab-widget.lab-expanded .lab-widget-body {
  background: var(--dm-bg-secondary);
}

body.dark-mode .lab-widget.lab-expanded .lab-message-assistant .lab-message-content {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

body.dark-mode .lab-widget.lab-expanded .lab-suggested-questions {
  background: rgba(255, 255, 255, 0.03);
  border-top-color: var(--dm-border);
}

body.dark-mode .lab-widget.lab-expanded .lab-suggested-btn {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .lab-widget.lab-expanded .lab-suggested-btn:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .lab-widget.lab-expanded .lab-chat-input-area {
  background: rgba(15, 15, 42, 0.9);
  border-top-color: var(--dm-border);
}

body.dark-mode .lab-widget.lab-expanded .lab-chat-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

body.dark-mode .lab-widget.lab-expanded .lab-message-content table th {
  background: rgba(128, 42, 142, 0.15);
  color: var(--dm-text-secondary);
  border-color: var(--dm-border);
}

body.dark-mode .lab-widget.lab-expanded .lab-message-content table td {
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .lab-widget.lab-expanded .lab-message-content table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .lab-widget.lab-expanded .lab-message-content table tr:hover td {
  background: rgba(128, 42, 142, 0.1);
}

/* Voice modal */
body.dark-mode .voice-modal-content {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .voice-modal-status {
  color: var(--dm-text);
}

body.dark-mode .voice-modal-hint {
  color: var(--dm-text-muted);
}

body.dark-mode .voice-modal-hint kbd {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .voice-status {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--dm-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .voice-status-text {
  color: var(--dm-text);
}

body.dark-mode .lab-chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .lab-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(128, 42, 142, 0.4);
}

body.dark-mode .lab-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 42, 142, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   KIT PREP — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .kit-prep-header h1 {
  color: var(--dm-text);
}

body.dark-mode .kit-prep-header .subtitle {
  color: var(--dm-text-secondary);
}

body.dark-mode .view-selector select {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

body.dark-mode .stat {
  background: var(--dm-surface);
}

body.dark-mode .stat-number {
  color: var(--dm-text);
}

body.dark-mode .stat-label {
  color: var(--dm-text-muted);
}

body.dark-mode .kit-card {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
}

body.dark-mode .kit-card.ready {
  background: rgba(16, 185, 129, 0.06);
}

body.dark-mode .kit-card.in_progress {
  background: rgba(245, 158, 11, 0.06);
}

body.dark-mode .kit-card.urgent {
  background: rgba(239, 68, 68, 0.06);
}

body.dark-mode .kit-title {
  color: var(--dm-text);
}

body.dark-mode .kit-staff {
  color: var(--dm-text-secondary);
}

body.dark-mode .date-tag {
  background: var(--dm-surface);
  color: var(--dm-text-secondary);
}

body.dark-mode .date-tag.urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark-mode .date-tag.tomorrow {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

body.dark-mode .kit-sessions {
  background: var(--dm-surface);
}

body.dark-mode .kit-sessions strong {
  color: var(--dm-text);
}

body.dark-mode .kit-sessions li {
  color: var(--dm-text-secondary);
}

body.dark-mode .kit-session-single {
  color: var(--dm-text-secondary);
}

body.dark-mode .kit-materials {
  color: var(--dm-text-secondary);
}

body.dark-mode .kit-notes {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

body.dark-mode .kit-ready-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

body.dark-mode .checklist-toggle-btn {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.dark-mode .checklist-toggle-btn:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .checklist-content {
  background: var(--dm-surface);
}

body.dark-mode .checklist-category {
  color: var(--dm-text-muted);
  border-bottom-color: var(--dm-border);
}

body.dark-mode .checklist-item:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .checklist-item.has-issue {
  background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .checklist-item-name {
  color: var(--dm-text);
}

body.dark-mode .checklist-checkbox {
  border-color: var(--dm-border);
}

body.dark-mode .checklist-qty {
  background: rgba(128, 42, 142, 0.2);
  color: var(--dm-purple-bright);
}

body.dark-mode .checklist-consumable {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
}

body.dark-mode .checklist-note-input {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

body.dark-mode .checklist-note-input.has-note {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

body.dark-mode .checklist-note-btn {
  color: var(--dm-text-muted);
}

body.dark-mode .checklist-note-btn:hover {
  color: var(--dm-text);
  background: var(--dm-surface-hover);
}

body.dark-mode .checklist-loading,
body.dark-mode .checklist-empty {
  color: var(--dm-text-muted);
}

body.dark-mode .checklist-progress {
  background: var(--dm-surface);
  color: var(--dm-text-secondary);
}

body.dark-mode .checklist-progress.complete {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

body.dark-mode .checklist-progress.has-issues {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark-mode .kit-checklist-section {
  border-top-color: var(--dm-border);
}

body.dark-mode .kit-assigned-badge {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

body.dark-mode .btn-assign-kit {
  background: var(--dm-surface);
  border-color: var(--dm-text-muted);
  color: var(--dm-text-muted);
}

body.dark-mode .btn-assign-kit:hover {
  border-color: var(--dm-purple-accent);
  color: var(--dm-purple-bright);
  background: rgba(128, 42, 142, 0.1);
}

body.dark-mode .btn-note {
  border-color: var(--dm-border);
  color: var(--dm-text-muted);
}

body.dark-mode .btn-note:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
  border-color: var(--dm-border-strong);
}

/* ═══════════════════════════════════════════════════════════════════
   INVENTORY — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .inventory-container .stat-card,
body.dark-mode .inventory-stats .stat-card {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
  color: var(--dm-text);
}

body.dark-mode .inventory-header h1 {
  color: var(--dm-text);
}

body.dark-mode .inventory-header .subtitle {
  color: var(--dm-text-secondary);
}

body.dark-mode .stat-icon {
  background: var(--dm-surface);
  color: var(--dm-text-muted);
}

body.dark-mode .quick-actions,
body.dark-mode .dashboard-section,
body.dark-mode .list-card,
body.dark-mode .form-card,
body.dark-mode .item-card,
body.dark-mode .kit-card,
body.dark-mode .inventory-card {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
  color: var(--dm-text);
}

body.dark-mode .filter-bar {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
}

body.dark-mode .status-tabs {
  background: var(--dm-surface);
}

body.dark-mode .status-tabs .tab {
  color: var(--dm-text-secondary);
}

body.dark-mode .status-tabs .tab.active {
  background: var(--dm-surface-active);
  color: var(--dm-text);
}

body.dark-mode .status-tabs .tab:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .list-item {
  background: var(--dm-surface);
  border-color: var(--dm-border);
}

body.dark-mode .list-item:hover {
  background: var(--dm-surface-hover);
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD WIDGETS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .widget {
  background: var(--dm-surface);
  backdrop-filter: blur(var(--dm-glass-blur));
  -webkit-backdrop-filter: blur(var(--dm-glass-blur));
  border-color: var(--dm-border);
  box-shadow: var(--dm-card-shadow);
}

body.dark-mode .widget:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 25px rgba(128, 42, 142, 0.15);
}

body.dark-mode .widget-header {
  background: rgba(128, 42, 142, 0.08);
  border-bottom-color: var(--dm-border);
}

body.dark-mode .widget-title {
  color: var(--dm-text);
}

body.dark-mode .widget-btn {
  color: var(--dm-text-muted);
}

body.dark-mode .widget-btn:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .schedule-item,
body.dark-mode .quick-link-card,
body.dark-mode .staff-hours-item,
body.dark-mode .attendance-stat {
  background: var(--dm-surface);
  color: var(--dm-text);
}

body.dark-mode .schedule-item:hover,
body.dark-mode .quick-link-card:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .attendance-stat.late {
  background: rgba(249, 115, 22, 0.1);
}

body.dark-mode .widget-settings-content,
body.dark-mode .day-events-popup {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  color: var(--dm-text);
}

body.dark-mode .day-events-header {
  background: rgba(128, 42, 142, 0.1);
  border-bottom-color: var(--dm-border);
}

body.dark-mode .day-events-header h4 {
  color: var(--dm-text);
}

body.dark-mode .day-events-header .btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--dm-border);
  color: var(--dm-text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

body.dark-mode .day-events-header .btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

body.dark-mode .day-event-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dm-border);
}

body.dark-mode .day-event-item:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
}

body.dark-mode .day-event-title {
  color: var(--dm-text);
}

body.dark-mode .day-event-time {
  color: var(--dm-text-secondary);
}

body.dark-mode .dashboard-header h1 {
  color: var(--dm-text);
}

body.dark-mode .dashboard-header p {
  color: var(--dm-text-secondary);
}

/* --- Program Fill Rates --- */
body.dark-mode .fill-rate-name {
  color: var(--dm-text);
}

body.dark-mode .fill-rate-count {
  color: var(--dm-text-secondary);
}

body.dark-mode .fill-rate-bar {
  background: rgba(255, 255, 255, 0.08);
}

/* --- Action Items --- */
body.dark-mode .action-widget-item {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .action-widget-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .action-widget-title {
  color: var(--dm-text);
}

body.dark-mode .action-widget-meta {
  color: var(--dm-text-muted);
}

body.dark-mode .action-widget-complete {
  color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .action-widget-complete:hover {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

body.dark-mode .action-widget-link {
  color: var(--dm-glow-purple);
}

body.dark-mode .action-widget-link:hover {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.1);
}

body.dark-mode .action-widget-system {
  background: rgba(245, 158, 11, 0.1) !important;
  border-left-color: #f59e0b !important;
}

/* --- Upcoming Schedule items --- */
body.dark-mode .schedule-title {
  color: var(--dm-text);
}

body.dark-mode .schedule-meta {
  color: var(--dm-text-muted);
}

body.dark-mode .schedule-badge.booking {
  background: rgba(128, 42, 142, 0.2);
  color: #c084fc;
}

body.dark-mode .schedule-badge.event {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

body.dark-mode .schedule-badge.program {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

body.dark-mode .schedule-badge.show {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

body.dark-mode .schedule-badge.party {
  background: rgba(236, 72, 153, 0.15);
  color: #f9a8d4;
}

/* --- Mini Calendar --- */
body.dark-mode .mini-calendar-title {
  color: var(--dm-text);
}

body.dark-mode .mini-calendar-day-header {
  color: var(--dm-text-muted);
}

body.dark-mode .mini-calendar-day {
  color: var(--dm-text-secondary);
}

body.dark-mode .mini-calendar-day.other-month {
  color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .mini-calendar-nav button {
  color: var(--dm-text-secondary);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .mini-calendar-nav button:hover {
  color: var(--dm-text);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .mini-calendar-day.has-event:hover {
  background: rgba(139, 92, 246, 0.25);
}

body.dark-mode .mini-calendar-day.today.has-event:hover {
  background: rgba(139, 92, 246, 0.6);
}

/* --- Emails Needing Reply (inline styles in JS) --- */
body.dark-mode .action-widget-item[href*="/emails/"] div[style*="color: var(--gray-500)"] {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .action-widget-item[href*="/emails/"] span[style*="color: var(--gray-400)"] {
  color: var(--dm-text-muted) !important;
}

/* --- Alert Items --- */
body.dark-mode .alert-item {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #f87171;
}

body.dark-mode .alert-item.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #fbbf24;
}

body.dark-mode .alert-icon {
  color: #f87171;
}

body.dark-mode .alert-item.warning .alert-icon {
  color: #fbbf24;
}

body.dark-mode .alert-title {
  color: var(--dm-text);
}

body.dark-mode .alert-text {
  color: var(--dm-text-secondary);
}

/* --- Widget Empty State --- */
body.dark-mode .widget-empty {
  color: var(--dm-text-muted);
}

body.dark-mode .widget-empty[style*="background: var(--green-50)"] {
  background: rgba(34, 197, 94, 0.08) !important;
  color: #86efac !important;
}

/* --- Staff Hours --- */
body.dark-mode .staff-name {
  color: var(--dm-text);
}

body.dark-mode .staff-hours {
  color: var(--dm-glow-purple);
}

body.dark-mode .staff-hours-item {
  background: rgba(255, 255, 255, 0.04);
}

/* --- Quick Links --- */
body.dark-mode .quick-link-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--dm-border);
}

body.dark-mode .quick-link-card:hover {
  background: rgba(128, 42, 142, 0.1);
  border-color: rgba(128, 42, 142, 0.3);
}

body.dark-mode .quick-link-label {
  color: var(--dm-text);
}

body.dark-mode .quick-link-icon {
  color: var(--dm-text-muted);
}

/* --- Schedule Item Link --- */
body.dark-mode .schedule-item-link {
  color: var(--dm-text-secondary);
}

body.dark-mode .schedule-item-link:hover {
  color: var(--dm-text);
}

/* ═══════════════════════════════════════════════════════════════════
   DESKTOP / WINDOW MANAGER — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .wm-panel {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
}

body.dark-mode .wm-content {
  background: transparent;
  color: var(--dm-text);
}

body.dark-mode .wm-content-inner {
  background: var(--dm-bg-secondary) !important;
  color: var(--dm-text);
}

body.dark-mode .wm-loading {
  background: var(--dm-bg-secondary) !important;
  color: var(--dm-text-muted);
}

body.dark-mode .wm-btn {
  background: var(--dm-surface);
  color: var(--dm-text-secondary);
}

body.dark-mode .wm-btn:hover {
  background: var(--dm-surface-hover);
}

body.dark-mode .dock-submenu {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border);
}

body.dark-mode .dock-submenu-item {
  color: var(--dm-text-secondary);
}

body.dark-mode .dock-submenu-item:hover {
  background: var(--dm-surface-hover);
  color: var(--dm-text);
}

body.dark-mode .wm-taskbar-item {
  background: var(--dm-surface) !important;
  color: var(--dm-text-secondary);
  border: 1px solid var(--dm-border);
}

body.dark-mode .wm-taskbar-item:hover {
  background: var(--dm-surface-hover) !important;
  color: var(--dm-text);
}

/* ═══════════════════════════════════════════════════════════════════
   STYLES.CSS EDGE CASES — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

/* Typeahead dropdown */
body.dark-mode .typeahead-dropdown {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px);
  border-color: var(--dm-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .typeahead-item:hover,
body.dark-mode .typeahead-item.selected {
  background: rgba(128, 42, 142, 0.15);
}

body.dark-mode .typeahead-name {
  color: var(--dm-text);
}

/* Settings page dropdown */
body.dark-mode .settings-dropdown {
  background: var(--dm-glass-bg);
  backdrop-filter: blur(16px);
  border-color: var(--dm-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Module cards */
body.dark-mode .module-card,
body.dark-mode .module-link-item {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

/* Admin page containers */
body.dark-mode .admin-page .card,
body.dark-mode .admin-content {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--dm-border);
  color: var(--dm-text);
}

/* Mobile data-table card mode */
@media (max-width: 768px) {
  body.dark-mode .data-table tbody tr {
    background: var(--dm-surface) !important;
    border: 1px solid var(--dm-border);
  }
  body.dark-mode .data-table tr:hover {
    background: var(--dm-surface-hover) !important;
  }
}

/* Empty states across all modules */
body.dark-mode .empty-state {
  background: var(--dm-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--dm-border);
  box-shadow: var(--dm-card-shadow);
}

body.dark-mode .empty-state h3 {
  color: var(--dm-text);
}

body.dark-mode .empty-state p {
  color: var(--dm-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   BROAD INLINE STYLE OVERRIDES — Catch-all for EJS inline styles
   ═══════════════════════════════════════════════════════════════════ */

/* Override common inline background:white patterns in views */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"] {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

/* Inline light gray backgrounds */
body.dark-mode [style*="background: #f9fafb"],
body.dark-mode [style*="background:#f9fafb"],
body.dark-mode [style*="background: #f3f4f6"],
body.dark-mode [style*="background:#f3f4f6"],
body.dark-mode [style*="background: var(--gray-50)"],
body.dark-mode [style*="background:var(--gray-50)"],
body.dark-mode [style*="background: var(--gray-100)"],
body.dark-mode [style*="background:var(--gray-100)"] {
  background: var(--dm-surface) !important;
}

/* Inline dark text colors that vanish on dark backgrounds */
body.dark-mode [style*="color: #374151"],
body.dark-mode [style*="color:#374151"],
body.dark-mode [style*="color: #1f2937"],
body.dark-mode [style*="color:#1f2937"],
body.dark-mode [style*="color: #111827"],
body.dark-mode [style*="color:#111827"],
body.dark-mode [style*="color: #2D3436"],
body.dark-mode [style*="color:#2D3436"] {
  color: var(--dm-text) !important;
}

body.dark-mode [style*="color: #6b7280"],
body.dark-mode [style*="color:#6b7280"],
body.dark-mode [style*="color: #4b5563"],
body.dark-mode [style*="color:#4b5563"],
body.dark-mode [style*="color: #9ca3af"],
body.dark-mode [style*="color:#9ca3af"] {
  color: var(--dm-text-secondary) !important;
}

/* Inline border colors */
body.dark-mode [style*="border-bottom: 1px solid #e5e7eb"],
body.dark-mode [style*="border-top: 1px solid #e5e7eb"],
body.dark-mode [style*="border: 1px solid #e5e7eb"],
body.dark-mode [style*="border-bottom:1px solid #e5e7eb"],
body.dark-mode [style*="border-bottom: 1px solid var(--gray-200)"],
body.dark-mode [style*="border-top: 1px solid var(--gray-200)"],
body.dark-mode [style*="border: 1px solid var(--gray-200)"] {
  border-color: var(--dm-border) !important;
}

/* Inline box-shadow overrides for cards/panels */
body.dark-mode [style*="box-shadow: 0 1px 3px rgba(0,0,0,0."],
body.dark-mode [style*="box-shadow: 0 2px 6px rgba(0,0,0,0."],
body.dark-mode [style*="box-shadow:0 1px 3px rgba(0,0,0,0."],
body.dark-mode [style*="box-shadow:0 2px 6px rgba(0,0,0,0."] {
  box-shadow: var(--dm-card-shadow) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   COMMUNICATIONS TABS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .comm-tab {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dm-text-secondary);
  border-color: var(--dm-border);
}

body.dark-mode .comm-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--dm-text);
}

body.dark-mode .comm-tab.active {
  background: rgba(128, 42, 142, 0.2);
  color: #c084fc;
  border-color: rgba(128, 42, 142, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════
   EMAIL INBOX — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .email-card {
  border-left-color: rgba(168, 85, 247, 0.3) !important;
}

/* Status badges — inline styles use hardcoded light colors */
body.dark-mode .email-meta span[style*="#D1FAE5"] {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6ee7b7 !important;
}
body.dark-mode .email-meta span[style*="#DBEAFE"] {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}
body.dark-mode .email-meta span[style*="#FEF3C7"] {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
}

/* Mobile email thread badges */
body.dark-mode .mt-badge-reply { background: rgba(245, 158, 11, 0.2) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.3) !important; }
body.dark-mode .mt-badge-replied { background: rgba(16, 185, 129, 0.2) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
body.dark-mode .mt-badge-handled { background: rgba(59, 130, 246, 0.2) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.3) !important; }
body.dark-mode .mt-badge-urgent { background: rgba(239, 68, 68, 0.2) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.3) !important; }

/* Mobile email thread — full dark mode support */
body.dark-mode .mobile-email-thread { background: var(--dm-bg) !important; }
body.dark-mode .mt-topbar { background: var(--dm-bg) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-topbar-subject { color: var(--dm-text) !important; }
body.dark-mode .mt-topbar-back,
body.dark-mode .mt-icon-btn { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .mt-meta-row { background: var(--dm-bg-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-scroll { background: var(--dm-bg) !important; }
body.dark-mode .mt-msg { background: var(--dm-bg-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-msg.active { border-color: rgba(168, 85, 247, 0.4) !important; }
body.dark-mode .mt-msg-from { color: var(--dm-text) !important; }
body.dark-mode .mt-msg-preview,
body.dark-mode .mt-msg-email,
body.dark-mode .mt-msg-time { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-msg-body { color: var(--dm-text-secondary) !important; }
body.dark-mode .mt-collapse-line { background: var(--dm-border) !important; }
body.dark-mode .mt-thread-line { background: var(--dm-border) !important; }
body.dark-mode .mt-contact-strip { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-contact-name { color: var(--dm-text) !important; }
body.dark-mode .mt-contact-email { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-ai-card { background: linear-gradient(135deg, rgba(168,85,247,.1) 0%, rgba(16,185,129,.06) 100%) !important; border-color: rgba(168,85,247,.25) !important; }
body.dark-mode .mt-ai-text { color: var(--dm-text-secondary) !important; }
body.dark-mode .mt-ai-prompt-input { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
body.dark-mode .mt-ai-chip { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .mt-reply-area { background: var(--dm-bg) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-reply-box { background: var(--dm-bg-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-reply-to-row { border-color: var(--dm-border) !important; }
body.dark-mode .mt-reply-to-label { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-reply-to-chip { background: rgba(168,85,247,.15) !important; color: #c084fc !important; border-color: rgba(168,85,247,.25) !important; }
body.dark-mode .mt-reply-editor { color: var(--dm-text) !important; }
body.dark-mode .mt-reply-editor::placeholder { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-reply-toolbar { border-color: var(--dm-border) !important; }
body.dark-mode .mt-reply-format-btn { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-reply-format-btn:hover { background: var(--dm-surface) !important; color: var(--dm-text) !important; }
body.dark-mode .mt-label-select { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .mt-quick-btn { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .mt-collapsible { background: var(--dm-bg-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-collapsible-header:hover { background: var(--dm-surface-hover) !important; }
body.dark-mode .mt-collapsible-body { border-color: var(--dm-border) !important; }
body.dark-mode .mt-col-title { color: var(--dm-text) !important; }
body.dark-mode .mt-col-chevron { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-form-label { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-form-input { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
/* Template overlay — dark mode */
body.dark-mode .mt-template-overlay { background: rgba(10,10,26,.96) !important; backdrop-filter: blur(8px) !important; }
body.dark-mode .mt-template-title { color: var(--dm-text) !important; }
body.dark-mode .mt-template-close { color: var(--dm-text-muted) !important; }
body.dark-mode .mt-template-item { background: var(--dm-bg-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .mt-template-item:hover { border-color: rgba(168,85,247,.5) !important; }
body.dark-mode .mt-template-item-name { color: var(--dm-text) !important; }
body.dark-mode .mt-template-item-preview { color: var(--dm-text-muted) !important; }
/* Desktop template picker — dark mode */
body.dark-mode #desktopTemplatePicker { background: var(--dm-bg-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode #desktopTemplatePicker > div > div[onclick] { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; }
body.dark-mode #desktopTemplatePicker > div > div[onclick]:hover { border-color: rgba(168,85,247,.5) !important; }

/* Quick action buttons */
body.dark-mode .email-quick-actions button {
  border-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}
body.dark-mode .email-quick-actions button:hover {
  background: rgba(168, 85, 247, 0.15) !important;
  color: var(--dm-purple-bright) !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
}

/* Email snippet text */
body.dark-mode .email-snippet {
  color: var(--dm-text-muted) !important;
}

/* Email topic tags */
body.dark-mode .email-topics span {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

/* Email detail status action buttons */
body.dark-mode button[onclick*="updateStatus('archived')"] {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode button[onclick*="updateStatus('handled')"] {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}
body.dark-mode button[onclick*="updateStatus('needs_reply')"] {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
}
body.dark-mode button[onclick*="openAvailabilityCheck"] {
  background: rgba(124, 58, 237, 0.2) !important;
  color: #c4b5fd !important;
}

/* ═══════════════════════════════════════════════════════════════════
   EMAIL DETAIL — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

/* Email body container — distinct dark surface */
body.dark-mode .email-body-html,
body.dark-mode .email-body-text {
  --email-body-bg: rgba(255, 255, 255, 0.04);
  --email-body-border: var(--dm-border, rgba(255, 255, 255, 0.08));
  --email-text: var(--dm-text);
  --email-heading: var(--dm-text-bright, #fff);
  --email-quote-bg: rgba(128, 42, 142, 0.08);
  background: var(--email-body-bg) !important;
  border-color: var(--email-body-border) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .email-body-html *:not(a):not(img) {
  color: var(--dm-text) !important;
  background-color: transparent !important;
}
body.dark-mode .email-body-html a {
  color: var(--purple-300, #C4B5FD) !important;
}

/* Quoted sections in dark mode */
body.dark-mode .email-quoted-line {
  color: var(--dm-text-muted) !important;
  border-left-color: var(--purple-400, #A78BFA) !important;
  background: rgba(128, 42, 142, 0.08) !important;
}
body.dark-mode .email-quoted-section {
  color: var(--dm-text-muted) !important;
  border-left-color: var(--purple-400, #A78BFA) !important;
  background: rgba(128, 42, 142, 0.08) !important;
}
body.dark-mode .email-quote-toggle {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--purple-300, #C4B5FD) !important;
}
body.dark-mode .email-body-html blockquote {
  border-left-color: var(--purple-400, #A78BFA) !important;
  background: rgba(128, 42, 142, 0.1) !important;
  color: var(--dm-text-muted) !important;
}
body.dark-mode .email-body-html hr {
  border-top-color: var(--dm-border) !important;
}

/* Show-more fade gradient — match dark surface instead of white */
body.dark-mode .email-body-fade {
  --email-fade-bg: var(--dm-bg, #0a0a1a);
}

/* Thread messages */
body.dark-mode .thread-msg {
  border-color: var(--dm-border) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Quick booking sidebar labels */
body.dark-mode .qb-label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .qb-input {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* AI draft reply section */
body.dark-mode #aiPrompt {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode #aiPrompt::placeholder {
  color: var(--dm-text-muted) !important;
}

body.dark-mode #aiDraft {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Email attachment items */
body.dark-mode #attachmentsList a {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode #attachmentsList a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   STAFF CHAT — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .chat-sidebar {
  background: #0f0f2a !important;
  border-right-color: var(--dm-border) !important;
}

body.dark-mode .chat-search input {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-search input::placeholder {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-channel-section-label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-channel-item {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-channel-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .chat-channel-item.active {
  background: rgba(128, 42, 142, 0.15) !important;
  border-left-color: var(--dm-glow-purple) !important;
}

body.dark-mode .chat-channel-name {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-channel-preview {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-channel-time {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-channel-avatar {
  background: rgba(128, 42, 142, 0.2) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-online-section {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .chat-messages {
  background: var(--dm-bg-secondary) !important;
}

body.dark-mode .chat-msg-content {
  background: var(--dm-surface) !important;
  color: var(--dm-text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .chat-msg.own .chat-msg-content {
  background: rgba(128, 42, 142, 0.7) !important;
  color: white !important;
}

body.dark-mode .chat-msg.system .chat-msg-content {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-msg-author {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-msg-time {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-msg-edited {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-msg-actions {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .chat-msg-actions button {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .chat-msg-actions button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-reaction-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .chat-reaction-pill.own {
  background: rgba(128, 42, 142, 0.15) !important;
  border-color: rgba(128, 42, 142, 0.4) !important;
}

body.dark-mode .chat-input-bar {
  background: var(--dm-surface) !important;
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .chat-input-bar textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-input-bar textarea::placeholder {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-attach-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .chat-attach-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .chat-input-btn {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .chat-input-btn:hover {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-date-divider span {
  background: var(--dm-bg-secondary) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .chat-date-divider {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .chat-thread-header {
  background: #0f0f2a !important;
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-back-btn {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-thread-info {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-thread-actions button {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .chat-thread-actions button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .chat-thread-actions button.active {
  background: rgba(128, 42, 142, 0.7) !important;
  color: white !important;
  border-color: rgba(128, 42, 142, 0.5) !important;
}

body.dark-mode .chat-modal {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-modal-header {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-modal-footer {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .chat-member-option {
  color: var(--dm-text) !important;
}

body.dark-mode .chat-member-option:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .chat-search-panel {
  background: var(--dm-surface) !important;
  border-left-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-search-result {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .chat-search-result:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .chat-mention {
  background: rgba(128, 42, 142, 0.2) !important;
  color: #c084fc !important;
}

body.dark-mode .chat-mention-group {
  background: rgba(128, 42, 142, 0.3) !important;
}

body.dark-mode .chat-file-preview {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-typing-bar {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .gif-picker {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .gif-picker-header input {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .emoji-picker-popup {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .emoji-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .chat-sidebar-header {
  background: #0f0f2a !important;
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .chat-sidebar-actions button {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .chat-sidebar-actions button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   WEEKLY PROGRAMS / SCHOOL CARDS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .school-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .school-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(128, 42, 142, 0.12) !important;
}

body.dark-mode .school-info h3,
body.dark-mode .school-info h4 {
  color: var(--dm-text) !important;
}

body.dark-mode .school-info p {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .capacity-section {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .capacity-bar-bg {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .school-actions .btn,
body.dark-mode .school-actions button {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .school-actions .btn:hover,
body.dark-mode .school-actions button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .status-badge {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .stats-row .stat-card,
body.dark-mode .stats-row .stat-box {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .enrollment-badge {
  color: var(--dm-text) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   KIT SCHEDULE — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .ks-day-section {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-color: var(--dm-border) !important;
}

body.dark-mode .ks-day-header {
  background: rgba(128, 42, 142, 0.08) !important;
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .ks-session-row {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .ks-session-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .ks-session-row.ks-unassigned {
  background: rgba(245, 158, 11, 0.08) !important;
}

body.dark-mode .ks-session-row.ks-changed {
  background: rgba(59, 130, 246, 0.08) !important;
  border-left-color: #60a5fa !important;
}

body.dark-mode .ks-booking-row {
  background: rgba(34, 197, 94, 0.06) !important;
}

body.dark-mode .ks-theme-select {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .ks-theme-select.ks-select-changed {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: #60a5fa !important;
}

body.dark-mode .ks-kit-panel {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .ks-kit-panel h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .ks-kit-theme {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .ks-kit-theme.ks-kit-used {
  background: rgba(245, 158, 11, 0.08) !important;
}

body.dark-mode .ks-kit-name {
  color: var(--dm-text) !important;
}

body.dark-mode .ks-kit-count {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .ks-kit-details {
  background: rgba(255, 255, 255, 0.03) !important;
}

body.dark-mode .ks-kit-item {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .ks-stats {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .ks-cell {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .ks-commit-btn {
  background: rgba(128, 42, 142, 0.8) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CALENDAR / SCHEDULE — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .schedule-container {
  background: transparent !important;
}

body.dark-mode .cal-grid {
  border-color: var(--dm-border) !important;
}

body.dark-mode .cal-header-cell {
  background: rgba(128, 42, 142, 0.08) !important;
  color: var(--dm-text) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .cal-cell {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .cal-cell:hover {
  background: var(--dm-surface-hover) !important;
}

body.dark-mode .cal-cell.today {
  background: rgba(128, 42, 142, 0.08) !important;
}

body.dark-mode .cal-cell.other-month {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .cal-day-num {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .cal-cell.today .cal-day-num {
  color: #c084fc !important;
}

body.dark-mode .cal-more {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .cal-more:hover {
  color: var(--dm-text) !important;
}

/* Calendar legend */
body.dark-mode .cal-legend,
body.dark-mode .legend {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .legend-item span {
  color: var(--dm-text-secondary) !important;
}

/* Calendar navigation */
body.dark-mode .cal-nav-btn,
body.dark-mode .schedule-nav-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .cal-nav-btn:hover,
body.dark-mode .schedule-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--dm-text) !important;
}

/* Schedule filter toggles */
body.dark-mode .filter-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .filter-btn.active,
body.dark-mode .filter-btn:checked {
  background: rgba(128, 42, 142, 0.25) !important;
  color: #c084fc !important;
  border-color: rgba(128, 42, 142, 0.5) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   WEATHER — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .weather-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .weather-card h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .forecast-row {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .forecast-period {
  color: var(--dm-text) !important;
}

body.dark-mode .forecast-condition {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .forecast-wind {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .ec-warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border-left-color: #fbbf24 !important;
  color: var(--dm-text) !important;
}

body.dark-mode .ec-warning.severe-warning {
  background: rgba(239, 68, 68, 0.12) !important;
  border-left-color: #f87171 !important;
}

body.dark-mode .weather-alert-banner {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .weather-alert-banner.severe {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

body.dark-mode .affected-table th {
  color: var(--dm-text-muted) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .affected-table td {
  color: var(--dm-text-secondary) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .risk-badge.risk-low {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .risk-badge.risk-moderate {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .risk-badge.risk-high {
  background: rgba(249, 115, 22, 0.15) !important;
  color: #fb923c !important;
}

body.dark-mode .risk-badge.risk-severe {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .weather-stat {
  color: var(--dm-text) !important;
}

body.dark-mode .stat-label {
  color: var(--dm-text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ANALYTICS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .analytics-grid .card,
body.dark-mode .analytics-section .card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .analytics-grid .card h3,
body.dark-mode .analytics-section .card h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .bar-container {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .bar-label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .bar-value {
  color: var(--dm-text) !important;
}

body.dark-mode .bar-row {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .type-card {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .type-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .type-name {
  color: var(--dm-text) !important;
}

body.dark-mode .type-count {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .type-amount {
  color: #4ade80 !important;
}

body.dark-mode .stat-card {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .stat-card .stat-label,
body.dark-mode .stat-card .stat-sublabel {
  color: var(--dm-text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   KIT PREP — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .kit-prep-header h1 {
  color: var(--dm-text) !important;
}

body.dark-mode .kit-prep-header .subtitle {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .kit-stats .stat-card {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .stat-number {
  color: var(--dm-text) !important;
}

body.dark-mode .stat-ready .stat-number {
  color: #4ade80 !important;
}

body.dark-mode .stat-progress .stat-number {
  color: #fbbf24 !important;
}

body.dark-mode .stat-pending .stat-number {
  color: #f87171 !important;
}

body.dark-mode .kit-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .kit-card.ready {
  background: linear-gradient(to right, rgba(16, 185, 129, 0.06), var(--dm-glass-bg)) !important;
}

body.dark-mode .kit-card.in_progress {
  background: linear-gradient(to right, rgba(245, 158, 11, 0.06), var(--dm-glass-bg)) !important;
}

body.dark-mode .kit-card.urgent {
  background: linear-gradient(to right, rgba(220, 38, 38, 0.06), var(--dm-glass-bg)) !important;
}

body.dark-mode .kit-title {
  color: var(--dm-text) !important;
}

body.dark-mode .kit-staff {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .kit-sessions {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .kit-session-single {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .kit-materials {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .kit-notes {
  background: rgba(245, 158, 11, 0.08) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .btn-assign-kit {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-text-muted) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .btn-assign-kit:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .kit-assigned-badge {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #93c5fd !important;
}

body.dark-mode .kit-location-tag {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #a5b4fc !important;
}

body.dark-mode .checked-out-tag {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fcd34d !important;
}

body.dark-mode .kit-checklist-section {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .checklist-toggle-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .checklist-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .checklist-content {
  background: rgba(255, 255, 255, 0.03) !important;
}

body.dark-mode .checklist-item {
  color: var(--dm-text) !important;
}

body.dark-mode .checklist-item:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .checklist-checkbox {
  border-color: var(--dm-text-muted) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .checklist-item-name {
  color: var(--dm-text) !important;
}

body.dark-mode .checklist-qty {
  background: rgba(128, 42, 142, 0.15) !important;
  color: #c084fc !important;
}

body.dark-mode .checklist-consumable {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #fcd34d !important;
}

body.dark-mode .checklist-progress {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .checklist-progress.complete {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .checklist-progress.has-issues {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .kit-ready-badge {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .btn-note {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .date-tag {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .date-tag.urgent {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #fca5a5 !important;
}

body.dark-mode .date-tag.tomorrow {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fcd34d !important;
}

body.dark-mode .btn-return-kit {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #fcd34d !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CHAT — Missing Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .chat-container {
  background: var(--dm-bg-secondary) !important;
}

body.dark-mode .mention-dropdown {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .mention-dropdown div:hover {
  background: rgba(128, 42, 142, 0.15) !important;
}

body.dark-mode .chat-channel-avatar .online-dot {
  border-color: var(--dm-bg-secondary) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   SMS / TEXTS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .sms-container {
  background: var(--dm-bg-secondary) !important;
}

body.dark-mode .sms-sidebar {
  background: var(--dm-surface) !important;
  border-right-color: var(--dm-border) !important;
}

body.dark-mode .sms-convo-item {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .sms-convo-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .sms-convo-item.active {
  background: rgba(128, 42, 142, 0.15) !important;
}

body.dark-mode .sms-convo-item.unread .sms-convo-avatar {
  background: rgba(128, 42, 142, 0.7) !important;
}

body.dark-mode .sms-convo-badge {
  background: var(--dm-purple-accent) !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5) !important;
}

body.dark-mode .sms-convo-name {
  color: var(--dm-text) !important;
}

body.dark-mode .sms-convo-preview {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-convo-time {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-convo-avatar {
  background: rgba(128, 42, 142, 0.2) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .sms-thread-header {
  background: var(--dm-surface) !important;
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .sms-thread-info {
  color: var(--dm-text) !important;
}

body.dark-mode .sms-thread-info span {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-thread-actions button {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .sms-thread-actions button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .sms-messages {
  background: var(--dm-bg-secondary) !important;
}

body.dark-mode .sms-bubble {
  color: var(--dm-text) !important;
}

body.dark-mode .sms-bubble.inbound {
  background: var(--dm-surface) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .sms-bubble.outbound {
  background: rgba(128, 42, 142, 0.7) !important;
  color: white !important;
}

body.dark-mode .sms-bubble.outbound.gizmo {
  background: rgba(99, 102, 241, 0.6) !important;
}

body.dark-mode .sms-bubble.outbound.system {
  background: rgba(100, 116, 139, 0.5) !important;
}

body.dark-mode .sms-bubble.failed {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .sms-bubble-tag {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-bubble-time {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-input-bar {
  background: var(--dm-surface) !important;
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .sms-input-bar textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .sms-input-bar textarea::placeholder {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-empty {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sms-search input {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .sms-search input::placeholder {
  color: var(--dm-text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CALLS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .call-stat-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-card-shadow) !important;
}

body.dark-mode .call-stat-card.missed {
  border-left: 3px solid #f87171 !important;
}

body.dark-mode .call-stat-card.answered {
  border-left: 3px solid #34d399 !important;
}

body.dark-mode .call-stat-card h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .call-stat-card .stat-number,
body.dark-mode .call-stat-card p {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .call-row {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .call-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .call-row.unread {
  background: rgba(128, 42, 142, 0.08) !important;
}

body.dark-mode .call-direction {
  color: white !important;
}

body.dark-mode .call-direction.inbound {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

body.dark-mode .call-direction.outbound {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .call-direction.missed {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}

body.dark-mode .call-result-badge {
  border: none !important;
}

body.dark-mode .call-result-badge.answered {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .call-result-badge.missed,
body.dark-mode .call-result-badge.no_answer {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .call-result-badge.voicemail {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .call-result-badge.busy {
  background: rgba(234, 179, 8, 0.15) !important;
  color: #fde68a !important;
}

body.dark-mode .call-name {
  color: var(--dm-text) !important;
}

body.dark-mode .call-number {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .call-time {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .call-duration {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .call-pagination button {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .call-pagination button:hover:not(.active) {
  background: var(--dm-surface-hover) !important;
}

body.dark-mode .call-pagination button.active {
  background: rgba(128, 42, 142, 0.7) !important;
  border-color: rgba(128, 42, 142, 0.5) !important;
  color: white !important;
}

/* ═══════════════════════════════════════════════════════════════════
   BOOKINGS — Dark Mode Overrides (Badges, Filters, Selected Rows)
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .filter-tab {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .filter-tab:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .filter-tab.active {
  background: rgba(128, 42, 142, 0.2) !important;
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .data-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .bookings-table tbody tr:hover {
  background: rgba(128, 42, 142, 0.06) !important;
}

body.dark-mode tr.selected,
body.dark-mode tr:has(.row-checkbox:checked) {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Booking type badges */
body.dark-mode .badge-party { background: rgba(190, 24, 93, 0.15) !important; color: #f9a8d4 !important; }
body.dark-mode .badge-workshop { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .badge-preschoolworkshop { background: rgba(30, 58, 138, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .badge-show { background: rgba(91, 33, 182, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .badge-assembly { background: rgba(20, 83, 45, 0.15) !important; color: #86efac !important; }
body.dark-mode .badge-program { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .badge-camp { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .badge-booth { background: rgba(133, 77, 14, 0.15) !important; color: #fde68a !important; }
body.dark-mode .badge-event { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .badge-celebration { background: rgba(194, 65, 12, 0.15) !important; color: #fdba74 !important; }
body.dark-mode .badge-familynight { background: rgba(8, 145, 178, 0.15) !important; color: #67e8f9 !important; }
body.dark-mode .badge-funstations { background: rgba(5, 150, 105, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .badge-excel { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }

/* Payment status badges */
body.dark-mode .badge-pay-unpaid { background: rgba(153, 27, 27, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .badge-pay-paid { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .badge-pay-partial { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .badge-pay-refunded { background: rgba(55, 48, 163, 0.15) !important; color: #a5b4fc !important; }
body.dark-mode .badge-pay-invoiced { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }

/* Booking status badges */
body.dark-mode .badge-status-pending { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .badge-status-confirmed { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .badge-status-completed { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .badge-status-cancelled { background: rgba(153, 27, 27, 0.15) !important; color: #fca5a5 !important; }

/* Invoice status badges */
body.dark-mode .badge-inv-draft { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .badge-inv-sent { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .badge-inv-paid { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .badge-inv-overdue { background: rgba(153, 27, 27, 0.15) !important; color: #fca5a5 !important; }

/* Mobile card layout */
body.dark-mode .bookings-table .mobile-card {
  background: var(--dm-surface) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   SCHOOLS — Index Page Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .stat-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-card-shadow) !important;
}

body.dark-mode .stat-value {
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .stat-label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .contact-label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .contact-value {
  color: var(--dm-text) !important;
}

body.dark-mode .capacity-section {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .meta-badge {
  border: none !important;
}

body.dark-mode .meta-badge.programs { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .meta-badge.students { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .meta-badge.contact { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .meta-badge.welcome-sent { background: rgba(59, 130, 246, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .meta-badge.no-welcome { background: rgba(234, 179, 8, 0.15) !important; color: #fde68a !important; }

body.dark-mode .deadline-info {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .empty-state {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .empty-state h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .empty-state p {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .alert-success {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: #86efac !important;
}

body.dark-mode .alert-error {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   SCHOOLS — Detail Page Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .school-detail-header {
  color: var(--dm-text) !important;
}

body.dark-mode .school-detail-icon {
  background: rgba(128, 42, 142, 0.2) !important;
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .school-detail-icon svg {
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .school-detail-info h1 {
  color: var(--dm-text) !important;
}

body.dark-mode .school-detail-actions .btn {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .school-detail-actions .btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .contact-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-card-shadow) !important;
}

body.dark-mode .contact-card h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .contact-card p,
body.dark-mode .contact-card span {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .program-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-card-shadow) !important;
}

body.dark-mode .program-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(128, 42, 142, 0.12) !important;
}

body.dark-mode .program-card-header h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .class-badge {
  background: rgba(128, 42, 142, 0.15) !important;
  color: #c084fc !important;
}

body.dark-mode .program-card p,
body.dark-mode .program-card span {
  color: var(--dm-text-secondary) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   KIT PREP — Booking Info Box Dark Mode Override
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .kit-booking-info {
  background: rgba(59, 130, 246, 0.1) !important;
  border-left-color: #60a5fa !important;
  color: var(--dm-text) !important;
}

body.dark-mode .kit-booking-info div {
  color: var(--dm-text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   GIZMO FLAGS — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .gf-card {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .gf-card:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .gf-card.high-priority {
  border-left-color: #f87171 !important;
}

/* Gizmo flag badges — dark mode versions */
body.dark-mode .gf-badge.channel-email { background: rgba(79, 70, 229, 0.15) !important; color: #a5b4fc !important; }
body.dark-mode .gf-badge.channel-sms { background: rgba(5, 150, 105, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .gf-badge.channel-facebook { background: rgba(37, 99, 235, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .gf-badge.channel-instagram { background: rgba(219, 39, 119, 0.15) !important; color: #f9a8d4 !important; }
body.dark-mode .gf-badge.priority-high { background: rgba(220, 38, 38, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .gf-badge.priority-normal { background: rgba(22, 163, 74, 0.15) !important; color: #86efac !important; }
body.dark-mode .gf-badge.cat-complaint { background: rgba(220, 38, 38, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .gf-badge.cat-urgent { background: rgba(234, 88, 12, 0.15) !important; color: #fdba74 !important; }
body.dark-mode .gf-badge.cat-booking_confirmation { background: rgba(37, 99, 235, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .gf-badge.cat-complex { background: rgba(202, 138, 4, 0.15) !important; color: #fde68a !important; }
body.dark-mode .gf-badge.cat-needs_review { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .gf-badge.cat-unclear { background: rgba(100, 116, 139, 0.15) !important; color: #94a3b8 !important; }
body.dark-mode .gf-badge.cat-information_request { background: rgba(5, 150, 105, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .gf-badge.cat-conversational { background: rgba(21, 128, 61, 0.15) !important; color: #86efac !important; }
body.dark-mode .gf-badge.holding-sent { background: rgba(217, 119, 6, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .gf-badge.status-approved { background: rgba(5, 150, 105, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .gf-badge.status-dismissed { background: rgba(100, 116, 139, 0.15) !important; color: #94a3b8 !important; }
body.dark-mode .gf-badge.status-replied_manually { background: rgba(37, 99, 235, 0.15) !important; color: #93c5fd !important; }

body.dark-mode .gf-draft {
  background: rgba(128, 42, 142, 0.08) !important;
  border-color: rgba(128, 42, 142, 0.25) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .gf-draft-label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .gf-draft textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .gf-score {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .gf-message {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .gf-sender {
  color: var(--dm-text) !important;
}

body.dark-mode .gf-time {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .gf-actions button {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .gf-actions button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--dm-text) !important;
}

/* Gizmo flags stat cards */
body.dark-mode .gizmo-flags-page .stat-card,
body.dark-mode #statsRow .stat-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-card-shadow) !important;
}

body.dark-mode #statsRow .stat-card:hover {
  border-color: var(--dm-purple-accent) !important;
}

body.dark-mode #statsRow .stat-card.active {
  border-color: var(--dm-purple-accent) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;
}

body.dark-mode #statsRow .stat-card .stat-number {
  color: var(--dm-text) !important;
}

body.dark-mode #statsRow .stat-card .stat-label {
  color: var(--dm-text-secondary) !important;
}

/* Gizmo flag cards */
body.dark-mode .gf-card {
  background: var(--dm-surface) !important;
  border-left-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .gf-card:hover {
  background: var(--dm-surface-hover) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
body.dark-mode .gf-card.high-priority { border-left-color: #ef4444 !important; }
body.dark-mode .gf-card.channel-email { border-left-color: #818cf8 !important; }
body.dark-mode .gf-card.channel-sms { border-left-color: #34d399 !important; }
body.dark-mode .gf-card.channel-facebook { border-left-color: #60a5fa !important; }
body.dark-mode .gf-card.channel-instagram { border-left-color: #f472b6 !important; }
body.dark-mode .gf-name { color: var(--dm-text) !important; }
body.dark-mode .gf-subject { color: var(--dm-text-secondary) !important; }
body.dark-mode .gf-message { color: var(--dm-text-muted) !important; }
body.dark-mode .gf-time { color: var(--dm-text-muted) !important; }
body.dark-mode .gf-reasoning { color: var(--dm-text-muted) !important; }
body.dark-mode .gf-expand-btn { color: var(--dm-purple-bright) !important; }
body.dark-mode .gf-confidence-bar { background: rgba(255, 255, 255, 0.1) !important; }
body.dark-mode .gf-confidence span { color: var(--dm-text-secondary) !important; }
body.dark-mode .gf-draft {
  background: rgba(124, 58, 237, 0.1) !important;
  border-color: rgba(124, 58, 237, 0.25) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .gf-draft textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .gf-reply-box textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .gf-btn-dismiss {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .gf-btn-view { color: var(--dm-text-muted) !important; }
body.dark-mode .gf-badge.channel-email { background: rgba(99, 102, 241, 0.2) !important; color: #a5b4fc !important; }
body.dark-mode .gf-badge.channel-sms { background: rgba(16, 185, 129, 0.2) !important; color: #6ee7b7 !important; }
body.dark-mode .gf-badge.channel-facebook { background: rgba(59, 130, 246, 0.2) !important; color: #93c5fd !important; }
body.dark-mode .gf-badge.channel-instagram { background: rgba(236, 72, 153, 0.2) !important; color: #f9a8d4 !important; }
body.dark-mode .gf-badge.priority-high { background: rgba(239, 68, 68, 0.2) !important; color: #fca5a5 !important; }
body.dark-mode .gf-badge.priority-normal { background: rgba(22, 163, 74, 0.2) !important; color: #86efac !important; }
body.dark-mode .gf-badge.cat-complaint { background: rgba(239, 68, 68, 0.2) !important; color: #fca5a5 !important; }
body.dark-mode .gf-badge.cat-urgent { background: rgba(234, 88, 12, 0.2) !important; color: #fdba74 !important; }
body.dark-mode .gf-badge.cat-booking_confirmation { background: rgba(37, 99, 235, 0.2) !important; color: #93c5fd !important; }
body.dark-mode .gf-badge.cat-complex { background: rgba(202, 138, 4, 0.2) !important; color: #fde047 !important; }
body.dark-mode .gf-badge.cat-needs_review { background: rgba(124, 58, 237, 0.2) !important; color: #c4b5fd !important; }
body.dark-mode .gf-badge.cat-unclear { background: rgba(100, 116, 139, 0.2) !important; color: #94a3b8 !important; }
body.dark-mode .gf-badge.cat-information_request { background: rgba(5, 150, 105, 0.2) !important; color: #6ee7b7 !important; }
body.dark-mode .gf-badge.cat-conversational { background: rgba(21, 128, 61, 0.2) !important; color: #86efac !important; }
body.dark-mode .gf-badge.holding-sent { background: rgba(217, 119, 6, 0.2) !important; color: #fcd34d !important; }
body.dark-mode .gf-badge.status-approved { background: rgba(5, 150, 105, 0.2) !important; color: #6ee7b7 !important; }
body.dark-mode .gf-badge.status-dismissed { background: rgba(100, 116, 139, 0.2) !important; color: #94a3b8 !important; }
body.dark-mode .gf-badge.status-replied_manually { background: rgba(37, 99, 235, 0.2) !important; color: #93c5fd !important; }

/* Sidebar badge visibility in dark mode */
body.dark-mode .sidebar-badge {
  background: var(--dm-purple-accent) !important;
  color: white !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6), 0 0 16px rgba(168, 85, 247, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   VOICEMAIL — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .vm-stat-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .vm-stat-card.unread {
  border-left: 3px solid var(--dm-purple-accent) !important;
}

body.dark-mode .vm-stat-card.today {
  border-left: 3px solid #34d399 !important;
}

body.dark-mode .vm-stat-value {
  color: var(--dm-text) !important;
}

body.dark-mode .vm-stat-label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .vm-row {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .vm-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .vm-row.unread {
  background: rgba(128, 42, 142, 0.08) !important;
}

body.dark-mode .vm-icon {
  background: rgba(154, 52, 18, 0.15) !important;
  color: #fdba74 !important;
}

body.dark-mode .vm-caller {
  color: var(--dm-text) !important;
}

body.dark-mode .vm-number {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .vm-transcript {
  background: rgba(245, 158, 11, 0.08) !important;
  border-left-color: #fbbf24 !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .vm-transcript.vm-no-transcript {
  background: transparent !important;
  border-left-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .vm-notes-preview {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .vm-action-btn {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .vm-action-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .vm-pagination {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .vm-pagination a {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .vm-pagination a.active {
  background: rgba(128, 42, 142, 0.7) !important;
  border-color: rgba(128, 42, 142, 0.5) !important;
  color: white !important;
}

body.dark-mode .vm-pagination a:hover:not(.active) {
  background: var(--dm-surface-hover) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   BOOKING DETAIL — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

/* Contact bar */
body.dark-mode .booking-contact-bar {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .contact-bar-name {
  color: var(--dm-text) !important;
}

body.dark-mode .contact-email {
  background: rgba(109, 40, 217, 0.15) !important;
  color: #c4b5fd !important;
}

body.dark-mode .contact-email:hover {
  background: rgba(109, 40, 217, 0.25) !important;
}

body.dark-mode .contact-phone {
  background: rgba(22, 101, 52, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .contact-phone:hover {
  background: rgba(22, 101, 52, 0.25) !important;
}

body.dark-mode .contact-address {
  background: rgba(30, 64, 175, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .contact-address:hover {
  background: rgba(30, 64, 175, 0.25) !important;
}

/* Event summary card — override inline gradient */
body.dark-mode .card[style*="background: linear-gradient"] {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}

/* Quick add section — override inline bg */
body.dark-mode div[style*="background: #f9fafb"] {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

/* Addon/event picker containers — override inline bg */
body.dark-mode div[style*="background: white"],
body.dark-mode div[style*="background:#fff"],
body.dark-mode div[style*="background: #fff"] {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode div[style*="background: linear-gradient(135deg, #f0f9ff"] {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}

/* Picker tabs */
body.dark-mode .picker-tab {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .picker-tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .picker-tab.active {
  background: rgba(3, 105, 161, 0.7) !important;
  color: white !important;
  border-color: rgba(3, 105, 161, 0.5) !important;
}

/* Event rows in picker */
body.dark-mode .event-row {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .event-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .event-name {
  color: var(--dm-text) !important;
}

body.dark-mode .event-category {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .event-price {
  color: #6ee7b7 !important;
}

/* Item booked badges — override inline white bg */
body.dark-mode span[style*="background: white"][style*="border: 1px solid #7dd3fc"] {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #93c5fd !important;
}

/* Line item rows */
body.dark-mode .line-item-row input {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Booking picker panels — override inline white backgrounds */
body.dark-mode #addonPicker,
body.dark-mode #mileageCalc {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
  backdrop-filter: blur(8px);
}

body.dark-mode #eventPicker {
  background: rgba(6, 182, 212, 0.08) !important;
  border-color: rgba(6, 182, 212, 0.25) !important;
  backdrop-filter: blur(8px);
}

body.dark-mode #eventPicker span[style*="color: #0369a1"] {
  color: #67e8f9 !important;
}

body.dark-mode #eventList {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode #addonList div[style*="border-bottom"] {
  border-color: var(--dm-border) !important;
}

body.dark-mode #addonList span[style*="color: #10b981"] {
  color: #6ee7b7 !important;
}

/* Picker tabs */
body.dark-mode .picker-tab {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .picker-tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .picker-tab.active {
  background: rgba(6, 182, 212, 0.2) !important;
  border-color: #06b6d4 !important;
  color: #67e8f9 !important;
}

/* Event list rows */
body.dark-mode .event-row {
  border-color: var(--dm-border) !important;
}

body.dark-mode .event-row:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .event-name {
  color: var(--dm-text) !important;
}

body.dark-mode .event-category {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .event-price {
  color: #6ee7b7 !important;
}

body.dark-mode .event-empty {
  color: var(--dm-text-muted) !important;
}

/* Mileage calculator dark mode */
body.dark-mode #mileageIncluded {
  background: rgba(16, 185, 129, 0.12) !important;
}

body.dark-mode #mileageIncluded span[style*="color: #166534"] {
  color: #6ee7b7 !important;
}

body.dark-mode #mileageIncluded div[style*="color: #166534"] {
  color: #6ee7b7 !important;
}

body.dark-mode #mileageCalc label[style*="color: #6b7280"] {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode #mileageCalc input[readonly] {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode #addonPicker span[style*="color: #6b7280"],
body.dark-mode #addonPicker button[style*="color: #6b7280"],
body.dark-mode #mileageCalc button[style*="color: #6b7280"],
body.dark-mode #eventPicker button[style*="color: #6b7280"] {
  color: var(--dm-text-muted) !important;
}

body.dark-mode #addonPicker input[style*="border: 1px solid #d1d5db"],
body.dark-mode #mileageCalc input[style*="border: 1px solid #d1d5db"] {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOMER PROFILE — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .detail-section {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .detail-section h3,
body.dark-mode .detail-section h4 {
  color: var(--dm-text) !important;
}

body.dark-mode .detail-section label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .detail-section p,
body.dark-mode .detail-section span {
  color: var(--dm-text) !important;
}

/* Tabs in customer detail */
body.dark-mode .detail-tabs {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .detail-tab {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .detail-tab:hover {
  color: var(--dm-text) !important;
}

body.dark-mode .detail-tab.active {
  color: var(--dm-purple-bright) !important;
  border-bottom-color: var(--dm-purple-accent) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CONTACTS PAGE — Dark Mode Overrides (Admin Contacts)
   ═══════════════════════════════════════════════════════════════════ */

/* Detail panel (slide-out sidebar) */
body.dark-mode #detailPanel {
  background: var(--dm-glass-bg) !important;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(128, 42, 142, 0.1) !important;
  color: var(--dm-text) !important;
}

body.dark-mode #detailPanel h3,
body.dark-mode #detailPanel h4 {
  color: var(--dm-text) !important;
}

body.dark-mode #detailPanel label,
body.dark-mode #detailPanel .label {
  color: var(--dm-text-secondary) !important;
}

/* Filter bar and selects — override inline backgrounds */
body.dark-mode select[style*="background:#fff"],
body.dark-mode select[style*="background: #fff"] {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Pagination buttons */
body.dark-mode .pg-btn {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .pg-btn.active {
  background: rgba(79, 70, 229, 0.7) !important;
  color: white !important;
  border-color: rgba(79, 70, 229, 0.5) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   STAFF MANAGEMENT — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .staff-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .staff-card:hover {
  border-color: var(--dm-border-strong) !important;
}

body.dark-mode .staff-card h3,
body.dark-mode .staff-card .staff-name {
  color: var(--dm-text) !important;
}

body.dark-mode .staff-card .staff-email,
body.dark-mode .staff-card .staff-role {
  color: var(--dm-text-secondary) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRAMS DETAIL — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .class-card {
  background: var(--dm-glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-card-shadow) !important;
}

body.dark-mode .class-card-header {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .class-card-body {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .class-card-staff {
  color: var(--dm-text-secondary) !important;
}

/* Unassigned class card — override inline bg */
body.dark-mode .class-card[style*="background: #fffbeb"] {
  background: rgba(251, 191, 36, 0.08) !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

/* Time inputs in programs */
body.dark-mode .time-hour,
body.dark-mode .time-min,
body.dark-mode .time-ampm {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Dropdown menus used across pages */
body.dark-mode .dropdown-menu {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   GLOBAL — Catch-all for inline style white backgrounds
   ═══════════════════════════════════════════════════════════════════ */

/* Override any remaining inline-styled white background containers */
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #ffffff"] {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Catch inline light gray backgrounds */
body.dark-mode [style*="background: #f9fafb"],
body.dark-mode [style*="background:#f9fafb"],
body.dark-mode [style*="background: #f3f4f6"],
body.dark-mode [style*="background:#f3f4f6"] {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

/* Catch inline light blue gradient backgrounds */
body.dark-mode [style*="background: linear-gradient(135deg, #f0f9ff"],
body.dark-mode [style*="background:linear-gradient(135deg, #f0f9ff"] {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}

/* Catch inline light yellow/orange backgrounds */
body.dark-mode [style*="background: #fffbeb"],
body.dark-mode [style*="background:#fffbeb"],
body.dark-mode [style*="background: #fff7ed"],
body.dark-mode [style*="background:#fff7ed"] {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Staff tags / chips with inline light backgrounds */
body.dark-mode span[style*="background: var(--gray-50)"],
body.dark-mode span[style*="background:var(--gray-50)"] {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Form controls globally */
body.dark-mode .form-control,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode input[type="password"],
body.dark-mode input[type="search"],
body.dark-mode textarea,
body.dark-mode select {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .form-control:focus,
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  border-color: var(--dm-purple-accent) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;
}

body.dark-mode .form-label {
  color: var(--dm-text-secondary) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   UNIVERSAL BADGE / TAG / CHIP / PILL — Dark Mode Overrides
   Covers all pastel-background badges across the entire codebase
   ═══════════════════════════════════════════════════════════════════ */

/* --- Staff role badges --- */
body.dark-mode .role-instructor { background: rgba(30, 64, 175, 0.2) !important; color: #93c5fd !important; }
body.dark-mode .role-sales { background: rgba(146, 64, 14, 0.2) !important; color: #fcd34d !important; }
body.dark-mode .role-equipment_coordinator { background: rgba(22, 101, 52, 0.2) !important; color: #86efac !important; }
body.dark-mode .role-super_admin { background: rgba(124, 58, 237, 0.2) !important; color: #c4b5fd !important; }
body.dark-mode .role-admin { background: rgba(124, 58, 237, 0.2) !important; color: #c4b5fd !important; }

/* --- Staff status badges --- */
body.dark-mode .status-badge.active { background: rgba(22, 101, 52, 0.2) !important; color: #86efac !important; }
body.dark-mode .status-badge.inactive { background: rgba(255, 255, 255, 0.08) !important; color: var(--dm-text-muted) !important; }

/* --- Bookable badge --- */
body.dark-mode .bookable-badge { background: rgba(22, 101, 52, 0.2) !important; color: #86efac !important; }
body.dark-mode .badge-bookable { background: rgba(22, 101, 52, 0.2) !important; color: #86efac !important; }
body.dark-mode .badge-not-bookable { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }

/* --- Type tags (addons, events, categories) --- */
body.dark-mode .type-tag.party,
body.dark-mode .category-tag.party { background: rgba(190, 24, 93, 0.15) !important; color: #f9a8d4 !important; }
body.dark-mode .type-tag.workshop,
body.dark-mode .category-tag.workshop { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .type-tag.show,
body.dark-mode .category-tag.show { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .type-tag.program,
body.dark-mode .category-tag.program { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .type-tag.camp,
body.dark-mode .category-tag.camp { background: rgba(55, 48, 163, 0.15) !important; color: #a5b4fc !important; }
body.dark-mode .type-tag.booth,
body.dark-mode .category-tag.booth { background: rgba(133, 77, 14, 0.15) !important; color: #fde68a !important; }
body.dark-mode .type-tag.event,
body.dark-mode .category-tag.event { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .type-tag.celebration,
body.dark-mode .category-tag.celebration { background: rgba(194, 65, 12, 0.15) !important; color: #fdba74 !important; }
body.dark-mode .type-tag.familynight,
body.dark-mode .category-tag.familynight { background: rgba(8, 145, 178, 0.15) !important; color: #67e8f9 !important; }
body.dark-mode .type-tag.funstations,
body.dark-mode .category-tag.funstations { background: rgba(5, 150, 105, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .type-tag.preschoolworkshop,
body.dark-mode .category-tag.preschoolworkshop { background: rgba(30, 58, 138, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .type-tag.excel,
body.dark-mode .category-tag.excel { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .type-tag.assembly,
body.dark-mode .category-tag.assembly { background: rgba(20, 83, 45, 0.15) !important; color: #86efac !important; }

/* --- Source badges (contacts page) --- */
body.dark-mode .source-badge.manual { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .source-badge.imported { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .source-badge.email { background: rgba(109, 40, 217, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .source-badge.booking { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .source-badge.registration { background: rgba(190, 24, 93, 0.15) !important; color: #f9a8d4 !important; }
body.dark-mode .source-badge.financial { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .source-badge.event { background: rgba(234, 88, 12, 0.15) !important; color: #fdba74 !important; }
body.dark-mode .source-badge.intel { background: rgba(55, 48, 163, 0.15) !important; color: #a5b4fc !important; }
body.dark-mode .source-badge.mailing_list { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }
body.dark-mode .source-badge.camp_reg { background: rgba(190, 24, 93, 0.15) !important; color: #f9a8d4 !important; }
body.dark-mode .source-badge.contact { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }

/* --- Staff calendar chips --- */
body.dark-mode .sc-chip.booking { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .sc-chip.program { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .sc-chip.camp { background: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
body.dark-mode .sc-chip.event { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }

/* --- Kit schedule badges --- */
body.dark-mode .ks-badge-red { background: rgba(239, 68, 68, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .ks-badge-yellow { background: rgba(245, 158, 11, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .ks-badge-duplicate { background: rgba(190, 24, 93, 0.15) !important; color: #f9a8d4 !important; }
body.dark-mode .ks-badge-info { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }

/* --- Invoice badges --- */
body.dark-mode .badge-draft { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .badge-cancelled { background: rgba(239, 68, 68, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .badge-paid { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .badge-exported { background: rgba(22, 101, 52, 0.1) !important; color: #6ee7b7 !important; }
body.dark-mode .badge-sent { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .badge-overdue { background: rgba(153, 27, 27, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .badge-custom { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }

/* --- Camp type badges --- */
body.dark-mode .camp-type-summer { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .camp-type-pd-day { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }

/* --- Enrollment badges --- */
body.dark-mode .enrollment-badge { background: rgba(128, 42, 142, 0.15) !important; color: #c084fc !important; }

/* --- Consent badges --- */
body.dark-mode .consent-badge.yes { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .consent-badge.no { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }

/* --- Payment status badges --- */
body.dark-mode .payment-status-badge.status-paid { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .payment-status-badge.status-partial { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }
body.dark-mode .payment-status-badge.status-unpaid { background: rgba(220, 38, 38, 0.15) !important; color: #fca5a5 !important; }
body.dark-mode .payment-method-text { color: var(--dm-text-muted) !important; }

/* --- Health alert rows (programs detail) --- */
body.dark-mode .health-alert-row { background: rgba(245, 158, 11, 0.06) !important; }
body.dark-mode .health-alert-row:hover { background: rgba(245, 158, 11, 0.12) !important; }

/* --- Class badges (programs) --- */
body.dark-mode .class-badge { background: rgba(109, 40, 217, 0.15) !important; color: #c4b5fd !important; }
body.dark-mode .class-badge.unassigned { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }

/* --- Price badge --- */
body.dark-mode .price-badge { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }

/* --- Customer Intelligence dark mode --- */
body.dark-mode .tag-chip { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }

/* Stat cards */
body.dark-mode .stat-card {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .stat-card div[style*="color:#1f2937"],
body.dark-mode .stat-card div[style*="color: #1f2937"] {
  color: var(--dm-text) !important;
}
body.dark-mode .stat-card div[style*="color:#6b7280"],
body.dark-mode .stat-card div[style*="color: #6b7280"] {
  color: var(--dm-text-secondary) !important;
}

/* Result cards (search results) */
body.dark-mode .result-card {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .result-card:hover {
  border-color: var(--dm-purple-accent) !important;
  box-shadow: 0 1px 8px rgba(128, 42, 142, 0.15) !important;
}
body.dark-mode .result-card div[style*="color:#1f2937"],
body.dark-mode .result-card span[style*="color:#1f2937"] {
  color: var(--dm-text) !important;
}
body.dark-mode .result-card div[style*="color:#6b7280"],
body.dark-mode .result-card span[style*="color:#6b7280"] {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .result-card div[style*="color:#9ca3af"] {
  color: var(--dm-text-muted) !important;
}

/* Search bar container */
body.dark-mode div[style*="background:#fff"][style*="border-radius:12px"] {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
}

/* Search inputs + select */
body.dark-mode #searchInput,
body.dark-mode #searchType,
body.dark-mode #aiQuery {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
body.dark-mode #searchInput::placeholder,
body.dark-mode #aiQuery::placeholder {
  color: var(--dm-text-muted) !important;
}
body.dark-mode #searchType option {
  background: var(--dm-bg-primary);
  color: var(--dm-text);
}

/* AI answer box */
body.dark-mode #aiAnswer {
  background: rgba(124, 58, 237, 0.1) !important;
  border-color: rgba(124, 58, 237, 0.25) !important;
  color: var(--dm-text) !important;
}

/* Section headings */
body.dark-mode #profileResults h3,
body.dark-mode #txnResults h3,
body.dark-mode #bkResults h3,
body.dark-mode #emResults h3 {
  color: var(--dm-text) !important;
}
body.dark-mode #profileCount,
body.dark-mode #txnCount,
body.dark-mode #bkCount,
body.dark-mode #emCount {
  color: var(--dm-text-secondary) !important;
}

/* Result labels */
body.dark-mode .label-source {
  background: rgba(55, 48, 163, 0.2) !important;
  color: #a5b4fc !important;
}
body.dark-mode .label-vip {
  background: rgba(109, 40, 217, 0.2) !important;
  color: #c4b5fd !important;
}
body.dark-mode .label-paid {
  background: rgba(5, 150, 105, 0.15) !important;
  color: #6ee7b7 !important;
}
body.dark-mode .label-unpaid {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* Loading indicator */
body.dark-mode #loadingIndicator {
  color: var(--dm-text-secondary) !important;
}

/* Page header */
body.dark-mode .page-header h1 {
  color: var(--dm-text) !important;
}
body.dark-mode .page-header p {
  color: var(--dm-text-secondary) !important;
}

/* Customer detail modal */
body.dark-mode #customerModal .modal-content {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
}
body.dark-mode #modalTitle {
  color: var(--dm-text) !important;
}
body.dark-mode #modalContent {
  color: var(--dm-text) !important;
}
body.dark-mode .detail-section h4 {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .detail-table th {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .detail-table td {
  border-top-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* --- Urgent badge (social chats) --- */
body.dark-mode .urgent-badge { background: rgba(239, 68, 68, 0.1) !important; border-color: rgba(239, 68, 68, 0.3) !important; color: #fca5a5 !important; }

/* --- Social studio badges --- */
body.dark-mode .idea-badge.status-new { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .idea-badge.status-used { background: rgba(55, 48, 163, 0.15) !important; color: #a5b4fc !important; }
body.dark-mode .idea-badge.status-dismissed { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }
body.dark-mode .connected-badge.connected { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }
body.dark-mode .connected-badge.disconnected { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }

/* --- Party Packages (settings) --- */
body.dark-mode .package-card {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .package-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
body.dark-mode .package-card.inactive {
  background: rgba(255, 255, 255, 0.02) !important;
}
body.dark-mode .package-header h3 {
  color: var(--dm-text) !important;
}
body.dark-mode .package-price {
  color: var(--dm-purple-bright) !important;
}
body.dark-mode .package-description {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .package-details {
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .detail-item {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .detail-item svg {
  color: var(--dm-purple-bright) !important;
}
body.dark-mode .package-includes {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .package-includes strong {
  color: var(--dm-text) !important;
}
body.dark-mode .package-includes p {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .status-badge.active {
  background: rgba(22, 101, 52, 0.15) !important;
  color: #86efac !important;
}
body.dark-mode .status-badge.inactive {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-muted) !important;
}

/* --- Inventory badges --- */
body.dark-mode .badge-default { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }
body.dark-mode .qty-badge { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text) !important; }

/* --- Assigned staff inline tags (bookings, camps) --- */
body.dark-mode span[style*="background: var(--gray-50)"][style*="border-radius: 2rem"] {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* --- Item source badges (booking detail) --- */
body.dark-mode .badge-theme { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }
body.dark-mode .item-source-badge.badge-workshop { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }

/* --- Email compose badge --- */
body.dark-mode span[style*="background:#f3f4f6"][style*="border-radius:4px"] {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-muted) !important;
}

/* --- Dropdown items --- */
body.dark-mode .dropdown-item {
  color: var(--dm-text) !important;
}

body.dark-mode .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .dropdown-divider {
  border-color: var(--dm-border) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CATCH-ALL — Pastel background badges in dark mode
   Generic rules for common light background hex colors
   ═══════════════════════════════════════════════════════════════════ */

/* Light pinks */
body.dark-mode [style*="background: #fce7f3"],
body.dark-mode [style*="background:#fce7f3"] { background: rgba(190, 24, 93, 0.15) !important; color: #f9a8d4 !important; }

/* Light blues */
body.dark-mode [style*="background: #dbeafe"],
body.dark-mode [style*="background:#dbeafe"] { background: rgba(30, 64, 175, 0.15) !important; color: #93c5fd !important; }

/* Light greens */
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"],
body.dark-mode [style*="background: #d1fae5"],
body.dark-mode [style*="background:#d1fae5"] { background: rgba(22, 101, 52, 0.15) !important; color: #86efac !important; }

/* Light purples */
body.dark-mode [style*="background: #ede9fe"],
body.dark-mode [style*="background:#ede9fe"],
body.dark-mode [style*="background: #f3e8ff"],
body.dark-mode [style*="background:#f3e8ff"],
body.dark-mode [style*="background: #e0e7ff"],
body.dark-mode [style*="background:#e0e7ff"] { background: rgba(124, 58, 237, 0.15) !important; color: #c4b5fd !important; }

/* Light yellows/oranges */
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background: #fef9c3"],
body.dark-mode [style*="background:#fef9c3"] { background: rgba(146, 64, 14, 0.15) !important; color: #fcd34d !important; }

/* Light reds */
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background:#fef2f2"] { background: rgba(220, 38, 38, 0.15) !important; color: #fca5a5 !important; }

/* Light oranges */
body.dark-mode [style*="background: #ffedd5"],
body.dark-mode [style*="background:#ffedd5"],
body.dark-mode [style*="background: #fed7aa"],
body.dark-mode [style*="background:#fed7aa"] { background: rgba(234, 88, 12, 0.15) !important; color: #fdba74 !important; }

/* Light cyans */
body.dark-mode [style*="background: #cffafe"],
body.dark-mode [style*="background:#cffafe"] { background: rgba(8, 145, 178, 0.15) !important; color: #67e8f9 !important; }

/* Light grays (generic tag backgrounds) */
body.dark-mode [style*="background: #f3f4f6"],
body.dark-mode [style*="background:#f3f4f6"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background:#f1f5f9"] { background: rgba(255, 255, 255, 0.06) !important; color: var(--dm-text-muted) !important; }

/* ═══════════════════════════════════════════════════════════════════
   STAFF — Compliance Document Badges
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .compliance-item.ok { background: rgba(22, 101, 52, 0.2) !important; color: #86efac !important; }
body.dark-mode .compliance-item.pending { background: rgba(146, 64, 14, 0.2) !important; color: #fcd34d !important; }
body.dark-mode .compliance-item.missing { background: rgba(255, 255, 255, 0.08) !important; color: var(--dm-text-muted) !important; }
body.dark-mode .compliance-item.expired { background: rgba(153, 27, 27, 0.2) !important; color: #fca5a5 !important; }

/* Staff bookable types text */
body.dark-mode .staff-bookable-types {
  color: var(--dm-text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRAMS DETAIL — Info Strip, Email Bar, Staff Widget
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .program-info-strip {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .strip-item {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .strip-item + .strip-item::before {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .strip-staff-label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .strip-no-staff {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .staff-chip {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .capacity-bar-mini {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .email-actions-bar {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .email-contact-info {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .email-no-contact {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .email-action-divider {
  background: var(--dm-border) !important;
}

body.dark-mode .edit-link {
  color: var(--dm-purple-bright) !important;
}

/* Staff assign widget (shared partial) */
body.dark-mode .sa-chip {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .sa-chip-role {
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .sa-chip-remove {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sa-empty {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .sa-select {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Health chips in program detail */
body.dark-mode .health-chip {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .health-chip strong {
  color: var(--dm-text) !important;
}

/* Health alert rows */
body.dark-mode .health-alert-row { background: rgba(245, 158, 11, 0.06) !important; }
body.dark-mode .health-alert-row:hover { background: rgba(245, 158, 11, 0.12) !important; }

/* ===== CRM Map View ===== */
body.dark-mode .map-sidebar {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .mobile-filter-bar {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .customer-list-mobile {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
}

body.dark-mode .map-filters {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .map-filters h4,
body.dark-mode .map-legend h4,
body.dark-mode .customer-list-mini h4 {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .filter-group label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .legend-item {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .customer-mini-item:hover {
  background: rgba(168, 85, 247, 0.12) !important;
}

body.dark-mode .customer-mini-item .name {
  color: var(--dm-text) !important;
}

body.dark-mode .customer-mini-item .meta {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .status-cb-label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .status-grid-compact .status-cb-label {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .status-grid-compact .status-cb-label:has(input:checked) {
  background: rgba(168, 85, 247, 0.15) !important;
  outline-color: rgba(168, 85, 247, 0.4) !important;
}

/* ─── Status Pill Chips (CRM Map) ─── */
body.dark-mode .status-pill {
  background: var(--dm-surface) !important;
  color: var(--dm-text-muted) !important;
  border-color: transparent !important;
}
body.dark-mode .status-pill:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
body.dark-mode .status-pill:has(input:checked) {
  color: var(--dm-text) !important;
}
body.dark-mode .status-pill[data-status="nevercontacted"]:has(input:checked) { background: rgba(128,128,128,0.15) !important; border-color: rgba(128,128,128,0.35) !important; }
body.dark-mode .status-pill[data-status="attemptedcontact"]:has(input:checked) { background: rgba(93,173,226,0.15) !important; border-color: rgba(93,173,226,0.35) !important; }
body.dark-mode .status-pill[data-status="inconversation"]:has(input:checked) { background: rgba(23,190,207,0.15) !important; border-color: rgba(23,190,207,0.35) !important; }
body.dark-mode .status-pill[data-status="proposalsent"]:has(input:checked) { background: rgba(155,89,182,0.15) !important; border-color: rgba(155,89,182,0.35) !important; }
body.dark-mode .status-pill[data-status="activecustomer"]:has(input:checked) { background: rgba(44,160,44,0.15) !important; border-color: rgba(44,160,44,0.35) !important; }
body.dark-mode .status-pill[data-status="pastcustomer"]:has(input:checked) { background: rgba(255,184,77,0.15) !important; border-color: rgba(255,184,77,0.35) !important; }
body.dark-mode .status-pill[data-status="notinterested"]:has(input:checked) { background: rgba(214,39,40,0.15) !important; border-color: rgba(214,39,40,0.35) !important; }
body.dark-mode .status-pill[data-status="donotcontact"]:has(input:checked) { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.25) !important; }

/* ─── Legend (CRM Map) ─── */
body.dark-mode .map-legend {
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .legend-item {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .legend-dot.donotcontact {
  background: #666 !important;
}

/* ─── Display Options / Toggle (CRM Map) ─── */
body.dark-mode .display-options {
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .display-options h4 {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .toggle-track {
  background: var(--dm-border) !important;
}
body.dark-mode .toggle-row input:checked + .toggle-track {
  background: var(--dm-purple-bright, #a855f7) !important;
}
body.dark-mode .toggle-label {
  color: var(--dm-text-secondary) !important;
}

/* ─── Staff Marker Popup (CRM Map) ─── */
body.dark-mode .leaflet-popup-content-wrapper {
  background: var(--dm-surface) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .leaflet-popup-tip {
  background: var(--dm-surface) !important;
}

body.dark-mode .mobile-filter-content {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .mobile-filter-bar .marker-badge {
  background: rgba(168, 85, 247, 0.2) !important;
  color: var(--dm-purple-bright) !important;
}

body.dark-mode .crm-nav {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .crm-nav a {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .crm-nav a:hover,
body.dark-mode .crm-nav a.active {
  color: var(--dm-purple-bright) !important;
  background: rgba(168, 85, 247, 0.12) !important;
}

body.dark-mode .crm-nav a.active {
  border-bottom-color: var(--dm-purple-bright) !important;
}

/* Leaflet popup dark mode */
body.dark-mode .leaflet-popup-content-wrapper {
  background: var(--dm-glass-bg) !important;
  color: var(--dm-text) !important;
  border: 1px solid var(--dm-border) !important;
}

body.dark-mode .leaflet-popup-tip {
  background: var(--dm-glass-bg) !important;
}

body.dark-mode .popup-title {
  color: var(--dm-text) !important;
}

body.dark-mode .popup-meta {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .popup-link {
  color: var(--dm-purple-bright) !important;
}

/* ===== Memos - Badge Pills ===== */
body.dark-mode .memo-badge.memo-urgent {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .memo-badge.memo-important {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .memo-badge.memo-draft {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .memo-badge.memo-recurring {
  background: rgba(108, 92, 231, 0.2) !important;
  color: #c4b5fd !important;
}

body.dark-mode .memo-content {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .memo-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

/* ===== Analytics Dashboard ===== */
body.dark-mode .analytics-section .section-title {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .stat-card {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .stat-label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .bar-container {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .bar-label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .bar-value {
  color: var(--dm-text) !important;
}

body.dark-mode .type-card {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .type-name {
  color: var(--dm-text) !important;
}

body.dark-mode .type-count {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .program-item {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .program-name {
  color: var(--dm-text) !important;
}

body.dark-mode .program-location {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .fill-bar-container {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .fill-text {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .upcoming-item {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .upcoming-name {
  color: var(--dm-text) !important;
}

body.dark-mode .staff-bar-container {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .staff-name {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .staff-hours {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .invoice-status-item {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .invoice-status-badge.status-draft {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .invoice-status-badge.status-sent {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .invoice-status-badge.status-paid {
  background: rgba(22, 101, 52, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .invoice-status-count {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .invoice-status-amount {
  color: var(--dm-text) !important;
}

body.dark-mode .overdue-item {
  background: rgba(220, 38, 38, 0.1) !important;
}

body.dark-mode .overdue-customer {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .overdue-amount {
  color: #fca5a5 !important;
}

body.dark-mode .payment-item {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .payment-customer {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .payment-date {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .empty-message {
  color: var(--dm-text-muted) !important;
}

/* Analytics data table */
body.dark-mode .analytics-section .data-table thead th {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-muted) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .analytics-section .data-table tbody td {
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .analytics-section .data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* QuickBooks export section */
body.dark-mode .export-description {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .export-form .form-group label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .export-form input[type="date"] {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ===== Inventory Module (inventory.css overrides) ===== */

/* Stat cards, dashboard sections, kit/item cards */
body.dark-mode .inventory-container .stat-card,
body.dark-mode .inventory-container .dashboard-section,
body.dark-mode .inventory-container .quick-actions,
body.dark-mode .inventory-container .list-card,
body.dark-mode .inventory-container .detail-card,
body.dark-mode .inventory-container .form-card,
body.dark-mode .inventory-container .empty-state,
body.dark-mode .inventory-container .contents-template-list {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .kit-card,
body.dark-mode .item-card {
  background: var(--dm-surface) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .shopping-item {
  background: var(--dm-surface) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Filter/search bar */
body.dark-mode .filters-bar,
body.dark-mode .filter-bar {
  background: var(--dm-surface) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .filter-group select,
body.dark-mode .filter-group input[type="text"] {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Headers and text */
body.dark-mode .inventory-header h1 {
  color: var(--dm-text) !important;
}

body.dark-mode .inventory-header .subtitle {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .section-header h2,
body.dark-mode .dashboard-section h2,
body.dark-mode .quick-actions h2,
body.dark-mode .list-card-header h3,
body.dark-mode .detail-card h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .kit-name,
body.dark-mode .kit-card h3,
body.dark-mode .item-card h3,
body.dark-mode .item-name {
  color: var(--dm-text) !important;
}

body.dark-mode .kit-theme,
body.dark-mode .item-sku,
body.dark-mode .item-sku-large {
  color: var(--dm-text-muted) !important;
}

/* Kit code pill */
body.dark-mode .kit-code {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .kit-code-large {
  background: rgba(168, 85, 247, 0.15) !important;
  color: var(--dm-purple-bright) !important;
}

/* Meta item pills (theme, location) */
body.dark-mode .kit-meta .meta-item {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}

/* Status badges */
body.dark-mode .status-badge.available {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .status-badge.checked_out {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .status-badge.maintenance {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .status-badge.retired {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .status-badge.complete {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .status-badge.incomplete {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .status-badge.missing_items {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .status-badge.needed {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .status-badge.ordered {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .status-badge.received {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .status-badge.cancelled {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

/* Condition badges */
body.dark-mode .condition-badge.excellent {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .condition-badge.good {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .condition-badge.fair {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .condition-badge.needs_repair {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .condition-badge.damaged {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}

/* Category badges */
body.dark-mode .category-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .category-badge.consumable {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .category-badge.equipment {
  background: rgba(55, 48, 163, 0.2) !important;
  color: #c4b5fd !important;
}

body.dark-mode .category-badge.take_home {
  background: rgba(157, 23, 77, 0.15) !important;
  color: #f9a8d4 !important;
}

body.dark-mode .category-badge.chemical {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .category-badge.supply {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

/* Stock, priority, type badges */
body.dark-mode .stock-badge.low {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .stock-badge.out {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .priority-badge.urgent {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .priority-badge.high {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .priority-badge.low {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .type-badge.consumable {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .type-badge.reusable {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .badge-default {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .badge-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .badge-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .badge-success {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}

body.dark-mode .qty-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .qty-badge.danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* Category tag in contents list */
body.dark-mode .category-tag {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

/* Inventory list items, check items, transaction items */
body.dark-mode .list-item {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode a.list-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .check-item,
body.dark-mode .transaction-item {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .contents-row {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .contents-header {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .template-summary {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .template-summary p {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .template-summary strong {
  color: var(--dm-text) !important;
}

/* Text colors */
body.dark-mode .item-info strong,
body.dark-mode .list-item-title {
  color: var(--dm-text) !important;
}

body.dark-mode .item-meta,
body.dark-mode .list-item-subtitle,
body.dark-mode .item-supplier {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .stat-icon {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .stat-icon.kit-icon {
  background: rgba(124, 58, 237, 0.15) !important;
}

body.dark-mode .stat-icon.items-icon {
  background: rgba(37, 99, 235, 0.15) !important;
}

body.dark-mode .stat-icon.shopping-icon {
  background: rgba(217, 119, 6, 0.15) !important;
}

body.dark-mode .stat-subtext {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .detail-row .label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .detail-row .value {
  color: var(--dm-text) !important;
}

body.dark-mode .detail-card.warning {
  background: rgba(245, 158, 11, 0.06) !important;
}

body.dark-mode .detail-card.danger {
  background: rgba(239, 68, 68, 0.06) !important;
}

body.dark-mode .detail-card.success {
  background: rgba(16, 185, 129, 0.06) !important;
}

body.dark-mode .qty-large {
  color: var(--dm-text) !important;
}

body.dark-mode .content-item {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .content-item .item-name {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .content-item .item-qty {
  color: var(--dm-text-muted) !important;
}

/* Status tabs */
body.dark-mode .status-tabs {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .status-tabs .tab {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .status-tabs .tab.active {
  background: rgba(168, 85, 247, 0.15) !important;
  color: var(--dm-purple-bright) !important;
  box-shadow: none !important;
}

/* Theme links */
body.dark-mode .theme-link {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .theme-link:hover {
  background: rgba(168, 85, 247, 0.12) !important;
  color: var(--dm-purple-bright) !important;
}

/* Quick action buttons */
body.dark-mode .quick-action-btn {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .quick-action-btn:hover {
  border-color: var(--dm-purple-accent) !important;
  color: var(--dm-purple-bright) !important;
  background: rgba(168, 85, 247, 0.08) !important;
}

body.dark-mode .action-btn.secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .action-btn.outline {
  background: transparent !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

/* Back link, breadcrumbs */
body.dark-mode .back-link {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .breadcrumb {
  color: var(--dm-text-muted) !important;
}

/* Inventory form elements */
body.dark-mode .form-card h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .form-card .form-actions {
  border-top-color: var(--dm-border) !important;
}

body.dark-mode .inventory-container .form-group label {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .inventory-container .form-group input,
body.dark-mode .inventory-container .form-group select,
body.dark-mode .inventory-container .form-group textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .small-input {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Import instructions */
body.dark-mode .import-instructions {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .import-instructions h4 {
  color: var(--dm-text) !important;
}

body.dark-mode .import-instructions p {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .import-instructions code {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .file-input {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Inventory modals */
body.dark-mode .inventory-container .modal-content {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
}

body.dark-mode .inventory-container .modal-content h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .modal-item-name {
  color: var(--dm-text-muted) !important;
}

/* Kit checkout info */
body.dark-mode .kit-checkout-info {
  color: #fcd34d !important;
}

/* Inventory empty/list messages */
body.dark-mode .empty-state-small {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .empty-list-message {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .list-card-header {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .list-item {
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode .item-notes {
  border-top-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .check-date {
  color: var(--dm-text) !important;
}

body.dark-mode .check-by {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .tx-type {
  color: var(--dm-text) !important;
}

body.dark-mode .tx-meta {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .tx-qty {
  color: var(--dm-text) !important;
}

body.dark-mode .reorder-info {
  color: var(--dm-text-muted) !important;
}

/* Badge small */
body.dark-mode .badge.badge-small {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

/* ===== Timesheet Submission ===== */
body.dark-mode .ts-reminder-box {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

body.dark-mode .ts-reminder-title {
  color: #fcd34d !important;
}

body.dark-mode .ts-reminder-box ul {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .ts-entry {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .ts-entry.from-schedule {
  background: rgba(16, 185, 129, 0.06) !important;
  border-color: rgba(134, 239, 172, 0.2) !important;
}

body.dark-mode .ts-entry label {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .ts-source-badge.schedule {
  background: rgba(22, 101, 52, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .ts-source-badge.manual {
  background: rgba(55, 48, 163, 0.2) !important;
  color: #c4b5fd !important;
}

body.dark-mode .ts-remove {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .ts-remove:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: white !important;
}

body.dark-mode .ts-add-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .ts-add-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--dm-text-muted) !important;
}

body.dark-mode .ts-mileage-section {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .ts-mileage-arrow {
  color: var(--dm-text-muted) !important;
}

/* ===== Availability Page ===== */
body.dark-mode .avail-day {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}

body.dark-mode .avail-toggle span {
  color: var(--dm-text) !important;
}

body.dark-mode .avail-times input[type="time"] {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* Override date overrides inline styles */
body.dark-mode input[type="date"],
body.dark-mode input[type="time"] {
  color-scheme: dark;
}

/* ===== My Documents / Compliance ===== */
body.dark-mode .info-box {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
}

body.dark-mode .info-title {
  color: #93c5fd !important;
}

body.dark-mode .info-box p,
body.dark-mode .info-box ul,
body.dark-mode .info-box li {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .doc-card {
  border-color: var(--dm-border) !important;
}

body.dark-mode .doc-icon.criminal {
  background: rgba(217, 119, 6, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .doc-icon.child-abuse {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .doc-icon.first-aid {
  background: rgba(22, 163, 74, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .doc-info h3 {
  color: var(--dm-text) !important;
}

body.dark-mode .status-badge.doc-approved {
  background: rgba(22, 101, 52, 0.15) !important;
  color: #86efac !important;
}

body.dark-mode .status-badge.doc-pending {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}

body.dark-mode .status-badge.doc-uploaded {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .status-badge.doc-rejected {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .status-badge.doc-not_started {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .doc-uploaded-info {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .doc-uploaded-info p {
  color: var(--dm-text-secondary) !important;
}

body.dark-mode .doc-upload-form {
  border-top-color: var(--dm-border) !important;
}

/* ===== Dashboard Customize Popup ===== */
body.dark-mode .widget-toggle-item {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--dm-border) !important;
}

body.dark-mode .widget-toggle-name {
  color: var(--dm-text) !important;
}

body.dark-mode .widget-settings-title {
  color: var(--dm-text) !important;
}

body.dark-mode .widget-settings-close {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode .widget-settings-close:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .widget-toggle-slider {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Memo popup dark mode */
body.dark-mode #memoPopup > div {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
}

body.dark-mode #memoPopup > div > div {
  border-color: var(--dm-border) !important;
}

/* ===== Program Detail - Health Alerts & Changes Banner ===== */
body.dark-mode .health-alerts-inline {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}

body.dark-mode .health-alerts-toggle {
  color: #fcd34d !important;
}

body.dark-mode .health-alerts-detail {
  border-top-color: rgba(245, 158, 11, 0.2) !important;
}

body.dark-mode .email-changes-banner {
  background: rgba(245, 158, 11, 0.08) !important;
  border-left-color: rgba(245, 158, 11, 0.4) !important;
}

body.dark-mode .email-changes-banner strong {
  color: #fcd34d !important;
}

body.dark-mode .change-item.added {
  color: #86efac !important;
}

body.dark-mode .change-item.removed {
  color: #fca5a5 !important;
}

body.dark-mode .health-alert-row {
  background: rgba(245, 158, 11, 0.06) !important;
}

body.dark-mode .health-alert-row:hover {
  background: rgba(245, 158, 11, 0.12) !important;
}

/* Unassigned class card with inline yellow background */
body.dark-mode .class-card[style*="background: #fffbeb"],
body.dark-mode .class-card[style*="background:#fffbeb"],
body.dark-mode [style*="background: #fffbeb"],
body.dark-mode [style*="background:#fffbeb"] {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}

/* Catch-all for common light yellow/orange/cream hardcoded backgrounds */
body.dark-mode [style*="background: #fff7ed"],
body.dark-mode [style*="background:#fff7ed"],
body.dark-mode [style*="background: #fff8e1"],
body.dark-mode [style*="background:#fff8e1"],
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background: #eff6ff"],
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #f9fafb"],
body.dark-mode [style*="background:#f9fafb"] {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* ===== Reference Panel (Ctrl+Click sidebar) ===== */
body.dark-mode #refPanel {
  background: var(--dm-glass-bg) !important;
  border-left-color: var(--dm-border) !important;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode #refPanelHeader {
  background: rgba(15, 15, 42, 0.9) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.dark-mode #refPanelFrame {
  background: var(--dm-bg) !important;
}

body.dark-mode #refMinTab {
  background: rgba(15, 15, 42, 0.9) !important;
  color: var(--dm-text-muted) !important;
}

body.dark-mode #refMinTab:hover {
  background: rgba(15, 15, 42, 1) !important;
  color: var(--dm-text) !important;
}

body.dark-mode .ref-btn {
  color: var(--dm-text-muted) !important;
}

body.dark-mode .ref-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ===== Timesheet Admin Type Pills ===== */
body.dark-mode .ts-type-Regular {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac !important;
}
body.dark-mode .ts-type-Training {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #93c5fd !important;
}
body.dark-mode .ts-type-Weekend {
  background: rgba(236, 72, 153, 0.15) !important;
  color: #f9a8d4 !important;
}
body.dark-mode .ts-modal-content {
  background: var(--dm-glass-bg) !important;
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ===== Timesheet Submit Page ===== */
body.dark-mode .ts-reminder-box {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
body.dark-mode .ts-reminder-title {
  color: #fbbf24 !important;
}
body.dark-mode .ts-reminder-box ul,
body.dark-mode .ts-reminder-box li {
  color: rgba(251, 191, 36, 0.8) !important;
}
body.dark-mode .ts-entry {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .ts-entry.from-schedule {
  background: rgba(34, 197, 94, 0.08) !important;
  border-color: rgba(34, 197, 94, 0.2) !important;
}
body.dark-mode .ts-source-badge.schedule {
  background: rgba(22, 101, 52, 0.2) !important;
  color: #86efac !important;
}
body.dark-mode .ts-source-badge.manual {
  background: rgba(55, 48, 163, 0.2) !important;
  color: #a5b4fc !important;
}
body.dark-mode .ts-remove {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #fca5a5 !important;
}
body.dark-mode .ts-remove:hover {
  background: rgba(220, 38, 38, 0.4) !important;
  color: #fff !important;
}
body.dark-mode .ts-add-btn {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .ts-add-btn:hover {
  background: var(--dm-surface-hover) !important;
  border-color: var(--dm-border-strong) !important;
}
body.dark-mode .ts-mileage-section {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .ts-mileage-toggle {
  color: var(--dm-purple-accent) !important;
}

/* ===== Dashboard Widget Stat Cards ===== */
body.dark-mode .stat-card.stat-warning {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}
body.dark-mode .stat-card.stat-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}
body.dark-mode .alert-item {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}
body.dark-mode .alert-item.warning {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

/* ===== Attendance Stat Variants ===== */
body.dark-mode .attendance-stat.absent {
  background: rgba(239, 68, 68, 0.1) !important;
}
body.dark-mode .attendance-stat.excused {
  background: rgba(245, 158, 11, 0.1) !important;
}

/* ===== Attendance Check Buttons (class-list) ===== */
body.dark-mode .attendance-check {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .attendance-check.att-present {
  color: #4ade80 !important;
  border-color: rgba(74, 222, 128, 0.3) !important;
}
body.dark-mode .attendance-check.att-present.active {
  background: rgba(34, 197, 94, 0.8) !important;
  color: #fff !important;
}
body.dark-mode .attendance-check.att-absent {
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.3) !important;
}
body.dark-mode .attendance-check.att-absent.active {
  background: rgba(220, 38, 38, 0.8) !important;
  color: #fff !important;
}
body.dark-mode .attendance-check.att-late {
  color: #fb923c !important;
  border-color: rgba(251, 146, 60, 0.3) !important;
}
body.dark-mode .attendance-check.att-late.active {
  background: rgba(234, 88, 12, 0.8) !important;
  color: #fff !important;
}
body.dark-mode .attendance-check.att-excused {
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}
body.dark-mode .attendance-check.att-excused.active {
  background: rgba(202, 138, 4, 0.8) !important;
  color: #fff !important;
}
body.dark-mode .attendance-check.att-refused {
  color: #a78bfa !important;
  border-color: rgba(167, 139, 250, 0.3) !important;
}
body.dark-mode .attendance-check.att-refused.active {
  background: rgba(124, 58, 237, 0.8) !important;
  color: #fff !important;
}

/* ===== Health Alerts in Class List ===== */
body.dark-mode .health-alerts-section {
  background: rgba(249, 115, 22, 0.08) !important;
  border-color: rgba(249, 115, 22, 0.25) !important;
}
body.dark-mode .alerts-title {
  color: #fb923c !important;
}
body.dark-mode .alert-card {
  border-color: rgba(251, 146, 60, 0.2) !important;
  background: var(--dm-surface) !important;
}
body.dark-mode .alert-card-header {
  background: rgba(249, 115, 22, 0.1) !important;
}
body.dark-mode .alert-label {
  color: #fb923c !important;
}

/* ===== Kit Prep Dashboard Badges ===== */
body.dark-mode .checklist-note-input.has-note {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #fca5a5 !important;
}

/* ===== Booking Detail Modal ===== */
body.dark-mode .bdm-status-pending {
  background: rgba(146, 64, 14, 0.15) !important;
  color: #fcd34d !important;
}
body.dark-mode .bdm-status-confirmed {
  background: rgba(22, 101, 52, 0.15) !important;
  color: #86efac !important;
}
body.dark-mode .bdm-status-completed {
  background: rgba(30, 64, 175, 0.15) !important;
  color: #93c5fd !important;
}
body.dark-mode .bdm-status-cancelled {
  background: rgba(153, 27, 27, 0.15) !important;
  color: #fca5a5 !important;
}

/* ===== Lab Assistant / Public Chat Send Button ===== */
body.dark-mode .lab-chat-send {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border-strong) !important;
}
body.dark-mode .lab-chat-send:hover {
  background: var(--dm-surface-hover) !important;
}
body.dark-mode .lab-send-icon {
  color: var(--dm-purple-accent) !important;
}

/* ===== Login / 2FA Pages (no body.dark-mode — dark-mode.css loaded directly) ===== */
.login-page {
  background: #0a0a1a !important;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(128, 42, 142, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  pointer-events: none;
}
.login-page .login-container {
  background: rgba(15, 15, 42, 0.7) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(128, 42, 142, 0.1) !important;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  z-index: 1;
}
.login-page .login-title { color: #c084fc !important; }
.login-page .login-subtitle { color: rgba(255, 255, 255, 0.5) !important; }
.login-page .login-form label { color: rgba(255, 255, 255, 0.7); }
.login-page .login-form input,
.login-page .login-form select {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}
.login-page .login-form input:focus,
.login-page .login-form select:focus {
  border-color: rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
}
.login-page .login-form input::placeholder { color: rgba(255, 255, 255, 0.3); }
.login-page .login-footer {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.3) !important;
}
.login-page .alert-error {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
}
.login-page #togglePassword { color: rgba(255, 255, 255, 0.4) !important; }
.login-page .btn-primary {
  background: rgba(168, 85, 247, 0.3) !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
  color: #e9d5ff !important;
}
.login-page .btn-primary:hover {
  background: rgba(168, 85, 247, 0.45) !important;
}
.login-page .btn-secondary,
.login-page .btn-outline {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}
.login-page .btn-secondary:hover,
.login-page .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}
.login-page .twofa-method-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}
.login-page .twofa-method-card:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
}
.login-page a { color: #c084fc; }
.login-page a:hover { color: #e9d5ff; }

/* ===== CRM Pipeline View ===== */
body.dark-mode .pipeline-column {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: none !important;
}
body.dark-mode .column-header {
  background: transparent !important;
  border-bottom-width: 3px;
}
body.dark-mode .column-title {
  color: var(--dm-text) !important;
}
body.dark-mode .column-count {
  box-shadow: none !important;
}
body.dark-mode .pipeline-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  box-shadow: none !important;
}
body.dark-mode .pipeline-card:hover {
  background: rgba(168, 85, 247, 0.1) !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .pipeline-card .name {
  color: var(--dm-text) !important;
}
body.dark-mode .pipeline-card .meta {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .pipeline-card .type-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .pipeline-card .last-contact {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .pipeline-card .action-date.overdue {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #fca5a5 !important;
}
body.dark-mode .pipeline-card .action-date.today {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
}
body.dark-mode .pipeline-card .action-date.upcoming {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #93c5fd !important;
}

/* Follow-up section */
body.dark-mode .followup-section {
  background: var(--dm-surface) !important;
  box-shadow: none !important;
  color: var(--dm-text) !important;
}
body.dark-mode .followup-card {
  background: rgba(255, 255, 255, 0.04) !important;
  border-left-color: #f87171 !important;
}
body.dark-mode .followup-card:hover {
  background: rgba(168, 85, 247, 0.08) !important;
}
body.dark-mode .followup-card .name {
  color: var(--dm-text) !important;
}
body.dark-mode .followup-card .date {
  color: #f87171 !important;
}
body.dark-mode .followup-card .type {
  color: var(--dm-text-secondary) !important;
}

/* Activity section */
body.dark-mode .activity-section {
  background: var(--dm-surface) !important;
  box-shadow: none !important;
  color: var(--dm-text) !important;
}
body.dark-mode .activity-item {
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .activity-icon.call {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #93c5fd !important;
}
body.dark-mode .activity-icon.email {
  background: rgba(5, 150, 105, 0.15) !important;
  color: #6ee7b7 !important;
}
body.dark-mode .activity-icon.meeting {
  background: rgba(124, 58, 237, 0.15) !important;
  color: #c4b5fd !important;
}
body.dark-mode .activity-icon.note {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .activity-content .title {
  color: var(--dm-text) !important;
}
body.dark-mode .activity-content .customer {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .activity-content .time {
  color: var(--dm-text-muted) !important;
}

/* ===== Action Items ===== */
body.dark-mode .action-item-card {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .action-item-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .action-item-card p {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .action-item-card .ai-meta,
body.dark-mode .action-item-card .ai-meta span {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .ai-group-header {
  background: transparent !important;
}
body.dark-mode .ai-group-header:hover {
  background: var(--dm-surface) !important;
}
body.dark-mode .stat-tile {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .stat-tile:hover {
  border-color: var(--dm-border-strong) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .stat-tile-active {
  border-color: var(--dm-purple-accent) !important;
  background: rgba(168, 85, 247, 0.1) !important;
}
body.dark-mode .status-in-progress {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}
body.dark-mode .status-overdue {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #fca5a5 !important;
}
body.dark-mode .modal-header {
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .modal-close {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .modal-close:hover {
  color: var(--dm-text) !important;
}
body.dark-mode .action-check {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .action-check:hover {
  color: #4ade80 !important;
}
body.dark-mode .color-swatch:has(input:checked) {
  border-color: var(--dm-text) !important;
  box-shadow: 0 0 0 2px var(--dm-bg), 0 0 0 4px var(--dm-text-secondary) !important;
}

/* ===== Social Chat Messages ===== */
body.dark-mode .social-msg {
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .social-msg:hover {
  background: var(--dm-surface) !important;
}
body.dark-mode .social-msg.unread {
  background: rgba(168, 85, 247, 0.08) !important;
}
body.dark-mode .social-msg.unread:hover {
  background: rgba(168, 85, 247, 0.12) !important;
}
body.dark-mode .social-msg-icon.facebook {
  background: rgba(24, 119, 242, 0.15) !important;
}
body.dark-mode .social-msg-icon.instagram {
  background: rgba(225, 48, 108, 0.15) !important;
}
body.dark-mode .social-msg-text {
  color: var(--dm-text) !important;
}
body.dark-mode .social-msg-response {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .social-msg-time {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .urgent-badge {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
body.dark-mode .read-btn {
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .read-btn:hover {
  background: var(--dm-surface) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .stat-card-value {
  color: var(--dm-text) !important;
}
body.dark-mode .stat-card-label {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .reply-btn {
  color: var(--dm-purple-bright) !important;
  border-color: var(--dm-purple-accent) !important;
  font-size: 0.7rem !important;
}
body.dark-mode .reply-btn:hover {
  background: rgba(168, 85, 247, 0.12) !important;
}
body.dark-mode .mute-btn {
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
  background: transparent !important;
  font-size: 0.7rem !important;
}
body.dark-mode .mute-btn:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
body.dark-mode .mute-btn.muted {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  font-weight: 600 !important;
}
body.dark-mode .reply-form textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .reply-form textarea:focus {
  border-color: var(--dm-purple-accent) !important;
}
body.dark-mode .reply-form .cancel-btn {
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}

/* ===== Document Library ===== */
body.dark-mode .document-card {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .document-card:hover {
  border-color: var(--dm-purple-accent) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}
body.dark-mode .document-content h3 {
  color: var(--dm-text) !important;
}
body.dark-mode .document-desc {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .document-meta span {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .document-icon {
  color: #f87171 !important;
}
body.dark-mode .category-title {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}
body.dark-mode .subcategory-title {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .filter-btn {
  background: var(--dm-glass-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .filter-btn:hover {
  background: var(--dm-surface-hover) !important;
}
body.dark-mode .filter-btn.active {
  background: var(--dm-purple-accent) !important;
  color: white !important;
  border-color: var(--dm-purple-accent) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN DOCUMENT LIBRARY — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .category-group {
  border-color: var(--dm-border) !important;
}
body.dark-mode .subcategory-header {
  background: var(--dm-surface) !important;
}
body.dark-mode .subcategory-header:hover {
  background: var(--dm-surface-hover) !important;
}
body.dark-mode .subcategory-name {
  color: var(--dm-text) !important;
}
body.dark-mode .subcategory-header .chevron {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .doc-count {
  background: rgba(128, 42, 142, 0.2) !important;
  color: var(--dm-purple-bright) !important;
}
body.dark-mode .document-item {
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}
body.dark-mode .document-item:hover {
  background: rgba(128, 42, 142, 0.1) !important;
}
body.dark-mode .document-info h4 {
  color: var(--dm-text) !important;
}
body.dark-mode .document-meta {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .document-meta span {
  color: var(--dm-text-muted) !important;
}
body.dark-mode .document-icon {
  color: #f87171 !important;
}
body.dark-mode .document-desc {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .subcategory-group {
  border-bottom-color: var(--dm-border) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ADD-ONS MANAGEMENT — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .filter-tab {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .filter-tab:hover {
  background: var(--dm-surface-hover) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .filter-tab.active {
  background: linear-gradient(135deg, #802a8e, #a855f7) !important;
  color: white !important;
  border-color: transparent !important;
}
body.dark-mode .price-badge {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
}
body.dark-mode .type-tag {
  opacity: 0.9;
}
body.dark-mode .type-tag.party { background: rgba(190, 24, 93, 0.2) !important; color: #f472b6 !important; }
body.dark-mode .type-tag.workshop { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .type-tag.show { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .type-tag.program { background: rgba(146, 64, 14, 0.2) !important; color: #fbbf24 !important; }
body.dark-mode .type-tag.camp { background: rgba(67, 56, 202, 0.2) !important; color: #818cf8 !important; }
body.dark-mode .type-tag.booth { background: rgba(133, 77, 14, 0.2) !important; color: #fcd34d !important; }
body.dark-mode .type-tag.event { background: rgba(124, 58, 237, 0.2) !important; color: #a78bfa !important; }
body.dark-mode .type-tag.celebration { background: rgba(194, 65, 12, 0.2) !important; color: #fb923c !important; }
body.dark-mode .type-tag.familynight { background: rgba(8, 145, 178, 0.2) !important; color: #22d3ee !important; }
body.dark-mode .type-tag.funstations { background: rgba(5, 150, 105, 0.2) !important; color: #34d399 !important; }
body.dark-mode .type-tag.preschoolworkshop { background: rgba(30, 58, 138, 0.2) !important; color: #93c5fd !important; }
body.dark-mode .type-tag.assembly { background: rgba(20, 83, 45, 0.2) !important; color: #86efac !important; }
body.dark-mode .checkbox-label {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode .data-table td[style*="color: #6b7280"] {
  color: var(--dm-text-secondary) !important;
}
body.dark-mode tr.inactive {
  opacity: 0.4 !important;
}
body.dark-mode .status-badge.inactive {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--dm-text-muted) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   THEMES MANAGEMENT — Dark Mode Overrides
   ═══════════════════════════════════════════════════════════════════ */

body.dark-mode .category-tag {
  opacity: 0.9;
}
body.dark-mode .category-tag.party { background: rgba(190, 24, 93, 0.2) !important; color: #f472b6 !important; }
body.dark-mode .category-tag.workshop { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .category-tag.preschoolworkshop { background: rgba(30, 58, 138, 0.2) !important; color: #93c5fd !important; }
body.dark-mode .category-tag.show { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .category-tag.assembly { background: rgba(20, 83, 45, 0.2) !important; color: #86efac !important; }
body.dark-mode .category-tag.program { background: rgba(146, 64, 14, 0.2) !important; color: #fbbf24 !important; }
body.dark-mode .category-tag.camp { background: rgba(67, 56, 202, 0.2) !important; color: #818cf8 !important; }
body.dark-mode .category-tag.booth { background: rgba(133, 77, 14, 0.2) !important; color: #fcd34d !important; }
body.dark-mode .category-tag.event { background: rgba(124, 58, 237, 0.2) !important; color: #a78bfa !important; }
body.dark-mode .category-tag.celebration { background: rgba(194, 65, 12, 0.2) !important; color: #fb923c !important; }
body.dark-mode .category-tag.familynight { background: rgba(8, 145, 178, 0.2) !important; color: #22d3ee !important; }
body.dark-mode .category-tag.funstations { background: rgba(5, 150, 105, 0.2) !important; color: #34d399 !important; }
body.dark-mode .category-tag.excel { background: rgba(33, 115, 70, 0.2) !important; color: #34d399 !important; }
body.dark-mode .public-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}
body.dark-mode .data-table .sortable:hover {
  background: var(--dm-surface-hover) !important;
}

/* ===== Incident Reports ===== */
body.dark-mode .ir-card {
  background: var(--dm-surface) !important;
  backdrop-filter: blur(var(--dm-glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .ir-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(128, 42, 142, 0.1) !important;
  border-color: var(--dm-border-strong) !important;
}
body.dark-mode .ir-title { color: var(--dm-text) !important; }
body.dark-mode .ir-date { color: var(--dm-text-muted) !important; }
body.dark-mode .ir-card-meta { color: var(--dm-text-secondary) !important; }
body.dark-mode .ir-card-meta strong { color: var(--dm-text) !important; }
body.dark-mode .ir-card-detail { border-top-color: var(--dm-border) !important; }
body.dark-mode .ir-detail-section label { color: var(--dm-text-secondary) !important; }
body.dark-mode .ir-detail-section p { color: var(--dm-text) !important; }
body.dark-mode .ir-detail-section[style*="background"] {
  background: rgba(59, 130, 246, 0.1) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .ir-admin-form { border-top-color: var(--dm-border) !important; }
body.dark-mode .ir-severity-minor { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .ir-severity-moderate { background: rgba(146, 64, 14, 0.2) !important; color: #fbbf24 !important; }
body.dark-mode .ir-severity-serious { background: rgba(153, 27, 27, 0.2) !important; color: #f87171 !important; }
body.dark-mode .ir-status-submitted { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .ir-status-reviewed { background: rgba(146, 64, 14, 0.2) !important; color: #fbbf24 !important; }
body.dark-mode .ir-status-resolved { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }

/* ===== Shift Requests ===== */
body.dark-mode .shift-item,
body.dark-mode .section-card {
  background: var(--dm-surface) !important;
  backdrop-filter: blur(var(--dm-glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .section-card h2 { color: var(--dm-text) !important; }
body.dark-mode .shift-name { color: var(--dm-text) !important; }
body.dark-mode .shift-meta { color: var(--dm-text-secondary) !important; }
body.dark-mode .shift-item:hover { border-color: var(--dm-purple-accent) !important; }
body.dark-mode .shift-type.booking { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .shift-type.party, body.dark-mode .shift-type.birthday { background: rgba(124, 58, 237, 0.2) !important; color: #a78bfa !important; }
body.dark-mode .shift-type.excel { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .shift-type.program { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .shift-type.camp { background: rgba(146, 64, 14, 0.2) !important; color: #fbbf24 !important; }
body.dark-mode .shift-type.event { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .shift-type.familynight { background: rgba(124, 58, 237, 0.2) !important; color: #c4b5fd !important; }
body.dark-mode .request-note { color: var(--dm-text-muted) !important; }
body.dark-mode .request-card {
  background: var(--dm-surface) !important;
  backdrop-filter: blur(var(--dm-glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: var(--dm-card-shadow) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .request-staff { color: var(--dm-text) !important; }
body.dark-mode .request-meta { color: var(--dm-text-secondary) !important; }
body.dark-mode .request-message { background: var(--dm-surface-hover) !important; color: var(--dm-text-secondary) !important; }
body.dark-mode .request-entity { color: var(--dm-text) !important; }

/* ===== Excel Invoicing ===== */
body.dark-mode .org-card {
  background: var(--dm-surface) !important;
  backdrop-filter: blur(var(--dm-glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--dm-glass-blur)) !important;
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
}
body.dark-mode .org-name { color: var(--dm-text) !important; }
body.dark-mode .org-meta { color: var(--dm-text-secondary) !important; }
body.dark-mode .org-booking-type { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .school-tag { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .school-tag .remove-school { color: #60a5fa !important; }
body.dark-mode .tabs { border-bottom-color: var(--dm-border) !important; }
body.dark-mode .tab-btn { color: var(--dm-text-secondary) !important; }
body.dark-mode .tab-btn.active { color: var(--dm-purple-bright) !important; border-bottom-color: var(--dm-purple-bright) !important; }
body.dark-mode .tab-btn:hover:not(.active) { color: var(--dm-text) !important; }
body.dark-mode .invoice-table th { color: var(--dm-text-secondary) !important; border-bottom-color: var(--dm-border) !important; }
body.dark-mode .invoice-table td { color: var(--dm-text) !important; border-bottom-color: var(--dm-border) !important; }
body.dark-mode .invoice-table tr:hover { background: var(--dm-surface-hover) !important; }
body.dark-mode .preview-school h4 { background: var(--dm-surface) !important; color: var(--dm-text) !important; }
body.dark-mode .preview-table th { color: var(--dm-text-secondary) !important; border-bottom-color: var(--dm-border) !important; }
body.dark-mode .preview-table td { color: var(--dm-text) !important; border-bottom-color: var(--dm-border) !important; }
body.dark-mode .preview-totals { color: var(--dm-text) !important; }
body.dark-mode .status-pill.draft { background: rgba(55, 65, 81, 0.3) !important; color: rgba(255,255,255,0.7) !important; }
body.dark-mode .status-pill.sent { background: rgba(30, 64, 175, 0.2) !important; color: #60a5fa !important; }
body.dark-mode .status-pill.paid { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .btn-outline { background: var(--dm-surface) !important; color: var(--dm-text-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .btn-outline:hover { background: var(--dm-surface-hover) !important; color: var(--dm-text) !important; }
body.dark-mode .btn-red { background: transparent !important; border-color: rgba(239, 68, 68, 0.4) !important; color: #f87171 !important; }
body.dark-mode .btn-red:hover { background: rgba(239, 68, 68, 0.1) !important; }
body.dark-mode .status-pill.pending { background: rgba(146, 64, 14, 0.2) !important; color: #fbbf24 !important; }
body.dark-mode .status-pill.approved { background: rgba(22, 101, 52, 0.2) !important; color: #4ade80 !important; }
body.dark-mode .status-pill.denied { background: rgba(153, 27, 27, 0.2) !important; color: #f87171 !important; }
body.dark-mode .filter-btn { background: var(--dm-surface) !important; color: var(--dm-text-secondary) !important; border-color: var(--dm-border) !important; }
body.dark-mode .filter-btn:hover:not(.active) { background: var(--dm-surface-hover) !important; }
body.dark-mode .filter-btn.active { background: var(--dm-purple-accent) !important; color: white !important; border-color: var(--dm-purple-accent) !important; }
body.dark-mode .processed-card { opacity: 0.5 !important; }
body.dark-mode .empty-state { color: var(--dm-text-muted) !important; }

/* ===== Bulk Action Bar (program/camp student selection) ===== */
body.dark-mode .bulk-action-bar {
  background: rgba(128, 42, 142, 0.2) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  color: var(--dm-purple-bright) !important;
}
body.dark-mode .bulk-action-bar select.form-control {
  background: var(--dm-surface) !important;
  color: var(--dm-text) !important;
  border-color: var(--dm-border) !important;
}
body.dark-mode .bulk-action-bar .bulk-paid-btn {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #4ade80 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
body.dark-mode .bulk-action-bar .bulk-delete-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
body.dark-mode .bulk-action-bar .btn-primary {
  background: var(--dm-purple-accent) !important;
  border-color: var(--dm-purple-accent) !important;
  color: white !important;
}
body.dark-mode .bulk-action-bar .btn-secondary {
  background: var(--dm-surface) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}

/* ===== Transition for toggling ===== */
body.dark-mode-transitioning,
body.dark-mode-transitioning * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* =============================================================
   OCEAN THEME — Deep-sea overrides for body.dark-mode.theme-ocean
   Swaps purple/galaxy accents for teal/cyan bioluminescent palette
   ============================================================= */

/* ===== Ocean CSS Variable Overrides ===== */
body.dark-mode.theme-ocean {
  --dm-bg: #040a14;
  --dm-bg-secondary: #071420;
  --dm-glow-purple: rgba(0, 180, 180, 0.5);
  --dm-glow-purple-strong: rgba(0, 180, 180, 0.8);
  --dm-glow-purple-subtle: rgba(0, 180, 180, 0.25);
  --dm-purple-accent: #06b6d4;
  --dm-purple-bright: #67e8f9;
  --dm-glass-bg: rgba(4, 20, 32, 0.7);
  --dm-glass-bg-light: rgba(4, 20, 32, 0.5);
  --dm-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 180, 180, 0.1);
  --primary: #67e8f9;
  --white: rgba(4, 20, 32, 0.7);
}

/* Ocean background gradient orbs */
body.dark-mode.theme-ocean::before {
  background: radial-gradient(circle, rgba(0, 120, 140, 0.35), transparent 70%);
}

body.dark-mode.theme-ocean::after {
  background: radial-gradient(circle, rgba(0, 60, 160, 0.25), transparent 70%);
}

/* Ocean header */
body.dark-mode.theme-ocean .header-logo-img {
  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(6, 182, 212, 0.6)) drop-shadow(0 0 20px rgba(0, 120, 140, 0.4));
}

body.dark-mode.theme-ocean .header-subtitle {
  text-shadow: 0 0 10px rgba(0, 180, 180, 0.5);
}

/* Ocean sidebar active */
body.dark-mode.theme-ocean .sidebar-item.active {
  box-shadow: inset 3px 0 10px rgba(0, 180, 180, 0.3);
}

body.dark-mode.theme-ocean .sidebar-badge {
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* Ocean buttons */
body.dark-mode.theme-ocean .btn-primary {
  background: linear-gradient(135deg, #0e7490, #06b6d4);
  box-shadow: 0 0 15px rgba(0, 180, 180, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode.theme-ocean .btn-primary:hover {
  background: linear-gradient(135deg, #06b6d4, #67e8f9);
  box-shadow: 0 0 25px rgba(0, 180, 180, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Ocean toggle switch */
body.dark-mode.theme-ocean .dm-switch input:checked + .dm-switch-slider {
  background: linear-gradient(135deg, #0e7490, #06b6d4);
  box-shadow: 0 0 15px rgba(0, 180, 180, 0.5);
}

body.dark-mode.theme-ocean .dm-switch input:checked + .dm-switch-slider::before {
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ocean data table */
body.dark-mode.theme-ocean .data-table thead th {
  background: rgba(0, 80, 100, 0.15);
}

/* Ocean select dropdown */
body.dark-mode.theme-ocean select option {
  background: #061420;
}

/* ===== Theme Card Picker (profile page) ===== */
.theme-card {
  border: 2px solid var(--gray-200, rgba(0,0,0,0.1));
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.theme-card:hover {
  border-color: var(--gray-400, #9ca3af);
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: var(--dm-purple-accent, #a855f7);
  box-shadow: 0 0 12px rgba(128, 42, 142, 0.3);
}

body.dark-mode.theme-ocean .theme-card.active {
  border-color: #06b6d4;
  box-shadow: 0 0 12px rgba(0, 180, 180, 0.3);
}

.theme-card-preview {
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
}

.theme-preview-galaxy {
  background: linear-gradient(135deg, #0a0a1a, #1a1040);
}

.theme-preview-ocean {
  background: linear-gradient(135deg, #040a14, #0a2030);
}

.theme-card-label strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.theme-card-label small {
  font-size: 0.72rem;
  color: var(--gray-500, #6b7280);
}

/* Ocean preview dots (bubble animation) */
.dm-ocean-dot {
  width: 4px;
  height: 4px;
  background: var(--gray-400, #9ca3af);
  border-radius: 50%;
  animation: dm-bubble 2.5s ease-in-out infinite;
}

body.dark-mode .dm-ocean-dot,
body.dark-mode.theme-ocean .dm-ocean-dot {
  background: #67e8f9;
  box-shadow: 0 0 4px rgba(6, 182, 212, 0.6);
}

.dm-ocean-dot:nth-child(1) { animation-delay: 0s; width: 3px; height: 3px; }
.dm-ocean-dot:nth-child(2) { animation-delay: 0.3s; }
.dm-ocean-dot:nth-child(3) { animation-delay: 0.6s; width: 5px; height: 5px; }
.dm-ocean-dot:nth-child(4) { animation-delay: 0.9s; width: 3px; height: 3px; }
.dm-ocean-dot:nth-child(5) { animation-delay: 1.2s; }

@keyframes dm-bubble {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* =============================================================
   SUBATOMIC THEME — Quantum physics overrides for body.dark-mode.theme-subatomic
   Swaps purple/galaxy accents for electric blue particle physics palette
   ============================================================= */

/* ===== Subatomic CSS Variable Overrides ===== */
body.dark-mode.theme-subatomic {
  --dm-bg: #050510;
  --dm-bg-secondary: #0a0a20;
  --dm-glow-purple: rgba(60, 140, 255, 0.5);
  --dm-glow-purple-strong: rgba(60, 140, 255, 0.8);
  --dm-glow-purple-subtle: rgba(60, 140, 255, 0.25);
  --dm-purple-accent: #3b82f6;
  --dm-purple-bright: #93c5fd;
  --dm-glass-bg: rgba(8, 8, 30, 0.75);
  --dm-glass-bg-light: rgba(8, 8, 30, 0.5);
  --dm-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(60, 140, 255, 0.1);
  --primary: #93c5fd;
  --white: rgba(8, 8, 30, 0.75);
}

/* Subatomic background gradient orbs */
body.dark-mode.theme-subatomic::before {
  background: radial-gradient(circle, rgba(40, 100, 220, 0.3), transparent 70%);
}

body.dark-mode.theme-subatomic::after {
  background: radial-gradient(circle, rgba(200, 120, 40, 0.15), transparent 70%);
}

/* Subatomic header */
body.dark-mode.theme-subatomic .header-logo-img {
  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(60, 140, 255, 0.6)) drop-shadow(0 0 20px rgba(40, 100, 220, 0.4));
}

body.dark-mode.theme-subatomic .header-subtitle {
  text-shadow: 0 0 10px rgba(60, 140, 255, 0.5);
}

/* Subatomic sidebar active */
body.dark-mode.theme-subatomic .sidebar-item.active {
  box-shadow: inset 3px 0 10px rgba(60, 140, 255, 0.3);
}

body.dark-mode.theme-subatomic .sidebar-badge {
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Subatomic buttons */
body.dark-mode.theme-subatomic .btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  box-shadow: 0 0 15px rgba(60, 140, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode.theme-subatomic .btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #93c5fd);
  box-shadow: 0 0 25px rgba(60, 140, 255, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Subatomic toggle switch */
body.dark-mode.theme-subatomic .dm-switch input:checked + .dm-switch-slider {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  box-shadow: 0 0 15px rgba(60, 140, 255, 0.5);
}

body.dark-mode.theme-subatomic .dm-switch input:checked + .dm-switch-slider::before {
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Subatomic data table */
body.dark-mode.theme-subatomic .data-table thead th {
  background: rgba(30, 60, 140, 0.15);
}

/* Subatomic select dropdown */
body.dark-mode.theme-subatomic select option {
  background: #080820;
}

/* Subatomic theme card active state */
body.dark-mode.theme-subatomic .theme-card.active {
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(60, 140, 255, 0.3);
}

/* Subatomic theme preview card */
.theme-preview-subatomic {
  background: linear-gradient(135deg, #050510, #0a1030);
}

/* Subatomic preview dots (orbiting animation) */
.dm-atom-dot {
  width: 4px;
  height: 4px;
  background: var(--gray-400, #9ca3af);
  border-radius: 50%;
  animation: dm-orbit 2s ease-in-out infinite;
}

body.dark-mode .dm-atom-dot,
body.dark-mode.theme-subatomic .dm-atom-dot {
  background: #93c5fd;
  box-shadow: 0 0 4px rgba(60, 140, 255, 0.6);
}

.dm-atom-dot:nth-child(1) { animation-delay: 0s; width: 5px; height: 5px; background: #ff9040; box-shadow: 0 0 4px rgba(255, 140, 50, 0.6); animation: none; }
.dm-atom-dot:nth-child(2) { animation-delay: 0.2s; width: 3px; height: 3px; }
.dm-atom-dot:nth-child(3) { animation-delay: 0.5s; }
.dm-atom-dot:nth-child(4) { animation-delay: 0.8s; width: 3px; height: 3px; }
.dm-atom-dot:nth-child(5) { animation-delay: 1.1s; }

@keyframes dm-orbit {
  0%, 100% { opacity: 0.3; transform: translateY(0) translateX(0); }
  25% { opacity: 1; transform: translateY(-4px) translateX(3px); }
  50% { opacity: 0.6; transform: translateY(0) translateX(6px); }
  75% { opacity: 1; transform: translateY(4px) translateX(3px); }
}


/* ===== Activity Log Action Badges (dark mode) ===== */
body.dark-mode .action-badge.login { background: rgba(34, 197, 94, 0.15); color: #86efac; }
body.dark-mode .action-badge.logout { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.6); }
body.dark-mode .action-badge.login_failed,
body.dark-mode .action-badge.login_blocked { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
body.dark-mode .action-badge.module_access { background: rgba(168, 85, 247, 0.15); color: #c4b5fd; }
body.dark-mode .action-badge.user_created,
body.dark-mode .action-badge.module_created { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
body.dark-mode .action-badge.user_updated,
body.dark-mode .action-badge.module_updated,
body.dark-mode .action-badge.password_reset { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
body.dark-mode .action-badge.module_deleted,
body.dark-mode .action-badge.user_deleted { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
body.dark-mode .action-badge.modules_reordered { background: rgba(168, 85, 247, 0.15); color: #c4b5fd; }

