/* MartDesk — clean counter UI. Figtree type, leaf-green brand, turmeric for money highlights. */
/* Figtree is served from our own site (SIL Open Font License, fonts/OFL-Figtree.txt): no Google Fonts call */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/figtree-latin-800-normal.woff2") format("woff2"); }

:root {
  --brand: #0f6b4f; --brand-ink: #0a4f3a; --brand-soft: #e7f3ed; --brand-line: #bcdccd;
  --gold: #f2b233; --gold-soft: #fff4d9;
  --bg: #f4f5f1; --card: #ffffff; --line: #e3e6df; --line-2: #eff1ec; --hover: #f5f8f4;
  --text: #16201b; --muted: #5d665f; --faint: #6d756f;
  --green: #127a3d; --amber: #9a6100; --red: #b42318;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 40, 30, .05), 0 1px 1px rgba(20, 40, 30, .03);
  --shadow-lg: 0 18px 50px rgba(15, 35, 25, .18);
  --font: "Figtree", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-family: var(--font); color: var(--text); font-size: 14px; line-height: 1.4; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--text); }
h4 { margin: 16px 0 6px; font-size: 13px; }
label, .field-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 12px 0 5px; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #d6dbd3; border-radius: var(--r-sm); font-size: 14px; background: #fff; color: var(--text); font-family: inherit; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 107, 79, .14); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); box-shadow: none; }
input[readonly] { background: #f6f7f4; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.upper { text-transform: uppercase; } .upper::placeholder { text-transform: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .2px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .r { text-align: right; } .c { text-align: center; } .b { font-weight: 700; }
.ok-text { color: var(--green); } .red-text { color: var(--red); } .amber-text { color: var(--amber); }
.error-text { color: var(--red); margin-top: 8px; min-height: 18px; font-size: 13px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
kbd, .kbd { font-family: var(--font); font-size: 11px; color: var(--faint); font-weight: 500; }
kbd.kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; margin-left: 6px; background: #fff; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid #d6dbd3; background: #fff; color: var(--text); border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--hover); border-color: #c6ccc3; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.primary kbd.kbd { background: rgba(0,0,0,.18); border-color: rgba(255,255,255,.35); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.small .ic { width: 16px; height: 16px; }
.btn.big { padding: 14px 16px; font-size: 16px; width: 100%; border-radius: 10px; }
.btn.wide { width: 100%; padding: 12px; margin-top: 14px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); cursor: pointer; color: var(--text); }
.icon-btn:hover { background: #fff; border-color: var(--line); }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); box-shadow: var(--shadow); }
.tool-btn:hover { border-color: var(--brand-line); color: var(--brand); }
.text-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 2px; border-radius: 6px; }
.text-btn .ic { width: 15px; height: 15px; }
.text-btn:hover { text-decoration: underline; }
.text-btn.danger { color: var(--red); }
.linkish { background: none; border: 0; color: var(--brand); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; font-weight: 600; }
.file-btn { display: inline-flex; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row.tight { margin-top: 0; gap: 6px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 160px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2.tight label { margin-top: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.span2 { grid-column: span 2; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; }
.input-row .tool-btn { min-height: 40px; box-shadow: none; }
.check { display: flex; gap: 9px; align-items: flex-start; color: var(--text); font-size: 13.5px; font-weight: 400; margin: 12px 0; cursor: pointer; }
.check input { margin-top: 1px; }
.check.inline { display: inline-flex; margin: 0 0 0 6px; font-size: 12.5px; }
.seg { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.seg.col { flex-direction: column; gap: 9px; }
.seg label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; margin: 0; cursor: pointer; font-weight: 400; }
.seg-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--line-2); padding: 4px; border-radius: 10px; }
.seg-btns button { border: 0; background: transparent; padding: 9px 6px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg-btns button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.seg-btns button:disabled { opacity: .4; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: #4b534e; white-space: nowrap; }
.tag.green { background: #e2f4e8; color: var(--green); }
.tag.amber { background: var(--gold-soft); color: var(--amber); }
.tag.red { background: #fde6e3; color: var(--red); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: #333; }
.st-paid { background: #e2f4e8; color: var(--green); } .st-part { background: var(--gold-soft); color: var(--amber); }
.st-unpaid { background: #fde6e3; color: var(--red); } .st-overdue { background: var(--red); color: #fff; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 12px; margin-right: 8px; vertical-align: middle; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, #e1f0e8 0%, transparent 60%), var(--bg); }
.login-card { background: #fff; padding: 32px; border-radius: 18px; box-shadow: var(--shadow-lg); width: 400px; max-width: 100%; }
.login-card h1 { font-size: 24px; margin: 10px 0 2px; letter-spacing: -.3px; }
.login-logo { height: 52px; border-radius: 13px; }
.tabs { display: flex; gap: 4px; background: var(--line-2); padding: 4px; border-radius: 10px; margin: 18px 0 6px; }
.tabs.inline { display: inline-flex; margin: 0 0 12px; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* shell */
.shell { display: flex; height: 100vh; height: 100dvh; }
.sidebar { width: 228px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; flex-shrink: 0; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; margin: 2px 6px 22px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { font-size: 12px; color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn { text-align: left; padding: 10px 12px; border: none; background: transparent; color: #3c4640; border-radius: 9px; cursor: pointer; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 11px; }
.nav-btn .ic { width: 19px; height: 19px; color: var(--faint); }
.nav-btn:hover { background: var(--hover); }
.nav-btn.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-btn.active .ic { color: var(--brand); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding-top: 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.me-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.me-txt span { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-btn { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; color: #4b534e; font-size: 13px; cursor: pointer; text-align: left; }
.foot-btn .ic { width: 16px; height: 16px; color: var(--faint); }
.foot-btn:hover { background: var(--hover); }
.content { flex: 1; overflow: auto; padding: 20px 26px 32px; position: relative; }
.topbar { display: none; }
.nav-scrim { display: none; }
.screen { max-width: 1320px; margin: 0 auto; }
.screen-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.screen-head select { width: auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar select { width: auto; }
.summary { margin: 2px 0 12px; font-size: 13.5px; }
.notice { background: var(--gold-soft); border: 1px solid #f0dca5; color: #6b4d00; padding: 9px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.notice.danger { background: #fde6e3; border-color: #f3b8b2; color: var(--red); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; padding: 0; }
.list-table, .edit-table, .cart { width: 100%; border-collapse: collapse; }
.list-table th, .edit-table th, .cart th { font-size: 11.5px; color: var(--muted); text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table th.r, .list-table td.r { text-align: right; }
.click-rows tbody tr { cursor: pointer; transition: background .1s; }
.click-rows tbody tr:hover { background: var(--hover); }
tr.cancelled td { color: var(--faint); text-decoration: line-through; }
tr.cancelled td .small { text-decoration: none; }
.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.edit-table td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.edit-table input { padding: 8px; font-size: 13.5px; min-width: 72px; }
.edit-table input[type=date] { min-width: 132px; margin-bottom: 3px; }
.scroll-y { max-height: 52vh; overflow-y: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.loading { opacity: .5; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi.click { cursor: pointer; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.hero { background: var(--brand); border-color: var(--brand); color: #fff; }
.kpi.hero .k, .kpi.hero .s { color: #cfe8dc; }

/* ===== billing (POS) ===== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; max-width: none; align-items: start; }
.pos-main { min-width: 0; }
.scan-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.scan-wrap { position: relative; flex: 1; }
.scan-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--faint); pointer-events: none; }
.scan-wrap input { padding: 13px 48px 13px 44px; font-size: 16px; border-radius: 10px; border: 1.5px solid #cfd6cc; box-shadow: var(--shadow); }
.scan-wrap input:focus { border-color: var(--brand); }
.scan-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.drop-wrap { position: relative; }
.drop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 30; max-height: 380px; overflow-y: auto; padding: 4px; }
.drop-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; cursor: pointer; border-radius: 8px; }
.drop-item.sel, .drop-item:hover { background: var(--brand-soft); }
.drop-item.add { color: var(--brand); font-weight: 600; border-top: 1px solid var(--line-2); border-radius: 0 0 8px 8px; }
.cart-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-height: 320px; overflow-x: auto; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.cart th { padding: 8px 10px; }
.cart td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.cart td.nm { min-width: 170px; }
.cart td.nm b { font-weight: 600; }
.cart tr.flash td { animation: flash .8s; }
@keyframes flash { from { background: #dcefe5; } to { background: transparent; } }
.qty { display: flex; align-items: center; border: 1px solid #d6dbd3; border-radius: 9px; overflow: hidden; width: 116px; margin: 0 auto; background: #fff; }
.qbtn { width: 32px; height: 34px; border: 0; background: #f4f6f2; font-size: 17px; cursor: pointer; color: var(--text); }
.qbtn:hover { background: var(--brand-soft); color: var(--brand); }
.qin { border: 0 !important; text-align: center; padding: 6px 2px !important; width: 52px !important; border-radius: 0 !important; font-weight: 700; box-shadow: none !important; }
.pin { width: 84px; padding: 7px 8px; text-align: right; }
.xbtn { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 15px; padding: 6px 8px; border-radius: 6px; }
.xbtn:hover { background: #fde6e3; color: var(--red); }
.cart-empty { text-align: center; padding: 64px 20px; color: var(--text); }
.empty-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.empty-ic .ic { width: 28px; height: 28px; }
.cart-empty .muted { max-width: 360px; margin: 6px auto 0; }
.held-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.pos-side { position: sticky; top: 0; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > .ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search-field input { padding-left: 38px; }
.search-field kbd { position: absolute; right: 10px; }
.cust-selected { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--brand-soft); border-radius: 10px; padding: 9px 10px; }
.totals { margin-top: 14px; }
.totals .trow { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-variant-numeric: tabular-nums; min-height: 28px; }
.disc-in { display: flex; align-items: center; gap: 8px; }
.disc-in input:not([type=checkbox]) { width: 110px; padding: 7px 10px; text-align: right; }
.pct { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: 13px; }
.grand-box { display: flex; justify-content: space-between; align-items: baseline; background: var(--brand); color: #fff; border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.grand-box span { font-size: 14px; font-weight: 600; color: #cfe8dc; }
.grand-box b { font-size: 32px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.fine { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; margin: 8px 2px 4px; min-height: 4px; }
.fine span:empty { display: none; }
#paySection { margin-top: 12px; }
.pay-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--line-2); padding: 4px; border-radius: 11px; }
.pay-btn { padding: 10px 4px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pay-btn:hover { color: var(--text); }
.pay-btn.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.split-link { margin: 6px 2px 2px; font-size: 12.5px; }
.split-link.active { color: var(--brand-ink); }
#cashBox, #upiBox, #splitBox { margin-top: 8px; }
.cash-row input { font-size: 15px; }
.change { font-size: 18px; font-weight: 800; color: var(--green); margin-top: 8px; min-height: 4px; }
.change.short { color: var(--red); }
.change.big { font-size: 20px; margin: 6px 0; }
.pos-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.act-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mob-bar { display: none; }
.wide-sm { width: 100%; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(14, 26, 20, .42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; backdrop-filter: blur(2px); }
.modal-box { background: #fff; border-radius: 16px; padding: 24px; width: 480px; max-width: 100%; max-height: 92vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); }
.modal-box.wide { width: 840px; }
.modal-x { position: absolute; right: 12px; top: 12px; border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.modal-x:hover { background: var(--hover); color: var(--text); }
.modal-box h3 { padding-right: 34px; font-size: 18px; }
.big-amt { font-size: 32px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.saved-box .ok-circle { width: 58px; height: 58px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }
.saved-box .ok-circle .ic { width: 26px; height: 26px; }
.saved-box h3 { padding: 0; }
.saved-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.qr-big svg { width: 240px; height: 240px; }
.cam-box { width: 100%; min-height: 260px; background: #111; border-radius: 12px; overflow: hidden; }
.cam-box video { width: 100% !important; }
.bill-view { display: flex; gap: 18px; }
.receipt-frame { width: 330px; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; flex-shrink: 0; }
.bill-side { flex: 1; }
.ret-note { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; }
.totals-mini { width: 100%; margin-top: 10px; border-collapse: collapse; }
.totals-mini td { padding: 3px 0; }
.logo-prev { height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.pur-totals .trow { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.pur-totals .trow.grand { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
details.more { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 2px 14px 12px; }
details.more summary { cursor: pointer; padding: 10px 0 0; font-weight: 600; color: var(--brand); font-size: 13.5px; list-style: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "− "; }
details.more summary::-webkit-details-marker { display: none; }
details.more:not([open]) { padding-bottom: 10px; }

/* returns */
.ret-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 8px; }
.ret-row { display: grid; grid-template-columns: 22px 1fr auto 90px; gap: 12px; align-items: center; padding: 11px 14px; margin: 0; border-bottom: 1px solid var(--line-2); cursor: pointer; color: var(--text); font-weight: 400; font-size: 14px; }
.ret-row:last-child { border-bottom: 0; }
.ret-row.on { background: var(--brand-soft); }
.ret-row.done { opacity: .55; cursor: default; }
.ret-name { display: flex; flex-direction: column; gap: 2px; }
.ret-qty { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ret-qty input { width: 70px; padding: 7px 8px; text-align: center; font-weight: 700; }
.ret-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.ret-total b { font-size: 26px; font-weight: 800; }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 55vh; overflow-y: auto; }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 14px; cursor: pointer; font-size: 14px; color: var(--text); }
.pick > span { display: flex; flex-direction: column; gap: 2px; }
.pick:hover { border-color: var(--brand-line); background: var(--hover); }

/* plans & payment */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; }
.plan { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 14px; cursor: pointer; color: var(--text); }
.plan:hover { border-color: var(--brand-line); }
.plan.active { border-color: var(--brand); background: var(--brand-soft); }
.plan-name { font-weight: 700; }
.plan-price { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.pay-box { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.qr-wrap svg { width: 100%; height: auto; display: block; }
.pay-steps .step { margin-bottom: 8px; font-size: 13.5px; }
.qr-inline { display: flex; gap: 12px; align-items: center; background: var(--line-2); border-radius: 10px; padding: 10px; margin-top: 8px; }
.qr-inline svg { width: 120px; height: 120px; background: #fff; border-radius: 6px; flex-shrink: 0; }

/* team */
.company-code { font-size: 30px; font-weight: 800; letter-spacing: 5px; font-family: ui-monospace, Menlo, monospace; color: var(--brand); margin: 4px 0 8px; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.user-row .who { display: flex; flex-direction: column; gap: 2px; }

/* dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-grid .card { margin: 0; }
.dash-grid .span2 { grid-column: span 2; }
.dash-grid .card:first-child { position: relative; }
.chart-box { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #eceee9; stroke-width: 1; }
.chart .base { stroke: #b8bdb6; stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .bar.on path { opacity: .8; }
.chart-tip { position: absolute; display: none; background: #16201b; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 7px; pointer-events: none; white-space: nowrap; z-index: 5; }
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin: 6px 0 14px; background: #fff; }
.stack-bar div { min-width: 3px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; font-size: 13px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend b { margin-left: 4px; }

/* toast / busy */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #16201b; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .2s; z-index: 80; max-width: 92vw; text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
.busy { position: fixed; inset: 0; background: rgba(244,245,241,.8); z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 600; }
.spinner { width: 36px; height: 36px; border: 4px solid #d6e6de; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== tablets & phones ===== */
@media (max-width: 1150px) {
  .pos { grid-template-columns: minmax(0, 1fr) 320px; }
  .pin { width: 72px; }
}
@media (max-width: 900px) {
  .shell { display: block; height: auto; min-height: 100vh; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; width: 260px; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .content { padding: 0 14px 96px; overflow: visible; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--bg); z-index: 20; padding: 8px 0; margin: 0 -4px 8px; }
  .top-title { display: flex; flex-direction: column; line-height: 1.15; }
  .pos { grid-template-columns: 1fr; }
  .pos-side { position: static; }
  .dash-grid, .two-col, .grid3 { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: auto; }
  .mob-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); justify-content: space-between; align-items: center; z-index: 25; box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
  .mob-bar .btn { padding: 12px 28px; font-size: 15px; }
  .big-num { font-size: 22px; }
  .kbd, kbd.kbd { display: none; }
  body:not(.on-pos) .mob-bar { display: none; }
  .bill-view { flex-direction: column; }
  .receipt-frame { width: 100%; height: 55vh; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box, .modal-box.wide { width: 100%; border-radius: 18px 18px 0 0; max-height: 94vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .tool-btn { padding: 0 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .cart thead { display: none; }
  .cart, .cart tbody { display: block; }
  .cart tr { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "nm nm x" "qty price amt"; gap: 6px 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-2); align-items: center; }
  .cart td { border: 0; padding: 0; }
  .cart td:nth-child(1) { display: none; }
  .cart td.nm { grid-area: nm; min-width: 0; }
  .cart td.qty-cell { grid-area: qty; }
  .cart td:nth-child(4) { grid-area: price; }
  .cart td:nth-child(5) { display: none; }
  .cart td:nth-child(6) { grid-area: amt; font-size: 15px; }
  .cart td:nth-child(7) { grid-area: x; }
  .qty { margin: 0; }
  .toolbar select, .toolbar input { flex: 1 1 140px; }
  .kpi .v { font-size: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .legend { grid-template-columns: 1fr; }
  .edit-table input { min-width: 62px; }
  .ret-row { grid-template-columns: 22px 1fr 80px; grid-template-areas: "c n a" "c q q"; }
  .ret-row .rt-check { grid-area: c; } .ret-name { grid-area: n; } .ret-qty { grid-area: q; } .ret-amt { grid-area: a; }
  .seg-btns { grid-template-columns: 1fr 1fr; }
  .pay-box { grid-template-columns: 1fr; }
  .qr-wrap { max-width: 220px; margin: 0 auto; }
  .grand-box b { font-size: 28px; }
}
@media print { body * { visibility: hidden; } }

/* screenshots + support */
.att { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.att-prev { display: inline-flex; align-items: center; gap: 6px; }
.att-prev img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #ddd); cursor: zoom-in; }
.pay-help { margin-top: 12px; }
.sp-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.sp-item { border: 1px solid var(--line, #e5e5e5); border-radius: 10px; padding: 8px 10px; }
.sp-msg { white-space: pre-line; margin: 4px 0; }
.sp-reply { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--brand-soft, #eaf5ef); white-space: pre-line; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .85); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100% - 60px); object-fit: contain; border-radius: 6px; background: #fff; }
.lightbox-bar { display: flex; gap: 8px; }
.look-line { min-height: 18px; margin-top: 4px; }
.net-pill { display: block; width: 100%; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--brand-line);
    background: var(--brand-soft); color: var(--brand-ink); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.net-pill.off { background: var(--gold-soft); border-color: #f0d18a; color: var(--amber); }
.net-pill.bad { background: #fdecea; border-color: #f3b8b1; color: var(--red); }
.lb-list { max-height: 45vh; overflow: auto; margin: 8px 0; }
.quick-row { display: flex; gap: 6px; margin: 0 0 10px; }
.quick-row input { min-width: 0; }
.quick-row #qrQty { width: 70px; flex: 0 0 70px; }
.quick-row #qrPrice { width: 96px; flex: 0 0 96px; }
.quick-row .grow { flex: 1; }
.vc-table td { vertical-align: middle; }
.vc-bad td { background: #fff6f5; }
#vcMic.listening { background: var(--red); border-color: var(--red); color: #fff; animation: vcpulse 1.2s infinite; }
@keyframes vcpulse { 50% { box-shadow: 0 0 0 6px rgba(180, 35, 24, .15); } }
#vcText { width: 100%; margin: 8px 0; }
.consent { font-size: 13px; line-height: 1.4; margin: 10px 0; align-items: flex-start; }
