/* Smart Cash design system — loaded after the prototype styles, before cloud.css.
   Expressive light SaaS surfaces; financial data, order and chart sizing stay intact. */
:root {
  color-scheme: light;
  --bg: #f4f7fc; --bg2: #f4f7fc;
  --fg: #14233f; --muted: #52627a; --subtle: #60708a; --t3: #65748c;
  --surface: #eaf0f8; --surface-raised: #ffffff; --surface-soft: #f1f5fb;
  --track: #dce5f2; --line: #dce4ef; --field-line: #8595ad;
  --glass: rgba(255, 255, 255, .94); --glass-line: #dce5f1;
  --glass-shadow: 0 2px 3px rgba(25, 52, 92, .025), 0 10px 28px rgba(25, 52, 92, .065);
  --shadow-sm: 0 2px 3px rgba(25, 52, 92, .025), 0 4px 12px rgba(25, 52, 92, .055);
  --shadow-md: 0 4px 8px rgba(25, 52, 92, .035), 0 16px 38px rgba(25, 52, 92, .11);
  --primary: #19345c; --on-primary: #ffffff;
  --accent: #276ef1; --on-accent: #ffffff; --accent-text: #215fcf; --accent-soft: #eaf1ff;
  --pos: #109884; --pos-text: #087568; --pos-soft: #e5f5ef;
  --warn: #efb343; --warn-text: #875300; --warn-soft: #fff4dc;
  --neg: #bf3349; --neg-soft: #fdebf0;
  --success-solid: #087568; --danger-solid: #bf3349; --on-status: #ffffff;
  --card: #19345c; --card-end: #233f70; --on-card: #ffffff;
  --card-muted: #c7d5ec; --card-track: #375278; --card-line: #526c93;
  --card-soft: #2b4873; --card-success: #73dec6; --card-warning: #ffda88; --card-danger: #ffacb9;
  --stage: #f6f8fc; --bezel: #15223a; --paper: #ffffff; --ink: #14233f;
  --wall-a: rgba(39, 110, 241, .075); --wall-b: rgba(39, 110, 241, .025); --wall-c: rgba(16, 152, 132, .045);
  --ambient-blue: #eaf1ff; --ambient-teal: #edf7f5; --ambient-warm: #fff7eb;
  --focus-ring: #276ef1; --scrim: rgba(12, 25, 47, .48);
  --wa: #087568; --tg: #1764a7;
  --font-latin: 'Plus Jakarta Sans', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-arabic: 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', Tahoma, sans-serif;
  --font-numeric: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font: var(--font-latin);
  --font-heading: var(--font);
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101a2b; --bg2: #101a2b;
  --fg: #eef3fc; --muted: #b5c3d9; --subtle: #a4b4cc; --t3: #a4b4cc;
  --surface: #24334b; --surface-raised: #18263b; --surface-soft: #1d2c43;
  --track: #344761; --line: #354760; --field-line: #7286a5;
  --glass: rgba(24, 38, 59, .98); --glass-line: #354760;
  --glass-shadow: 0 6px 24px rgba(3, 9, 19, .20);
  --shadow-sm: 0 2px 8px rgba(3, 9, 19, .18);
  --shadow-md: 0 10px 32px rgba(3, 9, 19, .30);
  --primary: #dce9ff; --on-primary: #14233f;
  --accent: #276ef1; --on-accent: #ffffff; --accent-text: #94baff; --accent-soft: #203858;
  --pos: #55d7b7; --pos-text: #7ce3c7; --pos-soft: #173e39;
  --warn: #f3c46e; --warn-text: #ffda88; --warn-soft: #423623;
  --neg: #ffa6b4; --neg-soft: #432b3c;
  --success-solid: #087568; --danger-solid: #bf3349; --on-status: #ffffff;
  --card: #18263b; --card-end: #223b61; --on-card: #f7faff;
  --card-muted: #c7d5ec; --card-track: #3c5375; --card-line: #526c93;
  --card-soft: #2b4262; --card-success: #7ce3c7; --card-warning: #ffda88; --card-danger: #ffa6b4;
  --stage: #101a2b; --bezel: #263a58; --paper: #f8faff; --ink: #14233f;
  --wall-a: rgba(39, 110, 241, .12); --wall-b: rgba(39, 110, 241, .04); --wall-c: rgba(148, 186, 255, .025);
  --ambient-blue: #203858; --ambient-teal: #1a353b; --ambient-warm: #352f28;
  --focus-ring: #94baff; --scrim: rgba(3, 9, 19, .68);
  --wa: #087568; --tg: #1764a7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101a2b; --bg2: #101a2b;
    --fg: #eef3fc; --muted: #b5c3d9; --subtle: #a4b4cc; --t3: #a4b4cc;
    --surface: #24334b; --surface-raised: #18263b; --surface-soft: #1d2c43;
    --track: #344761; --line: #354760; --field-line: #7286a5;
    --glass: rgba(24, 38, 59, .98); --glass-line: #354760;
    --glass-shadow: 0 6px 24px rgba(3, 9, 19, .20);
    --shadow-sm: 0 2px 8px rgba(3, 9, 19, .18);
    --shadow-md: 0 10px 32px rgba(3, 9, 19, .30);
    --primary: #dce9ff; --on-primary: #14233f;
    --accent: #276ef1; --on-accent: #ffffff; --accent-text: #94baff; --accent-soft: #203858;
    --pos: #55d7b7; --pos-text: #7ce3c7; --pos-soft: #173e39;
    --warn: #f3c46e; --warn-text: #ffda88; --warn-soft: #423623;
    --neg: #ffa6b4; --neg-soft: #432b3c;
    --success-solid: #087568; --danger-solid: #bf3349; --on-status: #ffffff;
    --card: #18263b; --card-end: #223b61; --on-card: #f7faff;
    --card-muted: #c7d5ec; --card-track: #3c5375; --card-line: #526c93;
    --card-soft: #2b4262; --card-success: #7ce3c7; --card-warning: #ffda88; --card-danger: #ffa6b4;
    --stage: #101a2b; --bezel: #263a58; --paper: #f8faff; --ink: #14233f;
    --wall-a: rgba(39, 110, 241, .12); --wall-b: rgba(39, 110, 241, .04); --wall-c: rgba(148, 186, 255, .025);
    --ambient-blue: #203858; --ambient-teal: #1a353b; --ambient-warm: #352f28;
    --focus-ring: #94baff; --scrim: rgba(3, 9, 19, .68);
    --wa: #087568; --tg: #1764a7;
  }
}

/* Local Tajawal 400/500/700/800 and Jakarta variable: no split Arabic glyphs.
   Inter remains reserved for tabular financial values, independent of the locale. */
html[lang="ar"] { --font: var(--font-arabic); }
html[lang="ur"], html[lang="fa"] { --font: 'Noto Sans Arabic', var(--font-arabic); }
html[lang="hi"], html[lang="ne"] { --font: 'Noto Sans Devanagari', var(--font-latin); }
html[lang="bn"] { --font: 'Noto Sans Bengali', var(--font-latin); }
html[lang="ml"] { --font: 'Noto Sans Malayalam', var(--font-latin); }
body { font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--fg); }
button, input, select, textarea { font-family: var(--font); }
button, summary, a, select { cursor: pointer; }
.num { font-family: var(--font-numeric); font-variant-numeric: lining-nums tabular-nums; }
bdi { unicode-bidi: isolate; }
h1, h2, h3, .h1, .h2, .nav-t, .brand, .sec-t { font-family: var(--font-heading); letter-spacing: 0; }
html[lang="ar"] :is(h1, h2, h3, .h1, .h2, .nav-t, .brand, .lead, .t1) { letter-spacing: 0; }
.h1 { font-size: clamp(30px, 2.8vw, 36px); font-weight: 800; line-height: 1.35; }
.hh .h1 { font-size: clamp(28px, 2.6vw, 34px); }
.h2 { font-size: 21px; font-weight: 700; line-height: 1.5; }
.nav-t { font-size: 25px; font-weight: 700; line-height: 1.45; }
.brand { font-weight: 800; }
.sub, .lead { font-size: 16px; line-height: 1.75; }
.t1, .tl .t1 { font-size: 16px; font-weight: 500; line-height: 1.6; }
.t2, .ctx, .small, .or, .err, .note, .rules { font-size: 14px; line-height: 1.6; }
.sec-t { font-size: 16px; font-weight: 700; line-height: 1.5; }
.plabel, .hh-date, .role-chip, .w-l, .w-s, .fold-no, .fold-note,
.legend, .flag, .sm-k, .sm-s, .hc-s, .g-n, .ws-org, .dayh, .cm-h { font-size: 13px; line-height: 1.55; }
.w-t, .hc-t { font-size: 16px; font-weight: 700; line-height: 1.5; }
.b-l, .catb { font-size: 13px; line-height: 1.4; }
.cm-t, .ov span, .totals span, .cb, .cb-v small { font-size: 14px; line-height: 1.6; }
.b-l { line-clamp: 2; }
.w-num, .sm-v, .g-v, .seqno, .avatar, .kv .tot .k, .kv .tot .v { font-weight: 700; letter-spacing: 0; }
.w-big, .hero-big, .hero-amt, .ap-amt, .fold-c, .pl-amt, .amount-in, .co-amt {
  font-family: var(--font-numeric); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; line-height: 1.25;
}
.amt, .w-num, .sm-v, .g-v, .seqno, .cb-v { font-family: var(--font-numeric); font-variant-numeric: lining-nums tabular-nums; }
.amt { font-size: 15px; line-height: 1.5; }
.cur { color: var(--muted); font-family: var(--font); }
.cb-v small { font-family: var(--font); }

/* Layered glass and clear component hierarchy, retaining every financial layout. */
.glass { background: var(--glass); border-color: var(--glass-line); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.card, .list, .hcard, .apcard, .pcard, .fcard, .goal, .erp, .quote, .kv, .timeline { color: var(--fg); }
.card { padding: 20px; }
.glass.list, .timeline, .erp { border-radius: var(--r-lg); }
.smart { border-color: var(--glass-line); box-shadow: var(--glass-shadow); }
.smart .sm { background: var(--surface-raised); }
.sm { padding-block: 16px; }
.card, .w, .hcard, .apcard, .pcard, .fcard, .goal, .quote, .kv, .timeline, .erp { box-shadow: var(--glass-shadow); }
.w, .hcard { border-radius: var(--r-lg); }
.ico, .w-ic, .sm-ic, .hc-ic { background-color: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 4%, transparent); }
.sec-h { gap: 12px; }
.sec-h .h2 { font-size: 20px; }
.row { min-height: 64px; }
.row.inline { min-height: 44px; }
.items, .cm-b, .co-bank { background-color: var(--surface-soft); }
.note { color: var(--muted); }
.pill, .m3 { font-size: 13px; font-weight: 600; line-height: 1.45; padding-block: 4px; }
.p-returned, .p-pr-new, .p-po-ordered, .p-f-open, .pill.pl-pending,
.b-info, .api-m.get, .calc-hint, .link, .tone-accent .w-ic,
.tone-accent .sm-ic, .sm.tone-accent .sm-ic, .hc-ic, .avatar.r-engineer, .avatar.r-supervisor { color: var(--accent-text); }
.row-links .link { font-size: 14px; }
.tbl { font-size: 14px; line-height: 1.5; }
.tbl th { font-size: 13px; background: var(--surface-soft); font-weight: 700; }
.tbl td { line-height: 1.65; }
.vert, .api-r code, .api-m { font-size: 13px; }
.banner, .allclear { font-size: 14px; line-height: 1.65; }
.checkout { background: var(--surface-raised); color: var(--fg); border-color: var(--line); box-shadow: var(--shadow-md); }
.checkout .t2, .co-amt span, .co-secure { color: var(--muted); }
.co-secure { font-size: 13px; line-height: 1.55; }
.co-logo, .co-m { background: var(--primary); color: var(--on-primary); }
.co-m:nth-child(n+2) { background: var(--surface); color: var(--fg); }
.co-bank .btn { background: var(--surface-raised); color: var(--fg); }
.co-done { color: var(--pos-text); } .co-done.bad { color: var(--warn-text); }

/* Keep messaging and legacy alert badges semantic, including auto dark mode. */
.wa-ic, .iconbtn.wa { background: var(--pos-soft); color: var(--pos-text); }
:root .wa-bubble, :root[data-theme] .wa-bubble, :root:not([data-theme="light"]) .wa-bubble { background: var(--pos-soft); color: var(--fg); box-shadow: var(--shadow-sm); }
.nbadge, .tl.done.bad .dot { background: var(--danger-solid); color: var(--on-status); }
.glass .w-big .cur { color: var(--muted); }

/* Balance surfaces always retain their own high-contrast foreground in either theme. */
.hero, .hero.save { background: linear-gradient(135deg, var(--card), var(--card-end)); color: var(--on-card); box-shadow: var(--shadow-md); }
.hero::after { content: none; animation: none; }
.w-dark, .fold { background: var(--card); color: var(--on-card); box-shadow: var(--shadow-md); }
.hero-l, .hero-cap, .hero-stats span, .hero-big .cur,
.hero .t2, .hero .sub, .hero .cur, .w-dark .cur, .w-dark .w-l, .w-dark .w-s,
.fold .cur, .fold .sub, .fold .t2 { color: var(--card-muted); }
.hero-l, .hero-cap, .hero-stats span, .w-stats div { font-size: 13px; line-height: 1.5; }
.hero-big .cur { font-size: 15px; font-family: var(--font); }
.hero-stats { border-color: var(--card-line); }
.hero-stats b, .hl-row, .hl-row b, .hero .avatar { color: var(--on-card); }
.hero-chip, .hl-row, .hero .avatar, .w-go { background: var(--card-soft); color: var(--on-card); }
.hero-chip { font-size: 13px; line-height: 1.5; }
.hl-row .grow { color: var(--card-muted); }
.hero-cta { background: var(--accent); color: var(--on-accent); font-size: 14px; }
.hero .pos, .w-dark .pos, .fold .pos { color: var(--card-success); }
.hero .neg, .w-dark .neg, .fold .neg { color: var(--card-danger); }
.w-accent { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-md); }
.w-accent .w-l, .w-accent .cur, .w-accent .w-big .cur { color: var(--on-accent); }
.slots i.s-withdrawn, .legend i.s-withdrawn { background: repeating-linear-gradient(45deg, var(--card-muted) 0 2px, transparent 2px 5px); outline-color: var(--card-muted); }
.fold .p-f-closed { background: var(--card-soft); color: var(--card-muted); }

/* Consistent controls, native pressed/disabled states and a strong keyboard ring. */
.btn { min-height: 50px; font-size: 16px; font-weight: 700; line-height: 1.5; border-radius: 14px; box-shadow: var(--shadow-sm); }
.btn-sm, .btn-text { height: auto; min-height: 44px; font-size: 14px; }
.btn-text { box-shadow: none; }
button:disabled { cursor: not-allowed; }
.iconbtn:disabled, .chip:disabled, .seg button:disabled, .mini-seg button:disabled, .hcard:disabled { opacity: .55; box-shadow: none; }
.btn-glass { color: var(--fg); border-color: var(--glass-line); }
.btn-neg-solid, .btn-gave, .cb-out, .toast.bad { background: var(--danger-solid); color: var(--on-status); }
.btn-got, .cb-in { background: var(--success-solid); color: var(--on-status); }
.btn:disabled, .wrapseg button:disabled, .calc-v .chip:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
.iconbtn, .iconbtn.sm, .round { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.iconbtn { color: var(--fg); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); }
.iconbtn.send { color: var(--on-accent); }
.iconbtn.sm { border-color: transparent; box-shadow: none; }
.langsel, .fsel { height: auto; min-height: 44px; font-size: 14px; }
.langsel select, .fsel select { font-size: 14px; min-height: 40px; }
select option { background: var(--surface-raised); color: var(--fg); }
.chip { min-height: 44px; padding-block: 10px; font-size: 14px; line-height: 1.6; }
.seg { background: var(--surface-soft); border-color: var(--glass-line); }
.seg button, .mini-seg button { min-height: 44px; font-size: 14px; line-height: 1.5; }
.seg button[aria-selected="true"], .chip[aria-pressed="true"], .catb.on { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.mini-seg button[aria-pressed="true"] { background: var(--surface-raised); color: var(--fg); box-shadow: var(--shadow-sm); }
.catb, .org-b, .org-tg, .pcb, .hero-cta, .hero-chip.btnish, .hl-row, .faq summary { min-height: 44px; }
.org-tg { width: 44px; }
.fld { font-size: 15px; font-weight: 500; line-height: 1.5; }
.fld input, .fld select, textarea, .cm-in input { min-height: 48px; font-size: 16px; font-weight: 400; background-color: var(--surface-raised); border-color: var(--field-line); }
.fld input:focus, .fld select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.fld select { padding-inline-end: 32px; }
.fld.low input, .items.low { border-color: var(--warn-text); }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
.fld input[aria-invalid="true"], .fld select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--neg); background-color: var(--neg-soft); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface); color: var(--muted); cursor: not-allowed; }
.search { min-height: 48px; border-color: var(--field-line); }
.search input { font-size: 16px; min-height: 44px; }
.radio, .cbx { border-color: var(--field-line); }
.radio.on { border-color: var(--accent); }
.switch { background: var(--field-line); }
.switch::after { background: var(--on-status); box-shadow: var(--shadow-sm); }
.switch.on { background: var(--success-solid); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.langsel:focus-within, .fsel:focus-within, .search:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.amount-in:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

/* Navigation and overlays: appearance only, original placement is untouched. */
.dock { background: var(--glass); border-color: var(--glass-line); box-shadow: var(--shadow-md); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tab { min-height: 56px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.tab span { white-space: normal; overflow-wrap: anywhere; }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.scrim { background: var(--scrim); }
.sheet { background: var(--surface-raised); color: var(--fg); border-top: 1px solid var(--glass-line); box-shadow: var(--shadow-md); }
.toast { font-size: 15px; line-height: 1.6; box-shadow: var(--shadow-md); }
.calc-pad { background: var(--card); color: var(--on-card); }
.calc-r, .calc-bs { color: var(--card-muted); }
.calc-bs { width: 44px; height: 44px; }
.ck { background: var(--card-track); color: var(--on-card); min-height: 44px; }
.ck.fn { background: var(--card-muted); color: var(--ink); }
.ck.op { background: var(--accent); color: var(--on-accent); }

/* Remove prototype drift/entrance motion; short feedback never changes geometry. */
.lb, .view.enter-fwd > *, .view.enter-back > *, .view.enter-tab > *,
.view.enter-fwd .glass, .view.enter-tab .glass, .view.enter-fwd .hero,
.view.enter-tab .hero, .view.enter-tab .bubble, .scrim.fresh, .scrim.fresh .sheet, .toast { animation: none; }
.btn, .row, .row-b, .bubble, .hero, .w, .pcard, .goal, .sm, .hcard, .sup-c,
.co-m, .ck, .chip, .iconbtn, .tab, .seg button, .mini-seg button {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.btn:active:not(:disabled), .pcard:active, .goal:active, .sup-c:active, .co-m:active,
.ck:active, .iconbtn:active, .hero:active:not(.static), .bubble:active .b-ic { transform: none; }
.ck:active { filter: none; }
.btn:active:not(:disabled), .iconbtn:active:not(:disabled), .hero:active:not(.static),
.chip:active:not(:disabled), .co-m:active, .ck:active { box-shadow: inset 0 0 0 2px var(--focus-ring); }
button.row:active, .row-b:active, .hcard:active, .pcard:active, .goal:active,
.seg button:active:not(:disabled), .mini-seg button:active:not(:disabled) { background-color: var(--accent-soft); }
@media (hover: hover) {
  button.row:hover { background: var(--surface-soft); }
  .pcard:hover, .goal:hover, .sup-c:hover, .erp:hover, .hcard:hover { box-shadow: var(--shadow-md); }
  .btn:hover:not(:disabled), .iconbtn:hover:not(:disabled) { box-shadow: var(--shadow-md); }
  .link:hover { text-decoration: underline; text-underline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
