/* PSTRAK dashboards (shopper app + platform owner).
   Calm and precise: light grey canvas, white cards, hairlines, black primary, orange only as a tiny accent.
   Every class from v1 is kept (the platform page uses them); new ones are added below each section. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --ink: #1A1A1A;
  --ink-2: #303030;
  --muted: #6D7175;
  --faint: #8A8D91;
  --line: #E3E3E3;
  --line-2: #D4D4D4;
  --bg: #F1F1F1;
  --bg-2: #F7F7F7;
  --card: #FFFFFF;
  --hover: #F3F3F3;
  --pill: #EBEBEB;
  --accent: #FF6A3D;
  --accent-soft: #FFF1EC;
  --ok: #0C7A43;
  --ok-soft: #E4F5EB;
  --warn: #8A5A00;
  --warn-soft: #FFF3D6;
  --bad: #C4271A;
  --bad-soft: #FDEBEA;
  --info: #1F5199;
  --info-soft: #EAF1FC;
  --violet: #5B3FB0;
  --violet-soft: #F0ECFB;
  --r: 12px;
  --r-sm: 8px;
  --r-xs: 6px;
  --shadow-pop: 0 1px 2px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.12);
  --latin: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --font: var(--latin), 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', var(--latin), system-ui, sans-serif;
  --sb-w: 240px;
  --top-h: 56px;
  --tab-h: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[dir=rtl] body, body[dir=rtl] { font-family: var(--font-ar); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
svg { flex: none; }
.num, .money { font-variant-numeric: tabular-nums; }
.amt { unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }
[dir=rtl] .stat .v { direction: ltr; text-align: right; }
.ltr { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] .ltr { text-align: end; }
.nowrap { white-space: nowrap; }
::selection { background: #FFE2D7; }

/* ── layout (v1 classes) ── */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg-2); color: var(--ink); padding: 14px 10px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; border-inline-end: 1px solid var(--line); }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; }
.side .brand b { font-weight: 800; letter-spacing: .6px; font-size: 15px; font-family: var(--latin), sans-serif; }
.side .shopname { font-size: 12px; color: var(--muted); padding: 0 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 34px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.side a.nav:hover { background: var(--hover); color: var(--ink); }
.side a.nav.on { background: var(--pill); color: var(--ink); font-weight: 600; }
.side a.nav .ic { width: 18px; display: inline-flex; justify-content: center; color: var(--muted); }
.side a.nav.on .ic { color: var(--ink); }
.side a.nav .ic svg { width: 18px; height: 18px; }
.side .spacer { flex: 1; }
.side .foot { font-size: 12px; color: var(--muted); padding: 10px 10px 2px; border-top: 1px solid var(--line); }
.side .sec-t { font-size: 11px; font-weight: 600; color: var(--faint); padding: 14px 10px 4px; }
.main { padding: 24px 32px 64px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.top .back { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: #fff; text-decoration: none; margin-inline-end: 10px; color: var(--ink-2); }
.top .back:hover { background: var(--hover); }
[dir=rtl] .top .back svg, [dir=rtl] .flip { transform: scaleX(-1); }
.top .ttl { display: flex; align-items: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 14px; }
.right { text-align: end; }
.center { text-align: center; }

/* ── shell: top bar, sidebar, bottom tabs (new) ── */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.shell > .side { height: 100vh; }
.shell .content { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(241,241,241,.88); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.topbar .tb-shop { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.topbar .tb-shop .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.topbar .tb-brand { display: none; align-items: center; gap: 8px; }
.topbar .tb-brand b { font-weight: 800; letter-spacing: .6px; font-family: var(--latin), sans-serif; }
.usr { position: relative; }
.usr-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
[dir=rtl] .usr-btn { padding: 0 4px 0 10px; }
.usr-btn:hover { background: var(--hover); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.menu-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; z-index: 60; }
.menu-pop .mh { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop .mh b { display: block; }
.menu-pop button, .menu-pop a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-xs); cursor: pointer; text-align: start; text-decoration: none; font-size: 13px; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--hover); }
.menu-pop .danger { color: var(--bad); }
.menu-pop svg { width: 16px; height: 16px; color: var(--muted); }
.menu-pop .danger svg { color: var(--bad); }
.tabbar { display: none; }
.demo-bar { background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; text-align: center; flex-wrap: wrap; }
.demo-bar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.demo-bar a { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.page { padding: 24px 32px 72px; width: 100%; max-width: 1240px; margin: 0 auto; }
.page.narrow { max-width: 760px; }

/* ── cards ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.card.flush { padding: 0; overflow: hidden; }
.card .card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 50px; }
.card .card-h h2 { margin: 0; }
.card .card-f { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg-2); }
.card.soft { background: var(--bg-2); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 4px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; letter-spacing: 0; }
.stat .h { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.dark .k, .stat.dark .h, .stat.dark .v small { color: #B5B5B5; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,.04); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 44px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.wa { background: #1DA851; border-color: #1DA851; color: #fff; }
.wa:hover { background: #178F44 !important; }

/* ── forms ── */
label.f { display: block; min-width: 0; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
label.f > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.in, select.in, textarea.in { width: 100%; height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; padding: 0 11px; outline: none; transition: border-color .12s, box-shadow .12s; font-size: 14px; }
select.in { padding-inline-end: 28px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%236D7175' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
[dir=rtl] select.in { background-position: left 10px center; }
textarea.in { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.in:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,26,26,.08); }
.in.err { border-color: var(--bad); }
.in[disabled] { background: var(--bg-2); color: var(--muted); }
.ferr { color: var(--bad); font-size: 12px; margin-top: 4px; }
.form { display: grid; gap: 12px; }
.form.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
.fsec { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-block-start: 14px; display: flex; justify-content: space-between; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 2px; background: #fff; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 0 10px; height: 26px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.seg.light button.on { background: var(--pill); color: var(--ink); }
.search { position: relative; }
.search .in { padding-inline-start: 34px; }
.search::before { content: ''; position: absolute; inset-inline-start: 11px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236D7175' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.toggle { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle i { position: absolute; inset: 0; background: #D0D0D0; border-radius: 999px; transition: background .15s; cursor: pointer; }
.toggle i::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: inset-inline-start .15s; }
.toggle input:checked + i { background: var(--ok); }
.toggle input:checked + i::after { inset-inline-start: 18px; }
.toggle input:disabled + i { opacity: .5; cursor: default; }
.input-add { display: flex; align-items: stretch; }
.input-add .in { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-add .sfx { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-inline-start: 0; border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); background: var(--bg-2); color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ── tables ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--bg-2); }
.tbl .num { text-align: end; }
.tbl td.min { width: 1%; white-space: nowrap; }
.tbl .t1 { font-weight: 600; }
.tbl .t2 { font-size: 12px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }

/* ── badges: soft tinted pills ── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--pill); color: var(--ink-2); white-space: nowrap; line-height: 1; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.plain::before { display: none; }
.b-requested { background: #E8E8E8; color: #454545; }
.b-purchased { background: var(--info-soft); color: var(--info); }
.b-in_transit { background: var(--violet-soft); color: var(--violet); }
.b-arrived { background: var(--warn-soft); color: var(--warn); }
.b-out_for_delivery { background: var(--accent-soft); color: #B4401A; }
.b-delivered { background: var(--ok-soft); color: var(--ok); }
.b-cancelled { background: var(--bad-soft); color: var(--bad); }
.b-trial { background: var(--info-soft); color: var(--info); }
.b-active { background: var(--ok-soft); color: var(--ok); }
.b-trial_ended, .b-expired { background: var(--warn-soft); color: var(--warn); }
.b-suspended, .b-cancelled, .b-rejected { background: var(--bad-soft); color: var(--bad); }
.b-new { background: var(--accent-soft); color: #B4401A; }
.b-contacted { background: var(--info-soft); color: var(--info); }
.b-approved { background: var(--ok-soft); color: var(--ok); }
.b-off { background: #EFEFEF; color: var(--muted); }
.b-owner { background: var(--ink); color: #fff; }

/* ── iOS-style grouped lists (new) ── */
.group { margin-bottom: 22px; }
.group > .gt { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px 6px; display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.group > .gf { font-size: 12px; color: var(--muted); padding: 6px 4px 0; }
.glist { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gr { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; text-decoration: none; color: inherit; position: relative; background: #fff; border: 0; width: 100%; text-align: start; font-size: 14px; }
.gr + .gr::before { content: ''; position: absolute; top: 0; inset-inline: 16px 0; height: 1px; background: var(--line); }
a.gr, button.gr { cursor: pointer; }
a.gr:hover, button.gr:hover { background: var(--bg-2); }
.gr .gi { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; }
.gr .gi svg { width: 17px; height: 17px; }
.gr .gl { flex: 1; min-width: 0; }
.gr .gl b { font-weight: 500; display: block; }
.gr .gl small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr .gv { color: var(--muted); font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.gr .chev { color: #B5B5B5; display: inline-flex; }
.gr .chev svg { width: 16px; height: 16px; }
[dir=rtl] .gr .chev svg { transform: scaleX(-1); }
.gr.danger, .gr.danger b { color: var(--bad); }
.gr.off .gl b { color: var(--muted); }

/* ── modal & toast ── */
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.38); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 24px; z-index: 50; overflow-y: auto; animation: fin .15s ease; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 540px; padding: 20px 22px; box-shadow: 0 24px 64px rgba(0,0,0,.22); animation: min .18s ease; }
.modal.wide { max-width: 820px; }
.modal h2 { margin: 0 0 16px; font-size: 17px; font-weight: 650; letter-spacing: -.1px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal .mhd { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.modal .mhd h2 { margin: 0; }
@keyframes fin { from { opacity: 0; } }
@keyframes min { from { opacity: 0; transform: translateY(8px) scale(.99); } }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
[dir=rtl] #toast { transform: translateX(-50%); }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: tin .2s ease; font-size: 13px; }
.toast.bad { background: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ── misc ── */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty .ei { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); margin-bottom: 10px; }
.empty .ei svg { width: 22px; height: 22px; }
.banner { border-radius: var(--r); padding: 10px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; font-weight: 500; font-size: 13px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--info-soft); color: var(--info); }
.pill-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tabs button { border: 0; background: transparent; border-radius: var(--r-sm); padding: 0 12px; height: 30px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pill-tabs button:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.pill-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line-2), 0 1px 0 rgba(0,0,0,.04); }
.pill-tabs button .c { opacity: .6; margin-inline-start: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--bg); object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; font-size: 12px; border: 1px solid var(--line); }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--latin), sans-serif; font-weight: 800; font-size: 12px; letter-spacing: -.4px; position: relative; flex: none; }
.logo-mark::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); right: 4px; bottom: 6px; }
.logo-mark.dark { background: var(--ink); color: #fff; }
.logo-mark.lg { width: 40px; height: 40px; font-size: 15px; border-radius: 10px; }
.logo-mark.lg::after { width: 5px; height: 5px; right: 6px; bottom: 9px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 60px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--bg); font-size: 12px; font-weight: 500; color: var(--ink-2); }
.mobile-top { display: none; }
.totals .r { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.totals .r.t { font-weight: 650; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.totals .r.due { color: var(--accent); font-weight: 650; }
.totals .r.sub { color: var(--muted); font-size: 13px; }
.mono-pw { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 24px; letter-spacing: 3px; font-weight: 600; text-align: center; padding: 16px; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--r); direction: ltr; user-select: all; }

/* ── responsive ── */
@media (max-width: 1100px) {
  .main, .page { padding-inline: 20px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app, .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  [dir=rtl] .side { transform: translateX(100%); }
  .side.open { transform: none !important; }
  .shell > .side { display: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #fff; color: var(--ink); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
  .main { padding: 16px 14px 90px; }
  .page { padding: 16px 14px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 14px; background: rgba(255,255,255,.92); }
  .usr-btn .unm { display: none; }
  .usr-btn { padding: 0 3px !important; border: 0; background: transparent; }
  .g3, .split, .form.cols, .form.cols3 { grid-template-columns: 1fr; }
  .form.cols.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl .hide-m { display: none; }
  .tbl td, .tbl th { padding-inline: 12px; }
  .top h1 { font-size: 18px; }
  .top > .row { width: 100%; }
  .top > .row .btn { flex: 1 1 auto; }
  .stat .v { font-size: 19px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 35; background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); text-decoration: none; color: var(--faint); font-size: 10.5px; font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); }
  .modal { padding: 18px 16px; border-radius: 16px; }
  .overlay { padding: 4vh 10px 20px; }
  #toast { bottom: calc(var(--tab-h) + 18px); }
}
