/* RetailFlow POS design system. Themes switch CSS variables via [data-theme] on <html>. */
:root, [data-theme="indigo"] {
  --p: #4f46e5; --p-600: #4338ca; --p-50: #eef2ff; --p-100: #e0e7ff; --on-p: #fff;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8fafc; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --side-bg: #111827; --side-text: #cbd5e1; --side-active: #4f46e5; --side-hover: #1f2937;
  --ok: #059669; --ok-50: #ecfdf5; --warn: #d97706; --warn-50: #fffbeb; --err: #dc2626; --err-50: #fef2f2;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.18);
  color-scheme: light;
}
[data-theme="emerald"] { --p:#059669; --p-600:#047857; --p-50:#ecfdf5; --p-100:#d1fae5; --side-bg:#064e3b; --side-text:#a7f3d0; --side-active:#10b981; --side-hover:#065f46; }
[data-theme="ocean"] { --p:#0284c7; --p-600:#0369a1; --p-50:#f0f9ff; --p-100:#e0f2fe; --side-bg:#0c4a6e; --side-text:#bae6fd; --side-active:#0ea5e9; --side-hover:#075985; }
[data-theme="sunset"] { --p:#ea580c; --p-600:#c2410c; --p-50:#fff7ed; --p-100:#ffedd5; --side-bg:#431407; --side-text:#fed7aa; --side-active:#f97316; --side-hover:#7c2d12; }
[data-theme="rose"] { --p:#e11d48; --p-600:#be123c; --p-50:#fff1f2; --p-100:#ffe4e6; --side-bg:#4c0519; --side-text:#fecdd3; --side-active:#f43f5e; --side-hover:#881337; }
[data-theme="forest"] { --p:#65a30d; --p-600:#4d7c0f; --p-50:#f7fee7; --p-100:#ecfccb; --side-bg:#1a2e05; --side-text:#d9f99d; --side-active:#84cc16; --side-hover:#365314; }
[data-theme="slate"] {
  --p:#6366f1; --p-600:#4f46e5; --p-50:#1e1b4b; --p-100:#312e81; --on-p:#fff;
  --bg:#0b1120; --surface:#111827; --surface-2:#0f172a; --text:#e5e7eb; --muted:#94a3b8; --border:#1f2937;
  --side-bg:#030712; --side-text:#9ca3af; --side-active:#6366f1; --side-hover:#111827;
  --ok-50:#052e1f; --warn-50:#2a1a05; --err-50:#2a0a0a; color-scheme: dark;
}
[data-theme="midnight"] {
  --p:#14b8a6; --p-600:#0d9488; --p-50:#042f2e; --p-100:#134e4a; --on-p:#04201e;
  --bg:#020617; --surface:#0f172a; --surface-2:#0b1222; --text:#e2e8f0; --muted:#94a3b8; --border:#1e293b;
  --side-bg:#000; --side-text:#94a3b8; --side-active:#14b8a6; --side-hover:#0f172a;
  --ok-50:#052e1f; --warn-50:#2a1a05; --err-50:#2a0a0a; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--p); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.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)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; }
@media (max-width: 600px) { .span2 { grid-column: span 1; } }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.side { width: 240px; flex: none; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; transition: transform .2s; z-index: 40; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; }
.side .brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--side-active); display: grid; place-items: center; overflow: hidden; flex: none; }
.side .brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.side .brand small { display: block; font-weight: 500; font-size: 11px; opacity: .65; }
.side nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.side .sec { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .5; padding: 14px 10px 6px; }
.side .nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); cursor: pointer; font-weight: 500; }
.side .nav:hover { background: var(--side-hover); color: #fff; }
.side .nav.on { background: var(--side-active); color: #fff; }
.side .nav .badge { margin-left: auto; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { height: 58px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.top .title { font-weight: 600; font-size: 16px; }
.content { flex: 1; overflow: auto; padding: 22px; }
.content.flush { padding: 0; }
.hamb { display: none; }
@media (max-width: 960px) {
  .side { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .hamb { display: inline-flex; }
  .content { padding: 14px; }
}
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-b { padding: 16px; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 21px; font-weight: 700; }
.page-h p { margin: 2px 0 0; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.pri { background: var(--p); border-color: var(--p); color: var(--on-p); }
.btn.pri:hover { background: var(--p-600); }
.btn.danger { color: var(--err); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 20px; font-size: 16px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.inp, .sel, textarea.inp { height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); outline: none; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea.inp { height: auto; padding: 9px 11px; min-height: 70px; resize: vertical; }
.inp:focus, .sel:focus { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-100); }
.inp.lg { height: 48px; font-size: 16px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--p); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.badge.ok { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-50); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-50); color: var(--err); border-color: transparent; }
.badge.pri { background: var(--p-50); color: var(--p); border-color: transparent; }

.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; user-select: none; z-index: 1; }
.tbl th.sort { cursor: pointer; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); position: sticky; bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-tools { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 14px; }

.kpi { padding: 16px; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--p-50); color: var(--p); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--p); border-color: var(--p); }

.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .14s; }
.modal.wide { max-width: 900px; }
.modal.xl { max-width: 1180px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 17px; flex: 1; }
.modal-b { padding: 20px; overflow: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 10px; background: #111827; color: #fff; box-shadow: var(--shadow-lg); animation: pop .15s; font-weight: 500; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.spin { width: 22px; height: 22px; border: 3px solid var(--p-100); border-top-color: var(--p); border-radius: 50%; animation: rot .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 50px; }
@keyframes rot { to { transform: rotate(360deg); } }
.alert { padding: 11px 14px; border-radius: 10px; background: var(--warn-50); color: var(--warn); font-weight: 500; }
.alert.err { background: var(--err-50); color: var(--err); }
.alert.ok { background: var(--ok-50); color: var(--ok); }
.alert.info { background: var(--p-50); color: var(--p); }
.divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------- auth / wizard ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .hero { background: linear-gradient(135deg, var(--side-bg), var(--p)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .hero h1 { font-size: 34px; line-height: 1.15; margin: 24px 0 12px; }
.auth .hero ul { padding: 0; list-style: none; display: grid; gap: 10px; opacity: .92; }
.auth .hero li::before { content: "✓  "; font-weight: 700; }
.auth .form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth .box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth .hero { display: none; } }
.wiz { max-width: 860px; margin: 0 auto; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--muted); }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.step.on { border-color: var(--p); color: var(--p); }
.step.on .n, .step.done .n { background: var(--p); color: var(--on-p); border-color: var(--p); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme { border: 2px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--surface); }
.theme.on { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-100); }
.theme .pv { height: 70px; display: flex; }
.theme .pv .s { width: 34%; }
.theme .pv .m { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.theme .pv .m i { display: block; height: 8px; border-radius: 4px; }
.theme .nm { padding: 8px 10px; font-weight: 600; text-transform: capitalize; font-size: 13px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 420px; height: 100%; }
.pos .left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.pos .bar { padding: 12px 14px; display: flex; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pos .cats { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--border); }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 13px; }
.chip.on { background: var(--p); border-color: var(--p); color: var(--on-p); }
.tiles { flex: 1; overflow: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; align-content: start; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .08s, box-shadow .12s; position: relative; }
.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tile.out { opacity: .45; cursor: not-allowed; }
.tile .img { aspect-ratio: 4/3; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 26px; font-weight: 700; }
.tile .img img { width: 100%; height: 100%; object-fit: cover; }
.tile .t { padding: 8px 10px; }
.tile .nm { font-weight: 600; font-size: 13px; line-height: 1.3; height: 34px; overflow: hidden; }
.tile .pr { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.tile .pr b { color: var(--p); }
.tile .stk { position: absolute; top: 6px; right: 6px; }
.pos .cart { display: flex; flex-direction: column; background: var(--surface); min-height: 0; }
.cart-h { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.cart-lines { flex: 1; overflow: auto; }
.cl { padding: 10px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.cl.sel { background: var(--p-50); }
.cl .nm { font-weight: 600; }
.cl .amt { font-weight: 700; text-align: right; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: 16px; }
.qty input { width: 52px; height: 30px; border: 0; text-align: center; background: var(--surface); outline: none; }
.cart-tot { padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cart-tot .r { display: flex; justify-content: space-between; padding: 2px 0; }
.cart-tot .grand { font-size: 26px; font-weight: 800; color: var(--text); }
.paybtn { margin: 0 14px 14px; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; grid-template-rows: 1fr 52vh; } .pos .left { border-right: 0; } .tiles { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } }
.pay-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.denoms { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- POS (professional layout) ---------- */
.posx { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 430px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "cat bill" "keys bill"; background: var(--bg); }
.posx-top { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.posx-store { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.posx-store b { display: block; font-size: 14.5px; }
.posx-store span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.posx-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-50); flex: none; }
.posx-search { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface-2); color: var(--muted); transition: border-color .12s, background .12s; min-width: 0; }
.posx-search:focus-within { border-color: var(--p); background: var(--surface); box-shadow: 0 0 0 4px var(--p-100); color: var(--p); }
.posx-search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--text); min-width: 0; }
.posx-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.posx-kbd { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-family: ui-monospace, monospace; }
.posx-kbd.inv { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); color: inherit; margin-left: 6px; }
.pos-clock { text-align: right; line-height: 1.15; min-width: 86px; }
.pos-clock b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.pos-clock span { font-size: 11.5px; color: var(--muted); }

.posx-cat { grid-area: cat; display: flex; flex-direction: column; min-height: 0; }
.posx-tabs { display: flex; gap: 6px; padding: 12px 16px 10px; overflow-x: auto; flex: none; }
.posx-tab { padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.posx-tab i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.posx-tab.on { background: var(--p); border-color: var(--p); color: var(--on-p); }
.posx-tab.on i { background: rgba(255,255,255,.22); color: inherit; }
.posx-grid { flex: 1; overflow: auto; padding: 4px 16px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; }
.posx-cat, .posx-top { min-width: 0; }
.posx-item { text-align: left; font: inherit; color: inherit; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .08s, box-shadow .12s, border-color .12s; }
.posx-item:hover { box-shadow: 0 10px 24px -10px rgba(15,23,42,.35); transform: translateY(-2px); border-color: var(--p-100); }
.posx-item:active { transform: scale(.98); }
.posx-item.in { border-color: var(--p); box-shadow: 0 0 0 2px var(--p-100); }
.posx-item.out { opacity: .5; cursor: not-allowed; }
.posx-item .ph { position: relative; flex: none; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--p-50), var(--surface-2)); display: grid; place-items: center; }
.posx-item .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.posx-item .ph > span:first-child { font-size: 28px; font-weight: 800; color: var(--p); opacity: .55; }
.posx-item .incart { position: absolute; top: 8px; left: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--p); color: var(--on-p); font-weight: 800; font-size: 12.5px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.posx-item .stk { position: absolute; bottom: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.92); color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.posx-item .stk.warn { background: #fef3c7; color: #92400e; }
.posx-item .stk.err { background: #fee2e2; color: #b91c1c; }
.posx-item .bd { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.posx-item .nm { font-weight: 600; font-size: 13px; line-height: 1.3; height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.posx-item .pr { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.posx-item .pr b { font-size: 15px; color: var(--text); }
.posx-item .pr small { font-size: 11px; color: var(--muted); font-weight: 500; }
.posx-item .pr s { font-size: 12px; color: var(--muted); }
.posx-keys { grid-area: keys; display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--muted); }
.posx-keys i { font-style: normal; font-family: ui-monospace, monospace; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); margin-right: 4px; }

.posx-bill { grid-area: bill; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px -16px rgba(15,23,42,.25); }
.posx-bh { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.posx-bh > div { flex: 1; }
.posx-bh b { display: block; font-size: 15px; }
.posx-bh span { font-size: 12px; color: var(--muted); }
.posx-cust { display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.posx-cust .av { width: 36px; height: 36px; border-radius: 50%; background: var(--p-100); color: var(--p); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.posx-cust b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posx-cust span { font-size: 11.5px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); flex: none; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--p); color: var(--on-p); }
.posx-custf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px 0; }
.posx-lines { flex: 1; overflow: auto; padding: 8px 8px 8px 16px; margin-top: 8px; }
.posx-empty { height: 100%; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; color: var(--muted); }
.posx-empty .ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--p-50); color: var(--p); margin-bottom: 6px; }
.posx-empty b { color: var(--text); }
.posx-line { position: relative; display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) auto; grid-template-areas: "no th info amt" "no th qty qty"; column-gap: 10px; row-gap: 6px; align-items: center; padding: 10px 30px 10px 6px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.posx-line + .posx-line { margin-top: 4px; }
.posx-line:hover { background: var(--surface-2); }
.posx-line.sel { background: var(--p-50); border-color: var(--p-100); }
.posx-line .no { grid-area: no; font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; }
.posx-line .th { grid-area: th; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); border: 1px solid var(--border); }
.posx-line .th img { width: 100%; height: 100%; object-fit: cover; }
.posx-line .info { grid-area: info; min-width: 0; }
.posx-line .info b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posx-line .info span { font-size: 12px; color: var(--muted); }
.posx-line .info em { font-style: normal; color: var(--ok); font-weight: 700; }
.posx-line .qty { grid-area: qty; justify-self: start; }
.posx-line .amt { grid-area: amt; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.posx-line .rm { position: absolute; top: 10px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; opacity: .5; }
.posx-line:hover .rm { opacity: 1; }
.posx-line .rm:hover { background: var(--err-50); color: var(--err); }
.posx-line .edit { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding-top: 4px; }
.posx-line .edit label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.posx-line .edit .inp { width: 96px; height: 32px; }
.posx-sum { margin: 0 16px; padding: 12px 0 10px; border-top: 1px dashed var(--border); font-size: 13px; }
.posx-sum .r { display: flex; justify-content: space-between; padding: 2px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.posx-sum .r.ok { color: var(--ok); }
.posx-sum .save { margin: 8px 0 2px; padding: 7px 10px; border-radius: 8px; background: var(--ok-50); color: var(--ok); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.posx-sum .tot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.posx-sum .tot span { font-weight: 700; }
.posx-sum .tot b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.posx-pay { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.posx-pay .modes { display: grid; gap: 8px; }
.posx-pay .modes .btn { height: 42px; }
.posx-pay .go { height: 56px; font-size: 18px; border-radius: 12px; box-shadow: 0 10px 22px -10px var(--p); }
@media (max-width: 1100px) { .posx { grid-template-columns: minmax(0, 1fr) 380px; } .pos-clock { display: none; } }
@media (max-width: 900px) {
  .posx { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "cat" "bill"; }
  .posx-bill { max-height: 48vh; border-left: 0; border-top: 1px solid var(--border); }
  .posx-keys, .posx-store { display: none; }
  .posx-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* Ctrl+P on a screen: hide app chrome so at least the content prints cleanly (Print buttons use the A4 letterhead layout) */
@media print {
  .side, .scrim, .tbl-tools, .pager, .btn, .toast, .page-h > :not(.grow) { display: none !important; }
  .app { display: block !important; } body { background: #fff !important; }
  .content, .tbl-wrap { overflow: visible !important; max-height: none !important; padding: 0 !important; }
}

/* payment */
.payx { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
.payx-l { display: flex; flex-direction: column; gap: 12px; }
.payx-total { padding: 16px; border-radius: 14px; background: linear-gradient(135deg, var(--side-bg), var(--p)); color: #fff; }
.payx-total span { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.payx-total b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; }
.payx-total small { opacity: .8; }
.payx-modes { display: flex; flex-direction: column; gap: 6px; }
.payx-mode { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.payx-mode span { flex: 1; text-align: left; }
.payx-mode em { font-style: normal; font-size: 12px; color: var(--muted); }
.payx-mode.on { border-color: var(--p); background: var(--p-50); color: var(--p); }
.payx-state { padding: 12px 14px; border-radius: 12px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.payx-state b { font-size: 20px; }
.payx-state.due { background: var(--err-50); color: var(--err); }
.payx-state.chg { background: var(--ok-50); color: var(--ok); }
.payx-state.ok { background: var(--surface-2); color: var(--muted); }
.payx-r { display: flex; flex-direction: column; gap: 10px; }
.payx-amt { display: flex; align-items: center; gap: 6px; height: 64px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--p); background: var(--surface); font-size: 28px; font-weight: 700; color: var(--muted); box-shadow: 0 0 0 4px var(--p-100); }
.payx-amt input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.payx-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.payx-quick .btn { flex: 1; min-width: 70px; }
.payx-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.payx-pad button { height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; color: var(--text); display: grid; place-items: center; }
.payx-pad button:hover { background: var(--p-50); border-color: var(--p-100); }
.payx-pad button:active { transform: scale(.97); }
@media (max-width: 700px) { .payx { grid-template-columns: 1fr; } .payx-pad button { height: 44px; } }
/* ---- payment v2 ---- */
.m-cash { --mc: #16a34a; --mb: #dcfce7; }
.m-upi { --mc: #7c3aed; --mb: #ede9fe; }
.m-card { --mc: #2563eb; --mb: #dbeafe; }
.m-wallet { --mc: #ea580c; --mb: #ffedd5; }
.m-banktransfer { --mc: #0891b2; --mb: #cffafe; }
.m-credit { --mc: #b45309; --mb: #fef3c7; }

/* bill panel: quick pay tiles + collect button */
.posx-pay { padding: 2px 16px 14px; gap: 8px; }
@media (max-height: 820px) and (min-width: 901px) {
  .posx-sum { padding: 8px 0 6px; }
  .posx-sum .save { margin: 4px 0 0; padding: 5px 10px; }
  .posx-sum .tot b { font-size: 26px; }
  .posx-cust { margin-top: 8px; padding: 7px 10px; }
  .posx-custf { padding-top: 8px; }
}
.pm-label { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pm-label i { flex: 1; height: 1px; background: var(--border); }
.pm-row { display: grid; gap: 8px; }
.posx-lines { min-height: 96px; }
.pm-label { display: none !important; }
.pm-tile { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 7px; padding: 6px 6px; min-height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font: inherit; cursor: pointer; color: var(--text); transition: border-color .12s, box-shadow .12s, transform .08s; }
.pm-tile .ic { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--mb, var(--p-50)); color: var(--mc, var(--p)); }
.pm-tile b { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pm-tile:hover:not(:disabled) { border-color: var(--mc, var(--p)); box-shadow: 0 6px 16px -10px var(--mc, var(--p)); transform: translateY(-1px); }
.pm-tile:disabled { opacity: .45; cursor: not-allowed; }
.posx-go { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 62px; padding: 8px 12px; border: 0; border-radius: 16px; cursor: pointer; font: inherit; text-align: left; color: #fff;
  background: linear-gradient(135deg, #15803d 0%, #16a34a 55%, #22c55e 100%); box-shadow: 0 14px 28px -14px rgba(22,163,74,.9), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .08s, box-shadow .15s, filter .15s; overflow: hidden; }
.posx-go::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); transform: translateX(-100%); transition: transform .6s; }
.posx-go:hover:not(:disabled)::after { transform: translateX(100%); }
.posx-go:hover:not(:disabled) { filter: brightness(1.04); box-shadow: 0 18px 32px -14px rgba(22,163,74,1), inset 0 1px 0 rgba(255,255,255,.25); }
.posx-go:active:not(:disabled) { transform: scale(.985); }
.posx-go .l { display: flex; align-items: center; gap: 11px; min-width: 0; }
.posx-go .l .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.18); flex: none; }
.posx-go .tx b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: .01em; }
.posx-go .tx small { display: block; font-size: 11.5px; opacity: .85; white-space: nowrap; }
.posx-go .r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.posx-go .r b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.posx-go .r .k { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.18); font-family: ui-monospace, monospace; }
.posx-go.off, .posx-go:disabled { cursor: not-allowed; background: var(--surface-2); color: var(--muted); box-shadow: none; border: 1px dashed var(--border); }
.posx-go:disabled .l .ic { background: var(--surface); }
.posx-go:disabled .r .k { background: var(--surface); }

/* collect payment modal */
.payx { grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
.payx-total { position: relative; overflow: hidden; padding: 16px 18px; border-radius: 16px; background: linear-gradient(140deg, #0f172a 0%, var(--side-bg) 45%, var(--p) 130%); box-shadow: 0 16px 30px -18px rgba(15,23,42,.8); }
.payx-total::before { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.07); }
.payx-total .h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.payx-total .h em { font-style: normal; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.14); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payx-total b { font-size: 36px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.payx-total .bk { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(255,255,255,.25); font-size: 12px; display: grid; gap: 3px; }
.payx-total .bk div { display: flex; justify-content: space-between; opacity: .85; font-variant-numeric: tabular-nums; }
.payx-h { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 2px 0 -4px; }
.payx-modes { gap: 7px; }
.payx-mode { gap: 11px; padding: 9px 11px; border-radius: 12px; border: 1.5px solid var(--border); transition: border-color .12s, background .12s, box-shadow .12s; }
.payx-mode .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--mb, var(--p-50)); color: var(--mc, var(--p)); flex: none; }
.payx-mode .tx { flex: 1; min-width: 0; text-align: left; }
.payx-mode > span:not(.tx) { flex: none; }
.payx-mode .tx b { display: block; font-size: 13.5px; }
.payx-mode .tx small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.payx-mode em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--mc, var(--p)); }
.payx-mode .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--mc, var(--p)); color: #fff; flex: none; }
.payx-mode:hover { border-color: var(--mc, var(--p)); }
.payx-mode.on { border-color: var(--mc, var(--p)); background: var(--mb, var(--p-50)); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc, var(--p)) 14%, transparent); }
.payx-mode.on .ic { background: var(--mc, var(--p)); color: #fff; }
.payx-prog .bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.payx-prog .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #f97316); transition: width .25s; }
.payx-prog .bar i.full { background: linear-gradient(90deg, #16a34a, #22c55e); }
.payx-prog .lbl { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.payx-prog .lbl b { color: var(--text); }
.payx-state { border: 1px solid transparent; }
.payx-state b { font-size: 22px; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.payx-state.due { border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.payx-state.chg { border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.payx-state.ok { background: var(--ok-50); color: var(--ok); }
.payx-r { gap: 11px; }
.payx-rh { display: flex; align-items: center; gap: 11px; }
.payx-rh .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--mc, var(--p)); color: #fff; flex: none; }
.payx-rh b { display: block; font-size: 15px; }
.payx-rh small { display: block; font-size: 12px; color: var(--muted); }
.payx-rh .pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--p-50); color: var(--p); }
.payx-amt { height: 72px; font-size: 34px; border-radius: 14px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.payx-amt > span { color: var(--muted); font-weight: 600; }
.payx-used { display: flex; flex-wrap: wrap; gap: 6px; }
.payx-used span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; cursor: pointer; }
.payx-used span.on { border-color: var(--p); background: var(--p-50); }
.payx-used i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); font-weight: 700; }
.payx-used i:hover { background: var(--err-50); color: var(--err); }
.payx-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.payx-quick button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 6px; border-radius: 11px; border: 1px solid #bbf7d0; background: linear-gradient(180deg, #f0fdf4, #dcfce7); color: #14532d; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums; transition: transform .08s, box-shadow .12s; }
.payx-quick button small { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.payx-quick button:hover { box-shadow: 0 6px 14px -8px #16a34a; transform: translateY(-1px); }
.payx-quick button.exact { border-color: var(--p-100); background: var(--p-50); color: var(--p); }
.payx-ref { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.payx-ref:focus-within { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-100); }
.payx-ref input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--text); }
.payx-qr { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid #ddd6fe; background: linear-gradient(135deg, #faf5ff, #ede9fe); }
.payx-qr .qr { width: 168px; height: 168px; flex: none; padding: 8px; border-radius: 12px; background: #fff; box-shadow: 0 8px 20px -12px rgba(76,29,149,.6); }
.payx-qr .qr svg { width: 100%; height: 100%; display: block; }
.payx-qr .qt b { display: block; font-size: 17px; color: #4c1d95; }
.payx-qr .qt small { display: block; font-family: ui-monospace, monospace; font-size: 12px; color: #6d28d9; margin: 2px 0 8px; word-break: break-all; }
.payx-qr .qt span { display: block; font-size: 12px; color: #5b21b6; line-height: 1.45; }
.payx-qr .qt em { font-style: normal; font-weight: 800; color: #15803d; }
.payx-tip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; border: 1px dashed var(--border); }
.payx-pad { gap: 8px; }
.payx-pad button { height: 54px; border-radius: 12px; background: var(--surface); box-shadow: 0 1px 0 var(--border), 0 2px 4px -2px rgba(15,23,42,.12); font-size: 21px; font-variant-numeric: tabular-nums; transition: background .1s, transform .06s; }
.payx-pad button.fn { background: var(--surface-2); color: var(--muted); }
.payx-pad button:active { background: var(--p-50); }
.payx-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.payx-keys i { font-style: normal; font-family: ui-monospace, monospace; font-weight: 700; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); margin-right: 3px; }
.payx-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.payx-switch input { position: absolute; opacity: 0; pointer-events: none; }
.payx-switch i { width: 40px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; flex: none; }
.payx-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.payx-switch input:checked + i { background: var(--p); }
.payx-switch input:checked + i::after { left: 21px; }
.payx-switch b { display: block; font-size: 13px; }
.payx-switch small { display: block; font-size: 11px; color: var(--muted); }
.payx-done { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border: 0; border-radius: 13px; font: inherit; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 12px 24px -12px rgba(22,163,74,.95); transition: transform .08s, filter .12s; }
.payx-done b { font-size: 17px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); font-variant-numeric: tabular-nums; }
.payx-done:hover:not(:disabled) { filter: brightness(1.05); }
.payx-done:active:not(:disabled) { transform: scale(.98); }
.payx-done.off, .payx-done:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; border: 1px dashed var(--border); }
@media (max-width: 760px) {
  .payx { grid-template-columns: 1fr; }
  .payx-total b { font-size: 30px; }
  .payx-qr { flex-direction: column; text-align: center; }
  .payx-switch small, .payx-keys { display: none; }
  .payx-done { height: 48px; padding: 0 14px; }
}

.donex { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0; }
.donex .ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-50); color: var(--ok); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 8%, transparent); margin-bottom: 6px; }
.donex .amt { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.donex .meta { color: var(--muted); font-size: 13px; }
.donex .chg { margin-top: 8px; width: 100%; padding: 14px; border-radius: 12px; background: var(--ok-50); color: var(--ok); display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.donex .chg b { font-size: 26px; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 38px; background: var(--p); border-radius: 6px 6px 2px 2px; min-height: 2px; opacity: .9; }
.bars .b:hover i { opacity: 1; }
.bars .b span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; padding: 6px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--p); border-radius: 6px; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.imgbox { width: 140px; height: 140px; border: 2px dashed var(--border); border-radius: 12px; display: grid; place-items: center; overflow: hidden; cursor: pointer; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 12px; }
.imgbox img { width: 100%; height: 100%; object-fit: cover; }
/* Item form: photo pane + sectioned fields (CSS grid, no flex-wrap height quirks) */
.itemform { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.photo-pane { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.imgbox.big { width: 100%; height: 200px; }
.fsec { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .itemform { grid-template-columns: 1fr; } .imgbox.big { height: 180px; } }
.modal-b { min-height: 0; }
.thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 14px; }
.icard { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .12s, transform .08s; }
.icard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.icard .ph { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; font-size: 28px; font-weight: 800; color: var(--muted); }
.icard .ph img { width: 100%; height: 100%; object-fit: cover; }
.icard .bd { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.icard .bd b { font-size: 13.5px; line-height: 1.3; }
.bc-prev { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--border); display: inline-block; }
/* printing uses a separate iframe document (see core.js printHtml) */

/* ---------- professional sign-in ---------- */
.lg { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr); background: var(--surface); }
.lg-hero { position: relative; overflow: hidden; color: #fff; padding: 40px 56px; display: flex; flex-direction: column; gap: 32px;
  background: radial-gradient(900px 520px at 0% 0%, rgba(255,255,255,.16), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(0,0,0,.25), transparent 60%), linear-gradient(140deg, var(--side-bg) 0%, var(--p-600) 58%, var(--p) 100%); }
.lg-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.lg-hero > * { position: relative; }
.lg-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.lg-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.lg-hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.025em; font-weight: 800; max-width: 560px; }
.lg-hero .lead { font-size: 16px; line-height: 1.6; opacity: .85; max-width: 520px; margin: 14px 0 0; }
.lg-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 600px; }
.lg-feat { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); }
.lg-feat .i { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.16); }
.lg-feat b { display: block; font-size: 14px; margin-bottom: 2px; }
.lg-feat span { font-size: 12.5px; opacity: .78; line-height: 1.45; }
.lg-trust { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12.5px; opacity: .8; }
.lg-trust span { display: inline-flex; align-items: center; gap: 7px; }
.lg-side { display: flex; flex-direction: column; padding: 28px 40px; background: var(--surface); }
.lg-side .top-r { display: flex; justify-content: flex-end; }
.lg-box { width: 100%; max-width: 400px; margin: auto; display: flex; flex-direction: column; gap: 18px; }
.lg-box h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.lg-box .sub { color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.lg-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--p-50); color: var(--p); margin-bottom: 14px; }
.ifield { position: relative; }
.ifield > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ifield .inp { height: 50px; padding-left: 44px; font-size: 15px; border-radius: 10px; background: var(--surface-2); }
.ifield .inp:focus { background: var(--surface); }
.ifield .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.lg-box .btn.pri { height: 50px; font-size: 15.5px; border-radius: 10px; box-shadow: 0 8px 20px -8px var(--p); }
.lg-caps { font-size: 12px; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.lg-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-top: 18px; }
.lg-foot span { display: inline-flex; align-items: center; gap: 6px; }
.lg.admin .lg-hero { background: radial-gradient(900px 520px at 0% 0%, rgba(99,102,241,.35), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(20,184,166,.22), transparent 60%), linear-gradient(150deg, #020617 0%, #0f172a 55%, #1e1b4b 100%); }
.lg-mock { max-width: 600px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lg-mock div { background: rgba(255,255,255,.08); border-radius: 10px; padding: 12px; }
.lg-mock small { display: block; opacity: .7; font-size: 11.5px; }
.lg-mock b { font-size: 20px; }
@media (max-width: 980px) {
  .lg { grid-template-columns: 1fr; }
  .lg-hero { display: none; }
  .lg-side { padding: 22px; }
}
.lg-mobile-brand { display: none; }
.lg-logo-plate { align-self: flex-start; background: #fff; border-radius: 16px; padding: 12px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.lg-logo-plate img { display: block; height: 64px; width: auto; max-width: 360px; }
.lg-form-logo { display: block; height: 56px; width: auto; max-width: 100%; object-fit: contain; object-position: left; margin-bottom: 4px; }
@media (min-width: 981px) { .lg-hero:has(.lg-logo-plate) ~ .lg-side .lg-form-logo { display: none; } }
.side .brand .logo.light { background: #fff; padding: 3px; }
.side .brand .logo.light img { object-fit: contain; }
.brand-prev { display: grid; place-items: center; min-height: 120px; border-radius: 12px; border: 1px dashed var(--border); padding: 16px; }
.brand-prev img { max-height: 90px; max-width: 100%; }
@media (max-width: 980px) { .lg-mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; } .lg-mobile-brand .lg-mark { background: var(--p); color: var(--on-p); border: 0; } }