/* Lugoda Sentinel — LIGHT THEME (default).
   A warm "safety-document" palette — paper-cream ground, warm ink, hairline rules,
   and Lugoda's fire-engine red as the single accent — echoing the company's own
   printed quotations and certificates. Activated by <html data-theme="light">
   (the default; the header toggle switches to dark and persists the choice).

   Strategy: (1) remap the design tokens to warm light values — fixes everything
   token-driven (cards, KPIs, tables, modals, rows, buttons); (2) override the
   hardcoded dark chrome (body/header/nav); (3) re-tint the recurring status palette
   to warm light tints; (4) neutralise every remaining hardcoded-dark surface
   (progress tracks, badges, verdict chips) so nothing shows through as a dark blob.
   Brand red is unchanged in both themes. */

html[data-theme="light"]{
  color-scheme:light;   /* native scrollbars + form controls render light */
  --ink:#efe9df; --ink2:#e7e0d4; --panel:#ffffff; --panel2:#faf7f0;
  --line:#ddd6c8; --muted:#5b5344; --txt:#1e1a14;
  --green:#16824f; --amber:#8a5e0c; --blue:#245fa8; --grey:#6a6252;
  --shadow:0 6px 24px rgba(70,55,30,.10);
}

/* ---- base chrome (warm paper) ---- */
html[data-theme="light"] body{background:#f6f3ec}
html[data-theme="light"] header.top{background:#fffdf9;border-bottom:1px solid var(--line)}
html[data-theme="light"] aside.sidenav{background:#fbf9f4;border-right:1px solid var(--line)}
html[data-theme="light"] aside.sidenav a:hover{background:#f1ece2;color:#1a1a17}
html[data-theme="light"] aside.sidenav a.ainav{color:#c12a2a}
html[data-theme="light"] footer{background:#fffdf9;border-top:1px solid var(--line)}
html[data-theme="light"] footer b{color:#3a3428}
/* the signature red hairline that runs under Lugoda's printed documents */
html[data-theme="light"] header.top{box-shadow:inset 0 -3px 0 -2px rgba(225,27,34,.55)}

/* header pills */
html[data-theme="light"] .zica{background:#fbf3df;color:#8a6412;border-color:#eaddb4}
html[data-theme="light"] .live-pill{background:#fceae7;border-color:#f0c0ba;color:#b3141a}
html[data-theme="light"] .line-badge{background:#fceae7;color:#c12a2a;border-color:#f0c0ba}

/* ---- status tints (shared, warm) ---- */
/* green */
html[data-theme="light"] .pill.green,
html[data-theme="light"] .four b.on,
html[data-theme="light"] .cal-chip.green,
html[data-theme="light"] .fm-railchip.done .fm-railn,
html[data-theme="light"] .fm-pfn .fm-segb.green.sel,
html[data-theme="light"] .fm-bool .fm-segb.green.sel,
html[data-theme="light"] .fm-pchip.on,
html[data-theme="light"] .fm-toast{background:#e4f2e9;color:#137a52;border-color:#c6e5d3}
html[data-theme="light"] .cal-chip.green{border-color:#c6e5d3}
html[data-theme="light"] .trk-ok:hover{background:#e4f2e9}
/* red */
html[data-theme="light"] .pill.red,
html[data-theme="light"] .four b.off,
html[data-theme="light"] .cal-chip.red,
html[data-theme="light"] .fm-pfn .fm-segb.red.sel,
html[data-theme="light"] .fm-pchip.off,
html[data-theme="light"] .alert .tag.crit,
html[data-theme="light"] .risk-score.red,
html[data-theme="light"] .risk-cell.red,
html[data-theme="light"] .trk-chip.red,
html[data-theme="light"] .schf-err{background:#fceae7;color:#c12a2a;border-color:#f0c0ba}
/* amber */
html[data-theme="light"] .pill.amber,
html[data-theme="light"] .qr-triverdict.pending,
html[data-theme="light"] .cal-chip.amber{background:#fbf1d8;color:#8a6412;border-color:#eaddb4}
/* blue */
html[data-theme="light"] .pill.blue,
html[data-theme="light"] .cal-chip.blue{background:#e6eef8;color:#2765b0;border-color:#c9dcf2}
/* grey — chips, badges, tier tags, 4-P tiles */
html[data-theme="light"] .pill.grey,
html[data-theme="light"] .chip,
html[data-theme="light"] .fm-railchip .fm-railn,
html[data-theme="light"] .fm-pfn .fm-segb.grey.sel,
html[data-theme="light"] .fm-bool .fm-segb.grey.sel,
html[data-theme="light"] .asset .tier,
html[data-theme="light"] .four b,
html[data-theme="light"] .reg-tier,
html[data-theme="light"] .reg-clientcount,
html[data-theme="light"] .fp-card h3.ch .fp-count,
html[data-theme="light"] .trn-modn-count,
html[data-theme="light"] .team-clear.standard,
html[data-theme="light"] .trk-chip.grey,
html[data-theme="light"] .alert .tag{background:#efeadf;color:#5f5849}
html[data-theme="light"] .chip.line{background:#fceae7;color:#bb3b3b}

/* ---- progress-bar tracks (were hardcoded dark #2c2c34) ---- */
html[data-theme="light"] .inv-bar,
html[data-theme="light"] .inv-bt,
html[data-theme="light"] .svc-lifebar,
html[data-theme="light"] .team-bt,
html[data-theme="light"] .trn-track,
html[data-theme="light"] .rp-bt,
html[data-theme="light"] .kpi .bar{background:#ece5d8}

/* ---- rings, asset cards ---- */
html[data-theme="light"] .ring{background:conic-gradient(var(--green) calc(var(--p,98)*1%), #e3ddd0 0)}
html[data-theme="light"] .ring.amber{background:conic-gradient(var(--amber) calc(var(--p)*1%), #e3ddd0 0)}
html[data-theme="light"] .ring.red{background:conic-gradient(var(--red) calc(var(--p)*1%), #e3ddd0 0)}
html[data-theme="light"] .ring.grey{background:conic-gradient(var(--grey) calc(var(--p)*1%), #e3ddd0 0)}
html[data-theme="light"] .kpi.clk:hover{border-color:#d8cfbe}
html[data-theme="light"] .asset:hover{border-color:#d8cfbe}
html[data-theme="light"] .asset.removed,
html[data-theme="light"] .asset.faulted{background:#fceae7}
html[data-theme="light"] .asset .four b{color:#8a8272}

/* ---- CRM detail (multi-branch badge + access rows) ---- */
html[data-theme="light"] .crm-branchbadge{background:#e6eef8;border-color:#c9dcf2;color:#2765b0}
html[data-theme="light"] .crm-access-row{background:#faf7f0;border-left-color:#c9dcf2}
html[data-theme="light"] .crm-access-row b{color:#2a4a7a}

/* ---- Service Reports blue summary bar ---- */
html[data-theme="light"] .svc-reportbar{background:#e6eef8;color:#2765b0;border-color:#c9dcf2}
html[data-theme="light"] .svc-reportbar b{color:#1f4f8a}

/* ---- QR / portal verdicts (were dark greens) ---- */
html[data-theme="light"] .qr-result.ok,
html[data-theme="light"] .qr-leg.on,
html[data-theme="light"] .qr-triverdict.ok,
html[data-theme="light"] .ptl-month.done{background:#e4f2e9;border-color:#bfe0cf;color:#137a52}

/* ---- floor plan / geo map keep a dark "screen" canvas (a monitoring display) ---- */
html[data-theme="light"] .fp-sel{color:#c12a2a;background:#fceae7;border-color:#f0c0ba}

/* ---- list rows / alerts / buttons / misc ---- */
html[data-theme="light"] .ackbtn:hover,
html[data-theme="light"] .x:hover,
html[data-theme="light"] .fm-railchip.active .fm-railn,
html[data-theme="light"] .cal-addmini:hover,
html[data-theme="light"] .cal-jump:hover,
html[data-theme="light"] nav.portnav a.active,
html[data-theme="light"] nav.portnav a.active b{color:#fff}
html[data-theme="light"] .note{background:#fbf3df;border-color:#eaddb4;color:#7a5a10}
html[data-theme="light"] .scrim{background:rgba(60,50,30,.42)}
html[data-theme="light"] .fm-segb:hover{border-color:#d8cfbe}
html[data-theme="light"] .fm-err,
html[data-theme="light"] .fm-summary{color:#c12a2a}
html[data-theme="light"] input[type=date]{color-scheme:light}
html[data-theme="light"] .schf-field input[type=date]{color-scheme:light}

/* ---- schedule calendar ---- */
html[data-theme="light"] .cal-cell:hover{border-color:#d8cfbe}
html[data-theme="light"] .cal-cell.drop-hover{background:#fbeeec}
html[data-theme="light"] .cal-cell.today .cal-num{color:#c12a2a}

/* ---- reports ---- */
html[data-theme="light"] .rp-tab:hover{border-color:#d8cfbe}
html[data-theme="light"] .rp-tab.on{background:#fbeeec}
html[data-theme="light"] .rp-tab.on .rp-tt em{color:#b06a6e}
html[data-theme="light"] .rp-rh{background:linear-gradient(90deg,#fbeeec,#ffffff)}
html[data-theme="light"] .rp-lg,
html[data-theme="light"] .rp-bl{color:#44403a}

/* ---- tracking ---- */
html[data-theme="light"] .trk-danger:hover{background:#fbeeec}

/* ---- Lugoda AI panel ---- */
html[data-theme="light"] .ai-drawer{background:linear-gradient(180deg,#ffffff,#faf7f0);border-left:1px solid var(--line)}
html[data-theme="light"] .ai-drawer-head{background:linear-gradient(90deg,#fbeeec,#faf7f0);border-bottom:1px solid var(--line)}
html[data-theme="light"] .ai-inputbar{background:#faf7f0}
html[data-theme="light"] .ai-fullcard{background:linear-gradient(180deg,#ffffff,#faf7f0)}
html[data-theme="light"] .ai-msg.bot .ai-bubble{background:#faf7f0;border:1px solid var(--line);color:#241f18}
html[data-theme="light"] .ai-msg.bot .ai-bubble strong,
html[data-theme="light"] .ai-bubble .ai-h,
html[data-theme="light"] .ai-bubble .ai-table thead th{color:#b3141a}
html[data-theme="light"] .ai-bubble h6.ai-h{color:var(--muted)}
html[data-theme="light"] .ai-bubble code{background:#efeadf;border-color:#e0d8c8;color:#3a352c}
html[data-theme="light"] .ai-bubble .ai-quote{background:#fbeeec;color:#5a3a3c}
html[data-theme="light"] .ai-bubble .ai-table{background:#fff}
html[data-theme="light"] .ai-bubble .ai-table thead th{background:linear-gradient(90deg,#fbeeec,#fff)}
html[data-theme="light"] .ai-hello b{color:#241f18}

/* ---- capture-time source badge ---- */
html[data-theme="light"] .fm-src.mobile{background:#e6eef8;color:#2167b8;border-color:#c9dcf2}
html[data-theme="light"] .fm-src.web{background:#efeadf;color:#5f5849;border-color:var(--line)}

/* ---- toasts ---- */
html[data-theme="light"] .toast{background:#fffdf9;box-shadow:0 12px 30px rgba(70,55,30,.16)}
html[data-theme="light"] .toast b{color:#241f18}
html[data-theme="light"] .toast .toast-tag{color:#137a52}

/* ---- Business Development board + Job Card chips (warm) ---- */
html[data-theme="light"] .lead-colhd{background:#f1ece2;color:#241f18}
html[data-theme="light"] .lead-card{background:#fffdf9}
html[data-theme="light"] .jc-tech{background:#fffdf9}

/* ---- header control buttons ---- */
.theme-toggle{
  background:transparent;border:1px solid var(--line);color:var(--muted);
  width:34px;height:34px;border-radius:9px;cursor:pointer;font-size:15px;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;transition:.15s;flex:0 0 auto;
}
.theme-toggle:hover{border-color:var(--red);color:var(--txt)}
.lang-toggle{
  background:transparent;border:1px solid var(--line);color:var(--muted);
  height:34px;padding:0 10px;border-radius:9px;cursor:pointer;font-size:12px;font-weight:700;
  letter-spacing:.3px;line-height:1;display:inline-flex;align-items:center;gap:4px;
  transition:.15s;flex:0 0 auto;
}
.lang-toggle:hover{border-color:var(--red);color:var(--txt)}
