/* Zeen Hospitality: tablet-first. Big touch targets (min 44px), a left rail in landscape, dark mode for dim bars. */
:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --ink: #18201f;
  --muted: #66706e;
  --line: #e2e0d9;
  --soft: #eeece6;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ec;
  --rail: #14211f;
  --rail-ink: #cfdcd8;
  --ok: #2e6b4a; --ok-bg: #e3f2e9;
  --warn: #8a5300; --warn-bg: #fbf0d9;
  --err: #b03030; --err-bg: #fbe8e6;
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1514; --card: #172120; --ink: #e7eeec; --muted: #93a19e; --line: #2a3735; --soft: #1f2b29;
    --accent: #3fb59c; --accent-ink: #062520; --accent-soft: #173a33; --rail: #0a0f0e; --rail-ink: #b6c6c2;
    --ok: #6fd39c; --ok-bg: #173628; --warn: #f2b84b; --warn-bg: #3a2c10; --err: #ff8a80; --err-bg: #3d1a18;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1514; --card: #172120; --ink: #e7eeec; --muted: #93a19e; --line: #2a3735; --soft: #1f2b29;
  --accent: #3fb59c; --accent-ink: #062520; --accent-soft: #173a33; --rail: #0a0f0e; --rail-ink: #b6c6c2;
  --ok: #6fd39c; --ok-bg: #173628; --warn: #f2b84b; --warn-bg: #3a2c10; --err: #ff8a80; --err-bg: #3d1a18;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
a { color: var(--accent); }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.neg { color: var(--err); }
.pos { color: var(--ok); }
code { background: var(--soft); padding: .35em .5em; border-radius: 6px; font-size: .85rem; word-break: break-all; display: inline-block; }

/* ---------- rail navigation ---------- */
.rail { position: fixed; inset: 0 auto 0 0; width: 200px; background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; overflow-y: auto; z-index: 20; padding-top: max(12px, env(safe-area-inset-top)); }
.rail a, .rail-btn { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: .95rem; }
.rail a:hover, .rail-btn:hover { background: rgba(255,255,255,.07); }
.rail a.on { background: var(--accent); color: #fff; }
.rail .brand { font-weight: 800; color: #fff; margin-bottom: 6px; }
.rail .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.rail-btn { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.rail form { margin: 0; }
.rail .who .dot, .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.lic-switch select { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.15); font-weight: 700; margin: 0 0 6px; }
.lic-switch option { color: #000; }
.lic-one { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 8px; opacity: .7; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; flex: none; }
.mark.large { width: 64px; height: 64px; font-size: 32px; border-radius: 18px; margin-bottom: 12px; }
body.has-rail main { margin-left: 200px; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 20px 96px; }
body.has-rail main { max-width: none; }
.hero { text-align: center; padding: 15vh 16px; }
.hero h1 { font-size: 2.4rem; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 520px; margin: 0 auto 1.4em; }

@media (max-width: 899px) {
  .rail { position: sticky; top: 0; inset: auto; width: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 6px 8px; gap: 4px; }
  .rail a, .rail-btn { flex: none; min-height: 44px; padding: 6px 10px; gap: 6px; font-size: .85rem; }
  .rail .brand span:last-child, .rail a:not(.brand) span { white-space: nowrap; }
  .rail .brand span:last-child { display: none; }
  .rail-foot { margin: 0; padding: 0; border: 0; display: flex; gap: 4px; }
  .lic-switch select { margin: 0; width: auto; }
  .lic-one { display: none; }
  body.has-rail main { margin-left: 0; }
  main { padding: 14px 16px 96px; }
}
@media (max-width: 600px) { .rail a:not(.brand):not(.on) span { display: none; } }

/* ---------- cards, tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 440px; margin: 10vh auto 0; }
.card.empty, .empty { text-align: center; color: var(--muted); padding: 32px !important; }
.card > h2:first-child { margin-top: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.actions, .row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-btns form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--card); white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.table.dense td, .table.dense th { padding: 8px 8px; font-size: .88rem; }
.table tr.rule td { border-top: 2px solid var(--line); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--soft); }
tr.low td { background: var(--warn-bg); }
.table input:not([type=checkbox]) { margin: 0; min-width: 80px; }
.sortable th { cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stats span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stats strong { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.stats em { display: block; font-style: normal; color: var(--muted); font-size: .82rem; }
.stats.big strong { font-size: 1.8rem; }
.bar { display: block; height: 8px; background: var(--soft); border-radius: 4px; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar-cell { width: 25%; }
.big-num { font-size: 2rem; font-weight: 800; margin: 0 0 .3em; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: .74rem; font-weight: 700; vertical-align: middle; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.err { background: var(--err-bg); color: var(--err); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; background: var(--accent-soft); color: var(--ink); }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.faded { opacity: .55; }
.row-card { padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-card:last-of-type { border-bottom: 0; }
.list-link { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-link .btn { margin-left: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs.scroll { flex-wrap: nowrap; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; display: flex; align-items: center; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 10px; font: 700 .95rem var(--sans); cursor: pointer; text-decoration: none; text-align: center; user-select: none; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 600; }
.btn.ghost:hover { background: var(--soft); filter: none; }
.btn.danger { color: var(--err); }
.btn.big { min-height: 54px; padding: 12px 22px; font-size: 1.05rem; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.btn.full { width: 100%; }
.btn.icon { min-width: 44px; padding: 0 10px; font-size: 1.3rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline-block; margin: 0 8px 8px 0; }
label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: 400 16px var(--sans); }
textarea { min-height: 0; }
input[type=color] { padding: 3px; width: 64px; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 22px; height: 22px; min-height: 0; margin: 0 8px 0 0; accent-color: var(--accent); vertical-align: middle; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.check { display: flex; align-items: center; font-weight: 500; min-height: 44px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.pair { display: flex; gap: 6px; }
.pair input { flex: 2; } .pair select { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
legend { font-size: .86rem; font-weight: 700; padding: 0 4px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; align-items: end; }
.grid-form .span { grid-column: 1 / -1; }
.grid-form > .btn { justify-self: start; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.seg button { min-height: 42px; padding: 6px 16px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: 600 .95rem var(--sans); cursor: pointer; }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* photos */
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; display: block; background: var(--soft); }
.ph { display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: .85rem; }
.photo { width: 160px; height: 160px; border-radius: 14px; object-fit: cover; background: var(--soft); display: grid; place-items: center; font-size: 2.2rem; }
.form-with-photo { display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.photo-pick { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-pick.inline { flex-direction: row; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.photo-pick [data-photo-preview] img { max-width: 220px; max-height: 220px; border-radius: 10px; }
.item-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
@media (max-width: 640px) { .form-with-photo { grid-template-columns: 1fr; } .photo { width: 120px; height: 120px; } }

/* filter bar */
.filter-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.filter-bar input[type=search] { margin: 0; font-size: 1.05rem; min-height: 50px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .9rem var(--sans); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, transparent); display: var(--c, none); }
.chip[style]::before { display: inline-block; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 899px) { .filter-bar { top: 56px; } }

/* entry tables (receive, transfer) */
.entry-table td { padding: 8px 10px; }
.qty-entry { display: flex; gap: 6px; align-items: center; }
.qty-entry input { width: 90px; flex: none; font-size: 1.1rem; text-align: center; }
.qty-entry select { width: auto; margin: 0; }
.entry-table input[data-cost] { width: 100px; }
.sticky-foot { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0 16px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.sticky-foot form { margin: 0; }
.sticky-foot > span:first-child { margin-right: auto; }
.inline-note { display: flex; align-items: center; gap: 8px; margin: 0; }
.inline-note input { margin: 0; width: 180px; }

/* tiles (spillage, POS) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; min-height: 120px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-align: left; font: inherit; user-select: none; }
.tile:active { transform: scale(.97); }
.tile-img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 8px; background: var(--soft); font-size: 1.3rem; }
.tile-name { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.tile-sub { font-size: .8rem; color: var(--muted); }

/* dialogs */
dialog.sheet { border: 0; border-radius: 18px; padding: 22px; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }
.stepper { display: flex; gap: 8px; margin-top: 6px; }
.stepper button { width: 64px; min-height: 56px; font-size: 1.6rem; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); cursor: pointer; }
.stepper input { text-align: center; font-size: 1.5rem; font-weight: 700; margin: 0; min-height: 56px; }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { margin: 0; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.pill input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill input:focus-visible + span { outline: 3px solid var(--accent); }

/* login + pin pad */
.login .mark { margin: 0 auto 12px; }
.pinpad-wrap { max-width: 380px; margin: 6vh auto 0; }
.pinpad { display: flex; flex-direction: column; gap: 16px; }
.pin-dots { text-align: center; font-size: 2.2rem; letter-spacing: .6em; min-height: 64px; border-radius: 14px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keys button { min-height: 76px; font-size: 1.8rem; font-weight: 700; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-family: inherit; }
.keys button:active { background: var(--soft); }
.keys .go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 1.1rem; }
.keys .muted-key { font-size: 1rem; color: var(--muted); }

/* recipe builder */
.part-row { display: grid; grid-template-columns: minmax(0, 3fr) 110px 60px 90px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.part-row select, .part-row input { margin: 0; }
.part-cost { text-align: right; }
.margin-box { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.margin-box > div { background: var(--soft); border-radius: 10px; padding: 10px 14px; min-width: 120px; }
.margin-box span { display: block; font-size: .75rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.margin-box strong { font-size: 1.25rem; }
@media (max-width: 640px) { .part-row { grid-template-columns: 1fr 90px 44px; } .part-unit, .part-cost { display: none; } }

/* count screen */
.count-group h2 { margin: 18px 0 8px; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.count-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.count-row.done { border-color: var(--accent); background: var(--accent-soft); }
.count-row .thumb { width: 52px; height: 52px; }
.count-row .name { font-weight: 700; }
.count-ctl { display: flex; align-items: center; gap: 6px; }
.count-ctl button { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.count-ctl input { width: 92px; height: 52px; margin: 0; text-align: center; font-size: 1.35rem; font-weight: 700; }
.count-row .saved { font-size: .75rem; color: var(--ok); min-height: 1em; }
.quick { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.quick button { min-height: 36px; padding: 2px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .85rem var(--sans); cursor: pointer; }
@media (max-width: 600px) { .count-row { grid-template-columns: 1fr; } .count-row .thumb { display: none; } }

/* ---------- POS ---------- */
body.pos-body main { padding: 0; max-width: none; }
.pos { display: grid; grid-template-columns: 150px minmax(0, 1fr) 380px; height: 100vh; height: 100dvh; }
.pos-loading { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); }
.pos-sections { background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pos-sections button { min-height: 58px; border: 0; border-left: 6px solid var(--c, var(--accent)); border-radius: 10px; background: var(--soft); color: var(--ink); text-align: left; padding: 8px 10px; font: 700 .92rem var(--sans); cursor: pointer; }
.pos-sections button.on { background: var(--c, var(--accent)); color: #fff; }
.pos-center { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.pos-top { display: flex; gap: 8px; padding: 10px; align-items: center; border-bottom: 1px solid var(--line); background: var(--card); }
.pos-top input { margin: 0; flex: 1; min-height: 46px; }
.pos-tabs { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--bg); min-height: 62px; align-items: center; }
.pos-tab { flex: none; min-height: 46px; padding: 4px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-align: left; font: inherit; line-height: 1.15; }
.pos-tab b { display: block; font-size: .9rem; }
.pos-tab small { color: var(--muted); font-size: .76rem; }
.pos-tab.on { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.pos-tab.new { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.pos-grid { flex: 1; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; align-content: start; }
.pos-item { position: relative; border-radius: 12px; border: 1px solid var(--line); border-top: 5px solid var(--c, var(--line)); background: var(--card); color: var(--ink); padding: 0; cursor: pointer; text-align: left; font: inherit; overflow: hidden; display: flex; flex-direction: column; min-height: 112px; user-select: none; -webkit-user-select: none; }
.pos-item:active { transform: scale(.97); }
.pos-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.pos-item .nm { padding: 8px 10px 0; font-weight: 700; font-size: .93rem; line-height: 1.2; }
.pos-item .pr { padding: 2px 10px 8px; color: var(--muted); font-size: .85rem; margin-top: auto; }
.pos-item .left { position: absolute; top: 6px; left: 6px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; font-size: .72rem; font-weight: 800; padding: 1px 6px; }
.pos-item .left.out { background: var(--err); color: #fff; }
.pos-item .info { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: .9rem; font-weight: 800; }
.pos-ticket { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ticket-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ticket-head h2 { margin: 0; font-size: 1.1rem; }
.ticket-head .meta { font-size: .8rem; color: var(--muted); }
.ticket-lines { flex: 1; overflow-y: auto; }
.tline { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; cursor: pointer; }
.tline .q { font-weight: 800; text-align: center; background: var(--soft); border-radius: 8px; padding: 4px 0; }
.tline .n { font-weight: 600; }
.tline .n small { display: block; color: var(--muted); font-weight: 400; }
.tline.void { opacity: .45; text-decoration: line-through; }
.tline.comp .p::after { content: " comp"; color: var(--warn); font-size: .75rem; font-weight: 700; }
.tline.sel { background: var(--accent-soft); }
.line-tools { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.line-tools button { min-height: 42px; }
.ticket-totals { padding: 10px 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ticket-totals div { display: flex; justify-content: space-between; font-size: .92rem; padding: 2px 0; }
.ticket-totals .total { font-size: 1.35rem; font-weight: 800; padding-top: 6px; }
.ticket-totals .bal { color: var(--accent); font-weight: 800; }
.ticket-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.ticket-actions .pay { grid-column: 1 / -1; min-height: 64px; font-size: 1.25rem; }
.ticket-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.paybox .due { font-size: 2.2rem; font-weight: 800; text-align: center; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.paybox .methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.paybox .methods button { min-height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 700 1rem var(--sans); cursor: pointer; }
.paybox .methods button.on { border-color: var(--accent); background: var(--accent-soft); }
.quick-amts { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.quick-amts button { min-height: 44px; padding: 4px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font: 700 .95rem var(--sans); cursor: pointer; }
.change-due { font-size: 1.5rem; font-weight: 800; color: var(--ok); text-align: center; margin: 8px 0; }
.info-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.info-text { white-space: pre-wrap; background: var(--soft); border-radius: 10px; padding: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 12px; font-weight: 700; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.toast.err { background: var(--err); color: #fff; }
.pos-mobile-bar { display: none; }
@media (max-width: 1100px) { .pos { grid-template-columns: 120px minmax(0, 1fr) 330px; } }
@media (max-width: 899px) {
  .pos { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100dvh - 56px); }
  .pos-sections { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .pos-sections button { flex: none; min-height: 46px; border-left: 0; border-bottom: 5px solid var(--c, var(--accent)); }
  .pos-ticket { position: fixed; inset: auto 0 0 0; height: 78vh; z-index: 30; transform: translateY(100%); transition: transform .2s; box-shadow: 0 -10px 40px rgba(0,0,0,.3); border-radius: 18px 18px 0 0; }
  .pos-ticket.open { transform: none; }
  .pos-mobile-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 25; }
  .pos-mobile-bar .btn { flex: 1; min-height: 58px; font-size: 1.1rem; }
}

/* receipts & printable docs */
.receipt { max-width: 360px; margin: 0 auto 20px; background: #fff; color: #000; padding: 20px; border-radius: 6px; font: 14px/1.4 ui-monospace, Menlo, Consolas, monospace; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.receipt h2 { text-align: center; margin-bottom: 4px; font-family: inherit; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt tr.rule td { border-top: 1px dashed #000; padding-top: 6px; }
.receipt tr.big td { font-weight: 800; font-size: 1.1em; }
.doc-view img { max-width: 100%; border-radius: 8px; }
.doc-view iframe { width: 100%; height: 75vh; border: 0; }
.report-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range input, .range select { width: auto; margin: 0; }
.report-scope { font-weight: 600; }

@media print {
  .rail, .no-print, .flash, .tabs, .report-bar, .filter-bar, .sticky-foot { display: none !important; }
  body.has-rail main { margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
  .receipt { box-shadow: none; }
}
.nowrap { white-space: nowrap; }
.pos-item .nm { padding-right: 40px; }

/* ---------- features, modifiers, cash-out, tickets, offline ---------- */
.feature-list { display: flex; flex-direction: column; gap: 10px; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin: 0; font-weight: 400; cursor: pointer; }
.feature input { margin-top: 2px; }
.feature strong { display: block; font-size: 1rem; }
.feature > span > span { display: block; }
.feature-list .btn { align-self: flex-start; margin-top: 6px; }
.inline-check { display: inline-flex; margin: 0 14px 4px 0; min-height: 40px; }
.mod-head, .mod-row { display: grid; grid-template-columns: 2fr 1fr 1.3fr 2fr 1fr; gap: 8px; align-items: center; }
.mod-row { margin-bottom: 6px; }
.mod-row input, .mod-row select { margin: 0; }
.mod-head { margin: 10px 0 4px; }
@media (max-width: 760px) { .mod-head { display: none; } .mod-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); } }
.mods-sheet fieldset { margin-bottom: 14px; }
.mod-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-opt { min-height: 52px; min-width: 90px; padding: 6px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 700 .95rem var(--sans); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mod-opt small { font-weight: 500; color: var(--muted); }
.mod-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pos-item .pr s { opacity: .6; }
.pos-item .hh, .tline small.hh { color: var(--warn); font-weight: 800; }
.mod-dot { color: var(--accent); font-weight: 800; }
.hh-bar { background: var(--warn-bg); color: var(--warn); font-weight: 700; padding: 6px 12px; text-align: center; }
.tline.pending { border-left: 4px dashed var(--warn); }
.pos-tab.local { border-style: dashed; border-color: var(--warn); }
.ticket-actions { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
.ticket-actions .send:not(:disabled) { background: var(--warn); border-color: var(--warn); color: #fff; }
.net-pill { padding: 6px 12px; border-radius: 99px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.net-pill.off { background: var(--err); color: #fff; }
.net-pill.syncing { background: var(--warn-bg); color: var(--warn); }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.denom { display: grid; grid-template-columns: 1fr 90px; gap: 2px 8px; align-items: center; margin: 0; }
.denom input { margin: 0; text-align: center; font-size: 1.2rem; font-weight: 700; }
.denom [data-line] { grid-column: 1 / -1; text-align: right; min-height: 1em; }
.clock-card { text-align: center; }
.clock-card .grid-form { justify-content: center; grid-template-columns: repeat(auto-fit, minmax(200px, 300px)); }
body.kds-body main { max-width: none; }
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.ticket { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--ok); border-radius: 12px; padding: 12px; }
.ticket.warn { border-top-color: var(--warn); }
.ticket.late { border-top-color: var(--err); }
.ticket header { display: flex; justify-content: space-between; gap: 8px; font-size: 1.15rem; }
.ticket header span { color: var(--muted); font-weight: 700; }
.ticket ul { list-style: none; padding: 0; margin: 8px 0 12px; font-size: 1.1rem; }
.ticket li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ticket li.void { text-decoration: line-through; opacity: .5; }
.ticket .mods { font-size: .9rem; color: var(--muted); padding-left: 24px; }
.ticket .row-btns { justify-content: space-between; }
