:root {
  --bg: #f8f5ef; --card: #fff; --ink: #1f1a24; --muted: #7d7585; --line: #e8e1d5;
  --plum: #4a2545; --plum-2: #6b3a64; --gold: #b8903d; --gold-soft: #f4ead2;
  --ok: #2f7d5b; --warn: #c27c0e; --bad: #b3392f;
  --radius: 12px; --shadow: 0 1px 2px rgba(40,20,40,.06), 0 4px 14px rgba(40,20,40,.06);
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .right { text-align: right; } .center { text-align: center; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.stack > * + * { margin-top: 10px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---- buttons / inputs */
.btn { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: .12s; white-space: nowrap; }
.btn:hover { border-color: var(--plum-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--plum); color: #fff; border-color: var(--plum); }
.btn.primary:hover { background: var(--plum-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e7c3bf; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { padding: 14px 20px; font-size: 16px; font-weight: 600; border-radius: 12px; }
.btn.block { width: 100%; }
input, select, textarea { border: 1px solid var(--line); background: #fff; padding: 8px 10px; border-radius: 9px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.field { margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--gold-soft); color: #7a5a14; }
.chip.ok { background: #dff1e8; color: var(--ok); } .chip.bad { background: #f6dcd8; color: var(--bad); } .chip.warn { background: #fbecd0; color: var(--warn); } .chip.grey { background: #eee9f0; color: #5d5566; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; }
.seg button.on { background: var(--plum); color: #fff; }

/* ---- shell */
.shell { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 8px 18px; background: var(--plum); color: #fff; }
.brand { font-family: var(--serif); font-size: 24px; display: flex; align-items: center; gap: 10px; }
.brand small { font: 11px system-ui; letter-spacing: .15em; text-transform: uppercase; color: #e7d3a2; display: block; margin-top: -4px; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: #e9dff0; text-decoration: none; padding: 8px 14px; border-radius: 8px; }
.nav a:hover { background: rgba(255,255,255,.1); } .nav a.on { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 -2px var(--gold); }
.topbar .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.shiftchip { cursor: pointer; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.12); font-size: 13px; }
.shiftchip.warn { background: rgba(251, 191, 36, .25); color: #fde68a; }
.shiftchip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #f08a80; } .shiftchip.open i { background: #6fe0a4; }
main { flex: 1; overflow: auto; padding: 16px 18px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 30px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 14px; }

/* ---- tables */
table { width: 100%; border-collapse: collapse; background: #fff; }
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #fbf9f4; }
tr:last-child td { border-bottom: 0; } tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: #fcf8ee; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- login */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #6b3a64 0, #3a1a36 60%); padding: 20px; }
.login-card { background: #fffdf8; width: 380px; max-width: 100%; border-radius: 18px; padding: 28px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h1 { font-size: 36px; color: var(--plum); } .login-card .sub { color: var(--muted); margin: 2px 0 18px; letter-spacing: .15em; text-transform: uppercase; font-size: 11px; }
.users { display: grid; gap: 8px; } .users button { padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: flex; justify-content: space-between; }
.users button:hover { border-color: var(--gold); background: var(--gold-soft); }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 14px 0; } .pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--plum); } .pin-dots i.f { background: var(--plum); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .keypad button { padding: 14px; font-size: 20px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; } .keypad button:hover { background: var(--gold-soft); }

/* ---- POS */
.pos { display: grid; grid-template-columns: 1fr 400px; gap: 16px; height: 100%; min-height: 0; align-content: stretch; }
.pos > #shift-banner { grid-column: 1 / -1; }
.catalog { display: flex; flex-direction: column; min-height: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .search { flex: 1; min-width: 200px; } .filters select { width: auto; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; overflow: auto; padding: 2px 4px 20px 2px; align-content: start; }
.pcard { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.pcard .top { display: flex; gap: 10px; align-items: center; }
.pcard .brand-n { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.pcard .name { font-family: var(--serif); font-size: 20px; line-height: 1.1; }
.pcard .meta { font-size: 12px; color: var(--muted); }
.vlist { display: grid; gap: 5px; margin-top: 4px; }
.vbtn { display: flex; justify-content: space-between; align-items: center; padding: 6px 9px; border: 1px solid var(--line); background: #fcfaf6; border-radius: 8px; cursor: pointer; }
.vbtn:hover:not(:disabled) { border-color: var(--plum-2); background: #f6eef5; } .vbtn:disabled { opacity: .45; cursor: not-allowed; }
.vbtn small { color: var(--muted); } .vbtn small.low { color: var(--warn); font-weight: 600; } .vbtn small.out { color: var(--bad); font-weight: 600; }
.cart { display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.cart-lines { flex: 1; overflow: auto; min-height: 120px; }
.cline { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); }
.cline .nm { font-weight: 600; } .cline .sub { color: var(--muted); font-size: 12px; }
.qty { justify-self: start; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { border: 0; background: #fbf9f4; width: 28px; height: 28px; cursor: pointer; font-size: 16px; } .qty span { min-width: 30px; text-align: center; font-weight: 600; }
.cart-foot { border-top: 1px solid var(--line); padding: 12px 14px; background: #fcfaf6; border-radius: 0 0 var(--radius) var(--radius); }
.tot { display: flex; justify-content: space-between; padding: 2px 0; } .tot.grand { font-size: 22px; font-family: var(--serif); font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 14px; }
.cust-box { padding: 8px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; background: #fdfbf6; }
.banner { background: #fbecd0; color: #7a4d06; border: 1px solid #f0d8a4; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }

/* ---- dashboard bits */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px; } .kpi .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); } .kpi .v { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--plum); line-height: 1.15; } .kpi .s { font-size: 12px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.hbar { display: grid; grid-template-columns: 150px 1fr max-content; gap: 8px; align-items: center; margin: 7px 0; font-size: 13px; } .hbar .bar { height: 10px; background: #f0e9dc; border-radius: 99px; overflow: hidden; } .hbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--plum), var(--gold)); border-radius: 99px; }
.hbar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hbar .right { white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; } .tabs button { background: none; border: 0; padding: 9px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; } .tabs button.on { color: var(--plum); border-color: var(--gold); font-weight: 600; }

/* ---- modal / toast */
.backdrop { position: fixed; inset: 0; background: rgba(25,12,28,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fffdf9; border-radius: 16px; width: 480px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.4); } .modal.wide { width: 1000px; } .modal.mid { width: 640px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal-head h3 { flex: 1; font-size: 24px; color: var(--plum); }
.modal-body { padding: 16px 18px; overflow: auto; } .modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 99; } .toast { background: #2b2230; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; } .toast.err { background: var(--bad); } .toast.ok { background: var(--ok); }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .pay-methods .btn { padding: 12px 4px; font-size: 14.5px; }
.pinwarn { margin: 0; border-radius: 0; border-width: 0 0 1px; padding: 7px 18px; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
.big-total { text-align: center; font-family: var(--serif); font-size: 44px; color: var(--plum); font-weight: 700; line-height: 1; margin: 6px 0 14px; }
.pc-result { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.pc-result.empty { color: var(--muted); text-align: center; padding: 28px 16px; }
.pc-top { display: flex; gap: 14px; align-items: center; }
.pc-name { font-family: var(--serif); font-size: 26px; line-height: 1.15; color: var(--plum); }
.pc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 4px; }
.pc-sizes { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pc-hit { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--ink); font: inherit; }
.pc-hit:hover { background: var(--gold-soft); }
.refund-methods { display: grid; gap: 6px; }
.refund-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; color: var(--ink); }
.refund-opt:has(input:checked) { border-color: var(--plum); background: #f7f1f6; }
.refund-opt input { width: auto; margin-top: 3px; }
.refund-opt b { display: block; } .refund-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.paylist .row { padding: 6px 10px; background: #f6f2ea; border-radius: 8px; margin-top: 6px; }

/* ---- receipt */
.receipt { font: 12.5px/1.4 "Courier New", monospace; width: 302px; margin: 0 auto; background: #fff; color: #000; padding: 8px; }
.receipt h4 { margin: 0; text-align: center; font: 700 17px/1.2 var(--serif); letter-spacing: .04em; } .receipt .c { text-align: center; } .receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .ln { display: flex; justify-content: space-between; gap: 8px; } .receipt .it { margin-bottom: 4px; } .receipt .b { font-weight: 700; }
#print-area { display: none; }

/* ---- user guide */
.guide-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-toc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.guide-toc .toc-title { font-family: Georgia, serif; font-weight: 700; margin-bottom: 6px; }
.guide-toc a { padding: 5px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.guide-toc a:hover { background: var(--gold-soft); }
.guide { max-width: 860px; line-height: 1.6; font-size: 15px; }
.guide h1 { font-family: Georgia, serif; font-size: 32px; margin: 0 0 4px; }
.guide h2 { font-family: Georgia, serif; font-size: 25px; margin: 34px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.guide h3 { font-size: 17px; margin: 20px 0 4px; }
.guide .lead { color: var(--muted); font-size: 17px; margin: 0 0 8px; }
.guide figure { margin: 14px 0; }
.guide figure img { width: 100%; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px rgba(74, 37, 69, .08); cursor: zoom-in; display: block; }
.guide figcaption { font-size: 13px; color: var(--muted); margin-top: 5px; }
.guide .note, .guide .tip, .guide .warn { padding: 10px 14px; border-radius: 10px; margin: 12px 0; border-left: 4px solid var(--gold); background: var(--gold-soft); }
.guide .tip { border-color: var(--ok); background: #e9f5ee; } .guide .warn { border-color: var(--bad); background: #fbe9e6; }
.guide code, .guide kbd { background: #f1ebe0; padding: 1px 6px; border-radius: 5px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.guide pre { background: #2b2230; color: #f4eee4; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.guide pre code { background: none; color: inherit; padding: 0; }
.guide table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.guide th, .guide td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.guide th { background: #f6f0e4; }
.guide ol, .guide ul { padding-left: 22px; } .guide li { margin: 3px 0; }
.guide.print figure, .guide.print .note, .guide.print .tip, .guide.print .warn, .guide.print table { break-inside: avoid; }
.guide.print h2 { break-after: avoid; } .guide.print h2:not(:first-of-type) { break-before: page; }
.guide.print figure img { cursor: auto; box-shadow: none; }
@media (max-width: 980px) { .guide-wrap { grid-template-columns: 1fr; } .guide-toc { position: static; } }

/* ---- POS mobile chrome (hidden on desktop) */
.pos-scan { display: none; }
.pos-root { height: 100%; min-height: 0; padding: 12px 18px; overflow: hidden; display: flex; flex-direction: column; }
.pos-root .pos { height: 100%; min-height: 0; flex: 1; }
.pos > #shift-banner:empty { display: none; }
.pos > #shift-banner { flex: 0 0 auto; margin: 0 0 10px; }

/* ---- barcode labels (50 × 30 mm) */
.labels { display: flex; flex-wrap: wrap; align-content: flex-start; }
.label { width: 50mm; height: 30mm; padding: 1.2mm 2mm; overflow: hidden; text-align: center; break-inside: avoid; page-break-inside: avoid;
  font: 7.5pt/1.15 system-ui, sans-serif; color: #000; display: flex; flex-direction: column; justify-content: space-between; }
.label .l-brand { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 6.5pt; }
.label .l-name { font-weight: 600; font-size: 8.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .l-meta { font-size: 6.5pt; }
.label .l-price { font-weight: 800; font-size: 11pt; }
.label .ean { width: 100%; height: 11mm; } .label .l-sku { font: 8pt monospace; }

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; } .receipt { width: 72mm; padding: 0; }
  @page { margin: 4mm; }
}

/* ---- tablet / phone: cart-first sell-only POS */
@media (max-width: 900px) {
  .hide-sm { display: none !important; }
  html, body, #app { height: 100dvh; max-height: 100dvh; overflow: hidden; }
  .shell { height: 100%; max-height: 100%; min-height: 0; }
  .topbar {
    flex-wrap: nowrap; gap: 8px; padding: 8px 10px;
    flex: 0 0 auto; z-index: 20;
  }
  .brand { font-size: 18px; gap: 6px; min-width: 0; flex: 1; }
  .brand svg { width: 24px; height: 24px; flex: 0 0 auto; }
  .brand small { font-size: 9px; }
  .nav { display: none !important; }
  .topbar .btn.sm { padding: 8px 10px; min-height: 36px; }
  .topbar-user { font-size: 13px; white-space: nowrap; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; }
  .shiftchip { font-size: 12px; padding: 6px 10px; flex: 0 0 auto; }
  main#view {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    padding: 0 !important; overflow: hidden;
  }
  .pos-root { padding: 0 !important; flex: 1; min-height: 0; height: auto; }
  .pinwarn { padding: 8px 10px; flex-wrap: wrap; font-size: 13px; flex: 0 0 auto; }

  .pos {
    display: flex; flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 0;
    grid-template-columns: unset;
  }
  .pos > #shift-banner { margin: 0; padding: 8px 10px 0; }
  .pos > #shift-banner .banner { margin-bottom: 0; border-radius: 0; border-left: 0; border-right: 0; }

  /* Cart-first: no product grid on phones */
  .catalog { display: none !important; }

  .pos-scan {
    display: flex; gap: 6px; align-items: center;
    flex: 0 0 auto; padding: 10px;
    background: var(--card); border-bottom: 1px solid var(--line);
  }
  .pos-scan .search {
    flex: 1; min-width: 0; font-size: 16px; min-height: 48px;
  }
  .pos-scan .btn {
    flex: 0 0 auto; min-height: 48px; padding: 10px 10px; font-weight: 600;
    white-space: nowrap;
  }
  #m-camscan {
    background: var(--plum); color: #fff; border-color: var(--plum);
  }

  .cart {
    flex: 1; min-height: 0; border-radius: 0; border: 0;
    display: flex; max-height: none; overflow: hidden;
  }
  .cart-head { flex-wrap: wrap; gap: 6px; padding: 10px; flex: 0 0 auto; }
  .cart-head h3 { font-size: 18px !important; flex: 1 1 auto; width: auto; }
  .cart-lines { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
  .cline { padding: 12px 10px; grid-template-columns: 1fr auto; gap: 6px 10px; }
  .qty button { width: 36px; height: 36px; font-size: 18px; }
  .qty span { min-width: 36px; }
  .cart-foot {
    flex: 0 0 auto; padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    overflow: auto; max-height: 48%;
  }
  .cart-foot .btn.lg { min-height: 52px; font-size: 17px; }
  .cust-box { padding: 10px; flex-wrap: wrap; flex: 0 0 auto; }

  .backdrop { padding: 0; align-items: end; }
  .modal, .modal.mid, .modal.wide {
    width: 100%; max-width: 100%; max-height: 92dvh;
    border-radius: 16px 16px 0 0; margin: 0;
  }
  .modal-head h3 { font-size: 20px; }
  .modal-body { padding: 12px 14px; }
  .modal-foot { padding: 10px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { min-height: 44px; flex: 1 1 auto; }
  .pay-methods { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pay-methods .btn.lg { min-height: 56px; font-size: 15px; }
  .big-total { font-size: 36px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  #toasts { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .login { min-height: 100dvh; overflow: auto; }
  .login-card { padding: 22px 16px; }
  .keypad button { min-height: 52px; }
  .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-head { padding: 0 0 8px; margin-bottom: 8px; }
  .page-head h2 { font-size: 24px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tabs button { flex: 0 0 auto; min-height: 44px; }
  .cols { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 100px 1fr max-content; }
}

@media (max-width: 480px) {
  .topbar .chip.grey { display: none; }
  .brand small { display: none; }
  .topbar-user { max-width: 22vw; }
  #mypin { display: none; }
  .pos-scan .btn { padding: 10px 8px; font-size: 13px; }
}

/* ---- camera barcode scanner overlay */
.scan-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 10, 22, .72);
  display: flex; align-items: stretch; justify-content: center;
  padding: 0;
}
.scan-sheet {
  width: 100%; max-width: 560px; margin: 0 auto;
  background: #120c14; color: #fff;
  display: flex; flex-direction: column; min-height: 100%;
}
.scan-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top));
  background: #1c121f;
}
.scan-head b { flex: 1; font-size: 18px; }
.scan-head .btn { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); min-height: 40px; }
.scan-stage {
  position: relative; flex: 1; min-height: 280px;
  background: #000; overflow: hidden;
}
.scan-stage video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.scan-reticle {
  position: absolute; left: 50%; top: 50%;
  width: min(78vw, 280px); height: 120px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
  pointer-events: none;
}
.scan-hint {
  text-align: center; padding: 12px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  color: #d7c9b0; margin: 0;
}
body.barcode-scanner-active { background: transparent !important; }
body.barcode-scanner-active .shell { visibility: hidden; }
