:root {
  --brand: #2f6fed; --brand-ink: #1f4fb8; --brand-soft: #e8f0fe;
  --bg: #f4f6fa; --surface: #fff; --surface-2: #f7f8fb; --line: #e3e7ef; --line-2: #cfd6e3;
  --ink: #141a26; --ink-2: #4a5468; --ink-3: #7a8499;
  --ok: #138a52; --ok-soft: #e3f5ec; --warn: #b26a00; --warn-soft: #fff3dc; --err: #c8312b; --err-soft: #fdebea;
  --side: #121a2b; --side-ink: #c8d0e0; --side-hi: #ffffff;
  --r: 10px; --r-lg: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 20px 50px rgba(16,24,40,.22);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.hide { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger-ghost { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, white); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 4px 11px; font-size: 13.5px; }
.btn.lg { min-height: 52px; font-size: 17px; padding: 10px 22px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.primary):not(.danger).loading::after { border-color: var(--line-2); border-top-color: var(--brand); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
input.money { text-align: right; font-family: var(--mono); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.field { display: block; }
.field > span { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.field .req { color: var(--err); }
.field .hint { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 550; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-input input { padding-left: 36px !important; }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.auth-card .logo { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 16px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--ink-2); margin: 6px 0 22px; }
.auth-card form > * + * { margin-top: 14px; }
.auth-card .btn.primary { width: 100%; min-height: 46px; margin-top: 20px; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--ink-3); text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--brand-ink); font-weight: 650; font-size: 13px; cursor: pointer; padding: 6px; }
.alert { padding: 11px 13px; border-radius: 9px; font-size: 14px; display: flex; gap: 9px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 2px; }
.alert.err { background: var(--err-soft); color: #8d1f1a; }
.alert.warn { background: var(--warn-soft); color: #7a4a00; }
.alert.info { background: var(--brand-soft); color: var(--brand-ink); }
.alert.ok { background: var(--ok-soft); color: #0b5c36; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--side-hi); }
.side-brand .mk { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; flex: none; }
.side-brand b { display: block; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.side-brand small { color: var(--side-ink); opacity: .7; font-size: 12px; }
.nav { padding: 6px 10px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--side-ink); font-weight: 560; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: var(--side-hi); }
.nav a.on { background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.me-box { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.me-box .who { min-width: 0; flex: 1; }
.me-box .who b { display: block; color: var(--side-hi); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-box .who small { font-size: 12px; opacity: .7; }
.me-box .icon-btn { color: var(--side-ink); }
.me-box .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; }
.gsearch { position: relative; width: min(420px, 100%); }
.gsearch-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; z-index: 30; padding: 6px; }
.gsearch-results .grp { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 4px; letter-spacing: .05em; }
.gsearch-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.gsearch-results a:hover, .gsearch-results a.hl { background: var(--brand-soft); }
.gsearch-results small { display: block; color: var(--ink-3); }
.content { padding: 24px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; margin-bottom: 10px; }

/* ---------- cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search-input { flex: 1; min-width: 220px; max-width: 420px; }
.toolbar select { width: auto; min-width: 150px; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .t-main { font-weight: 650; }
.tbl .t-sub { color: var(--ink-3); font-size: 13px; }
.tbl tr.dim td { color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 650; color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tab.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab .count { background: var(--surface-2); border-radius: 999px; padding: 0 7px; font-size: 12px; color: var(--ink-3); }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty p { margin: 0 0 14px; }
.loading-box { padding: 40px; display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--ink-3); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 30px; text-align: center; color: var(--err); display: grid; justify-items: center; gap: 10px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink-3); font-size: 13.5px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 13.5px; }
.dl dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip .count { opacity: .75; margin-left: 4px; font-weight: 500; }

/* ---------- KPI & charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-l { display: block; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.kpi-v { display: block; font-size: 24px; font-weight: 750; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-s { font-size: 12.5px; color: var(--ink-3); }
.kpi-s .up { color: var(--ok); font-weight: 700; }
.kpi-s .down { color: var(--err); font-weight: 700; }
.kpi.warn .kpi-v { color: var(--warn); }
.chart { width: 100%; height: 230px; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--brand-ink); }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .grid { stroke: var(--line); }
.hbars { display: grid; gap: 10px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.hbar .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 7px; background: var(--surface-2); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; height: calc(100vh - 57px - var(--tour-h, 0px)); }
.pos-left { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px 0; overflow: hidden; }
.pos-search { display: flex; gap: 10px; }
.pos-search .search-input { flex: 1; }
.pos-search input { min-height: 46px; font-size: 16px; }
.pos-cats { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; flex: none; }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding-bottom: 18px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 108px; transition: border-color .1s, box-shadow .1s, transform .05s; position: relative; }
.pcard:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pcard:active { transform: scale(.98); }
.pcard .pn { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pp { margin-top: auto; font-weight: 750; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.pcard .ps { font-size: 12px; color: var(--ink-3); }
.pcard .ps.low { color: var(--warn); font-weight: 650; }
.pcard .ps.out { color: var(--err); font-weight: 650; }
.pcard.disabled { opacity: .5; }
.pcard .incart { position: absolute; top: 8px; right: 8px; background: var(--brand); color: #fff; border-radius: 99px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; font-weight: 750; padding: 0 6px; }
.pos-right { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pos-cust { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cust-pill { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; }
.cust-pill .grow b { display: block; }
.cust-pill .grow small { color: var(--ink-2); }
.cart-lines { flex: 1; overflow-y: auto; padding: 4px 16px; }
.cline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cline .cn { font-weight: 620; line-height: 1.3; }
.cline .cp { font-size: 13px; color: var(--ink-3); }
.cline .ct { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--line); }
.qty input { width: 48px; min-height: 32px !important; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0 !important; box-shadow: none !important; font-weight: 700; }
.cline .acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.cart-empty { color: var(--ink-3); text-align: center; padding: 50px 10px; }
.pos-sum { border-top: 1px solid var(--line); padding: 14px 16px 16px; background: var(--surface-2); }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.sum-row.total { font-size: 22px; font-weight: 800; padding-top: 8px; }
.sum-row .link { background: none; border: 0; color: var(--brand-ink); font-weight: 650; cursor: pointer; padding: 0; }
.pay-btn { margin-top: 12px; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method { border: 2px solid var(--line-2); border-radius: 10px; padding: 12px 8px; background: var(--surface); font-weight: 700; cursor: pointer; }
.method.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pay-total { text-align: center; padding: 6px 0 14px; }
.pay-total small { color: var(--ink-3); display: block; }
.pay-total b { font-size: 32px; font-variant-numeric: tabular-nums; }
.change { display: flex; justify-content: space-between; font-size: 18px; font-weight: 750; padding: 12px 14px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); margin-top: 12px; }
.change.neg { background: var(--err-soft); color: var(--err); }
.held { display: flex; gap: 6px; flex-wrap: wrap; }
.cart-toggle { display: none !important; width: 100%; justify-content: center; align-items: center; gap: 6px; border: 0; background: none; color: var(--brand-ink); font-weight: 700; padding: 2px 0 8px; cursor: pointer; }

/* ---------- receipt ---------- */
.receipt { width: 300px; margin: 0 auto; font-family: var(--mono); font-size: 12.5px; color: #000; background: #fff; padding: 14px 12px; }
.receipt .c { text-align: center; }
.receipt h3 { font-family: var(--font); font-size: 16px; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt .r { text-align: right; white-space: nowrap; }
.receipt .big { font-size: 15px; font-weight: 700; }

/* ---------- modal & toasts ---------- */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; color: var(--ink); }
dialog.modal:not([open]) { display: none; }
dialog.modal.wide { width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(16, 24, 40, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-msg { margin: 0 0 12px; color: var(--ink-2); }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 1000; }
.toast { display: flex; align-items: center; gap: 9px; background: #16213a; color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: min(420px, calc(100vw - 36px)); animation: tin .2s ease; }
.toast.ok svg { color: #6ee7a8; }
.toast.err { background: #8d1f1a; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- perms matrix ---------- */
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.perm-group h3 { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.perm-group label { display: flex; gap: 9px; align-items: center; padding: 5px 0; cursor: pointer; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.timeline .dot.note { background: var(--ink-3); }
.timeline .dot.void { background: var(--err); }
.timeline .meta { font-size: 12.5px; color: var(--ink-3); }

/* ---------- demo guide ---------- */
.tour { background: #fffbea; border-bottom: 1px solid #f0dc9a; padding: 10px 24px 12px; }
.tour-head { display: flex; align-items: center; gap: 10px; }
.tour-badge { background: #f5b301; color: #3d2c00; font-size: 11px; font-weight: 800; letter-spacing: .06em; border-radius: 6px; padding: 2px 7px; }
.tour-title { font-size: 14.5px; }
.tour-prog { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tour-bar { flex: 1; max-width: 220px; height: 6px; background: #f3e6b8; border-radius: 99px; overflow: hidden; }
.tour-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.tour-toggle { margin-left: auto; font-size: 16px; }
.tour-now { display: flex; align-items: center; gap: 12px; margin-top: 8px; background: #fff; border: 1px solid #f0dc9a; border-radius: 10px; padding: 10px 12px; }
.tour-now.flash { animation: tourflash .9s ease; }
@keyframes tourflash { 0% { background: var(--ok-soft); } 100% { background: #fff; } }
.tour-now.done { color: var(--ok); font-weight: 650; }
.tour-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.tour-text { font-weight: 650; }
.tour-hint { font-size: 13px; color: var(--ink-2); }
.tour-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; font-size: 13.5px; }
.tour-list li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.tour-list li.ok { color: var(--ok); text-decoration: line-through; text-decoration-color: rgba(19,138,82,.4); }
.tour-list li.cur { color: var(--ink); font-weight: 650; }
.tour-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 11px; flex: none; margin-top: 1px; }
.tour-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; }
.tour-foot .chip { text-decoration: none; }
.tour-note { margin-left: auto; }
.demo-roles { display: grid; gap: 8px; }
.demo-role { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none !important; }
.demo-role:hover { border-color: var(--brand); background: var(--brand-soft); }
.demo-role small { grid-column: 1; color: var(--ink-2); }
.demo-role .go { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--brand-ink); font-weight: 700; }
.auth details { margin-top: 6px; }
.auth details summary { cursor: pointer; margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 40; }
  .topbar { padding: 8px 12px; }
  .topbar .menu-btn { display: inline-grid; }
  .content { padding: 16px 12px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-left { padding: 12px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: none; overflow: visible; }
  .pos-right { border-left: 0; border-top: 1px solid var(--line); position: sticky; bottom: 0; max-height: 85vh; box-shadow: 0 -8px 24px rgba(16,24,40,.12); }
  .pos-right:not(.open) .pos-cust, .pos-right:not(.open) .held, .pos-right:not(.open) .cart-lines, .pos-right:not(.open) .sum-row:not(.total) { display: none; }
  .pos-right:not(.open) .pos-sum { padding-top: 8px; }
  .pos-right:not(.open) .sum-row.total { font-size: 18px; padding-top: 0; }
  .cart-toggle { display: flex !important; }
  .dl { grid-template-columns: 110px 1fr; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .hide-sm { display: none; }
  .tour { padding: 8px 12px 10px; }
  .tour-bar { display: none; }
  .tour-title { font-size: 13.5px; }
  .tour-now { padding: 8px 10px; gap: 9px; }
  .tour-text { font-size: 14px; }
  .tour-list { grid-template-columns: 1fr; }
  .tour-note { margin-left: 0; width: 100%; }
}

/* ---------- print (receipt only) ---------- */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .receipt { width: 72mm; padding: 0; }
  @page { margin: 4mm; size: 80mm auto; }
}
