/* Zumot Cash Ledger. Colours and type follow the Zumot Brand Guidelines v1 (draft, Nov 2026), as in bz-hub/core/tokens.css:
   Navy #0F2A4A, Royal #1F4FA3, Signal Red #E8352A, Gold #D4A63A, Platinum #E6E8EC. Lexend headings, Inter body, IBM Plex Sans Arabic.
   TODO(brand): confirm these once the guideline is approved; every colour is a variable below. */
:root{
  color-scheme:light;
  --navy:#0F2A4A; --royal:#1F4FA3; --red:#E8352A; --gold:#D4A63A; --platinum:#E6E8EC;
  --bg:#F2F3F6; --surface:#FFFFFF; --surface-2:#E6E8EC; --ink:#101820; --ink-2:#2C405A; --muted:#5D6A7B; --line:#D2D7DF;
  --accent:#1F4FA3; --accent-ink:#FFFFFF; --accent-soft:#E2E9F6;
  --up:#B4271D; --up-soft:#FDE6E3;     /* adds to what Bulos owes (red, darkened for text) */
  --down:#1D7A48; --down-soft:#E2F3E9; /* settles it */
  --warn:#8F5A00; --warn-soft:#FBEFD9; --gold-ink:#8A6710; --gold-soft:#F8F0D9;
  --head:#0F2A4A; --head-ink:#FFFFFF; --head-muted:#C5D6F2;
  --font:"Inter","IBM Plex Sans Arabic","Segoe UI",system-ui,-apple-system,sans-serif;
  --font-head:"Lexend","IBM Plex Sans Arabic","Segoe UI",system-ui,sans-serif;
  --r:14px; --r-s:10px; --g:16px; --shadow:0 1px 2px rgba(16,24,32,.06),0 4px 16px rgba(16,24,32,.05);
  --tabbar:64px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --bg:#09172A; --surface:#0F2A4A; --surface-2:#17365C; --ink:#EAEEF4; --ink-2:#BDC8D7; --muted:#8E9CB0; --line:#264567;
  --accent:#7FA6EE; --accent-ink:#071A35; --accent-soft:#1B3D6E;
  --up:#F58477; --up-soft:#43201C; --down:#4CC38A; --down-soft:#143425; --warn:#E3A64E; --warn-soft:#3A2A10; --gold-ink:#E2BB5C; --gold-soft:#3B2F12;
  --head:#071A35; --shadow:none}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#09172A; --surface:#0F2A4A; --surface-2:#17365C; --ink:#EAEEF4; --ink-2:#BDC8D7; --muted:#8E9CB0; --line:#264567;
  --accent:#7FA6EE; --accent-ink:#071A35; --accent-soft:#1B3D6E;
  --up:#F58477; --up-soft:#43201C; --down:#4CC38A; --down-soft:#143425; --warn:#E3A64E; --warn-soft:#3A2A10; --gold-ink:#E2BB5C; --gold-soft:#3B2F12;
  --head:#071A35; --shadow:none}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.45 var(--font);-webkit-font-smoothing:antialiased;text-size-adjust:100%}
html[lang="ar"] body{font-family:"IBM Plex Sans Arabic","Inter",system-ui,sans-serif}
h1,h2,h3{font-family:var(--font-head);margin:0;font-weight:600;letter-spacing:-.01em}
html[lang="ar"] h1,html[lang="ar"] h2,html[lang="ar"] h3{font-family:"IBM Plex Sans Arabic",var(--font-head);letter-spacing:0}
button,input,select,textarea{font:inherit;color:inherit}
[hidden]{display:none!important}
.num,.amt{font-family:"Inter",system-ui,sans-serif;font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate;white-space:nowrap}
.mono{font-family:"Inter",system-ui,sans-serif;font-variant-numeric:tabular-nums;font-size:12.5px;color:var(--muted);direction:ltr;unicode-bidi:isolate}

/* ---------- shell ---------- */
.top{position:sticky;top:0;z-index:20;background:var(--head);color:var(--head-ink);padding:calc(env(safe-area-inset-top) + 10px) var(--g) 10px;display:flex;align-items:center;gap:12px}
.top .logo{height:26px;width:auto}
.top .ttl{font:600 16px var(--font-head);white-space:nowrap}
.top .sp{flex:1}
.top .who{color:var(--head-muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw}
.top button{background:rgba(255,255,255,.12);border:0;color:#fff;border-radius:999px;min-height:36px;min-width:44px;padding:0 12px;font-weight:600;cursor:pointer}
.layout{display:block}
.nav{position:fixed;inset-inline:0;bottom:0;z-index:30;display:flex;justify-content:space-around;background:var(--surface);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
.nav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;text-decoration:none;color:var(--muted);font-size:11px;font-weight:600;min-height:48px;justify-content:center;border-radius:12px}
.nav a svg{width:24px;height:24px}
.nav a.on{color:var(--accent)}
.nav a.fab{color:var(--ink-2)}
.nav a.fab span.dot{width:50px;height:50px;border-radius:50%;background:var(--accent);display:grid;place-items:center;margin-top:-26px;margin-bottom:2px;box-shadow:0 6px 18px rgba(31,79,163,.35)}
.nav a.fab svg{width:26px;height:26px}
main{padding:var(--g) var(--g) calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));max-width:760px;margin:0 auto}
.badge{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-weight:700;line-height:1}
.nav a .ic{position:relative}.nav a .ic .badge{position:absolute;top:-4px;inset-inline-end:-10px}

@media (min-width:1024px){
  .layout{display:grid;grid-template-columns:232px 1fr;min-height:calc(100vh - 56px)}
  .nav{position:sticky;top:56px;height:calc(100vh - 56px);flex-direction:column;justify-content:flex-start;gap:4px;border-top:0;border-inline-end:1px solid var(--line);padding:16px 12px}
  .nav a{flex:none;flex-direction:row;justify-content:flex-start;gap:12px;font-size:14.5px;padding:0 12px;min-height:44px}
  .nav a.on{background:var(--accent-soft)}
  .nav a.fab{order:-1;background:var(--accent);color:var(--accent-ink);margin-bottom:12px}
  .nav a.fab span.dot{width:auto;height:auto;margin:0;background:none;box-shadow:none;display:contents}
  .nav a.fab svg{width:22px;height:22px}
  .nav a .ic .badge{position:static;margin-inline-start:6px}
  main{max-width:1120px;padding:28px 32px 48px;width:100%}
}

/* ---------- blocks ---------- */
.stack>*+*{margin-top:12px}
.grid2{display:grid;gap:12px;grid-template-columns:minmax(0,1fr)}
.grid2>*,.stack>*{min-width:0}
@media (min-width:1024px){.grid2{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start}}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.card>.hd{display:flex;align-items:center;gap:8px;padding:14px 16px 6px}
.card>.hd h2{font-size:15px;flex:1}
.card>.hd .link{color:var(--accent);font-weight:600;font-size:14px;text-decoration:none;background:none;border:0;cursor:pointer;padding:6px 0;min-height:32px}
.card>.bd{padding:6px 16px 16px}
.pad{padding:16px}
.muted{color:var(--muted)}.small{font-size:13px}
.sec{font:600 12px var(--font);text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:20px 4px 8px}
html[lang="ar"] .sec{letter-spacing:0;text-transform:none;font-size:13px}

.hero{background:var(--head);color:#fff;border:0;position:relative}
.hero .bd{padding:18px 18px 16px}
.hero .lbl{color:var(--head-muted);font-size:13px;font-weight:600}
.hero .big{font:600 40px/1.1 "Inter",system-ui,sans-serif;font-variant-numeric:tabular-nums;margin:6px 0 2px;direction:ltr;unicode-bidi:isolate;display:inline-block}
.hero .big small{font-size:18px;color:var(--head-muted);margin-inline-end:6px;font-weight:600}
.hero .note{color:var(--head-muted);font-size:13px}
.hero .boxes{margin-top:14px;border-top:1px solid rgba(255,255,255,.14)}
.hero .boxes div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.08);font-size:14px}
.hero .boxes div:last-child{border-bottom:0}
.hero::after{content:"";position:absolute;inset-inline-start:0;bottom:0;height:4px;width:30%;background:var(--gold)}

.kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;box-shadow:var(--shadow)}
.kpi .lbl{color:var(--muted);font-size:12.5px;font-weight:600}
.kpi .v{font:600 20px "Inter",system-ui,sans-serif;font-variant-numeric:tabular-nums;margin-top:4px;direction:ltr;unicode-bidi:isolate;display:inline-block}
.kpi .s{color:var(--muted);font-size:12.5px;margin-top:2px}
.bar{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden;display:flex;margin-top:10px}
.bar i{display:block;height:100%}

/* rows */
.rows{list-style:none;margin:0;padding:0}
.row{display:flex;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--line);text-decoration:none;color:inherit;min-height:60px;cursor:pointer;background:none;width:100%;text-align:start;border-inline:0;border-bottom:0}
.rows>.row:first-child,.rows>li:first-child>.row{border-top:0}
.row:active{background:var(--surface-2)}
@media (hover:hover){.row:hover{background:color-mix(in srgb,var(--surface-2) 45%,transparent)}}
.row .ico{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;flex:none;font-weight:700}
.row .ico svg{width:20px;height:20px}
.ico{display:grid;place-items:center;flex:none;border-radius:10px;width:36px;height:36px}.ico svg{width:20px;height:20px}
.ico.up{background:var(--up-soft);color:var(--up)}.ico.down{background:var(--down-soft);color:var(--down)}.ico.req{background:var(--accent-soft);color:var(--accent)}.ico.bank{background:var(--gold-soft);color:var(--gold-ink)}
.seg.types button .ico{width:30px;height:30px;border-radius:8px}.seg.types button.on .ico{background:rgba(255,255,255,.2);color:inherit}
.row .mid{flex:1;min-width:0}
.row .t1,.row .t2{display:block}
.row .t1{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .t2{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .end{text-align:end;flex:none}
.row .end .amt{font-weight:600}
.amt.up{color:var(--up)}.amt.down{color:var(--down)}
.chip{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:2px 9px;font-size:12px;font-weight:600;background:var(--surface-2);color:var(--ink-2);white-space:nowrap}
.chip.pending{background:var(--warn-soft);color:var(--warn)}.chip.confirmed,.chip.done{background:var(--down-soft);color:var(--down)}.chip.disputed{background:var(--up-soft);color:var(--up)}.chip.void,.chip.cancelled,.chip.deleted{background:var(--surface-2);color:var(--muted);text-decoration:line-through}.chip.new{background:var(--accent-soft);color:var(--accent)}.chip.in_progress{background:var(--gold-soft);color:var(--gold-ink)}
.empty{padding:22px 16px;color:var(--muted);text-align:center;font-size:14px}

/* confirm rows: one-tap actions */
.confirm{padding:12px 16px;border-top:1px solid var(--line)}
.confirm:first-child{border-top:0}
.confirm .line{display:flex;gap:12px;align-items:flex-start}
.confirm .acts{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 18px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-weight:600;font-size:15.5px;cursor:pointer;text-decoration:none;color:var(--ink)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.ok{background:var(--down);border-color:var(--down);color:#fff}
.btn.danger{background:var(--surface);border-color:var(--up);color:var(--up)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--accent)}
.btn.block{width:100%}
.btn.sm{min-height:40px;font-size:14px;padding:0 14px;border-radius:10px}
.btn:disabled{opacity:.55;cursor:default}
.btn svg{width:20px;height:20px}
html[dir="rtl"] a.btn.ghost svg{transform:scaleX(-1)}
.btnrow{display:flex;gap:10px;flex-wrap:wrap}.btnrow>.btn{flex:1}

/* big choice tiles (Ask) */
.tiles{display:grid;gap:12px}
@media (min-width:700px){.tiles{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}}
.tile{text-decoration:none;color:inherit;display:flex;align-items:center;gap:14px;padding:18px;border-radius:var(--r);border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow);cursor:pointer;text-align:start;min-height:84px;width:100%}
.tile .ico{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;flex:none}
.tile .ico svg{width:26px;height:26px}
.tile b{display:block;font-size:16.5px;color:var(--ink)}.tile span span{display:block;color:var(--muted);font-size:13px;margin-top:2px}
@media (min-width:700px){.tile{flex-direction:column;align-items:flex-start;min-height:150px}}

/* forms */
.form{display:flex;flex-direction:column;gap:16px}
.f{display:flex;flex-direction:column;gap:6px}
.f>label,.f>.lb{font-size:13px;font-weight:600;color:var(--ink-2)}
.f .hint{font-size:12.5px;color:var(--muted)}
.in{width:100%;min-height:48px;border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:10px 14px;font-size:16px;outline:none}
.in:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
textarea.in{min-height:76px;resize:vertical}
.amount-in{display:flex;align-items:center;border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:0 14px;min-height:64px;direction:ltr}
.amount-in:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.amount-in select{border:0;background:transparent;font:600 16px "Inter";color:var(--muted);padding:0 4px;min-height:44px}
.amount-in input{flex:1;border:0;outline:0;background:transparent;font:600 30px "Inter",system-ui;font-variant-numeric:tabular-nums;min-width:0;text-align:end;padding:6px 0}
.seg{display:flex;flex-wrap:wrap;gap:8px}
.seg button{min-height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-weight:600;cursor:pointer;font-size:14.5px}
.seg button.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.seg.types button{border-radius:12px;flex:1 1 140px;text-align:start;padding:10px 12px;min-height:56px;display:flex;align-items:center;gap:8px}
.seg.types button small{display:block;font-weight:500;font-size:12px;opacity:.8}
.err{background:var(--up-soft);color:var(--up);border-radius:12px;padding:10px 14px;font-size:14px;font-weight:600}
.ok-msg{background:var(--down-soft);color:var(--down);border-radius:12px;padding:10px 14px;font-size:14px;font-weight:600}
.info{background:var(--accent-soft);color:var(--ink-2);border-radius:12px;padding:12px 14px;font-size:14px}
.warnbox{background:var(--gold-soft);color:var(--ink);border-radius:12px;padding:12px 14px;font-size:14px;border-inline-start:4px solid var(--gold)}
.photos{display:flex;gap:8px;flex-wrap:wrap}
.photos .ph{width:84px;height:84px;border-radius:12px;background:var(--surface-2) center/cover no-repeat;border:1px solid var(--line);position:relative;display:grid;place-items:center;font-size:12px;color:var(--muted);overflow:hidden;cursor:pointer}
.photos .ph img{width:100%;height:100%;object-fit:cover}
.photos label.ph{border-style:dashed;color:var(--accent);font-weight:600;text-align:center;padding:6px}
.photos input{display:none}
.photos .ph svg{width:26px;height:26px}
.photos label.ph{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:11.5px;line-height:1.2}

/* detail */
.dl{display:grid;grid-template-columns:minmax(110px,38%) 1fr;margin:0}
.dl dt,.dl dd{margin:0;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.dl dt{color:var(--muted)}.dl dd{overflow-wrap:anywhere}
.dl dt:first-of-type,.dl dt:first-of-type+dd{border-top:0}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{padding:10px 0 10px 0;border-top:1px solid var(--line);font-size:13.5px}
.timeline li:first-child{border-top:0}
.timeline .w{color:var(--muted);font-size:12.5px}
.diff{font-size:13px;margin-top:4px}.diff del{color:var(--up)}.diff ins{color:var(--down);text-decoration:none;font-weight:600}

/* filters */
.filters{display:flex;gap:8px;overflow-x:auto;padding:2px 0 8px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filters select,.filters input{min-height:40px;border-radius:999px;border:1px solid var(--line);background:var(--surface);padding:0 12px;font-size:14px;flex:none;max-width:200px}
.filters .on{border-color:var(--accent);color:var(--accent);font-weight:600}
.sumbar{display:flex;gap:16px;flex-wrap:wrap;font-size:13.5px;color:var(--muted);padding:4px 4px 10px}
.sumbar b{color:var(--ink)}

/* sheet / dialog */
.scrim{position:fixed;inset:0;background:rgba(9,23,42,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
.sheet{background:var(--bg);width:100%;max-height:92vh;overflow:auto;border-radius:20px 20px 0 0;padding:8px var(--g) calc(20px + env(safe-area-inset-bottom));animation:up .2s ease-out}
.sheet .grab{width:40px;height:5px;border-radius:3px;background:var(--line);margin:4px auto 10px}
.sheet .sh{display:flex;align-items:center;gap:8px;margin-bottom:12px}.sheet .sh h2{flex:1;font-size:18px}
@media (min-width:700px){.scrim{align-items:center}.sheet{max-width:560px;border-radius:20px;max-height:86vh}}
@keyframes up{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}
@keyframes fade{from{opacity:0}}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tabbar) + 24px + env(safe-area-inset-bottom));background:var(--ink);color:var(--bg);padding:12px 18px;border-radius:12px;font-weight:600;z-index:60;box-shadow:0 8px 24px rgba(0,0,0,.2);max-width:calc(100vw - 32px);animation:up .2s}
@media (min-width:1024px){.toast{bottom:32px}}

/* sign-in */
.auth{min-height:100vh;display:flex;flex-direction:column;background:var(--head)}
.auth .brandbar{padding:calc(env(safe-area-inset-top) + 28px) 24px 24px;color:#fff;display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.auth .brandbar img{height:34px}
.auth .brandbar h1{font-size:24px}.auth .brandbar p{margin:0;color:var(--head-muted)}
.auth .panel{background:var(--bg);flex:1;border-radius:22px 22px 0 0;padding:24px var(--g) 32px}
.auth .panel .form{max-width:420px;margin:0 auto}
@media (min-width:700px){.auth{align-items:center;justify-content:center}.auth .brandbar{width:420px;padding:0 0 20px}.auth .panel{flex:none;width:460px;border-radius:20px;padding:28px}}
.qr{background:#fff;padding:12px;border-radius:12px;width:max-content;margin:0 auto}
.qr img,.qr canvas{display:block;width:196px;height:196px;image-rendering:pixelated}
.secret{font:600 14px "Inter";letter-spacing:.08em;word-break:break-all;background:var(--surface);border:1px dashed var(--line);border-radius:10px;padding:10px;text-align:center;direction:ltr}
.code-in{font:600 28px "Inter";letter-spacing:.3em;text-align:center;direction:ltr}
.langsw{position:absolute;top:calc(env(safe-area-inset-top) + 16px);inset-inline-end:16px}
.langsw button{background:rgba(255,255,255,.14);color:#fff;border:0;border-radius:999px;min-height:36px;padding:0 14px;font-weight:600;cursor:pointer}
.install{display:flex;gap:12px;align-items:center}
.install img{width:44px;height:44px;border-radius:10px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
