/* StockNest POS */
:root {
  --ink: #1c2b33;
  --ink-2: #3c4d57;
  --muted: #6b7a83;
  --line: #dde3e1;
  --line-2: #eef1f0;
  --paper: #f3f5f4;
  --surface: #ffffff;
  --brand: #0e7c66;
  --brand-ink: #ffffff;
  --amber: #b97d0b;
  --amber-bg: #fdf3dc;
  --danger: #c2412d;
  --danger-bg: #fbe9e5;
  --ok-bg: #e2f3ee;
  --side: #1c2b33;
  --side-ink: #c9d3d8;
  --r: 8px;
  --r-lg: 12px;
  --solid: #1c2b33;
  --on-solid: #ffffff;
  --input-line: #cdd5d2;
  --thead: #fafbfb;
  --row-hover: #fafcfb;
  --pos-bg: #e7ebe9;
  --tape: #fffdf8;
  --tape-line: #ddd6c4;
  --tape-line-2: #e8e2d3;
  --tape-chip: #f2efe6;
  --tape-muted: #9a9483;
  color-scheme: light;
  --font: "IBM Plex Sans", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* Dark theme: follows the device unless the user picked light or dark (html[data-theme]). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --ink: #e3eaed; --ink-2: #c3ced3; --muted: #93a3ab; --line: #2c3a41; --line-2: #222e34; --paper: #10181c; --surface: #172126;
  --amber: #e2a93b; --amber-bg: #3a2e14; --danger: #ef7a66; --danger-bg: #3d1f1a; --ok-bg: #133229; --side: #0b1215; --side-ink: #b3c1c8;
  --solid: #dfe7ea; --on-solid: #10181c; --input-line: #33434b; --thead: #1b262c; --row-hover: #1c282e; --pos-bg: #0d1418;
  --tape: #1e2a2f; --tape-line: #3a4a52; --tape-line-2: #2e3d44; --tape-chip: #26343a; --tape-muted: #8a9aa2; } }
:root[data-theme="dark"] { color-scheme: dark; --ink: #e3eaed; --ink-2: #c3ced3; --muted: #93a3ab; --line: #2c3a41; --line-2: #222e34; --paper: #10181c; --surface: #172126;
  --amber: #e2a93b; --amber-bg: #3a2e14; --danger: #ef7a66; --danger-bg: #3d1f1a; --ok-bg: #133229; --side: #0b1215; --side-ink: #b3c1c8;
  --solid: #dfe7ea; --on-solid: #10181c; --input-line: #33434b; --thead: #1b262c; --row-hover: #1c282e; --pos-bg: #0d1418;
  --tape: #1e2a2f; --tape-line: #3a4a52; --tape-line-2: #2e3d44; --tape-chip: #26343a; --tape-muted: #8a9aa2; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; }
html[lang="bn"] body { font-family: "Noto Sans Bengali", "IBM Plex Sans", system-ui, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
img { max-width: 100%; }
.ic { flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--brand); }
.amber-text { color: var(--amber); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; background: #fff; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.side nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 1px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; color: var(--side-ink); font-size: 14.5px; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side nav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav-sep { margin: 16px 10px 6px; font-size: 12px; color: #8597a1; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: #71848e; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; min-height: 60px; }
.page-title { font-size: 1.2rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 10px; }
.branch-pick select { padding: 6px 28px 6px 10px; font-size: 14px; }
.lang { border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; font-size: 13px; color: var(--ink-2); }
.lang:hover { text-decoration: none; border-color: var(--ink-2); }
.menu { position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--solid); color: var(--on-solid); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.menu-pop { position: absolute; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(28,43,51,.14); padding: 8px; min-width: 190px; z-index: 30; }
.menu-pop > div { padding: 4px 10px 8px; }
.menu-pop a, .menu-pop button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--line-2); text-decoration: none; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.demo-bar { background: var(--amber-bg); color: #6d4a06; padding: 7px 24px; font-size: 13.5px; border-bottom: 1px solid #f1dfb3; }
.only-m { display: none; }
.scrim { display: none; }

/* ---------- elements ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--solid); background: var(--solid); color: var(--on-solid); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); filter: none; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #efc4bb; }
.btn.danger:hover { background: var(--danger-bg); filter: none; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 12px 18px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; color: inherit; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--line-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.link-btn.danger { color: var(--danger); }

input, select, textarea { font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--input-line); border-radius: 7px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.15); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a83' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
textarea { min-height: 80px; resize: vertical; }
label.f { display: block; margin-bottom: 14px; }
label.f > span, .f-label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 5px; color: var(--ink-2); }
.hint, label.f > span.hint { font-size: 12.5px; font-weight: 400; color: var(--muted); margin: 4px 0 0; display: block; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 16px 20px 0; }
.narrow { max-width: 760px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 420px; position: relative; }
.toolbar .search .ic { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.toolbar .search input { padding-left: 34px; }
.toolbar select { width: auto; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.filters input, .filters select { width: auto; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; }
.chip:hover { text-decoration: none; border-color: var(--ink-2); }
.chip.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--thead); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr:hover { background: var(--row-hover); }
.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.t .num, .t th.num { text-align: right; }
.t-wrap { overflow-x: auto; }
.t .thumb { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--line-2); display: block; }
.t .actions { white-space: nowrap; text-align: right; }
.t .actions > * { margin-left: 4px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: #0a5c4b; }
.badge.warn { background: var(--amber-bg); color: #7a5306; }
.badge.bad { background: var(--danger-bg); color: #9c321f; }

.alert { padding: 11px 14px; border-radius: var(--r); margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert.success { background: var(--ok-bg); border-color: #b9e0d4; color: #0a5c4b; }
.alert.error { background: var(--danger-bg); border-color: #f0c6bd; color: #8e2b19; }
.alert.info { background: #eaf1f6; border-color: #cbdbe6; color: #234556; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 14px 0 0; font-size: 14px; }
.panel.flush .pager { padding: 12px 20px 16px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.kpi .k-label { font-size: 13.5px; color: var(--muted); }
.kpi .k-val { font-size: 1.6rem; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.kpi .k-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi.alert-kpi .k-val { color: var(--amber); }
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.chart-box { position: relative; height: 280px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.bar-mini { height: 6px; background: var(--line-2); border-radius: 3px; margin-top: 5px; }
.bar-mini > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

/* ---------- detail ---------- */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; }
.meta div > span { display: block; font-size: 12.5px; color: var(--muted); }
.meta div > b { font-weight: 600; }
.totals { margin-left: auto; width: min(340px, 100%); font-size: 14.5px; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 1.15rem; font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14.5px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 500; }

/* variant rows editor */
.vrows .vrow { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr .9fr .9fr .8fr .9fr 36px; gap: 8px; align-items: end; margin-bottom: 8px; }
.vrows .vrow.head { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.img-prev { width: 96px; height: 96px; border-radius: var(--r); object-fit: cover; border: 1px solid var(--line); background: var(--line-2); }

/* line editor (purchases, adjustments, transfers) */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 28px rgba(28,43,51,.16); max-height: 320px; overflow-y: auto; margin-top: 4px; }
.picker-list button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line-2); font: inherit; font-size: 14px; cursor: pointer; }
.picker-list button:hover, .picker-list button.hl { background: var(--ok-bg); }
.lines input { padding: 6px 8px; }
.lines td { padding: 6px 8px; }

/* ---------- login / install ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-art { background: var(--side); color: #dbe3e7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { color: #fff; font-size: 2.1rem; max-width: 14em; font-weight: 600; letter-spacing: -.015em; }
.auth-art p { max-width: 30em; color: #aebcc4; }
.tape { position: absolute; right: 48px; bottom: 0; width: 230px; background: #fffdf8; color: var(--ink); padding: 20px 20px 34px; font-size: 13px; transform: rotate(-3deg); transform-origin: bottom right;
  -webkit-mask: radial-gradient(circle 6px at 8px 0, transparent 98%, #000) -8px 0 / 16px 100% repeat-x; mask: radial-gradient(circle 6px at 8px 0, transparent 98%, #000) -8px 0 / 16px 100% repeat-x; }
.tape div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #e2ddd0; }
.tape .tot { border: 0; font-size: 20px; font-weight: 700; padding-top: 10px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .btn { width: 100%; padding: 11px; font-size: 15px; }
.demo-creds { background: var(--ok-bg); border: 1px solid #b9e0d4; border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; }
.demo-creds button { margin-top: 6px; }
.install { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }
.install h1 { font-size: 1.8rem; margin-bottom: 4px; }
.install fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 18px 20px 6px; margin: 0 0 18px; }
.install legend { font-weight: 600; padding: 0 6px; }
.seg { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--ok-bg); }

/* ---------- POS ---------- */
body.pos-body .content { max-width: none; padding: 0; }
body.pos-body .top { padding: 8px 16px; min-height: 52px; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 52px); overflow: hidden; }
body.pos-body.has-demo .pos { height: calc(100vh - 52px - 36px); }
.pos-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 16px 0; }
.pos-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pos-search .search-box { flex: 1; position: relative; }
.pos-search .search-box .ic { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.pos-search input { padding: 11px 12px 11px 38px; font-size: 16px; border-radius: 10px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.cats button { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.cats button.on { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.tile:hover { border-color: var(--brand); }
.tile:active { transform: scale(.98); }
.tile .ph { aspect-ratio: 4 / 3; background: var(--line-2); display: grid; place-items: center; color: #9fb0b8; font-size: 26px; font-weight: 600; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; }
.tile.noimg { flex-direction: row; align-items: stretch; min-height: 92px; }
.tile.noimg .ini { flex: none; width: 6px; background: var(--cat, #c9d3d8); }
.tile .tb .meta-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 4px; }
.tile .tb .meta-row .tp { margin: 0; padding: 0; }
.tile .tb { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tile .tn { font-size: 13.5px; line-height: 1.3; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tp { font-weight: 600; margin-top: auto; padding-top: 4px; }
.tile .ts { font-size: 12px; color: var(--muted); }
.tile .ts.low { color: var(--amber); }
.tile .ts.out { color: var(--danger); }
.tile[disabled] { opacity: .5; cursor: not-allowed; }

/* the receipt tape */
.pos-right { background: var(--pos-bg); padding: 12px 14px 14px 0; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.receipt { background: var(--tape); flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; box-shadow: 0 1px 3px rgba(28,43,51,.12); position: relative; }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: radial-gradient(circle 5px at 7px 0, var(--tape) 98%, transparent) 0 0 / 14px 8px repeat-x; }
.rc-head { padding: 12px 14px 8px; border-bottom: 1px dashed var(--tape-line); }
.cust-pick { display: flex; gap: 6px; }
.cust-pick .picker { flex: 1; }
.cust-pick input { padding: 7px 10px; font-size: 14px; background: var(--surface); }
.cust-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--tape-chip); border-radius: 7px; padding: 6px 6px 6px 10px; font-size: 14px; }
.cust-chip .due { font-size: 12px; color: var(--danger); }
.rc-lines { flex: 1; overflow-y: auto; padding: 4px 14px; }
.rc-empty { text-align: center; color: var(--tape-muted); padding: 40px 10px; font-size: 14px; }
.rc-line { padding: 9px 0; border-bottom: 1px dashed var(--tape-line-2); }
.rc-line .l1 { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rc-line .l1 .nm { font-weight: 500; }
.rc-line .l2 { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--tape-line); border-radius: 7px; background: var(--surface); }
.qty-ctl button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.qty-ctl input { width: 52px; border: 0; text-align: center; padding: 3px; font-size: 14px; border-radius: 0; }
.qty-ctl input:focus { box-shadow: none; }
.rc-line .mini { width: 78px; padding: 4px 6px; font-size: 13px; }
.rc-line .rm { margin-left: auto; color: var(--tape-muted); }
.rc-sum { padding: 10px 14px 4px; border-top: 1px dashed var(--tape-line); font-size: 14px; }
.rc-sum > div { display: flex; justify-content: space-between; padding: 2px 0; align-items: center; }
.rc-sum .disc-ctl { display: flex; gap: 4px; align-items: center; }
.rc-sum .disc-ctl input { width: 80px; padding: 3px 6px; font-size: 13.5px; text-align: right; }
.rc-sum .disc-ctl select { width: auto; padding: 3px 24px 3px 6px; font-size: 13px; background-position: right 6px center; }
.totalizer { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px 16px; }
.totalizer .tl { font-size: 14px; color: var(--muted); }
.totalizer .tv { font-size: 2.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.pos-actions { display: grid; grid-template-columns: auto auto auto 1fr; gap: 8px; margin-top: 16px; }
.pos-actions .btn.pay { font-size: 17px; padding: 13px; }

/* pay dialog */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 0 24px 60px rgba(28,43,51,.3); color: var(--ink); }
dialog::backdrop { background: rgba(28,43,51,.45); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-b { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.dlg-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.pay-due b { font-size: 2rem; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pay-methods button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.pay-methods button.on { border-color: var(--brand); background: var(--ok-bg); }
.pay-row { display: grid; grid-template-columns: 1fr 1.2fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.pay-row input { font-size: 18px; padding: 9px 10px; text-align: right; }
.cash-keys { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.cash-keys button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font: inherit; font-size: 14px; cursor: pointer; }
.pay-result { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 8px; background: var(--paper); font-size: 15px; }
.pay-result.change { background: var(--ok-bg); }
.pay-result.due { background: var(--danger-bg); }
.held-list .h-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.done-box { text-align: center; padding: 10px 0; }
.done-box .ok-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--ok-bg); color: var(--brand); display: inline-grid; place-items: center; margin-bottom: 10px; }
.done-box .big { font-size: 1.8rem; font-weight: 700; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--solid); color: var(--on-solid); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); }
.pos-mobile-bar { display: none; }

/* ---------- print: receipts, invoices, labels ---------- */
.print-page { background: #fff; }
.receipt-print { width: 80mm; margin: 0 auto; padding: 4mm 3mm; font: 12px/1.35 "IBM Plex Sans", "Noto Sans Bengali", Arial, sans-serif; color: #000; }
.receipt-print.w58 { width: 58mm; font-size: 11px; }
.receipt-print .c { text-align: center; }
.receipt-print h1 { font-size: 16px; margin: 2px 0; }
.receipt-print img.logo { max-height: 50px; display: block; margin: 0 auto 4px; }
.receipt-print hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt-print table { width: 100%; border-collapse: collapse; }
.receipt-print td { padding: 2px 0; vertical-align: top; }
.receipt-print .r { text-align: right; white-space: nowrap; }
.receipt-print .big { font-size: 15px; font-weight: 700; }
.receipt-print svg.bc { display: block; margin: 6px auto 0; max-width: 100%; }
.print-tools { position: sticky; top: 0; background: var(--paper); padding: 10px; display: flex; gap: 8px; justify-content: center; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.invoice-a4 { max-width: 210mm; margin: 0 auto; padding: 14mm; background: #fff; font-size: 13px; }
.invoice-a4 .inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.invoice-a4 h1 { font-size: 24px; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, 50mm); gap: 3mm; padding: 6mm; justify-content: center; }
.label { width: 50mm; height: 30mm; border: 1px dashed #bbb; padding: 1.5mm; text-align: center; overflow: hidden; font-size: 9px; line-height: 1.2; display: flex; flex-direction: column; justify-content: center; }
.label .ln { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lp { font-weight: 700; font-size: 11px; }
.label svg { width: 100%; height: 13mm; }
@media print {
  .print-tools, .no-print { display: none !important; }
  body { background: #fff; }
  .label { border: 0; }
  @page { margin: 0; }
}

/* ---------- responsive ---------- */
.close-cart { display: none !important; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0, 1fr) 350px; }
  .vrows .vrow { grid-template-columns: 1fr 1fr 1fr 36px; }
  .vrows .vrow.head { display: none; }
  .vrows .vrow > label > span.f-label { display: block; }
}
@media (min-width: 1101px) { .vrows .vrow > label > span.f-label { display: none; } }
@media (max-width: 860px) {
  .pos { overflow: visible; grid-template-rows: auto; }
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(28,43,51,.4); z-index: 50; }
  .only-m { display: inline-grid; }
  .hide-s { display: none; }
  .top { padding: 10px 14px; }
  .content { padding: 16px 14px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-left { padding: 12px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); overflow: visible; padding-bottom: 90px; }
  .pos-right { position: fixed; inset: 0; z-index: 70; padding: 0; background: var(--tape); display: none; }
  body.cart-open .pos-right { display: flex; }
  .receipt { border-radius: 0; }
  .receipt::after { display: none; }
  .pos-right .pos-actions { padding: 0 12px 12px; margin-top: 0; }
  .pos-mobile-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 65; }
  .pos-mobile-bar .btn { flex: 1; padding: 14px; font-size: 16px; justify-content: space-between; box-shadow: 0 8px 20px rgba(14,124,102,.35); }
  .close-cart { display: inline-grid !important; }
  .panel { padding: 16px; }
  .t th, .t td { padding: 9px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* two-step sign-in */
.codes { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r); padding: 14px 18px; font: 600 15px/1.9 ui-monospace, "SFMono-Regular", Consolas, monospace; columns: 2; max-width: 360px; }
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.qr-box .qr svg { width: 180px; height: 180px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
.qr-box .secret { display: block; font-size: 15px; letter-spacing: .08em; margin-top: 4px; word-break: break-all; }
ol.steps { padding-left: 20px; margin: 0 0 8px; }
ol.steps li { margin-bottom: 6px; }

/* loyalty points */
.cust-chip .pts { font-size: 12px; color: var(--brand); }
.points-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--ok-bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.points-row input[type=number] { width: 90px; padding: 5px 8px; }

/* Dark theme: text colours that were tuned for light backgrounds. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-bar, :root:not([data-theme="light"]) .badge.warn { color: #f0c977; border-color: #4d3d1b; }
  :root:not([data-theme="light"]) .badge.ok, :root:not([data-theme="light"]) .alert.success { color: #7fd8bd; border-color: #1f4a3d; }
  :root:not([data-theme="light"]) .badge.bad, :root:not([data-theme="light"]) .alert.error { color: #f4a493; border-color: #5a2a22; }
  :root:not([data-theme="light"]) .alert.info { background: #172a35; border-color: #2a4555; color: #a9cbe0; }
}
:root[data-theme="dark"] .demo-bar, :root[data-theme="dark"] .badge.warn { color: #f0c977; border-color: #4d3d1b; }
:root[data-theme="dark"] .badge.ok, :root[data-theme="dark"] .alert.success { color: #7fd8bd; border-color: #1f4a3d; }
:root[data-theme="dark"] .badge.bad, :root[data-theme="dark"] .alert.error { color: #f4a493; border-color: #5a2a22; }
:root[data-theme="dark"] .alert.info { background: #172a35; border-color: #2a4555; color: #a9cbe0; }
.theme-pick { display: flex; gap: 4px; padding: 6px 12px; }
.theme-pick button { flex: 1; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.theme-pick button.on { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
input[type=file]::file-selector-button { margin-right: 10px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
