/* Zumot Maintenance Desk — design system.
   Colours: Zumot Brand Guidelines v1 (draft, Nov 2026) as used in bz-hub/core/tokens.css:
   Navy #0F2A4A · Royal #1F4FA3 · Signal Red #E8352A · Gold #D4A63A · Platinum #E6E8EC · Black #101820.
   TODO(brand): "Olive" is named in the Royal palette brief but has no hex in the guideline; --olive below is a placeholder.
   Fonts: Lexend (headings), Inter (Latin body), IBM Plex Sans Arabic (Arabic). */
:root {
  --navy: #0f2a4a; --royal: #1f4fa3; --red: #e8352a; --gold: #d4a63a; --platinum: #e6e8ec; --black: #101820;
  --olive: #6b7a3a; /* TODO(brand): placeholder until the guideline gives the olive hex */
  color-scheme: light;
  --bg: #eef0f4; --bg-glow-1: rgba(31, 79, 163, .14); --bg-glow-2: rgba(212, 166, 58, .10);
  --surface: rgba(255, 255, 255, .78); --surface-solid: #ffffff; --surface-2: #e6e8ec; --sunken: #f5f6f8;
  --glass-border: rgba(15, 42, 74, .10); --line: #d6dbe3;
  --ink: #101820; --ink-2: #2c405a; --muted: #5d6a7b; --faint: #8a96a6;
  --accent: #1f4fa3; --accent-ink: #ffffff; --accent-soft: #e2e9f6;
  --good: #1d7a48; --good-soft: #e2f3e9; --warn: #8f5a00; --warn-soft: #fbefd9;
  --bad: #c4261c; --bad-soft: #fde6e3; --gold-ink: #8a6710; --gold-soft: #f8f0d9; --info: #4a3a9c; --info-soft: #ece8fa;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 8px 24px rgba(15, 42, 74, .08);
  --radius: 18px; --radius-sm: 12px;
  --font: "Inter", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-head: "Lexend", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --tap: 56px;
  --viz-1: #1f4fa3; --viz-2: #d4a63a; /* chart series (validated light) */
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07111f; --bg-glow-1: rgba(31, 79, 163, .35); --bg-glow-2: rgba(212, 166, 58, .10);
    --surface: rgba(18, 40, 70, .62); --surface-solid: #0f2a4a; --surface-2: #17365c; --sunken: #0b1d34;
    --glass-border: rgba(230, 232, 236, .10); --line: #24425f;
    --ink: #eef1f5; --ink-2: #c6d0dd; --muted: #93a3b8; --faint: #6c7f96;
    --accent: #7fa6ee; --accent-ink: #071a35; --accent-soft: #1b3d6e;
    --good: #4cc38a; --good-soft: #143425; --warn: #e8b05a; --warn-soft: #3a2a10; --bad: #f58477; --bad-soft: #43201c;
    --gold-ink: #e2bb5c; --gold-soft: #3b2f12; --info: #b9a4ff; --info-soft: #2a2147;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --viz-1: #5b8be0; --viz-2: #b8892a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f; --bg-glow-1: rgba(31, 79, 163, .35); --bg-glow-2: rgba(212, 166, 58, .10);
  --surface: rgba(18, 40, 70, .62); --surface-solid: #0f2a4a; --surface-2: #17365c; --sunken: #0b1d34;
  --glass-border: rgba(230, 232, 236, .10); --line: #24425f;
  --ink: #eef1f5; --ink-2: #c6d0dd; --muted: #93a3b8; --faint: #6c7f96;
  --accent: #7fa6ee; --accent-ink: #071a35; --accent-soft: #1b3d6e;
  --good: #4cc38a; --good-soft: #143425; --warn: #e8b05a; --warn-soft: #3a2a10; --bad: #f58477; --bad-soft: #43201c;
  --gold-ink: #e2bb5c; --gold-soft: #3b2f12; --info: #b9a4ff; --info-soft: #2a2147;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --viz-1: #5b8be0; --viz-2: #b8892a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg);
  background-image: radial-gradient(900px 600px at 85% -10%, var(--bg-glow-1), transparent 60%), radial-gradient(700px 500px at -10% 110%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[dir="rtl"] body, body[dir="rtl"] { font-family: var(--font-ar); }
h1, h2, h3, .h { font-family: var(--font-head); letter-spacing: -.01em; margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 600; } h2 { font-size: 18px; font-weight: 600; } h3 { font-size: 15px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
[hidden] { display: none !important; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.main { min-width: 0; padding: max(12px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; width: 100%; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 12px; padding: 6px 0 14px; min-height: 56px; }
.top .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top .brand img { height: 26px; width: auto; }
.top .brand .t { font-family: var(--font-head); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sp { flex: 1; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--glass-border); color: var(--ink); cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* side rail (desktop) / bottom tabs (mobile) */
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--glass-border); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; cursor: pointer; background: none; border: 0; font-family: inherit; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.tab .badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); }
@media (min-width: 900px) {
  .shell.with-rail { grid-template-columns: 232px minmax(0, 1fr); }
  .tabs { position: sticky; top: 0; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 18px 12px; border-top: 0; border-inline-end: 1px solid var(--glass-border); }
  .tabs .rail-brand { display: flex !important; }
  .tab { flex: none; flex-direction: row; gap: 12px; padding: 10px 14px; font-size: 14px; justify-content: flex-start; min-height: 46px; }
  .tab.on { background: var(--accent-soft); }
  .tab .badge { position: static; margin-inline-start: auto; }
  .main { padding-bottom: 40px; padding-inline: 28px; }
}
.rail-brand { display: none; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.rail-brand img { height: 28px; }
.rail-brand span { font-family: var(--font-head); font-weight: 600; font-size: 14px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.card.flat { box-shadow: none; }
.card h2 + *, .card h3 + * { margin-top: 10px; }
.sect-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 2px 8px; }
.sect-title h2 { font-size: 16px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; border: 0; }
.fade-in { animation: fadeUp .32s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } * { transition: none !important; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-solid); color: var(--ink); font: 600 14px var(--font); cursor: pointer; transition: transform .12s var(--ease), background .2s; text-align: center; }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--royal); border-color: var(--royal); color: #fff; }
:root[data-theme="dark"] .btn.primary { background: #2a5fc0; border-color: #2a5fc0; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: var(--tap); font-size: 16px; border-radius: 16px; padding: 0 20px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { width: 44px; height: 44px; padding: 0; border-radius: 14px; }
.hero-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 190px; border-radius: 28px; border: 0;
  background: linear-gradient(145deg, var(--royal), var(--navy)); color: #fff; font: 700 26px var(--font-head); cursor: pointer; box-shadow: 0 18px 40px rgba(31, 79, 163, .35); }
.hero-btn svg { width: 64px; height: 64px; }
.hero-btn small { font: 500 15px var(--font); opacity: .85; }
.hero-btn:active { transform: scale(.98); }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.chip.pending { background: var(--accent-soft); color: var(--accent); }
.chip.returned { background: var(--warn-soft); color: var(--warn); }
.chip.rejected { background: var(--bad-soft); color: var(--bad); }
.chip.approved { background: var(--gold-soft); color: var(--gold-ink); }
.chip.paid, .chip.filed { background: var(--good-soft); color: var(--good); }
.chip.queued { background: var(--info-soft); color: var(--info); }
.chip.dup { background: var(--bad-soft); color: var(--bad); }
.chip.demo { background: var(--gold-soft); color: var(--gold-ink); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; }

/* ---------- forms ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: 16px var(--font); color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px; width: 100%; }
[dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea { font-family: var(--font-ar); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.err-text { color: var(--bad); font-size: 13px; font-weight: 500; }
.field-err input, .field-err select { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--royal); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }
.pin { letter-spacing: .5em; text-align: center; font-size: 24px !important; font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--glass-border); cursor: pointer; transition: transform .15s var(--ease); min-height: 72px; }
.item:active { transform: scale(.99); }
.item .thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex: none; }
.item .ti { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .amt { font-weight: 700; font-family: var(--font-head); white-space: nowrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; opacity: .5; margin: 0 auto 8px; display: block; }

/* ---------- tiles (projects / categories) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 10px 6px; border-radius: 18px; border: 2px solid var(--line);
  background: var(--surface-solid); color: var(--ink); font: 600 14px var(--font); text-align: center; cursor: pointer; line-height: 1.25; transition: transform .12s var(--ease), border-color .15s; }
.tile svg { width: 36px; height: 36px; color: var(--accent); }
.tile.on { border-color: var(--royal); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.tile:active { transform: scale(.96); }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* ---------- wizard ---------- */
.steps-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.steps-dots i { width: 28px; height: 6px; border-radius: 3px; background: var(--line); }
.steps-dots i.on { background: var(--royal); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .kind { position: absolute; inset-inline: 6px; bottom: 6px; display: flex; justify-content: center; }
.photo .kind button { font: 600 11.5px var(--font); border: 0; border-radius: 999px; padding: 4px 9px; background: rgba(16, 24, 32, .72); color: #fff; cursor: pointer; }
.photo .x { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(16, 24, 32, .7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo .x svg { width: 16px; height: 16px; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; border-radius: 20px; border: 2px dashed var(--line); background: var(--surface-solid); font-weight: 600; cursor: pointer; text-align: center; }
.pick label svg { width: 40px; height: 40px; color: var(--accent); }
.pick input { display: none; }
.ocr-card .conf { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.conf.hi { background: var(--good-soft); color: var(--good); } .conf.mid { background: var(--warn-soft); color: var(--warn); } .conf.lo { background: var(--bad-soft); color: var(--bad); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 12px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.big-amt { font: 700 34px var(--font-head); letter-spacing: -.02em; }
.sticky-actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 10px; padding: 10px; margin: 0 -6px; border-radius: 20px;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.sticky-actions .btn { flex: 1; }
@media (min-width: 900px) { .sticky-actions { bottom: 16px; } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); }
.timeline .dot svg { width: 18px; height: 18px; }
.timeline .approved .dot { background: var(--good-soft); color: var(--good); }
.timeline .returned .dot { background: var(--warn-soft); color: var(--warn); }
.timeline .rejected .dot { background: var(--bad-soft); color: var(--bad); }
.timeline .skipped .dot { background: var(--gold-soft); color: var(--gold-ink); }
.timeline .current .dot { background: var(--royal); color: #fff; box-shadow: 0 0 0 5px var(--accent-soft); }
.quote { margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: var(--sunken); font-size: 13.5px; }

/* ---------- alerts, sheets, toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--accent-soft); color: var(--accent); } .alert.good { background: var(--good-soft); color: var(--good); }
.alert.gold { background: var(--gold-soft); color: var(--gold-ink); }
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(7, 17, 31, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--surface-solid); border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .28s var(--ease) both; }
.sheet.wide { max-width: 900px; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 24px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 12px; }
.toast { position: fixed; z-index: 80; inset-inline: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 420px; padding: 12px 16px; border-radius: 14px; background: var(--black); color: #fff; font-weight: 500; box-shadow: var(--shadow); animation: up .25s var(--ease) both; text-align: center; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 13.5px; font-weight: 500; }
.banner.off { background: var(--warn-soft); color: var(--warn); } .banner.demo { background: var(--gold-soft); color: var(--gold-ink); }
.banner svg { width: 18px; height: 18px; flex: none; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gallery button { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .tag { position: absolute; bottom: 6px; inset-inline-start: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(16, 24, 32, .72); color: #fff; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .back { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-end: 12px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--glass-border); cursor: pointer; text-align: start; font-family: inherit; color: inherit; box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font: 700 22px var(--font-head); letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.hl { background: linear-gradient(145deg, var(--royal), var(--navy)); color: #fff; border-color: transparent; }
.kpi.hl .l, .kpi.hl .s { color: rgba(255, 255, 255, .78); }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; cursor: pointer; background: none; border: 0; font: inherit; color: inherit; text-align: start; min-height: 40px; }
.bar:hover { background: var(--sunken); }
.bar .lab { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { height: 12px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--viz-1); }
[dir="rtl"] .bar .fill { border-radius: 4px 0 0 4px; }
.bar .val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; cursor: pointer; background: none; border: 0; font: inherit; color: inherit; padding: 0; min-width: 0; }
.col .c { width: 100%; max-width: 38px; border-radius: 4px 4px 0 0; background: var(--viz-1); min-height: 2px; }
.col .x { font-size: 11px; color: var(--muted); white-space: nowrap; }
.col .y { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget { display: flex; flex-direction: column; gap: 6px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.budget:last-child { border-bottom: 0; }
.budget .track { position: relative; height: 14px; border-radius: 7px; background: var(--sunken); overflow: hidden; display: flex; }
.budget .fill { height: 100%; background: var(--viz-1); }
.budget .pend { height: 100%; margin-inline-start: 2px; background: repeating-linear-gradient(45deg, var(--viz-2), var(--viz-2) 4px, color-mix(in srgb, var(--viz-2) 55%, transparent) 4px, color-mix(in srgb, var(--viz-2) 55%, transparent) 8px); }
.budget.over .fill { background: var(--red); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters select { width: auto; min-width: 120px; min-height: 40px; padding: 6px 10px; font-size: 14px; border-radius: 999px; flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; min-height: 38px; }
.seg button.on { background: var(--surface-solid); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 420px; padding: 24px; }
.auth .logo { height: 40px; margin: 0 auto 18px; }
.qr-box { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: 14px; }
.qr-box canvas { width: 200px; height: 200px; image-rendering: pixelated; }

/* ---------- technician mode: simpler, bigger, no glass ---------- */
body.simple { font-size: 17px; }
body.simple .card, body.simple .item, body.simple .kpi { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-solid); }
body.simple .btn { min-height: var(--tap); font-size: 16px; border-radius: 16px; }
body.simple .item { min-height: 84px; }
body.simple .chip { font-size: 14px; padding: 5px 12px; }
body.simple .tab { font-size: 13px; min-height: 60px; }
body.simple .tab svg { width: 28px; height: 28px; }
body.simple input, body.simple select, body.simple textarea { min-height: var(--tap); font-size: 18px; }
body.simple .tile { min-height: 116px; font-size: 15.5px; }

/* ---------- payment form preview ---------- */
.pdf-frame { width: 100%; height: 70dvh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pdf-preview { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

/* ---------- verify ---------- */
.verify-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); color: #fff; }
.verify-head.ok { background: linear-gradient(145deg, #1d7a48, #145c36); }
.verify-head.no { background: linear-gradient(145deg, #c4261c, #8e1a13); }
.verify-head svg { width: 36px; height: 36px; }

/* logo per theme */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none !important; } :root:not([data-theme="light"]) .logo-dark { display: block !important; } }
.auth .logo.logo-dark { margin: 0 auto 18px; }
.bar .track { display: flex; }
@media (min-width: 900px) { .top .brand img { display: none !important; } }
.filters .btn { white-space: nowrap; flex: none; }
