/* Mandaing POS — shared styles */
/* Brand: deep navy on white. */
:root {
  --brand: #1b2a55;
  --sidebar: #1b2a55;
  --sidebar-2: #13204a;
  --sidebar-text: #eef1f8;
  --sidebar-muted: #9ea9c6;
  --content: #eef1f7;
  --surface: #ffffff;
  --topbar: #ffffff;
  --ink: #2b3452;
  --ink-strong: #15203f;
  --muted: #7b849e;
  --line: #e3e7f0;
  --head: #e9edf5;
  --accent: #1b2a55;
  --warn: #b7791f;
  --ok: #2f7a55;
  --bad: #c8372d;
  --pill-border: #b8c0d3;
  --search-border: #1b2a55;
  --focus: #3a5bb8;
  --icon: #1b2a55;
  --bar: #2e4485;
  --pill-active: #1b2a55;
  --shadow: 0 1px 3px rgba(27, 42, 85, .07);
  --card-border: transparent;
  --font: "Nunito", "Noto Sans Myanmar", "Pyidaungsu", "Noto Sans SC", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #e6ebf8; --sidebar: #0b0f1c; --sidebar-2: #080b15; --sidebar-text: #e3e8f5; --sidebar-muted: #8590ad;
    --content: #0f1426; --surface: #161d31; --topbar: #131a2d; --card-border: #242c43;
    --ink: #d5dbea; --ink-strong: #f3f5fb; --muted: #8c96b2; --line: #273049; --head: #1d2539;
    --accent: #8ea8ff; --warn: #f0b25a; --ok: #5fd09c; --bad: #ff7f73; --pill-border: #39435d; --search-border: #414c69;
    --focus: #8ea8ff; --icon: #a8b8ec; --bar: #6d88e0; --pill-active: #3f5dbd;
    --shadow: 0 2px 10px rgba(0, 0, 0, .28); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #e6ebf8; --sidebar: #0b0f1c; --sidebar-2: #080b15; --sidebar-text: #e3e8f5; --sidebar-muted: #8590ad;
    --content: #0f1426; --surface: #161d31; --topbar: #131a2d; --card-border: #242c43;
    --ink: #d5dbea; --ink-strong: #f3f5fb; --muted: #8c96b2; --line: #273049; --head: #1d2539;
    --accent: #8ea8ff; --warn: #f0b25a; --ok: #5fd09c; --bad: #ff7f73; --pill-border: #39435d; --search-border: #414c69;
    --focus: #8ea8ff; --icon: #a8b8ec; --bar: #6d88e0; --pill-active: #3f5dbd;
    --shadow: 0 2px 10px rgba(0, 0, 0, .28); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--content); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 200px 1fr; height: 100vh; }

.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 22px 0 26px; overflow: hidden auto; }
.profile { text-align: center; padding: 0 16px 30px; }
.avatar { width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 50%; padding: 4px; border: 2px solid rgba(255,255,255,.55); }
.avatar span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #f1f6f8; color: #27505f; font-weight: 800; font-size: 19px; }
.profile-name { font-weight: 600; font-size: 15px; }
.profile-sub { font-size: 11px; color: var(--sidebar-muted); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 6px; padding-left: 14px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 16px; border-radius: 18px 0 0 18px; color: var(--sidebar-text); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { background: var(--content); color: var(--ink-strong); }
.nav-item.active::before, .nav-item.active::after { content: ""; position: absolute; right: 0; width: 18px; height: 18px; pointer-events: none; }
.nav-item.active::before { top: -18px; border-bottom-right-radius: 18px; box-shadow: 6px 6px 0 6px var(--content); }
.nav-item.active::after { bottom: -18px; border-top-right-radius: 18px; box-shadow: 6px -6px 0 6px var(--content); }
.nav-item .ico { width: 17px; height: 17px; }
.logout { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 0 40px; color: #f6c3b2; text-decoration: none; font-weight: 600; }
.logout .ico { width: 16px; height: 16px; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { flex: none; height: 58px; background: var(--topbar); display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 24px; }
.search { display: flex; align-items: stretch; width: min(276px, 40vw); height: 30px; border: 1.5px solid var(--search-border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; font-size: 13px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search button { border: 0; background: var(--head); width: 38px; display: grid; place-items: center; cursor: pointer; color: var(--ink-strong); }
.lang { height: 26px; border: 1px solid var(--pill-border); border-radius: 13px; background: var(--surface); padding: 0 8px; font-size: 12px; cursor: pointer; }
.theme-toggle { display: flex; background: var(--head); border-radius: 12px; padding: 2px; }
.theme-toggle button { border: 0; background: transparent; width: 30px; height: 20px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--icon); }
.theme-toggle button[aria-pressed="true"] { background: var(--pill-active); color: #fff; }
.theme-toggle .ico { width: 12px; height: 12px; }
.bell { position: relative; border: 0; background: transparent; cursor: pointer; padding: 4px; color: var(--ink-strong); display: grid; }
.bell .ico { width: 20px; height: 20px; }
.bell .dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }

.content { flex: 1; overflow: auto; padding: 18px 18px 22px; }

/* ---------- card + toolbar ---------- */
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 6px; padding: 18px 12px 18px; box-shadow: var(--shadow); }
.card-title { font-size: 17px; font-weight: 700; margin: 0 0 16px; color: var(--ink-strong); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 0 24px 0 25px; margin-bottom: 18px; }
.tabs { display: flex; gap: 16px; }
.tab { border: 0; background: none; padding: 4px 0 5px; cursor: pointer; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.date-range { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-strong); }
.date-pill { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--pill-border); border-radius: 16px; cursor: pointer; }
.date-pill .ico { width: 18px; height: 18px; color: var(--icon); }
.date-pill input { border: 0; background: transparent; font-size: 13px; padding: 0; width: 98px; outline: none; cursor: pointer; }
.date-pill input::-webkit-calendar-picker-indicator { display: none; }

/* ---------- table ---------- */
.table-wrap { padding: 0 22px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.table th { background: var(--head); text-align: left; font-weight: 600; font-size: 13.5px; color: var(--ink-strong); padding: 0; }
.th-sort { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 7px 18px 7px 12px; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 600; white-space: nowrap; }
.th-sort .ico { width: 15px; height: 15px; opacity: .65; }
.th-sort[data-dir] .ico { opacity: 1; color: var(--accent); }
.table td { padding: 0 12px 0 16px; height: 47.5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td, .table tbody tr:focus-visible td { background: color-mix(in srgb, var(--head) 45%, transparent); }
.table tbody tr:focus-visible { outline: none; }
.num { font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: 11px; margin-left: 6px; }
.status { font-weight: 700; }
.status.completed { color: var(--ok); }
.status.void { color: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 40px 0 !important; height: auto !important; cursor: default; }

/* ---------- pager ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 16px; font-size: 12px; }
.pager button { min-width: 20px; height: 20px; border-radius: 10px; border: 0; background: none; cursor: pointer; color: var(--ink-strong); padding: 0 4px; font-variant-numeric: tabular-nums; }
.pager button.arrow { border: 1px solid var(--icon); color: var(--icon); display: grid; place-items: center; padding: 0; width: 20px; }
.pager button.arrow .ico { width: 13px; height: 13px; }
.pager button[aria-current="page"] { background: var(--pill-active); color: #fff; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { color: var(--ink-strong); letter-spacing: 1px; }

/* ---------- summary ---------- */
.summary { padding: 0 24px 6px; display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--ink-strong); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.panel h2 { font-size: 14px; margin: 0 0 12px; color: var(--ink-strong); }
.bar-row { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 10px; }
.bar { height: 8px; background: var(--head); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.top-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.top-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.top-list li:last-child { border-bottom: 0; }
.top-list .rank { color: var(--muted); width: 22px; display: inline-block; }

/* ---------- receipt detail dialog ---------- */
.detail { border: 0; border-radius: 8px; padding: 0; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.detail::backdrop { background: rgba(15, 35, 45, .45); }
.detail-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 0; font-size: 15px; }
.detail-head button { border: 0; background: none; cursor: pointer; padding: 4px; display: grid; }
.detail-body { padding: 14px 18px 18px; font-size: 13px; }
.detail-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.line .q { color: var(--muted); font-size: 12px; }
.rule { border-top: 1px dashed var(--pill-border); margin: 8px 0; }
.line.total { font-weight: 800; font-size: 15px; }
.void-box { margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); font-size: 12.5px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--sidebar); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

}

/* ---------- topbar badges ---------- */
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; text-decoration: none; white-space: nowrap; }
.badge.unsynced { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.offline { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.badges { margin-right: auto; display: flex; gap: 8px; }

/* ---------- buttons / forms (shared) ---------- */
kbd { font: 600 10.5px/1 var(--font); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line); background: var(--content); color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--pill-border); background: var(--surface); color: var(--ink-strong); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--head) 50%, var(--surface)); }
.btn:disabled { opacity: .45; cursor: default; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--pill-active) 85%, #000); }
.btn-primary kbd { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 6px; display: grid; place-items: center; color: var(--ink-strong); border-radius: 6px; }
.icon-btn:hover { background: var(--head); }
.icon-btn .ico { width: 16px; height: 16px; }
.count { background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; }
.input, .mini-input, .big-input, .select { border: 1px solid var(--pill-border); border-radius: 8px; background: var(--surface); padding: 0 10px; height: 36px; outline: none; }
.input:focus, .mini-input:focus, .big-input:focus, .select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.mini-input { height: 30px; width: 110px; text-align: right; }
.big-input { height: 50px; width: 100%; font-size: 24px; font-weight: 700; text-align: right; }
.big-input[readonly] { background: var(--content); }
.field { display: grid; gap: 6px; font-size: 13px; }
.field > span { font-weight: 600; color: var(--ink-strong); }
.field small { color: var(--muted); font-size: 11.5px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-strong); margin: 14px 0 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.muted-center { text-align: center; color: var(--muted); padding: 28px 0; margin: 0; grid-column: 1 / -1; }
.content-fixed { overflow: hidden; display: flex; flex-direction: column; }

/* ---------- modal ---------- */
.modal { border: 0; border-radius: 10px; padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal.wide { width: min(620px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(15, 35, 45, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15px; color: var(--ink-strong); }
.modal-body { padding: 16px 18px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }

/* ---------- POS ---------- */
.pos { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; }
.pos .card { display: flex; flex-direction: column; min-height: 0; }
.pos-left { padding: 16px; }
.scan { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border: 2px solid var(--pill-active); border-radius: 10px; background: var(--surface); }
.scan:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }
.scan-ico { width: 26px; height: 26px; color: var(--icon); }
.scan input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 12px; }
.chip { height: 28px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--pill-border); background: transparent; cursor: pointer; font-size: 12.5px; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); grid-auto-rows: min-content; gap: 10px; padding: 2px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; min-height: 92px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.tile:hover { border-color: var(--focus); background: color-mix(in srgb, var(--head) 35%, var(--surface)); }
.tile-name { font-weight: 600; font-size: 13px; color: var(--ink-strong); line-height: 1.3; }
.tile-price { font-weight: 800; font-size: 15px; color: var(--ink-strong); margin-top: auto; }
.tile-meta { font-size: 11px; color: var(--muted); }
.tile-meta.low { color: var(--bad); font-weight: 700; }
.hints { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 11.5px; color: var(--muted); }
.hints .ico { width: 16px; height: 16px; flex: none; }

.pos-right { padding: 16px 0 16px; }
.cart-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.cart-head .card-title { margin: 0 0 2px; }
.cart-head .sub { margin: 0; }
.cart { flex: 1; min-height: 0; overflow-y: auto; }
.cart-empty { height: 100%; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; padding: 20px; }
.cart-empty .big { width: 48px; height: 48px; opacity: .5; }
.cart-empty p { font-size: 13px; margin: 10px 0 0; }
.line { display: grid; grid-template-columns: 1fr auto 72px 24px; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 3px solid transparent; }
.line.selected { background: color-mix(in srgb, var(--head) 55%, transparent); border-left-color: var(--accent); }
.line-name { font-weight: 600; font-size: 13px; color: var(--ink-strong); }
.line-price { font-size: 11.5px; color: var(--muted); }
.line-disc { color: var(--bad); }
.line-total { text-align: right; font-weight: 700; font-size: 13.5px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--pill-border); border-radius: 8px; overflow: hidden; height: 30px; }
.stepper button { border: 0; background: transparent; width: 26px; height: 100%; cursor: pointer; display: grid; place-items: center; color: var(--ink-strong); }
.stepper button:hover { background: var(--head); }
.stepper .ico { width: 13px; height: 13px; }
.stepper input { width: 36px; height: 100%; border: 0; border-inline: 1px solid var(--line); text-align: center; background: transparent; outline: none; font-weight: 700; }
.line-remove { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px; display: grid; }
.line-remove:hover { color: var(--bad); }
.line-remove .ico { width: 14px; height: 14px; }
.line-disc-edit { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 12px; color: var(--muted); }
.totals { padding: 12px 16px 0; border-top: 1px solid var(--line); }
.t-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 3px 0; }
.t-total { font-size: 20px; font-weight: 800; color: var(--ink-strong); padding-top: 8px; }
.t-sub { font-size: 12px; color: var(--muted); min-height: 20px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px 0; }
.actions .btn-primary { grid-column: 1 / -1; height: 52px; font-size: 16px; }

.checkout .due { display: grid; gap: 2px; text-align: center; padding: 12px; background: var(--content); border-radius: 8px; }
.checkout .due span { font-size: 12.5px; color: var(--muted); }
.checkout .due strong { font-size: 28px; color: var(--ink-strong); }
.checkout .due small { color: var(--muted); font-size: 12px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg-2 { grid-template-columns: 1fr 1fr; }
.seg button { height: 36px; border-radius: 8px; border: 1px solid var(--pill-border); background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.change { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; font-size: 14px; }
.change strong { font-size: 20px; color: var(--ok); }
.change strong.bad { color: var(--bad); font-size: 14px; }
.held-list { list-style: none; margin: 0; padding: 0; }
.held-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.held-list li:last-child { border-bottom: 0; }
.held-list kbd { margin-right: 2px; }

/* ---------- 80mm receipt ---------- */
#receipt { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff !important; }
  body > *:not(#receipt) { display: none !important; }
  #receipt { display: block; width: 72mm; margin: 0 auto; padding: 4mm 0; font: 12px/1.4 var(--font); color: #000; }
  .r-center { text-align: center; }
  .r-shop { font-size: 16px; font-weight: 800; }
  .r-row { display: flex; justify-content: space-between; gap: 8px; }
  .r-cols { display: grid; grid-template-columns: 60% 14% 26%; align-items: start; }
  .r-cols > span:nth-child(2) { text-align: center; }
  .r-cols > span:nth-child(3) { text-align: right; }
  .r-sub { font-size: 11px; }
  .r-total { font-size: 15px; font-weight: 800; }
  .r-rule { border-top: 1px dashed #000; margin: 6px 0; }
  .r-footer { margin-top: 6px; font-size: 10px; }
  .r-barcode { text-align: center; margin: 4px 0 2px; }
  .r-barcode svg { max-width: 100%; height: 14mm; }
}


/* ---------- page pieces (dashboard / reports / products / settings / support) ---------- */
.card.pad { padding: 18px 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head.inset { padding: 0 24px 0 25px; }
.page-head .card-title { margin: 0; }
.page-title { font-size: 20px; margin: 0; color: var(--ink-strong); }
.page-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 14px; margin: 0 0 14px; color: var(--ink-strong); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.link { color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.stat-value.bad { color: var(--bad); }
.stat-value.warn { color: var(--warn); }
.stats .stat { background: var(--surface); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.simple-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.simple-list li:last-child { border-bottom: 0; }
.simple-list .sub { margin-left: 8px; }
.plan-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-card > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.plan-pill { background: var(--pill-active); color: #fff; font-weight: 800; font-size: 11px; padding: 3px 9px; border-radius: 10px; letter-spacing: .5px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.banner.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.cols { display: flex; align-items: flex-end; gap: 8px; height: 170px; }
.cols.dense { gap: 3px; }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.col-bar { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; }
.col-bar i { display: block; width: 100%; min-height: 2px; background: var(--bar); border-radius: 4px 4px 0 0; }
.col-val { font-size: 10.5px; color: var(--muted); }
.col-label { font-size: 11px; color: var(--muted); }
.report-head { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.report-head .card-title { margin: 0; margin-right: auto; }
.report-head .chips { margin: 0; }
.mt { margin-top: 16px; }
.upgrade { display: flex; gap: 12px; align-items: flex-start; border: 1px dashed var(--pill-border); border-radius: 8px; padding: 14px 16px; font-size: 13px; }
.upgrade .ico { width: 22px; height: 22px; color: var(--muted); }
.upgrade p { margin: 4px 0 0; color: var(--muted); }
.th-plain { display: block; padding: 7px 12px 7px 16px; font-weight: 600; white-space: nowrap; }
.table th.right .th-plain, .table td.right { text-align: right; }
.row-actions { display: flex; gap: 4px; align-items: center; height: 47.5px; }
.table tr.dim td { opacity: .6; }
.toolbar .select { height: 32px; }
.form-error { color: var(--bad); font-size: 13px; font-weight: 600; margin: 0; }
.adj-product { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; background: var(--content); border-radius: 8px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.adj-preview { margin: 12px 0 0; font-weight: 700; color: var(--ink-strong); min-height: 20px; }
.settings { display: grid; gap: 16px; max-width: 860px; }
.settings .card-title { margin-bottom: 18px; }
.locked { display: grid; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--content); font-size: 13px; font-weight: 600; }
.locked small { font-weight: 400; color: var(--muted); }
.plan-line { display: flex; gap: 10px; align-items: center; font-size: 13px; margin: 0; }
.sub-block { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.form-actions { display: flex; justify-content: flex-end; }
.form-actions .btn { min-width: 140px; }
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.support .contact { grid-column: 1 / -1; }
.support .contact .card-title { margin-bottom: 4px; }
.contact-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.kv { border-collapse: collapse; width: 100%; font-size: 13px; }
.kv td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv td:first-child { width: 80px; }
.kv tr:last-child td { border-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink-strong); }
.faq details p { margin: 8px 0 0; color: var(--ink); line-height: 1.6; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--content); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: 12px; padding: 26px 26px 20px; box-shadow: 0 8px 30px rgba(20, 50, 65, .12); }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.auth-brand > .ico { width: 42px; height: 42px; padding: 9px; border-radius: 10px; background: var(--sidebar); color: #fff; }
.auth-brand strong { display: block; font-size: 17px; color: var(--ink-strong); }
.auth-brand span { font-size: 12px; color: var(--muted); }
.auth-tabs { margin-bottom: 16px; }
.auth form { display: grid; gap: 12px; }
.auth form .btn-primary { height: 44px; margin-top: 4px; font-size: 15px; }
.auth-note { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.auth-demo { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--content); font-size: 12px; color: var(--muted); }
.auth-demo .ico { width: 16px; height: 16px; flex: none; color: var(--warn); }

@media (max-width: 860px) {
  .dash-grid, .support { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- sync / void ---------- */
.badge.pending { margin-left: 8px; font-size: 10.5px; padding: 2px 7px; }
.card-title .badge { vertical-align: middle; font-size: 11px; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.void-form { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.void-row { display: flex; gap: 8px; }
.void-row .input { flex: 1; min-width: 0; }
.cashier-list { list-style: none; margin: 0 0 12px; padding: 0; }
.cashier-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cashier-list .role { font-size: 11px; color: var(--muted); margin-left: 6px; }

/* ---------- Admin ---------- */
.admin-sidebar { background: var(--sidebar-2); }
.badge.admin-badge { background: var(--pill-active); color: #fff; letter-spacing: .3px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 10px; white-space: nowrap; vertical-align: middle; }
.pill-active { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill-expiring { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill-readonly { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill-suspended { background: color-mix(in srgb, var(--ink-strong) 12%, transparent); color: var(--ink-strong); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-strong) 35%, transparent); }
.page-title .plan-pill, .page-title .pill { margin-left: 6px; font-size: 11px; }
.stat-value.small { font-size: 15px; padding-top: 6px; }
.table-wrap.flush { padding: 0; }
.table tr.static { cursor: default; }
.table td.muted, .muted { color: var(--muted); }
.audit-detail { font-size: 12px; color: var(--muted); word-break: break-word; }
.audit-list li { align-items: flex-start; }

/* =====================================================================
   Responsive: desktop (≥1100) · tablet rail (768–1099) · phone (<768)
   ===================================================================== */
.nav-short, .tabbar, .bill-bar, .cart-close, .top-brand { display: none; }
.cart-head-actions { display: flex; align-items: center; gap: 4px; }

/* phone "More" sheet (a <dialog>, only opened from the phone tab bar) */
.sheet { border: 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); margin: auto 0 0; width: 100%; max-width: 100%;
  max-height: 85vh; border-radius: 18px 18px 0 0; background: var(--surface); color: var(--ink); }
.sheet:focus { outline: none; }
.sheet::backdrop { background: rgba(15, 35, 45, .45); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet-profile { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sheet-profile .avatar { margin: 0; width: 46px; height: 46px; padding: 3px; border-color: var(--line); flex: none; }
.sheet-profile .avatar span { background: var(--pill-active); color: #fff; font-size: 14px; }
.sheet-profile strong { display: block; color: var(--ink-strong); }
.sheet-profile .sub { margin: 0; }
.sheet-nav { display: grid; padding: 4px 0; border-bottom: 1px solid var(--line); }
.sheet-link { display: flex; gap: 12px; align-items: center; padding: 12px 4px; color: var(--ink-strong); text-decoration: none; font-weight: 600; }
.sheet-link .ico { color: var(--icon); }
.sheet-link.active { color: var(--accent); }
.sheet-row { display: flex; gap: 12px; align-items: center; padding: 14px 0; }
.sheet-row .lang { height: 36px; flex: 1; }
.sheet-row .theme-toggle button { width: 44px; height: 30px; border-radius: 14px; }
.sheet-row .theme-toggle { border-radius: 16px; }
.sheet-logout { color: var(--bad); }

/* ---------- tablet portrait / small laptop: icon rail with short labels ---------- */
@media (max-width: 1099px) {
  .shell { grid-template-columns: 92px 1fr; }
  .profile { padding: 0 6px 20px; }
  .avatar { width: 46px; height: 46px; padding: 3px; }
  .avatar span { font-size: 14px; }
  .profile-name, .profile-sub, .nav-label { display: none; }
  .nav { padding-left: 10px; gap: 4px; }
  .nav-item { flex-direction: column; justify-content: center; gap: 4px; height: auto; min-height: 60px; padding: 8px 10px 8px 0;
    text-align: center; border-radius: 14px 0 0 14px; }
  .nav-short { display: block; font-size: 10.5px; line-height: 1.25; font-weight: 600; }
  .nav-item .ico { width: 19px; height: 19px; }
  .logout { padding: 0; justify-content: center; }
  .split { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .hints { display: none; }
  .search { width: min(260px, 34vw); }
  .actions .btn { min-width: 0; padding: 0 8px; white-space: normal; line-height: 1.2; }
  .actions .btn kbd { display: none; }
  .cart-head .btn kbd { display: none; }
}

/* ---------- tables become cards (tablet portrait 2 columns, phone 1 column) ---------- */
@media (max-width: 900px) {
  .table-wrap { padding: 0 14px; overflow: visible; }
  .table-cards { min-width: 0; display: block; }
  .table-cards thead { display: none; }
  .table-cards tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
  .table-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .table-cards td { display: block; height: auto; padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; }
  .table-cards td.right { text-align: right; }
  .table-cards td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-size: 11px; font-weight: 600; }
  .table-cards tbody tr:hover td, .table-cards tbody tr:focus-visible td { background: none; }
  .table-cards tbody tr:focus-visible { outline: 2px solid var(--focus); }
  .table-cards tr:has(td.empty) { display: block; border: 0; padding: 0; }
  .table-cards td.empty { padding: 28px 0 !important; text-align: center; }

  .sales-table tr { grid-template-areas: "receipt total" "items status" "pay qty"; }
  .sales-table .c-no { display: none; }
  .sales-table .c-receipt { grid-area: receipt; font-weight: 700; color: var(--ink-strong); }
  .sales-table .c-receipt .sub { display: block; margin: 2px 0 0; font-weight: 400; }
  .sales-table .c-total { grid-area: total; text-align: right; font-weight: 800; font-size: 16px; color: var(--ink-strong); }
  .sales-table .c-items { grid-area: items; }
  .sales-table .c-status { grid-area: status; text-align: right; }
  .sales-table .c-pay { grid-area: pay; color: var(--muted); }
  .sales-table .c-qty { grid-area: qty; text-align: right; color: var(--muted); }

  .prod-table tr { grid-template-areas: "name price" "code stock" "cat status" "actions actions"; }
  .prod-table .c-name { grid-area: name; }
  .prod-table .c-price { grid-area: price; font-weight: 800; font-size: 15px; color: var(--ink-strong); }
  .prod-table .c-code { grid-area: code; font-size: 11.5px; color: var(--muted); }
  .prod-table .c-stock { grid-area: stock; }
  .prod-table .c-cat { grid-area: cat; color: var(--muted); }
  .prod-table .c-status { grid-area: status; text-align: right; }
  .prod-table .c-actions { grid-area: actions; height: auto; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
  .prod-table .c-actions .icon-btn { padding: 8px; }

  .admin-table tr { grid-template-areas: "shop status" "owner days" "exp sync"; }
  .admin-table .c-id, .admin-table .c-plan { display: none; }
  .admin-table .c-shop { grid-area: shop; }
  .admin-table .c-status { grid-area: status; text-align: right; }
  .admin-table .c-owner { grid-area: owner; color: var(--muted); }
  .admin-table .c-days { grid-area: days; }
  .admin-table .c-exp { grid-area: exp; font-size: 12px; }
  .admin-table .c-sync { grid-area: sync; text-align: right; font-size: 12px; }
}

/* ---------- phone: bottom tab bar, POS bill bar ---------- */
@media (max-width: 767px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px; gap: 8px; height: 54px; }
  .topbar .lang, .topbar .theme-toggle, .topbar .bell, .topbar .me-menu { display: none; }
  .top-brand { display: grid; place-items: center; flex: none; color: var(--brand); }
  .top-brand .brand-mark { width: 30px; }
  .badges { margin-right: 0; }
  .search { flex: 1; width: auto; height: 36px; border-radius: 18px; }
  .search input { font-size: 15px; }
  .content { padding: 12px 10px calc(78px + env(safe-area-inset-bottom)); }
  .card.pad { padding: 16px 14px; }
  .toolbar, .page-head.inset { padding: 0 14px; }
  .tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tab { font-size: 13.5px; }
  .date-range { flex-wrap: wrap; gap: 8px; }
  .date-pill { height: 36px; }
  .date-pill input { width: 104px; font-size: 14px; }
  .table-wrap { padding: 0 10px; }
  .table-cards tbody { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 18px; }
  .page-title { font-size: 18px; }
  .summary { padding: 0 14px 6px; }
  .report-head .card-title { width: 100%; }
  .bar-row { grid-template-columns: 70px 1fr auto; }
  .modal, .detail { width: calc(100vw - 20px); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }
  .btn, .icon-btn, .seg button, .chip { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .contact-row .btn { flex: 1; }

  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--sidebar); box-shadow: 0 -2px 12px rgba(0, 0, 0, .15); }
  .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
    color: var(--sidebar-muted); text-decoration: none; font: 600 11px/1.2 var(--font); cursor: pointer; padding: 0 2px; }
  .tab-item .ico { width: 44px; height: 26px; padding: 3px 11px; border-radius: 13px; }
  .tab-item.active { color: #fff; }
  .tab-item.active .ico { background: rgba(255, 255, 255, .16); }

  /* POS: products scroll with the page; the bill opens full screen from the total bar */
  .content-fixed { display: block; overflow: auto; padding-bottom: calc(146px + env(safe-area-inset-bottom)); }
  .pos { display: block; }
  .pos .pos-left { padding: 10px; border-radius: 10px; }
  .scan { position: sticky; top: -12px; z-index: 3; height: 48px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 10px -10px 10px; padding: 0 10px; }
  .chip { flex: none; }
  .grid { overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; flex: none; gap: 8px; }
  .tile { min-height: 86px; }
  .pos .pos-right { display: none; }
  body.cart-open .pos .pos-right { display: flex; position: fixed; inset: 0; z-index: 40; border-radius: 0;
    padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.cart-open { overflow: hidden; }
  .cart-close { display: grid; }
  .cart-close .ico { width: 20px; height: 20px; }
  .actions .btn-primary { height: 56px; }
  .line { grid-template-columns: 1fr auto 64px 28px; padding: 12px 10px 12px 14px; }
  .stepper { height: 36px; }
  .stepper button { width: 34px; }
  .bill-bar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 25;
    align-items: center; gap: 10px; height: 54px; padding: 0 14px; border: 0; border-radius: 14px; cursor: pointer;
    background: var(--pill-active); color: #fff; font: inherit; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
  .bill-bar.empty { display: none; }
  .bill-bar.bump { animation: bill-bump .25s ease-out; }
  .bill-count { background: rgba(255, 255, 255, .18); border-radius: 10px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
  .bill-bar strong { font-size: 17px; }
  .bill-open { margin-left: auto; display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; }
  .bill-open .ico { width: 16px; height: 16px; }
}
@keyframes bill-bump { 50% { transform: scale(1.04); } }
/* Touch screens: no physical keyboard → hide F-key hints */
@media (pointer: coarse) { kbd, .hints { display: none !important; } }

/* ---------- Mandaing POS brand (temporary "M" mark + wordmark, until a real logo is made) ---------- */
.brand-mark { display: block; flex: none; width: 40px; aspect-ratio: 200 / 180; background: currentColor;
  -webkit-mask: url(/img/mark.png) center / contain no-repeat; mask: url(/img/mark.png) center / contain no-repeat; }
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-logo .brand-mark { width: 34px; }
.brand-word { font-weight: 800; font-size: 20px; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.brand-word b { font-weight: 800; opacity: .6; }

/* sidebar brand (top) */
.side-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--sidebar-text); padding: 0 12px 18px; margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1); text-decoration: none; }
.side-brand > .brand-mark { display: none; }
.sidebar .profile { padding-bottom: 22px; }
.sidebar .avatar { border-color: rgba(255, 255, 255, .35); }
.sidebar .avatar span { background: #fff; color: #1b2a55; }

/* login pages */
.auth-brand { flex-direction: column; text-align: center; gap: 14px; margin-bottom: 22px; color: var(--brand); }
.auth-brand .brand-logo { color: var(--brand); }
.auth-brand .brand-logo .brand-mark { width: 44px; }
.auth-brand .brand-word { font-size: 26px; }
.auth-brand .app-title { display: block; margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.auth-brand .app-sub { font-size: 12px; color: var(--muted); }
.auth { background:
  radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 45%),
  radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 40%), var(--content); }
.auth-card { border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(27, 42, 85, .12); }
.auth-foot { margin: 18px 0 0; text-align: center; font-size: 11px; color: var(--muted); letter-spacing: .04em; }

@media (max-width: 1099px) {
  .side-brand { padding: 0 6px 14px; margin-bottom: 14px; }
  .side-brand .brand-logo { display: none; }
  .side-brand > .brand-mark { display: block; width: 36px; }
}

/* ---------- PWA ---------- */
.badge.install-badge { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: 700 12px var(--font);
  background: var(--pill-active); color: #fff; }
.badge.install-badge .ico { width: 14px; height: 14px; }
.sheet-install { margin-bottom: 8px; }
/* Installed app (standalone): no browser bar, so give the top a little room on notched phones */
@media (display-mode: standalone) { .topbar { padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); } }

/* ---------- expenses ---------- */
.stat-value.good { color: var(--ok); }
.stat-link { text-decoration: none; color: inherit; display: block; }
.stat-link .stat:hover { border-color: var(--focus); }
.cat-row span:first-child { display: flex; align-items: center; gap: 6px; }
.cat-row .ico { width: 15px; height: 15px; color: var(--icon); flex: none; }
.bar-row.cat-row { grid-template-columns: 130px 1fr auto; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-strong); }
.cat-chip .ico { width: 15px; height: 15px; color: var(--icon); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cat-grid button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 8px; border: 1px solid var(--pill-border);
  background: transparent; color: var(--ink); cursor: pointer; font: 600 11.5px/1.2 var(--font); text-align: center; }
.cat-grid button .ico { width: 20px; height: 20px; color: var(--icon); }
.cat-grid button[aria-pressed="true"] { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.cat-grid button[aria-pressed="true"] .ico { color: #fff; }
.exp-table .c-amount { font-weight: 700; color: var(--ink-strong); }
@media (max-width: 900px) {
  .exp-table tr { grid-template-areas: "cat amount" "note status" "date pay"; }
  .exp-table .c-cat { grid-area: cat; }
  .exp-table .c-amount { grid-area: amount; font-size: 16px; font-weight: 800; }
  .exp-table .c-note { grid-area: note; color: var(--muted); }
  .exp-table .c-status { grid-area: status; text-align: right; }
  .exp-table .c-date { grid-area: date; font-size: 12px; color: var(--muted); }
  .exp-table .c-pay { grid-area: pay; text-align: right; color: var(--muted); }
}
@media (max-width: 767px) { .bar-row.cat-row { grid-template-columns: 110px 1fr auto; } }

/* ---------- password ---------- */
.profile-link { display: inline-block; margin-top: 8px; font-size: 11px; color: var(--sidebar-muted); text-decoration: underline; text-underline-offset: 2px; }
.profile-link:hover { color: var(--sidebar-text); }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font: 600 12.5px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; justify-self: center; }
.forgot-help { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: var(--content); font-size: 12.5px; }
.forgot-help p { margin: 0; }
.forgot-help .btn { justify-self: start; }
.row-btns { display: inline-flex; gap: 6px; }
.temp-pw { display: grid; gap: 4px; margin-top: 10px; padding: 12px 14px; border-radius: 8px; border: 1px dashed var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface)); font-size: 13px; }
.temp-pw strong { font-size: 26px; letter-spacing: .15em; color: var(--ink-strong); }
.temp-pw small { color: var(--muted); }
.auth .banner { margin: 0 0 14px; }

/* ---------- POS open-price item ---------- */
.scan-row { display: flex; gap: 10px; align-items: stretch; }
.scan-row .scan { flex: 1; min-width: 0; }
.open-item-btn { height: auto; min-height: 50px; border-radius: 10px; }
.open-tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: middle;
  background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

/* ---------- end-of-day close ---------- */
.inset-title { padding: 0 24px; margin-top: 4px; }
.close-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.close-cols .panel h2 { font-size: 15px; }
.calc { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--content); }
.calc .t-total { font-size: 17px; padding-top: 6px; border-top: 1px dashed var(--pill-border); margin-top: 4px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.notes-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-strong); }
.notes-grid .input { height: 36px; text-align: right; }
.close-diff { margin-top: 10px; min-height: 22px; font-size: 13px; }
.diff { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 600; }
.diff strong { font-size: 15px; }
.diff.good { color: var(--ok); } .diff.warn { color: var(--warn); } .diff.bad { color: var(--bad); }
.close-result { margin-top: 16px; }
.close-result h2 { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.close-result h2 .ico { width: 18px; height: 18px; }
.close-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 10px 0; }
.close-grid > div { display: grid; gap: 4px; }
.close-grid span:first-child { font-size: 12px; color: var(--muted); }
.close-grid strong { font-size: 18px; color: var(--ink-strong); }

/* ---------- stock history ---------- */
.hist-now { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 8px; background: var(--content); margin-bottom: 8px; }
.hist-now strong { font-size: 20px; color: var(--ink-strong); }
.hist-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.hist-list li { display: grid; grid-template-columns: 92px 1fr 54px 60px; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist-when { font-size: 11.5px; color: var(--muted); }
.hist-what .sub { display: block; margin: 2px 0 0; }
.hist-change { text-align: right; font-weight: 800; }
.hist-change.pos { color: var(--ok); } .hist-change.neg { color: var(--bad); }
.hist-after { text-align: right; color: var(--muted); }

/* ---------- empty states + getting-started guide ---------- */
.empty-start { display: grid; justify-items: center; gap: 8px; padding: 18px 8px; color: var(--ink); text-align: center; }
.empty-start > .ico { width: 40px; height: 40px; color: var(--icon); opacity: .7; }
.empty-start strong { font-size: 15px; color: var(--ink-strong); }
.empty-start p { margin: 0 0 6px; color: var(--muted); font-size: 13px; max-width: 420px; }
.guide { margin-bottom: 16px; border-left: 4px solid var(--accent); }
.guide .section-title { display: flex; align-items: center; gap: 8px; }
.guide .section-title .ico { width: 18px; height: 18px; color: var(--accent); }
.guide-bar { margin: 4px 0 12px; }
.guide-steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.guide-steps li { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.guide-steps li:last-child { border-bottom: 0; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  border: 1.5px solid var(--pill-border); color: var(--muted); }
.step-dot .ico { width: 14px; height: 14px; }
.guide-steps li.done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.guide-steps li.done strong { color: var(--muted); text-decoration: line-through; }
.step-text .sub { display: block; margin: 2px 0 0; }
.step-text small { color: var(--muted); font-weight: 400; }

@media (max-width: 1099px) { .profile-link { display: none; } }
@media (max-width: 900px) {
  .close-table tr { grid-template-areas: "date diff" "sales exp" "count by"; }
  .close-table .c-date { grid-area: date; font-weight: 700; }
  .close-table .c-diff { grid-area: diff; }
  .close-table .c-sales { grid-area: sales; text-align: left; }
  .close-table .c-exp { grid-area: exp; }
  .close-table .c-count { grid-area: count; text-align: left; }
  .close-table .c-by { grid-area: by; text-align: right; color: var(--muted); }
}
@media (max-width: 767px) {
  .scan-row { flex-wrap: wrap; }
  .open-item-btn { min-height: 44px; flex: 1; }
  .hist-list li { grid-template-columns: 1fr 50px 54px; }
  .hist-when { grid-column: 1 / -1; }
  .guide-steps li { grid-template-columns: 30px 1fr; }
  .guide-steps li > .btn, .guide-steps li > a { grid-column: 2; justify-self: start; }
  .inset-title { padding: 0 14px; }
}

/* ---------- printer settings ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.mode-card { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.mode-card .ico { width: 22px; height: 22px; color: var(--icon); }
.mode-card strong { color: var(--ink-strong); font-size: 13.5px; }
.mode-card span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mode-card em { font-style: normal; font-size: 11.5px; color: var(--warn); font-weight: 600; }
.mode-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.mode-card:disabled { opacity: .55; cursor: not-allowed; }
.device-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--content); }
.device-row > span { display: flex; align-items: center; gap: 8px; }
.device-row .ico { width: 18px; height: 18px; color: var(--icon); }
.help summary { cursor: pointer; font-weight: 700; color: var(--ink-strong); font-size: 13px; }
.help ol { margin: 8px 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.cmd { display: block; padding: 10px 12px; border-radius: 8px; background: var(--content); font-size: 11.5px; word-break: break-all; color: var(--ink-strong); }
.toggles { display: grid; gap: 4px; }
.toggle { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .switch { width: 40px; height: 22px; border-radius: 11px; background: var(--pill-border); position: relative; transition: .15s; }
.toggle .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.toggle input:checked + .switch { background: var(--pill-active); }
.toggle input:checked + .switch::after { left: 21px; }
.toggle input:focus-visible + .switch { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle > span:last-child { display: grid; gap: 2px; font-size: 13px; }
.toggle small { color: var(--muted); font-size: 11.5px; }
.toggle.disabled { opacity: .55; cursor: default; }
.toggle { grid-template-columns: 40px 1fr; }
.toggle > input { grid-column: 1; }
.preview-paper { display: flex; justify-content: center; padding: 16px; border-radius: 8px; background: var(--content); overflow: auto; }
.preview-paper canvas { width: min(320px, 100%); height: auto; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); image-rendering: auto; }

/* ---------- product form: simple / advanced ---------- */
.product-form.simple .adv-only, .product-form.simple .mode-hint[data-hint="advanced"],
.product-form.advanced .mode-hint[data-hint="simple"] { display: none; }
.product-form .mode-hint { margin-top: 8px; }
.product-form .price-input { height: 46px; font-size: 20px; font-weight: 700; }

/* ---------- cost price / margin ---------- */
.margin-box { align-content: center; padding: 10px 12px; border-radius: 8px; background: var(--content); }
.margin-box > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.margin-box strong { font-size: 16px; }
.margin-box .pos { color: var(--ok); } .margin-box .neg, .margin-box small.neg { color: var(--bad); }
.cost-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }

/* ---------- refunds ---------- */
.badge.refund-badge { margin-left: 6px; font-size: 10.5px; padding: 2px 7px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.refund-tag { font-size: 11px; font-weight: 700; color: var(--warn); }
.refund-list { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 9%, transparent); display: grid; gap: 6px; }
.refund-entry { border-bottom: 1px dashed var(--pill-border); padding-bottom: 6px; }
.refund-entry .link-btn { justify-self: start; font-size: 11.5px; }
.detail-actions { display: flex; gap: 8px; margin-top: 12px; }
.refund-items { list-style: none; margin: 0 0 6px; padding: 0; }
.refund-items li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.refund-items li > span { display: grid; gap: 2px; }
.refund-items li.done { opacity: .6; }
.refund-items .stepper { height: 36px; }
.refund-items .stepper button { width: 34px; }

/* ---------- shop assistant ---------- */
.assistant { display: flex; flex-direction: column; min-height: calc(100dvh - 140px); padding: 18px 18px 0; gap: 12px; }
.as-foot { position: sticky; bottom: 0; display: grid; gap: 8px; padding: 10px 0 18px; background: var(--surface); border-top: 1px solid var(--line); }
.as-head .card-title { display: flex; align-items: center; gap: 8px; }
.as-head .card-title .ico { width: 22px; height: 22px; color: var(--accent); }
.as-head .sub-block { margin: 4px 0 0; }
.as-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; min-height: 240px; }
.as-msg { max-width: min(560px, 92%); padding: 10px 14px; border-radius: 14px; line-height: 1.55; }
.as-msg p { margin: 0; }
.as-msg.me { align-self: flex-end; background: var(--pill-active); color: #fff; border-bottom-right-radius: 4px; }
.as-msg.bot { align-self: flex-start; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.as-msg h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.as-big { font-size: 24px; font-weight: 800; }
.as-sub { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.as-row { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-size: 13.5px; }
.as-row.total { border-top: 1px dashed var(--pill-border); margin-top: 4px; padding-top: 6px; font-weight: 700; }
.as-msg .bad { color: var(--bad); }
.as-msg .warn { color: var(--warn); font-weight: 700; }
.as-list { margin: 4px 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
ul.as-list { padding-left: 0; list-style: none; }
.as-list li { display: flex; justify-content: space-between; gap: 16px; }
.as-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.as-examples .chip { height: auto; min-height: 28px; padding: 4px 12px; text-align: left; }
.as-quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.as-quick .chip { flex: none; white-space: nowrap; }
.as-date { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.as-date .ico { width: 14px; height: 14px; }
.as-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.as-form { display: flex; gap: 8px; }
.as-form .input { flex: 1; min-width: 0; }
.as-form .btn .ico { width: 18px; height: 18px; }
.as-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.as-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: as-blink 1s infinite; }
.as-typing i:nth-child(2) { animation-delay: .15s; } .as-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes as-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 767px) {
  .assistant { min-height: calc(100dvh - 170px); padding: 14px 14px 0; }
  .as-foot { padding-bottom: 12px; box-shadow: 0 28px 0 var(--surface); }
}

.as-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.as-change { font-size: 12.5px; font-weight: 800; }
.as-change.up { color: var(--ok); } .as-change.down { color: var(--bad); }
.as-row.strong { font-weight: 700; }
.as-ok { margin: 6px 0 0; font-weight: 700; color: var(--ok); }
.as-msg .link-btn { display: inline-block; margin-top: 6px; }
.as-group { margin-top: 8px; }
.as-group > strong { font-size: 12.5px; }
.as-group .as-examples { margin-top: 4px; }
.as-bars { display: grid; gap: 4px; margin: 6px 0; }
.as-bar { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.as-bar > i { display: block; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 35%, transparent); width: var(--w); min-width: 2px; }
.as-bar.best > i { background: var(--accent); }
.as-bar.best { font-weight: 700; }
.as-act { display: grid !important; gap: 1px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.as-act.void, .as-act.refund { color: var(--bad); }
.as-act .as-sub { margin: 0; color: var(--muted); }
.as-menu .ico { width: 14px; height: 14px; margin-right: 2px; vertical-align: -2px; }
.as-msg p .ico { width: 14px; height: 14px; vertical-align: -2px; }

/* POS: ⭐ quick buttons, unknown-barcode dialog, cash notes */
.chip-quick { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.chip-quick .ico { width: 13px; height: 13px; color: var(--warn); }
.chip-quick[aria-pressed="true"] .ico { color: #fff; }
.new-code { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); font-weight: 600; word-break: break-all; }
.new-code .ico { flex: none; width: 18px; height: 18px; }
.notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note { flex: 1 1 64px; height: 38px; border-radius: 8px; border: 1px dashed var(--line); background: transparent; color: var(--ink-strong); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.note:hover { border-color: var(--focus); }
.note-clear { flex: 0 1 auto; padding: 0 12px; font-weight: 500; color: var(--muted); }
.hint-line { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

/* Checkout: kyat + yuan together */
.mix-left { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.mix-left strong { font-size: 18px; color: var(--ink-strong); }
.change-cur { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.change-cur > span { font-size: 13px; color: var(--muted); }
.change-cur .seg { flex: 0 1 200px; }

/* today's yuan rate (POS, F7) */
.rate-banner { justify-content: flex-start; }
.rate-banner > span { flex: 1; }
.rate-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.rate-chip:hover { color: var(--ink-strong); border-color: var(--accent); }
.rate-chip .ico { width: 14px; height: 14px; }
.rate-chip kbd { font-size: 10px; }
.rate-chip.stale { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.rate-example { margin: 8px 0 0; color: var(--muted); font-size: 14px; min-height: 20px; }
.rate-history { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.rate-history h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); }
.rate-history .line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; }

/* plan gating (Basic vs Pro) */
.set-links { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-locked { opacity: .7; }
.chip-locked .ico { width: 13px; height: 13px; }
.soon-pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  vertical-align: middle; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.upgrade-page { max-width: 560px; }

/* Settings → Telegram daily summary */
.tg-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.tg-hour { min-width: 160px; }
.tg-code { margin-top: 12px; padding: 14px 16px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); display: grid; gap: 10px; justify-items: start; }
.tg-code p { margin: 0; }

/* Settings: Basic vs Pro */
.plan-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 13px; }
.plan-box.current { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.plan-box:not(.current) { border-style: dashed; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; }
.plan-head .soon-pill { margin-left: 0; }
.plan-price { margin: 6px 0 2px; font-weight: 700; color: var(--ink-strong); }
.plan-box .sub { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
@media (max-width: 767px) { .plan-compare { grid-template-columns: 1fr; } }

/* ---------- customer chat (Help page) + renew ---------- */
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tab-item .nav-badge, .sheet-link .nav-badge { margin-left: 4px; }
.chat-card .card-title { display: flex; align-items: center; gap: 8px; }
.chat-list { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; min-height: 140px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--content); margin: 10px 0; }
.chat-msg { display: flex; flex-direction: column; max-width: 82%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.chat-bubble { padding: 9px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.chat-msg.mine .chat-bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-msg.system .chat-bubble { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.chat-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.pay-account { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border: 1px dashed var(--pill-border); border-radius: 10px; margin: 8px 0 14px; }
.pay-account strong { font-size: 20px; letter-spacing: .5px; }
.pay-account .sub { width: 100%; color: var(--muted); font-size: 12px; }
.pay-shot { max-width: 220px; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.pay-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-row .row-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 600px) { .pay-row { grid-template-columns: 1fr; } .pay-shot { max-width: 100%; } .chat-msg { max-width: 92%; } }
.as-action { border: 1px dashed var(--pill-border); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.as-action p { margin: 0 0 8px; }
.as-act-summary, .as-action > p { white-space: pre-line; }
.as-ai { white-space: pre-line; }

/* ---------- admin dashboard charts ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-base { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.chart-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.bar-main { fill: var(--accent); }
.bar-bad { fill: var(--bad); }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-hit:hover, .chart-hit:focus-visible { fill: color-mix(in srgb, var(--ink-strong) 6%, transparent); }
.chart-tip { position: absolute; z-index: 50; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.5; box-shadow: var(--shadow); max-width: 240px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.state-bars { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.state-bars li { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.state-bars strong { text-align: right; }
.state-track { height: 10px; background: color-mix(in srgb, var(--line) 60%, transparent); border-radius: 5px; overflow: hidden; }
.state-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.sf-paying { background: var(--ok); }
.sf-trial { background: var(--accent); }
.sf-expiring { background: var(--warn); }
.sf-readonly { background: var(--bad); }
.sf-suspended { background: var(--ink-strong); }
.inbox li { padding: 0; }
.inbox-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 4px; color: inherit; text-decoration: none; }
.inbox-row:hover { background: color-mix(in srgb, var(--ink-strong) 4%, transparent); }
.inbox-row .sub { overflow-wrap: anywhere; }
.inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.field.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }

/* ---------- Help page: bot + Mandaing POS chat in one thread ---------- */
.as-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; font-size: 13px; }
.as-contact .ico { width: 14px; height: 14px; vertical-align: -2px; }
.as-msg.benny { border-left: 3px solid var(--ok); }
.as-from { display: block; font-size: 11.5px; font-weight: 700; color: var(--ok); margin-bottom: 2px; }
.as-to { display: block; font-size: 11px; opacity: .75; margin-top: 3px; }
.as-msg.note { background: none; border: 0; box-shadow: none; align-self: stretch; text-align: center; padding: 0; }
.as-divider { font-size: 11.5px; color: var(--muted); }
.chip.as-direct.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Basic extras (2026-11-28): reports compare / net, quick pin, stickers, stock count, buy list, pay QR ---------- */
.delta { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.delta small { font-weight: 500; margin-left: 2px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.net-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px;
  padding: 16px 18px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.net-card.neg { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.net-card .net-label { display: block; font-weight: 800; color: var(--ink-strong); }
.net-card strong { font-size: 26px; color: var(--ok); font-variant-numeric: tabular-nums; }
.net-card.neg strong { color: var(--bad); }
.net-card strong small { font-size: 13px; color: var(--muted); }
.cols.hours { height: 150px; gap: 4px; }
.cols.hours .col.best .col-bar i { background: var(--accent); }
.quick-star .ico { width: 14px; height: 14px; color: var(--warn); vertical-align: -2px; }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn .input { flex: 1; min-width: 0; }
.diff-up { color: var(--ok); font-weight: 700; }
.diff-down { color: var(--bad); font-weight: 700; }
.stk-scan { margin-top: 12px; }
.stk-table td, .stk-table th { vertical-align: middle; }
.stk-table .mini-input { width: 90px; }
.pick-list button { text-align: left; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.qr-box { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.qr-img { width: 96px; height: 96px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.qr-img img { width: 100%; height: 100%; object-fit: contain; }
.qr-img .ico { width: 40px; height: 40px; color: var(--muted); }
.qr-box .row-btns { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.pay-qr { display: flex; align-items: center; gap: 14px; width: 100%; margin: 10px 0 2px; padding: 10px; border: 1px dashed var(--pill-border);
  border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: zoom-in; font: inherit; }
.pay-qr img { width: 110px; height: 110px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.pay-qr .num { font-size: 18px; font-weight: 800; color: var(--ink-strong); }
.pay-qr.big { flex-direction: column; text-align: center; cursor: zoom-out; }
.pay-qr.big img { width: min(320px, 80vw); height: min(320px, 80vw); }

/* ---------- sidebar: full ↔ icon rail (« / »), account menu in the topbar (2026-11-28) ---------- */
.rail-toggle { margin-top: auto; display: flex; align-items: center; gap: 10px; align-self: stretch; margin-inline: 14px; padding: 8px 14px;
  border: 0; border-radius: 10px; background: transparent; color: var(--sidebar-muted); font: 600 13px var(--font); cursor: pointer; }
.rail-toggle:hover { background: rgba(255,255,255,.07); color: var(--sidebar-text); }
.rail-toggle .ico { width: 16px; height: 16px; }
/* Smooth: the sidebar width animates, labels fade, icons never move (same x in both modes). */
.shell { transition: grid-template-columns .22s cubic-bezier(.4, 0, .2, 1); }
.shell.no-anim, .shell.no-anim * { transition: none !important; }
.sidebar .nav-label, .side-brand .brand-word { white-space: nowrap; transition: opacity .16s ease; }
.shell.rail { grid-template-columns: 72px 1fr; }
.shell.rail .sidebar .nav-label, .shell.rail .side-brand .brand-word { opacity: 0; pointer-events: none; }
@media (min-width: 1100px) {
  .side-brand { align-items: flex-start; padding-left: 20px; padding-right: 0; }
  .side-brand .brand-word { font-size: 17px; }
}
.me-menu { position: relative; }
.me-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--pill-active); color: #fff;
  font: 800 12.5px var(--font); display: grid; place-items: center; }
.me-btn:hover { filter: brightness(1.1); }
.me-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; padding: 6px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(15, 25, 50, .18); }
.me-who { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.me-who strong { color: var(--ink-strong); }
.me-who .profile-sub { font-size: 12px; color: var(--muted); margin: 0; }
.me-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-strong); text-decoration: none; font: 600 13.5px var(--font); cursor: pointer; text-align: left; }
.me-item:hover { background: var(--head); }
.me-item .ico { width: 16px; height: 16px; color: var(--icon); }
.me-logout, .me-logout .ico { color: var(--bad); }

/* ---------- page change: the menu is painted at once from the last page (layout.js), only the content fades in.
   (A full cross-page view transition was tried 2026-11-28: it froze the old screen until the new one was ready
   and felt laggy on shop PCs — don't bring it back.) Opacity only = cheap for slow PCs. */
#page { animation: page-in .16s ease-out both; }
@keyframes page-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #page { animation: none; } }
.nav-item, .tab-item { transition: background-color .15s ease, color .15s ease; }

/* ---------- credit book, camera scan, goods-in (2026-11-29) ---------- */
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 480px) { .seg-5 { grid-template-columns: repeat(3, 1fr); } }
.mt-s { margin-top: 8px; }
.owes { color: var(--warn); font-weight: 800; }
.cam-btn { flex: none; min-width: 50px; justify-content: center; }
.cam-btn .ico { width: 22px; height: 22px; }
.cam-dlg { width: min(520px, 96vw); padding: 0; }
.cam-view { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-frame { position: absolute; inset: 28% 12%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
.cam-hint { margin: 0; padding: 12px 16px; text-align: center; font-weight: 600; }
.stk-scan { margin-top: 12px; }
.stk-scan .scan { flex: 1; }

/* POS: credit customer picker */
.cust-q { width: 100%; height: 42px; font-size: 15px; }
.cust-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.cust-list button { width: 100%; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-strong); font: 600 14px var(--font);
  cursor: pointer; text-align: left; }
.cust-list button:hover, .cust-list button:focus-visible { border-color: var(--focus); background: var(--head); }
.cust-list small { color: var(--muted); font-weight: 500; }
.cust-chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  border: 1.5px solid var(--pill-active); background: color-mix(in srgb, var(--pill-active) 7%, var(--surface)); }
.cust-chosen small { color: var(--muted); }

/* credit book page */
.toolbar.flush { padding: 0; justify-content: flex-start; }
.toolbar.flush .input { flex: 1; min-width: 200px; max-width: 420px; }
.cust-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cust-rows button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.cust-rows button:hover { background: var(--head); }
.cust-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800;
  background: color-mix(in srgb, var(--pill-active) 14%, var(--surface)); color: var(--accent); }
.cust-main { flex: 1; min-width: 0; display: grid; }
.cust-main strong { color: var(--ink-strong); }
.cust-main .sub { margin: 0; font-size: 12px; }
.cust-bal { font-size: 15px; white-space: nowrap; }
.cust-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cust-head strong { display: block; font-size: 26px; }
.cust-head .row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-box { margin-top: 14px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--content); }
.pay-row-2 { display: flex; gap: 8px; margin-bottom: 8px; }
.pay-row-2 .big-input { flex: 1; min-width: 0; }
.pay-box .input { width: 100%; }
.credit-hist .hist-change.neg { color: var(--warn); }
.cols.dense .col-label { white-space: nowrap; overflow: visible; font-size: 10.5px; }

/* sign-up: what the shop sells in (radio buttons that look like the segmented buttons) */
.cur-choice { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.cur-choice legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.cur-choice small { color: var(--muted); font-size: 11.5px; }
.cur-main { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink); }
.cur-main[hidden] { display: none; }
.seg-radio { position: relative; display: block; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-radio span { display: grid; place-items: center; min-height: 36px; padding: 4px 6px; border-radius: 8px; text-align: center;
  border: 1px solid var(--pill-border); font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.seg-radio input:checked + span { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.seg-radio input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- product photos + tap-to-add buttons (2026-11-30) ---------- */
.pimg { display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: color-mix(in srgb, var(--pill-active) 12%, var(--surface)) center / cover no-repeat; color: var(--accent);
  font-weight: 800; font-size: 20px; }
.pimg.has-img { background-color: #fff; }
.pimg.has-img > span { visibility: hidden; }
.pimg.sm { width: 32px; height: 32px; border-radius: 7px; font-size: 13px; }
.pimg.big { width: 88px; height: 88px; border-radius: 12px; font-size: 30px; }
.name-with-img { display: inline-flex; align-items: center; gap: 10px; }
.photo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-field small { color: var(--muted); }
/* POS tile with a photo */
.tile.with-img .tile-img { width: 100%; height: 72px; border-radius: 6px; margin-bottom: 4px; }
/* stock page picker */
.picker { margin-top: 10px; }
.pick-cats { margin: 0 0 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto;
  padding: 2px; }
.pick-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; text-align: center;
  transition: transform .08s ease, border-color .15s ease; }
.pick-tile:hover { border-color: var(--focus); }
.pick-tile:active, .pick-tile.tapped { transform: scale(.96); border-color: var(--pill-active); }
.pick-tile .pimg { width: 100%; height: 64px; }
.pick-name { font-size: 12.5px; font-weight: 600; color: var(--ink-strong); line-height: 1.25; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pick-stock { font-size: 11px; color: var(--muted); }
.pick-more { grid-column: 1 / -1; text-align: center; }
@media (max-width: 767px) { .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 280px; } }

/* credit book both ways: ရရန် / ပေးရန် tabs (2026-11-30) */
.credit-tabs { margin-bottom: 14px; }
.credit-tabs button { height: auto; min-height: 40px; padding: 6px 8px; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.credit-tabs .tab-txt { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.35; }
.credit-tabs .tab-txt small { font-size: 11.5px; font-weight: 500; opacity: .8; }
.credit-tabs .tab-amt { font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.credit-tabs button[aria-pressed="true"] .tab-amt { background: rgba(255,255,255,.22); color: #fff; }
.mb-s { margin-bottom: 8px; }

/* bulk price change + starter products (2026-11-30) */
.bp-list, .st-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.bp-list li, .st-list li { border-bottom: 1px solid var(--line); }
.bp-list li:last-child, .st-list li:last-child { border-bottom: 0; }
.bp-list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.bp-list .bp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-list .bp-old { color: var(--muted); text-decoration: line-through; }
.bp-list .bp-new { min-width: 64px; text-align: right; }
.st-list li { display: grid; grid-template-columns: 1fr 96px 72px; align-items: center; gap: 8px; padding: 6px 10px; }
.st-list li.on { background: color-mix(in srgb, var(--pill-active) 8%, transparent); }
.st-list li.dim { grid-template-columns: 1fr; }
.st-pick { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.st-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; background: #fff; }
.st-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.st-name .pill { font-size: 11px; }
.st-list .input { height: 36px; padding: 0 8px; }
.st-cats { flex-wrap: wrap; }
@media (max-width: 560px) {
  .st-list li { grid-template-columns: 1fr 1fr; }
  .st-pick { grid-column: 1 / -1; }
}
.tile-price.no-price { color: var(--warn); font-size: 12px; }
