/* =====================================================================
   CHAX colour tokens, light and dark (2026-11-28).
   Loaded first by layouts/admin, layouts/helpdesk and layouts/auth.
   The theme is chosen per user with the Light/Dark buttons in the top bar
   (cookie "hd_theme"); the layouts render <html data-theme="light|dark">.
   ===================================================================== */
:root {
    color-scheme: light;
    --hd-surface-2: #F8FAFC;
    --hd-hover: #F5F8FC;
    --hd-line-soft: #EEF1F5;
    --hd-chip: #EEF2F7;
    --hd-success-soft: #E8F7EE;
    --hd-error-soft: #FDECEC;
    --hd-warning-soft: #FEF3E2;
    --hd-purple-soft: #F1ECFF;
    --hd-success-text: #15803D;
    --hd-error-text: #B42318;
    --hd-warning-text: #B45309;
    --hd-blue-text: #0057D9;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --hd-nav-from: #0A1A33;
    --hd-nav-to: #11305A;
    --hd-navy: #DCE7F7;              /* page titles */
    --hd-blue: #1F6FEB;              /* fills: buttons, active pills (white text 4.6:1) */
    --hd-blue-hover: #1A60D4;
    --hd-blue-text: #7FB0FF;         /* blue text on dark surfaces (7:1) */
    --hd-blue-soft: rgba(56, 132, 255, .2);
    --hd-blue-tint: #13233F;
    --hd-blue-line: #284F8C;
    --hd-bg: #0B1220;
    --hd-card: #121B2D;
    --hd-surface-2: #0F1828;
    --hd-hover: #1A263C;
    --hd-line-soft: #1E2A40;
    --hd-chip: #1E2A40;
    --hd-border: #263450;
    --hd-border-strong: #34445F;
    --hd-text: #E6EDF7;
    --hd-text-2: #B4C0D3;
    --hd-text-3: #8C9BB3;
    --hd-success: #22C55E;
    --hd-success-soft: rgba(34, 197, 94, .16);
    --hd-success-text: #6EE7A0;
    --hd-warning: #F59E0B;
    --hd-warning-soft: rgba(245, 158, 11, .16);
    --hd-warning-text: #FBC25C;
    --hd-error: #EF4444;
    --hd-error-soft: rgba(239, 68, 68, .16);
    --hd-error-text: #FCA5A5;
    --hd-purple-soft: rgba(139, 92, 246, .2);
    --hd-note: #2A2412;
    --hd-note-line: #5F4B17;
    --hd-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --hd-shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
    --hd-shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    --hd-focus: 0 0 0 3px rgba(127, 176, 255, .45);
    --color-customColor: #1F6FEB;
}

/* ---- Light / Dark buttons in the top bars ---- */
.chax-theme-toggle {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px; height: 40px;
    border: 1px solid var(--hd-border, #E2E8F0); border-radius: 10px; background: var(--hd-card, #fff);
    box-shadow: var(--hd-shadow-sm);
}
.chax-theme-toggle button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent; color: var(--hd-text-2, #475467);
    font: 600 13px "Inter", -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer;
}
.chax-theme-toggle button .ti { font-size: 17px; }
.chax-theme-toggle button:hover { color: var(--hd-text, #101828); background: var(--hd-hover, #F5F8FC); }
.chax-theme-toggle button[aria-pressed="true"] { background: var(--hd-blue, #0866FF); color: #fff; }
.chax-theme-toggle button:focus-visible { outline: none; box-shadow: var(--hd-focus); }
@media (max-width: 767.98px) { .chax-theme-toggle .chax-theme-label { display: none; } }
