/* Kendra dark mode (html[data-theme=dark], set by theme.js). Screen only; printing stays light.
   dark-auto.css (generated) darkens the colours in style.css and spatial.css; this file sets the glass and sign-in. */
@media screen{
html[data-theme=dark]{--ink:#ece8f4;--muted:#bdb4cc;--text-soft:#d3cbe0;--line:rgba(255,255,255,.1);--bg:#100c18;
  --k-navy:#e3e9f7;--k-ink:#e8ecf5;--k-muted:#aeb8cd;--k-line:#2a3550;--k-bg:#0d1424}
html[data-theme=dark] body{background:#100c18;color:#ece8f4}
html[data-theme=dark]{--donut-empty:#2f2546}
html[data-theme=dark] .kp-switch a:not(.on),html[data-theme=dark] .kp-plan .kp-btn-outline{color:#c9d5f5}
html[data-theme=dark] .skip{background:#1d2540;color:#fff}
html[data-theme=dark] body.kp a:not(.kp-btn):not(.kp-logo){color:#a9bcff}
html[data-theme=dark] .kp-plan .cur{color:#a9bcff}
html[data-theme=dark] .kp-btn-outline{color:#d3ddff!important;border-color:#6f86d6!important;background:transparent!important}
html[data-theme=dark] .kp-flag{color:#1a1200!important}
html[data-theme=dark] body.k-spatial{
  --sp-glass:rgba(30,24,44,.72);--sp-glass-strong:rgba(34,28,50,.9);--sp-line:rgba(255,255,255,.09);
  --sp-shadow:0 26px 54px -26px rgba(0,0,0,.75),0 8px 20px -12px rgba(0,0,0,.45);
  --sp-shadow-hi:0 34px 64px -26px rgba(0,0,0,.8),0 12px 26px -12px rgba(0,0,0,.5);
  background:radial-gradient(40vmax 40vmax at 88% 4%,rgba(255,255,255,.04),transparent 70%),
    linear-gradient(135deg,#120d1d 0%,#100f1f 50%,#17120e 100%) fixed;color:#ece8f4}
html[data-theme=dark] body.k-spatial::before{opacity:.45}
html[data-theme=dark] body.k-spatial::after{opacity:.3}
html[data-theme=dark] .k-spatial :is(.panel,.stat-card,.filters,.profile-hero,.form-help,.empty-state,.report-filter,.filter-bar,.error-panel,.topbar,.footer){
  box-shadow:var(--sp-shadow),inset 0 1px 0 rgba(255,255,255,.05)}
html[data-theme=dark] .k-spatial .topbar,html[data-theme=dark] .k-spatial .footer{background:var(--sp-glass);border-color:var(--sp-line)}
html[data-theme=dark] :is(h1,h2,h3,h4,h5,h6){color:#f3eff9}
html[data-theme=dark] :is(.muted,small){color:#b9b0c9}
html[data-theme=dark] .k-spatial :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]){
  background:rgba(14,10,22,.75);color:#ece8f4;border-color:rgba(255,255,255,.14);box-shadow:inset 0 2px 4px rgba(0,0,0,.3)}
html[data-theme=dark] .k-spatial :is(input,select,textarea):focus{background:#160f22}
html[data-theme=dark] ::placeholder{color:#8f86a2}
html[data-theme=dark] .k-spatial th{background:rgba(255,255,255,.05);color:#c9c1d8}
html[data-theme=dark] .k-spatial td{border-top-color:rgba(255,255,255,.07)}
html[data-theme=dark] .k-spatial tbody tr:hover td{background:rgba(255,255,255,.04)}
html[data-theme=dark] .k-spatial :is(.btn.secondary,.btn.ghost){background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.14);color:#ece8f4}
html[data-theme=dark] .k-spatial .avatar{background:#2a2140;color:#fff}
html[data-theme=dark] .k-spatial a.text-link,html[data-theme=dark] .k-spatial .content a:not(.btn){color:#d6b8ff}
html[data-theme=dark] .k-spatial .messages .alert.success{background:rgba(25,135,84,.2);color:#a6e9c6}
html[data-theme=dark] .k-spatial .messages .alert.error{background:rgba(220,53,69,.2);color:#ffb7bf}
html[data-theme=dark] .k-spatial .messages .alert.warning{background:rgba(255,193,7,.16);color:#ffe08a}
html[data-theme=dark] .k-spatial :is(.receipt-sheet,.doc-sheet){background:#1b1529;color:#ece8f4}

/* sign-in: neumorphism on a deep base, shaded with darker and lighter tones of it */
html[data-theme=dark] body.k-auth{--nm-base:#1d1828;--nm-dark:rgba(0,0,0,.55);--nm-light:rgba(255,255,255,.05);
  background:radial-gradient(60vmax 50vmax at 50% 0%,#241d33,transparent 70%),var(--nm-base) fixed}
html[data-theme=dark] .k-auth .login-card{background:linear-gradient(145deg,rgba(40,33,56,.75),rgba(24,19,35,.7));border-color:rgba(255,255,255,.08)}
html[data-theme=dark] .k-auth .login-card .stack label,html[data-theme=dark] .k-auth .login-card p{color:#c9c1d8}
html[data-theme=dark] .k-auth .login-card :is(input,select):not([type=checkbox]):not([type=radio]):not([type=file]){background:var(--nm-base);color:#f1edf7}
html[data-theme=dark] .k-auth .login-card :is(input,select):not([type=checkbox]):not([type=radio]):not([type=file]):focus{background:#221c30}
html[data-theme=dark] .k-auth .login-help{color:#c9c1d8}

/* public site */
html[data-theme=dark] body.kp{background:linear-gradient(135deg,#0d1424 0%,#121227 55%,#1a140b 100%) fixed;color:#e8ecf5}
html[data-theme=dark] body.kp::before{opacity:.5}html[data-theme=dark] body.kp::after{opacity:.35}
html[data-theme=dark] :is(.kp-nav,.kp-features article,.kp-plan,.kp-form,.kc-table,.kp-switch,.kp-alert){
  background:rgba(22,28,46,.75)!important;border-color:rgba(255,255,255,.09)!important;box-shadow:0 26px 50px -28px rgba(0,0,0,.7),inset 0 1px 0 rgba(255,255,255,.05)!important;color:#e8ecf5}
html[data-theme=dark] .kp-plan.featured{border-color:rgba(120,150,255,.7)!important}
html[data-theme=dark] .kp-form :is(input,select){background:#0f1526;color:#e8ecf5;border-color:#33405e}
html[data-theme=dark] body.kp-auth{--nm-base:#161b29;--nm-dark:rgba(0,0,0,.55);--nm-light:rgba(255,255,255,.05);background:var(--nm-base)}
html[data-theme=dark] .kp-auth .kp-form input{background:var(--nm-base)!important}
html[data-theme=dark] .kp-nav a,html[data-theme=dark] .kp-logo{color:#e8ecf5}
}

/* the light/dark button */
.theme-toggle{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;border:1px solid rgba(80,16,110,.2);background:rgba(255,255,255,.75);
  color:#2a2034;border-radius:999px;padding:6px 12px;font:700 13px/1.2 inherit;cursor:pointer}
.theme-toggle .tt-icon{font-size:15px}
.theme-toggle:hover{border-color:var(--purple,#50106e)}
html[data-theme=dark] .theme-toggle{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.18);color:#f4f0fa}
.topbar-tools{display:flex;align-items:center;gap:12px}
.k-auth-theme{position:absolute;top:16px;right:18px;z-index:5}
.main-auth{position:relative}
@media(max-width:700px){.theme-toggle .tt-text{display:none}}
@media print{.theme-toggle{display:none!important}}

/* Language switch (EN / FR) */
.lang-switch{display:inline-flex;align-items:center;gap:2px;padding:2px;border-radius:999px;border:1px solid rgba(80,16,110,.2);background:rgba(255,255,255,.75);margin:0}
.lang-switch button{border:0;background:transparent;color:inherit;font:inherit;font-size:12px;font-weight:700;letter-spacing:.04em;padding:5px 9px;border-radius:999px;cursor:pointer;min-height:0;box-shadow:none}
.lang-switch button.on{background:var(--purple,#50106e);color:#fff}
.lang-switch button:focus-visible{outline:2px solid var(--gold,#f2a900);outline-offset:1px}
html[data-theme=dark] .lang-switch{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.18);color:#f4f0fa}
html[data-theme=dark] .lang-switch button.on{background:#b98ae0;color:#1a1024}
.k-auth-lang{position:absolute;top:16px;left:18px;z-index:5}
@media print{.lang-switch{display:none!important}}
.kp nav .lang-switch{margin-left:6px}
