/* Dark theme: hand-tuned variables and surfaces. */
html[data-theme="dark"] {
  --brand: #2ec4ae;          /* ZENTAVA teal, lifted for dark screens */
  --brand-strong: #5fd8c5;
  --brand-soft: rgba(46, 196, 174, .14);
  --link: #4fd3bf;
  --accent: #f2b134;         /* ZENTAVA gold */
  --accent-soft: rgba(242, 177, 52, .15);
  --danger: #ff7a6b;
  --success: #5fd394;
  --warning: #f2b134;

  --page-bg: #0b1120;
  --page-glow-1: rgba(46, 196, 174, .09);
  --page-glow-2: rgba(242, 177, 52, .06);
  --surface: rgba(22, 33, 58, .64);
  --glass-edge: rgba(255, 255, 255, .07);
  --aurora-1: rgba(46, 196, 174, .42);
  --aurora-2: rgba(92, 112, 240, .42);
  --aurora-3: rgba(242, 177, 52, .18);
  --aurora-4: rgba(160, 90, 220, .24);
  --aurora-5: rgba(64, 214, 168, .32);
  --neu-bg: #141e35;
  --neu-dark: rgba(0, 0, 0, .55);
  --neu-light: rgba(70, 92, 140, .22);
  --surface-solid: #16213a;
  --surface-2: rgba(34, 48, 80, .6);
  --border: rgba(200, 215, 240, .10);
  --text: #e6ebf3;
  --text-muted: #9eabc2;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);

  --bs-primary-rgb: 46, 196, 174;
  --bs-link-color-rgb: 79, 211, 191;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--page-bg);
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border);
  --bs-tertiary-bg: var(--surface-2);
}
html[data-theme="dark"] .btn-primary { --bs-btn-color: #0b1427; --bs-btn-hover-color: #0b1427; --bs-btn-active-color: #0b1427; --bs-btn-disabled-color: #0b1427; box-shadow: 0 6px 16px rgba(46, 196, 174, .2); }
html[data-theme="dark"] .nav-link-item a[aria-current="page"],
html[data-theme="dark"] .nav-link-item a[aria-current="page"] i { color: #0b1427; }
html[data-theme="dark"] .btn-soft:hover { color: #0b1427; }
html[data-theme="dark"] .brand-mark { color: #0b1427; background: linear-gradient(135deg, #2ec4ae, #8fe6d8); }
html[data-theme="dark"] .brand-mark.logo { background: #f4f6f8; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { background-color: #0f1830; color: var(--text); }
html[data-theme="dark"] .form-control::placeholder { color: #8391a8; }
html[data-theme="dark"] .auth-card { border-color: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .auth-card > .auth-brand { box-shadow: 0 22px 44px rgba(0, 0, 0, .5), 0 4px 10px rgba(0, 0, 0, .3), inset 0 1px 0 var(--glass-edge); }
html[data-theme="dark"] .auth-card .btn-primary { box-shadow: 6px 6px 16px rgba(0, 0, 0, .5), -4px -4px 12px rgba(70, 92, 140, .18); }
html[data-theme="dark"] .alert-success { --bs-alert-bg: rgba(95, 211, 148, .12); --bs-alert-color: #9be8bd; --bs-alert-border-color: rgba(95, 211, 148, .3); }
html[data-theme="dark"] .alert-danger { --bs-alert-bg: rgba(255, 122, 107, .12); --bs-alert-color: #ffb3aa; --bs-alert-border-color: rgba(255, 122, 107, .3); }
html[data-theme="dark"] .alert-warning { --bs-alert-bg: rgba(240, 181, 74, .12); --bs-alert-color: #f6d08c; --bs-alert-border-color: rgba(240, 181, 74, .3); }
html[data-theme="dark"] .alert-info { --bs-alert-bg: rgba(46, 196, 174, .12); --bs-alert-color: #a6e6de; --bs-alert-border-color: rgba(46, 196, 174, .3); }
html[data-theme="dark"] .btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text); --bs-btn-hover-bg: rgba(46, 196, 174, .18); --bs-btn-hover-border-color: var(--border); --bs-btn-hover-color: var(--text); --bs-btn-active-bg: rgba(46, 196, 174, .24); --bs-btn-active-color: var(--text); }
html[data-theme="dark"] .modal-content, html[data-theme="dark"] .dropdown-menu { background: var(--surface-solid); }
html[data-theme="dark"] .support-banner { border-color: rgba(240, 181, 74, .35); }
html[data-theme="dark"] .badge-dot { color: #2a0905; }
html[data-theme="dark"] .report-page { background: var(--surface-solid); color: var(--text); }
html[data-theme="dark"] .report-page th, html[data-theme="dark"] .report-page td { border-color: var(--border); }

/* Phase 4: risk levels need lighter text on dark surfaces */
html[data-theme="dark"] .lv-high { color: #f0a46a; }
html[data-theme="dark"] .rm-high { color: #f6b27c; }
html[data-theme="dark"] .rm-critical { color: #ff9c8f; }

/* Phase 7: chart series colour for dark surfaces (validated) */
html[data-theme="dark"] { --chart-1: #26a395; }
html[data-theme="dark"] .acr-tiles li { background: #0b1427; box-shadow: inset 0 0 0 1px rgba(200, 215, 240, .10); }
html[data-theme="dark"] .pagination { --bs-pagination-active-color: #0b1427; }   /* dark text on the teal current page */
