/* ماپت — design system (see design-system/maapet-pos/MASTER.md override) */
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #F4F6FA; --surface: #FFFFFF; --surface-2: #EEF2F7; --border: #D9E0EA; --divider: #E6EBF2;
  --text: #0F172A; --text-2: #475569; --text-3: #64748B;
  --primary: #1C49C2; --primary-soft: #E8EEFF; --on-primary: #FFFFFF; --primary-hover: #163B9E;
  --success: #15803D; --success-soft: #DCFCE7; --warning: #B45309; --warning-soft: #FEF3C7;
  --danger: #B91C1C; --danger-soft: #FEE2E2; --info: #0E7490; --info-soft: #CFFAFE; --accent: #EA580C;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06); --shadow-md: 0 4px 12px rgba(15,23,42,.08); --shadow-lg: 0 12px 32px rgba(15,23,42,.16);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --fs: 14px; --nav-w: 232px; --tabbar-h: 64px;
  --t-fast: 150ms; --t-med: 220ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220; --surface: #121B2E; --surface-2: #182338; --border: #263349; --divider: #1E2A40;
    --text: #E5EAF3; --text-2: #A7B3C6; --text-3: #8391A8;
    --primary: #7C9BFF; --primary-soft: #1B2A55; --on-primary: #0B1220; --primary-hover: #99B1FF;
    --success: #4ADE80; --success-soft: #14321F; --warning: #FBBF24; --warning-soft: #3A2A0A;
    --danger: #F87171; --danger-soft: #3F1515; --info: #67E8F9; --info-soft: #0B2F36; --accent: #FB923C;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 4px 12px rgba(0,0,0,.45); --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1220; --surface: #121B2E; --surface-2: #182338; --border: #263349; --divider: #1E2A40;
  --text: #E5EAF3; --text-2: #A7B3C6; --text-3: #8391A8;
  --primary: #7C9BFF; --primary-soft: #1B2A55; --on-primary: #0B1220; --primary-hover: #99B1FF;
  --success: #4ADE80; --success-soft: #14321F; --warning: #FBBF24; --warning-soft: #3A2A0A;
  --danger: #F87171; --danger-soft: #3F1515; --info: #67E8F9; --info-soft: #0B2F36; --accent: #FB923C;
  color-scheme: dark;
}
@media (max-width: 899px) { :root { --fs: 16px; } }
@media (prefers-reduced-motion: reduce) { :root { --t-fast: 0ms; --t-med: 0ms; } *, *::before, *::after { animation: none !important; transition: none !important; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; line-height: 1.55; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 26px; height: 26px; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: .86rem; } .tiny { font-size: .78rem; }
.bold { font-weight: 700; } .med { font-weight: 500; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.pos { color: var(--success); } .neg { color: var(--danger); } .warn { color: var(--warning); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hide-mobile { } .hide-desktop { display: none !important; }
@media (max-width: 899px) { .hide-mobile { display: none !important; } .hide-desktop { display: initial !important; } .hide-desktop.row { display: flex !important; } }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.nav { position: fixed; inset-inline-start: 0; top: 0; bottom: 0; width: var(--nav-w); background: var(--surface); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; font-weight: 700; font-size: 1.1rem; }
.nav .brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.nav .items { flex: 1; overflow: auto; padding: 4px 8px; }
.nav a.item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; margin-bottom: 2px; transition: background var(--t-fast), color var(--t-fast); min-height: 40px; }
.nav a.item:hover { background: var(--surface-2); color: var(--text); }
.nav a.item.active { background: var(--primary-soft); color: var(--primary); }
.nav .item .badge { margin-inline-start: auto; }
.nav .sect { font-size: .74rem; color: var(--text-3); padding: 12px 12px 4px; font-weight: 500; letter-spacing: .02em; }
.nav .foot { padding: 10px 12px; border-top: 1px solid var(--divider); font-size: .84rem; }
.main { flex: 1; padding-inline-start: var(--nav-w); display: flex; flex-direction: column; min-height: 100dvh; }
.page { padding: 20px 24px 40px; max-width: 1400px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.3rem; }
.tabbar { display: none; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-2); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status-pill .dot.on { background: var(--success); } .status-pill .dot.off { background: var(--danger); }
@media (max-width: 899px) {
  .nav { display: none; }
  .main { padding-inline-start: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .page { padding: 12px 14px 24px; }
  .page-head { margin-bottom: 12px; }
  .tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); z-index: 30; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: .7rem; font-weight: 500; min-height: 44px; position: relative; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a .ic { width: 24px; height: 24px; }
  .tabbar a .badge { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); }
}
.topbar-mobile { display: none; }
@media (max-width: 899px) { .topbar-mobile { display: flex; align-items: center; gap: 8px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 15; } }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.card.pad { padding: 16px; }
.card .card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--divider); font-weight: 700; }
.card .card-body { padding: 16px; }
.grid { display: grid; gap: 12px; }
.grid.kpi { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 899px) { .grid.two, .grid.three { grid-template-columns: 1fr; } .grid.kpi { grid-template-columns: 1fr 1fr; gap: 8px; } .kpi-tile .value { font-size: 1.02rem; } .kpi-tile { padding: 12px; } }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-height: 84px; }
.kpi-tile .label { font-size: .8rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-tile .value { font-size: 1.25rem; font-weight: 700; }
.kpi-tile .sub { font-size: .78rem; color: var(--text-3); }
.kpi-tile.accent { border-color: var(--primary); background: var(--primary-soft); }
.empty { text-align: center; color: var(--text-3); padding: 40px 16px; }
.empty .ic { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--divider) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 6px; height: 14px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--r-sm); padding: 0 14px; min-height: 40px; font-weight: 500; background: var(--surface-2); color: var(--text); transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); white-space: nowrap; }
.btn:hover { background: var(--divider); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); } .btn.primary:hover { background: var(--primary-hover); }
.btn.success { background: var(--success); color: #fff; } .btn.success:hover { filter: brightness(.95); }
.btn.danger { background: var(--danger-soft); color: var(--danger); } .btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); } .btn.ghost:hover { background: var(--surface-2); }
.btn.link { background: transparent; color: var(--primary); padding: 0 6px; min-height: 32px; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: .86rem; } .btn.lg { min-height: 48px; font-size: 1.05rem; padding: 0 20px; }
.btn.icon { padding: 0; width: 40px; } .btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
@media (max-width: 899px) { .btn { min-height: 44px; } .btn.sm { min-height: 36px; } .btn.icon { width: 44px; } .btn.icon.sm { width: 36px; } }
.btn:focus-visible, .input:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: .84rem; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: .76rem; color: var(--text-3); } .field .err { font-size: .78rem; color: var(--danger); }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
.input.invalid { border-color: var(--danger); }
.input.num { direction: ltr; text-align: left; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; padding-inline-start: 30px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .ic { position: absolute; inset-inline-start: 10px; color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-inline-start: 36px; }
.input-wrap .suffix { position: absolute; inset-inline-end: 10px; color: var(--text-3); font-size: .8rem; pointer-events: none; }
@media (max-width: 899px) { .input, select.input { min-height: 44px; font-size: 16px; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; color: var(--text-2); font-weight: 500; min-height: 32px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid .span2 { grid-column: 1 / -1; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 500; border: 1px solid transparent; white-space: nowrap; min-height: 30px; }
.chip.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.chip.success { background: var(--success-soft); color: var(--success); } .chip.warning { background: var(--warning-soft); color: var(--warning); }
.chip.danger { background: var(--danger-soft); color: var(--danger); } .chip.info { background: var(--info-soft); color: var(--info); }
button.chip { cursor: pointer; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; }
.badge.primary { background: var(--primary); }

/* ---------- table / list ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; font-weight: 500; color: var(--text-2); font-size: .8rem; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl td.n, .tbl th.n { text-align: end; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); }
@media (max-width: 899px) { .tbl td, .tbl th { padding: 10px 10px; } }
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--divider); min-height: 52px; background: var(--surface); }
.list .li:last-child { border-bottom: 0; }
.list .li.click { cursor: pointer; } .list .li.click:hover { background: var(--surface-2); }
.list .li .t { font-weight: 500; } .list .li .s { font-size: .8rem; color: var(--text-3); }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; gap: 16px; height: calc(100dvh - 40px); }
.pos .products { display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.pos .products .plist { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.pos .cart { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.pos .cart .lines { flex: 1; overflow: auto; }
.pos .cart .totals { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.pos .cart .totals .grand { font-size: 1.25rem; font-weight: 700; display: flex; justify-content: space-between; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--divider); cursor: pointer; min-height: 48px; }
.prow:hover { background: var(--surface-2); } .prow:active { background: var(--primary-soft); }
.prow .thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-2); object-fit: cover; flex: none; display: grid; place-items: center; color: var(--text-3); }
.prow .title { font-weight: 500; } .prow .meta { font-size: .78rem; color: var(--text-3); }
.prow .price { font-weight: 700; white-space: nowrap; }
.prow.out { opacity: .55; }
.cline { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--divider); }
.cline .qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.cline .qty button { border: 0; background: var(--surface-2); width: 34px; height: 34px; display: grid; place-items: center; }
.cline .qty input { width: 48px; text-align: center; border: 0; height: 34px; background: var(--surface); }
@media (max-width: 899px) { .cline .qty button { width: 40px; height: 40px; } .cline .qty input { height: 40px; } }
.cartbar { position: fixed; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); inset-inline: 12px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-md); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); z-index: 25; min-height: 52px; }
@media (max-width: 899px) { .pos { display: flex; flex-direction: column; height: auto; gap: 8px; } .pos .products .plist { border: 0; background: transparent; max-height: none; } .pos .cart.desktop { display: none; } }
.paykey { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paykey button { min-height: 44px; }
.total-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.total-line.big { font-size: 1.3rem; font-weight: 700; }

/* ---------- sheet / modal ---------- */
.sheet-bd { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade var(--t-fast) ease; }
.sheet { background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%); max-height: 90dvh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop var(--t-med) ease; }
.sheet.wide { width: min(880px, 100%); }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--divider); }
.sheet .sheet-body { padding: 16px 18px; overflow: auto; flex: 1; }
.sheet .sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--divider); }
@media (max-width: 899px) {
  .sheet-bd { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; animation: up var(--t-med) ease; }
  .sheet .sheet-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .sheet .sheet-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toasts { position: fixed; top: 16px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
@media (max-width: 899px) { .toasts { top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 72px); } }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; animation: pop var(--t-med) ease; font-size: .92rem; }
.toast.success { background: var(--success); color: #fff; } .toast.error { background: var(--danger); color: #fff; } .toast.warning { background: var(--warning); color: #fff; }
.banner { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: .86rem; }
.banner.warning { background: var(--warning-soft); color: var(--warning); } .banner.danger { background: var(--danger-soft); color: var(--danger); } .banner.info { background: var(--info-soft); color: var(--info); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--primary-soft), var(--bg) 60%); }
.login .card { width: min(400px, 100%); padding: 28px 24px; }
.login .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; margin: 0 auto 12px; }

/* ---------- scanner ---------- */
.scanner { position: fixed; inset: 0; background: #000; z-index: 70; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 20% 12%; border: 2px solid rgba(255,255,255,.8); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.scanner .bar { position: absolute; top: env(safe-area-inset-top); inset-inline: 0; display: flex; justify-content: space-between; padding: 12px 16px; color: #fff; }
.scanner .bar .btn { background: rgba(255,255,255,.15); color: #fff; }
.scanner .msg { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); inset-inline: 0; text-align: center; color: #fff; font-size: .9rem; }

/* ---------- misc ---------- */
.jcal { position: absolute; z-index: 45; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 10px; width: 280px; top: calc(100% + 4px); inset-inline-start: 0; }
.jcal .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.jcal .grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jcal .grid7 .wd { font-size: .7rem; color: var(--text-3); padding: 4px 0; }
.jcal .grid7 button { border: 0; background: transparent; border-radius: 6px; min-height: 32px; font-size: .86rem; }
.jcal .grid7 button:hover { background: var(--surface-2); } .jcal .grid7 button.sel { background: var(--primary); color: var(--on-primary); } .jcal .grid7 button.today { border: 1px solid var(--primary); }
.jcal .grid7 button.fri { color: var(--danger); }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.divider { height: 1px; background: var(--divider); margin: 8px 0; }
.print-only { display: none; }
@media print { body { background: #fff; } .nav, .tabbar, .topbar-mobile, .cartbar, .toasts, .no-print { display: none !important; } .main { padding: 0; } .page { padding: 0; } .print-only { display: block; } }
.receipt-preview { font-family: 'Vazirmatn', monospace; width: 300px; background: #fff; color: #000; padding: 12px; border: 1px dashed var(--border); margin: 0 auto; font-size: 12px; }
.receipt-preview .c { text-align: center; } .receipt-preview .l { display: flex; justify-content: space-between; gap: 6px; } .receipt-preview hr { border: 0; border-top: 1px dashed #999; margin: 6px 0; }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--divider); }
.tree .node.l1 { font-weight: 700; background: var(--surface-2); } .tree .node.l2 { font-weight: 500; padding-inline-start: 24px; } .tree .node.l3 { padding-inline-start: 44px; } .tree .node.l4 { padding-inline-start: 64px; font-size: .9rem; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; } .progress > div { height: 100%; background: var(--primary); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
