/* Stone Surgeons CRM — the flat look after dark (Nov 19 2026; replaces the "onyx night" glass this file used to hold).
   Same rules as glass.css: solid surfaces, 1 px lines, small corners, one accent; no glass, blur, gradients or glow.
   On only while <html data-theme="dark"> (theme.js; Settings → Display → Dark mode). Loaded last, screen only, so
   printing always uses the light look. Paper previews (quote sheets, postcards, labels, signatures) stay white on purpose. */

:root[data-theme="dark"] {
  /* the flat tokens (glass.css names them; the old names there follow these on their own) */
  --bg: #0f1216;
  --surface: #161a20;
  --surface-2: #1d222a;
  --border: #2a313b;
  --border-strong: #3a4350;
  --text: #e8ebef;
  --text-2: #a9b2bd;
  --text-3: #8a94a0;
  --primary: #9cc3ef;
  --primary-h: #b6d4f5;
  --primary-contrast: #0f1216;
  --accent: #6aa8ee;
  --accent-soft: #16263a;
  --focus: #8ab9f2;
  --success: #5cc28f; --success-bg: #12271d; --success-line: #24513a;
  --warning: #e3b25a; --warning-bg: #2a2112; --warning-line: #54421f;
  --danger: #f08a84;  --danger-bg: #2c1514;  --danger-line: #5c2a26;
  --info: #8ab9f2;    --info-bg: #13202f;    --info-line: #27466a;
  --violet: #bba8f2;  --violet-bg: #221c36;
  --shadow-1: none;
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
  /* old names with their own values */
  --navy: var(--text);
  --blue-d: #8ab9f2;
  --teal: #5fd0c2;
  --mint: #8fe6d8;
  --mint-xl: rgba(60, 190, 170, .14);
  --ice: rgba(106, 168, 238, .16);
  --brand: #6aa8ee;
  --accent-bg: #2f6fc4;
  --accent-bg-h: #3a7dd4;
  --glow: none;
  --field: var(--surface);
  --solid: var(--surface);
  --hover: var(--surface-2);
  color-scheme: dark;
}
html[data-theme="dark"] { background: var(--bg); }

/* ── buttons, fields, focus ── */
html[data-theme="dark"] .btn { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); box-shadow: none; }
html[data-theme="dark"] .btn:hover { background: var(--primary-h); border-color: var(--primary-h); }
html[data-theme="dark"] .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
html[data-theme="dark"] .btn-ghost:hover { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] .btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
html[data-theme="dark"] .btn-danger:hover { background: var(--danger-bg); }
html[data-theme="dark"] .in,
html[data-theme="dark"] .in-sm,
html[data-theme="dark"] textarea.in,
html[data-theme="dark"] select.in { background-color: var(--surface); color: var(--text); box-shadow: none; }
html[data-theme="dark"] .in::placeholder,
html[data-theme="dark"] .top-search input::placeholder { color: var(--text-3); }
html[data-theme="dark"] select.in option,
html[data-theme="dark"] select option { background: var(--surface); color: var(--text); }
html[data-theme="dark"] input[type=checkbox],
html[data-theme="dark"] input[type=radio],
html[data-theme="dark"] input[type=range] { accent-color: var(--accent); }
@supports selector(::-webkit-calendar-picker-indicator) {
  html[data-theme="dark"] input[type="date"]:not([data-native]),
  html[data-theme="dark"] input[type="datetime-local"]:not([data-native]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a9b2bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E");
  }
}

/* ── menu and top bar ── */
html[data-theme="dark"] .nav-badge { box-shadow: 0 0 0 2px var(--surface); }
/* --danger is a light red for text on dark; filled red things keep a deep red so white on them reads. */
html[data-theme="dark"] .nav-badge,
html[data-theme="dark"] .nav-badge.acct-badge-late,
html[data-theme="dark"] .map-tool .badge,
html[data-theme="dark"] .ph-end,
html[data-theme="dark"] .ph-decline { background: #c8352b; color: #fff; }
html[data-theme="dark"] .ph-end:hover,
html[data-theme="dark"] .ph-decline:hover { background: #a82a22; }
html[data-theme="dark"] .ham { color: var(--text); }

/* ── lists and tables ── */
html[data-theme="dark"] .mini a:not(.btn):hover,
html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .stack-row:hover,
html[data-theme="dark"] .qt-result:hover,
html[data-theme="dark"] .qt-result.on,
html[data-theme="dark"] .wday-add:hover { background: var(--surface-2); }
html[data-theme="dark"] .tbl-wrap tbody tr:hover { background: transparent; }
html[data-theme="dark"] th { background: transparent; }
html[data-theme="dark"] .tbl-wrap th { background: var(--surface-2); }
html[data-theme="dark"] .lead-check-ui { background: var(--surface); border-color: var(--border-strong); }
html[data-theme="dark"] .lead-check input:checked + .lead-check-ui { background: var(--accent-bg); border-color: var(--accent-bg); }
html[data-theme="dark"] .lead-check input:indeterminate + .lead-check-ui { background: var(--surface-2); border-color: var(--accent); }
html[data-theme="dark"] .nb-btn:hover { background: rgba(255, 255, 255, .08); }

/* ── pills, tags, statuses ── */
html[data-theme="dark"] .st-bot { background: #10262a; color: #7fd6c8; }
html[data-theme="dark"] .st-founder { background: #151f35; color: #a9c0f2; }
html[data-theme="dark"] .q-opt.pill { background: #10262a; color: #8fe0d2; border-color: #1f4a48; }
html[data-theme="dark"] .lb-rank { background: var(--surface-2); color: var(--text-2); }
html[data-theme="dark"] .lb-rank.m1 { background: #d9b54a; color: #2a1f00; }
html[data-theme="dark"] .lb-rank.m2 { background: #b8bfcc; color: #1d232c; }
html[data-theme="dark"] .lb-rank.m3 { background: #c98f5c; color: #2a1606; }
html[data-theme="dark"] .loc-pill { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }

/* ── schedule, jobs, leaderboard ── */
html[data-theme="dark"] .jcard,
html[data-theme="dark"] .jcard.j-completed,
html[data-theme="dark"] .jcard.j-in_progress,
html[data-theme="dark"] .jcard.j-cancelled { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .jcard { border-left-color: #6b7683; }
html[data-theme="dark"] .jcard.j-completed { border-left-color: var(--success); }
html[data-theme="dark"] .jcard.j-in_progress { border-left-color: var(--violet); }
html[data-theme="dark"] .jcard.j-cancelled { border-left-color: #5a636e; }
html[data-theme="dark"] .drop-on { background: var(--accent-soft) !important; }
html[data-theme="dark"] .modal,
html[data-theme="dark"] .sheet-back,
html[data-theme="dark"] .qt-ask-back,
html[data-theme="dark"] .print-wrap,
html[data-theme="dark"] .scrim,
html[data-theme="dark"] .dp-shade { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .sheet-x { background: var(--surface-2); color: var(--text); }

/* ── maps: the map stays daylight (it's a photo / street map); its labels and buttons go dark ── */
html[data-theme="dark"] .qt-tools .qt-primary,
html[data-theme="dark"] .qt-tools .qt-primary:hover,
html[data-theme="dark"] .map-bar .btn.on,
html[data-theme="dark"] .map-tool.on { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
html[data-theme="dark"] .leaflet-bar a,
html[data-theme="dark"] .leaflet-bar a:hover { background: var(--surface); color: var(--text); border-bottom-color: var(--border); }
html[data-theme="dark"] .leaflet-control-attribution { background: rgba(15, 18, 22, .88) !important; color: var(--text-2); }
html[data-theme="dark"] .leaflet-control-attribution a { color: var(--accent); }
html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--text); }
html[data-theme="dark"] .map-tool,
html[data-theme="dark"] .strip-btn,
html[data-theme="dark"] .route-banner { background: var(--surface); color: var(--text); }
html[data-theme="dark"] .strip-btn { border-color: var(--border-strong); }
html[data-theme="dark"] .strip-btn.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, #161a20); }
html[data-theme="dark"] .pin em,
html[data-theme="dark"] .terr-label,
html[data-theme="dark"] .strip-hint,
html[data-theme="dark"] .qt-hn span { background: rgba(22, 26, 32, .92); color: var(--text); }
html[data-theme="dark"] .pin-n { background: #1d2f48; color: #fff; }
html[data-theme="dark"] .qt-warn { color: var(--warning); }
html[data-theme="dark"] .qt-margin.is-low { background: var(--danger-bg); }
html[data-theme="dark"] .qt-margin.is-ok { border-color: var(--success-line); }
html[data-theme="dark"] .map-fs-layer { background: var(--bg); }

/* ── doors ── */
html[data-theme="dark"] .door-btn,
html[data-theme="dark"] .disp-btn {
  border-color: color-mix(in srgb, var(--c, #6b7683) 58%, #161a20);
  background: color-mix(in srgb, var(--c, #6b7683) 14%, #161a20);
  color: var(--text);
}
html[data-theme="dark"] .door-btn.o-booked, html[data-theme="dark"] .door-btn.o-sold,
html[data-theme="dark"] .door-btn.grp-yes, html[data-theme="dark"] .disp-btn.grp-yes { border-color: #2f6b4c; background: #12271d; }
html[data-theme="dark"] .door-btn.o-interested, html[data-theme="dark"] .door-btn.o-come_back,
html[data-theme="dark"] .door-btn.grp-info, html[data-theme="dark"] .disp-btn.grp-info { border-color: #2f5480; background: #13202f; }
html[data-theme="dark"] .door-btn.grp-hot, html[data-theme="dark"] .disp-btn.grp-hot { border-color: #5a4a8c; background: #221c36; }
html[data-theme="dark"] .door-btn.grp-maybe, html[data-theme="dark"] .disp-btn.grp-maybe { border-color: #6b5524; background: #2a2112; }
html[data-theme="dark"] .door-btn.grp-no, html[data-theme="dark"] .disp-btn.grp-no { border-color: #6e4028; background: #2a1a12; }
html[data-theme="dark"] .door-btn.grp-dnk, html[data-theme="dark"] .disp-btn.grp-dnk { border-color: #6e2f2c; background: #2c1514; }
html[data-theme="dark"] .door-btn.grp-none, html[data-theme="dark"] .disp-btn.grp-none { border-color: var(--border); background: var(--surface); }
html[data-theme="dark"] .st-chip { background: color-mix(in srgb, var(--c) 20%, #161a20); border-color: color-mix(in srgb, var(--c) 50%, #161a20); color: var(--text); }
html[data-theme="dark"] .hh-btn { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .hh-btn:hover { background: var(--surface-2); }
html[data-theme="dark"] .hh-ok { background: var(--success-bg); color: var(--success); }
html[data-theme="dark"] .hh-mid { background: var(--warning-bg); color: var(--warning); }
html[data-theme="dark"] .hh-low { background: var(--danger-bg); color: var(--danger); }
html[data-theme="dark"] .stats-jump button { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .stats-jump button:hover { background: var(--surface-2); }

/* ── calendar ── */
html[data-theme="dark"] .cal-seg { background: var(--surface); box-shadow: none; }
html[data-theme="dark"] .cal-seg-b:hover,
html[data-theme="dark"] .cal-add:hover,
html[data-theme="dark"] .cal-more:hover,
html[data-theme="dark"] button.cal-dh-b:hover { background: var(--surface-2); }
html[data-theme="dark"] .cal-seg-b.on { background: var(--primary); color: var(--primary-contrast); }
html[data-theme="dark"] .cal-chip {
  background: color-mix(in srgb, var(--ev-c) 20%, #161a20);
  border-color: var(--border);
  border-left-color: var(--ev-c);
}
html[data-theme="dark"] .cal-chip:hover { background: color-mix(in srgb, var(--ev-c) 30%, #161a20); }
html[data-theme="dark"] .cal-cell:hover { background: var(--surface-2); }
html[data-theme="dark"] .cal-cell.out { background: rgba(0, 0, 0, .22); }
html[data-theme="dark"] .cal-cell.today { background: var(--accent-soft); }
html[data-theme="dark"] .cal-col {
  background-image:
    repeating-linear-gradient(to bottom, #2a313b 0 1px, transparent 1px var(--cal-hour)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--cal-hour) / 2), #20262e calc(var(--cal-hour) / 2) calc(var(--cal-hour) / 2 + 1px), transparent calc(var(--cal-hour) / 2 + 1px) var(--cal-hour));
}
html[data-theme="dark"] .cal-col.today { background-color: rgba(106, 168, 238, .06); }
html[data-theme="dark"] .cal-ev {
  background: color-mix(in srgb, var(--ev-c) 24%, #161a20);
  border-color: var(--border);
  border-left-color: var(--ev-c);
  box-shadow: none;
}
html[data-theme="dark"] .cal-ev:hover,
html[data-theme="dark"] .cal-ev:focus-visible { box-shadow: inset 0 0 0 1px var(--border-strong); }
html[data-theme="dark"] .cal-now,
html[data-theme="dark"] .cal-now::before { background: #ff6b6b; }
html[data-theme="dark"] .cal-aday.today { box-shadow: inset 0 3px 0 var(--accent); }

/* ── calls, phone, scripts ── */
html[data-theme="dark"] .calls-side,
html[data-theme="dark"] .ph-card,
html[data-theme="dark"] .calls-script { background: var(--surface); border-color: var(--border); box-shadow: none; }
html[data-theme="dark"] .calls-row { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .calls-row:hover { border-color: var(--border-strong); }
html[data-theme="dark"] .calls-row.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
html[data-theme="dark"] .chip { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .chip.on,
html[data-theme="dark"] .fb-plus.on { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
/* the Accountant / Simulator / Owners and Features chips are tabs (glass.css): the dark chip fill above must not reach them */
html[data-theme="dark"] .acct-sub .chip, html[data-theme="dark"] .feat-sub .chip,
html[data-theme="dark"] .acct-sub .chip.on, html[data-theme="dark"] .feat-sub .chip.on { background: transparent; border-color: transparent; color: var(--text-2); }
html[data-theme="dark"] .acct-sub .chip.on, html[data-theme="dark"] .feat-sub .chip.on { color: var(--text); border-bottom-color: var(--accent); }
html[data-theme="dark"] .chip.warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
html[data-theme="dark"] .ph-btn { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .ph-btn.on { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
html[data-theme="dark"] .ph-incoming { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
html[data-theme="dark"] .code-st.live { background: var(--warning-bg); color: var(--warning); }
html[data-theme="dark"] .code-st.used { background: var(--success-bg); color: var(--success); }
html[data-theme="dark"] .code-st.boof { background: var(--danger-bg); color: var(--danger); }
html[data-theme="dark"] .code-st.quoted { background: var(--info-bg); color: var(--info); }
html[data-theme="dark"] .bell-row.is-new, html[data-theme="dark"] .bell-banner { background: var(--success-bg); }
html[data-theme="dark"] .code-st.sold { background: #2f7a55; color: #fff; }

/* ── accountant ── */
html[data-theme="dark"] .acct-warn,
html[data-theme="dark"] .acct-alert.warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
html[data-theme="dark"] .acct-alert { background: var(--info-bg); color: var(--text); }
html[data-theme="dark"] .acct-alert.bad { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
html[data-theme="dark"] .acct-tbl tr.acct-neg td { background: var(--danger-bg); }
html[data-theme="dark"] .acct-posted, html[data-theme="dark"] .acct-paid, html[data-theme="dark"] .acct-filed,
html[data-theme="dark"] .acct-sent, html[data-theme="dark"] .acct-done, html[data-theme="dark"] .acct-issued { background: var(--success-bg); color: var(--success); }
html[data-theme="dark"] .acct-draft, html[data-theme="dark"] .acct-open, html[data-theme="dark"] .acct-to_issue { background: var(--surface-2); color: var(--text-2); }
html[data-theme="dark"] .acct-void, html[data-theme="dark"] .acct-failed { background: var(--danger-bg); color: var(--danger); }
html[data-theme="dark"] .acct-approved, html[data-theme="dark"] .acct-replied { background: var(--warning-bg); color: var(--warning); }
html[data-theme="dark"] .acct-audit li.warn a { color: var(--warning); }
html[data-theme="dark"] .acct-mail,
html[data-theme="dark"] .er-text { background: var(--surface); color: var(--text); }
html[data-theme="dark"] .acct-msg { background: var(--surface-2); }
html[data-theme="dark"] .acct-msg.me { background: var(--accent-soft); }

/* ── date picker ── */
html[data-theme="dark"] .dp { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-2); }
html[data-theme="dark"] .dp-nav { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .dp-nav:hover:not([disabled]),
html[data-theme="dark"] .dp-day:hover:not([disabled]) { background: var(--surface-2); }
html[data-theme="dark"] .dp-day.dp-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
html[data-theme="dark"] .dp-day.dp-on { background: var(--primary); color: var(--primary-contrast); }
html[data-theme="dark"] .dp-day[disabled] { color: #5a636e; }
html[data-theme="dark"] .dp-day:focus-visible,
html[data-theme="dark"] .dp-nav:focus-visible { outline-color: var(--focus); }

/* ── flowcharts (the editor's own colour names; literal values, see glass.css) ── */
html[data-theme="dark"] #fc-root {
  --bg: #0f1216;
  --surface: #161a20;
  --border: #2a313b;
  --border-strong: #3a4350;
  --text: #e8ebef;
  --muted: #a9b2bd;
  --accent: #9cc3ef;
  --accent-soft: #1d222a;
  background: #161a20;
}
html[data-theme="dark"] #fc-root button.primary,
html[data-theme="dark"] #fc-root .btn.primary,
html[data-theme="dark"] #fc-root .folder-chips button.on { background: #9cc3ef; color: #0f1216; border-color: #9cc3ef; }
html[data-theme="dark"] #fc-root button:hover:not(:disabled):not(.primary),
html[data-theme="dark"] #fc-root .btn:hover:not(.primary) { background: #1d222a; }
html[data-theme="dark"] #fc-root .canvas-wrap { background: #0f1216; }
html[data-theme="dark"] #fc-root .card,
html[data-theme="dark"] #fc-root .modal,
html[data-theme="dark"] #fc-root input,
html[data-theme="dark"] #fc-root select,
html[data-theme="dark"] #fc-root textarea { background: #161a20; color: var(--text); }
html[data-theme="dark"] #fc-root .shape-tile,
html[data-theme="dark"] #fc-root .panel .row > span:first-child,
html[data-theme="dark"] #fc-root .panel .col span { color: #d2d8df; }
html[data-theme="dark"] #fc-root .help ul { color: var(--muted); }
html[data-theme="dark"] #fc-root .shape-tile svg text { fill: #d2d8df; }
html[data-theme="dark"] #fc-root .thumb { background: rgba(255, 255, 255, .92); }
html[data-theme="dark"] #fc-root .badge,
html[data-theme="dark"] #fc-root .folder-group summary .count { background: #1d222a; color: var(--muted); }
html[data-theme="dark"] #fc-root .badge.ok { background: #12271d; color: #5cc28f; }
html[data-theme="dark"] #fc-root #save-status.dirty { color: #e3b25a; }
html[data-theme="dark"] #fc-root button.danger:hover { background: #2c1514; }

/* ── paper stays paper: previews of what customers get keep the light colours ── */
html[data-theme="dark"] .print-sheet, html[data-theme="dark"] .pc-page, html[data-theme="dark"] .pc-front,
html[data-theme="dark"] .labels, html[data-theme="dark"] .label, html[data-theme="dark"] .c-preview {
  --ink: #071a2e; --navy: #0b2a4a; --blue: #1f6fd0; --text: #16263a; --muted: #4c5d72; --line: #dde5ee;
  --off: #eef5fb; --white: #fff; --mint-xl: #e3f8f4; --ice: #dcedfc; --err: #c62f28; --ok: #1d7a4f;
  --surface: #fff; --surface-2: #f1f3f6; --border: #e2e6eb; --text-2: #4a5562;
  color-scheme: light;
}
html[data-theme="dark"] .c-preview { background: #fcfdff; color: #16263a; }

/* weather.js (Nov 16 2026) */
html[data-theme="dark"] .wx-chip { background: var(--surface-2); color: var(--text-2); }
html[data-theme="dark"] .wx-chip.wx-rain { background: #13202f; color: #9cc3ef; }
html[data-theme="dark"] .wx-risk { background: #13202f; border-color: #27466a; border-left-color: #4f8ad8; }
/* popups that were still white (Nov 16 2026): Household Info, Quoting's areas card + question box, the full-screen map's exit */
html[data-theme="dark"] .hh, html[data-theme="dark"] .qt-ask { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .hh-title, html[data-theme="dark"] .qt-ask h3 { color: var(--text); }
html[data-theme="dark"] .map-fs-exit { background: var(--surface); color: var(--text); border-color: var(--border); }
/* doors-gl.css: the Doors map app (Nov 16 2026). The map picture itself stays daylight. */
html[data-theme="dark"] .dg-shell { --dg-panel: #161a20; --dg-soft: #1d222a; --dg-ink: var(--text); --dg-accent: #8ab9f2; }
html[data-theme="dark"] .dg-grab i { background: #4a535e; }
html[data-theme="dark"] .dg-round { color: #0f1216; }
html[data-theme="dark"] .dg-round.is-off { background: #2a313b; color: #8a94a0; }
html[data-theme="dark"] .dg-tool.on { color: #0f1216; }
html[data-theme="dark"] .dg-fchip.on { background: #13202f; border-color: #8ab9f2; }
html[data-theme="dark"] .dg-street-frame { background: #1d222a; }
html[data-theme="dark"] .dg-seg-b.on { box-shadow: none; }
/* crew.js (Nov 16 2026) */
html[data-theme="dark"] .asg { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] .stars i { color: #3a4350; }
html[data-theme="dark"] .tag.trn-live { background: var(--success-bg); color: var(--success); }
html[data-theme="dark"] .tag.trn-draft { background: var(--warning-bg); color: var(--warning); }
html[data-theme="dark"] .tag.trn-retired { background: var(--surface-2); color: var(--text-2); }
/* texts.js (Nov 16 2026) */
html[data-theme="dark"] .texts-row, html[data-theme="dark"] .texts-thread, html[data-theme="dark"] .texts-pick { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .texts-msg { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] .texts-msg.out { background: #2f6fc4; color: #fff; }
html[data-theme="dark"] .texts-msg.word { background: var(--warning-bg); color: var(--warning); }
html[data-theme="dark"] .texts-msg.failed { background: var(--danger-bg); color: var(--danger); }
/* health.js (Nov 16 2026) */
html[data-theme="dark"] .health-row { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .health-row.bad { border-color: var(--danger-line); }
html[data-theme="dark"] .chip.health-chip.ok { background: var(--success-bg); color: var(--success); }
html[data-theme="dark"] .chip.health-chip.warn { background: var(--warning-bg); color: var(--warning); }
html[data-theme="dark"] .chip.health-chip.bad { background: var(--danger-bg); color: var(--danger); }
/* complaints.js (Nov 16 2026) */
html[data-theme="dark"] .cp-item { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .cp-mini-row { color: var(--text); }
html[data-theme="dark"] .chip.cp-open { background: var(--warning-bg); color: var(--warning); } html[data-theme="dark"] .chip.cp-working { background: var(--info-bg); color: var(--info); }
html[data-theme="dark"] .chip.cp-resolved { background: var(--success-bg); color: var(--success); } html[data-theme="dark"] .chip.cp-late, html[data-theme="dark"] .chip.cp-high { background: var(--danger-bg); color: var(--danger); }
/* goals.js (Nov 16 2026) */
html[data-theme="dark"] .goal-bar { background: var(--surface-2); } html[data-theme="dark"] .goal-tick { background: #fff; }
html[data-theme="dark"] .goal-behind .goal-line { color: var(--warning); } html[data-theme="dark"] .goal-done .goal-line { color: var(--success); }
html[data-theme="dark"] .goal-co th, html[data-theme="dark"] .goal-co td { background: var(--surface-2); }
/* Good / Better / Best editor, self-booking card, recruiting board (Nov 16 2026) */
html[data-theme="dark"] .gbb-opt { border-color: var(--border); } html[data-theme="dark"] .gbb-total { border-color: var(--border); }
html[data-theme="dark"] .sb-custom { border-color: var(--border-strong); }
html[data-theme="dark"] .rc-col { background: var(--surface-2); border-color: var(--border); }
html[data-theme="dark"] .rc-card { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .rc-star { color: #3a4350; } html[data-theme="dark"] .rc-star.on { color: #e8a300; }

/* UI redesign (Nov 2026): the red "!" on Admin → Connections reads on dark */
html[data-theme="dark"] [data-conn].conn-off::after { background: #e5483e; }
