/* Venditas POS. Same palette and type as the site (styles.css), tuned for all-day use on tablets and phones. */
:root {
  --paper: #f6f2ea;
  --paper-2: #efe9dd;
  --card: #fffdf9;
  --ink: #17140f;
  --ink-2: #3a342b;
  --muted: #6e665a;
  --line: #e2dacb;
  --line-2: #d4cab7;
  --accent: #a63d24;
  --accent-ink: #8a311c;
  --accent-soft: #f3e3da;
  --green: #1d6b46;
  --green-soft: #e3efe7;
  --amber: #8a5a00;
  --amber-soft: #f6ead0;
  --blue: #24508a;
  --blue-soft: #e2eaf5;
  --veg: #1d7a3e;
  --nonveg: #a3261b;
  --shadow: 0 18px 40px -24px rgba(40, 20, 10, .35);

  /* Inter and Instrument Serif have no Devanagari: Hindi and Marathi text falls through to Anek Devanagari
     (only downloaded when such text is on screen). */
  --serif: "Instrument Serif", "Anek Devanagari", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Anek Devanagari", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;

  --radius: 12px;
  --radius-lg: 18px;
  --bar-h: 58px;
  --dock-h: 64px;
}

/* Kitchen screen: dark, high contrast, readable from across the pass. */
body.kds-dark {
  --paper: #121110;
  --paper-2: #1b1917;
  --card: #1f1d1a;
  --ink: #f4efe6;
  --ink-2: #d9d1c4;
  --muted: #9a9185;
  --line: #2f2b27;
  --line-2: #403a34;
  --accent: #e8906f;
  --accent-ink: #f0a587;
  --accent-soft: #3a2620;
  --green: #6fd39c;
  --green-soft: #183326;
  --amber: #f2c46d;
  --amber-soft: #3a2f17;
  --blue: #8fb6ec;
  --blue-soft: #1c2a3d;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.pos {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }

/* ---------- buttons ---------- */
.pos-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--card); color: var(--ink); user-select: none;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, opacity .15s ease;
}
.pos-btn:active { transform: translateY(1px); }
.pos-btn:disabled { opacity: .5; cursor: default; }
.pos-btn.busy { opacity: .7; cursor: progress; }
.pos-btn.primary { background: var(--ink); color: var(--paper); }
.pos-btn.primary:hover:not(:disabled) { background: var(--accent); color: #fff; }
.pos-btn.ghost { background: transparent; border-color: var(--line-2); }
.pos-btn.ghost:hover:not(:disabled) { border-color: var(--ink); }
.pos-btn.ok { background: var(--green); color: #fff; }
.pos-btn.ok:hover:not(:disabled) { filter: brightness(1.08); }
.pos-btn.danger { background: var(--accent); color: #fff; }
.pos-btn.danger:hover:not(:disabled) { background: var(--accent-ink); }
.pos-btn.quiet { background: var(--paper-2); }
.pos-btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.pos-btn.lg { min-height: 54px; padding: 0 24px; font-size: 16.5px; }
.pos-btn.block { width: 100%; }
.pos-btn .ic { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); display: inline-grid; place-items: center; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.icon-btn:hover { border-color: var(--ink); }

/* ---------- top bar ---------- */
.pos-bar {
  position: sticky; top: 0; z-index: 40; height: var(--bar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.pos-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex: 0 1 auto; }
.pos-brand svg { width: 30px; height: 30px; flex: none; }
.pos-outlet { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pos-outlet b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.pos-outlet small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.pos-outlet-pick { min-height: 34px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 10px; background: var(--card); max-width: 160px; }
/* section rail (tablets and desktops) */
.pos-rail { position: fixed; top: var(--bar-h); bottom: 0; left: 0; z-index: 30; width: 86px; display: flex; flex-direction: column; gap: 2px; padding: 10px 6px 16px; overflow-y: auto; scrollbar-width: none; background: var(--paper); border-right: 1px solid var(--line); }
.pos-rail::-webkit-scrollbar { display: none; }
.pos-rail a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border-radius: 12px; text-decoration: none; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.15; }
.pos-rail a:hover { background: var(--paper-2); color: var(--ink); }
.pos-rail a[aria-current=page] { background: var(--ink); color: var(--paper); }
.pos-rail .ic { width: 21px; height: 21px; }
.pos-rail .badge-n { position: absolute; top: 4px; right: 8px; }
body.has-rail .pos-main { margin-left: 86px; }
.badge-n { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; }
.pos-bar-end { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.lang-btn { min-width: 46px; padding: 0 10px !important; }
html:lang(hi) body.pos, html:lang(mr) body.pos { line-height: 1.55; }
.lang-pick { display: grid; gap: 8px; }
.lang-pick button { min-height: 52px; font-size: 17px; }
.gate-langs { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.clock { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.net { display: inline-flex; align-items: center; }
.net i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: block; }
.net.live i { background: #2f9e62; box-shadow: 0 0 0 3px color-mix(in srgb, #2f9e62 22%, transparent); }
.net.poll i { background: #c98a12; }
.net.off i { background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* notice bar: stale data, plan, update */
.pos-notice { position: sticky; top: var(--bar-h); z-index: 35; padding: 9px 16px; font-size: 14px; background: var(--amber-soft); color: var(--amber); border-bottom: 1px solid var(--line); }
.pos-notice.stale { background: var(--accent); color: #fff; }
.pos-notice.stale .linkish { color: #fff; }
.pos-notice.update { background: var(--blue-soft); color: var(--blue); }
.pos-notice a, .pos-notice .linkish { color: inherit; font-weight: 600; }
body.has-rail .pos-notice { margin-left: 86px; }
@media (max-width: 860px) { body.has-rail .pos-notice { margin-left: 0; } }

/* phones: bottom dock instead of tabs */
.pos-dock { display: none; }
@media (max-width: 860px) {
  .pos-rail { display: none !important; }
  body.has-rail .pos-main { margin-left: 0; }
  .clock { display: none; }
  .pos-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
    height: calc(var(--dock-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line);
  }
  .pos-dock[hidden] { display: none !important; }
  .pos-dock a, .pos-dock button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11.5px; font-weight: 550; color: var(--muted); border: 0; background: none; position: relative; cursor: pointer; min-width: 0; }
  .pos-dock [aria-current=page] { color: var(--ink); }
  .pos-dock [aria-current=page] .ic { stroke-width: 2.3; }
  .pos-dock .badge-n { position: absolute; top: 6px; left: calc(50% + 6px); }
  .pos-main { padding-bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 520px) {
  body.multi-outlet .pos-outlet b { display: none; }
  .pos-outlet b, .pos-outlet small { max-width: 130px; }
  .pos-outlet-pick { max-width: 110px; }
}
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); text-decoration: none; font-size: 14px; font-weight: 550; cursor: pointer; }

/* ---------- page ---------- */
.pos-main { padding: 18px 18px 40px; max-width: 1500px; margin: 0 auto; }
.pos-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; }
.pos-h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
.pos-head .grow { flex: 1; }
.pos-head .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.sub-h { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.pos-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; min-width: 0; }
:not(.card-grid) > .pos-card + .pos-card { margin-top: 14px; }
.pos-card .stats { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pos-card h2, .pos-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
.pos-card.flush { padding: 0; overflow: hidden; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pos-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.pos-empty h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--ink); margin: 0 0 8px; }
.pos-empty p { max-width: 34em; margin: 0 auto 16px; }
.note { background: var(--amber-soft); color: var(--amber); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; margin: 0 0 14px; }
.note.ok { background: var(--green-soft); color: var(--green); }
.note.err { background: var(--accent-soft); color: var(--accent-ink); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 0 0 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stat span { display: block; font-size: 12.5px; color: var(--muted); }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin-top: 2px; }
.stat small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.warn b { color: var(--accent-ink); }

/* chips and segmented controls */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.pill.new, .pill.sent { background: var(--blue-soft); color: var(--blue); }
.pill.open, .pill.preparing { background: var(--amber-soft); color: var(--amber); }
.pill.billed { background: var(--accent-soft); color: var(--accent-ink); }
.pill.paid, .pill.ready, .pill.served, .pill.ok { background: var(--green-soft); color: var(--green); }
.pill.cancelled, .pill.void, .pill.merged { background: var(--paper-2); color: var(--muted); text-decoration: line-through; }
.pill.low { background: var(--accent-soft); color: var(--accent-ink); }

.veg-dot { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; flex: none; vertical-align: -2px; }
.veg-dot i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.veg-dot.veg { color: var(--veg); }
.veg-dot.nonveg { color: var(--nonveg); }
.veg-dot.nonveg i { border-radius: 0; width: 0; height: 0; background: none; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid currentColor; }

/* tables (data) */
.ptbl { width: 100%; overflow-x: auto; }
.ptbl table { width: 100%; border-collapse: collapse; }
.ptbl th, .ptbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14.5px; }
.ptbl th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--paper); position: sticky; top: 0; }
.ptbl tr:last-child td { border-bottom: 0; }
.ptbl tr.click { cursor: pointer; }
.ptbl tr.click:hover td { background: var(--paper); }
.ptbl td.num, .ptbl th.num { text-align: right; }
.ptbl input, .ptbl select { min-height: 38px; }

/* ---------- forms ---------- */
.pos-form { display: block; }
.f { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; }
.f > span { font-size: 14px; font-weight: 550; color: var(--ink-2); }
.f small { font-size: 12.5px; }
.pos input:not([type=checkbox]):not([type=radio]):not([type=file]), .pos select, .pos textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; font-size: 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px;
}
.pos textarea { resize: vertical; line-height: 1.45; }
.pos input:focus, .pos select:focus, .pos textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos ::placeholder { color: #a99f90; }
.check { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; margin: 0; }
.form-msg { min-height: 1.3em; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.form-msg.err { color: var(--accent-ink); }
.form-msg.ok { color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- modals ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(23, 20, 15, .45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); color: var(--ink); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.modal-head .x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.modal-body { padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > p:first-child { margin-top: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .scrim { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-foot .pos-btn { flex: 1; }
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 120; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-size: 15px; font-weight: 550; transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--accent); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }
@media (max-width: 860px) { .toast { bottom: calc(var(--dock-h) + 16px + env(safe-area-inset-bottom)); } }

#print-frame { position: fixed; width: 0; height: 0; border: 0; visibility: hidden; }

/* ---------- login gate ---------- */
.pos-gate { max-width: 860px; }
.gate { display: flex; flex-direction: column; align-items: center; padding: 40px 0; }
.gate-mark svg { width: 46px; height: 46px; }
.gate-h { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 52px); line-height: 1; margin: 16px 0 10px; text-align: center; letter-spacing: -0.02em; }
.gate-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-top: 18px; }
@media (max-width: 680px) { .gate-cards { grid-template-columns: 1fr; } }
.gate-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.gate-card h2 { margin: 0; font-size: 18px; }
.gate-card p { margin: 0; }
.gate-card .pos-btn { margin-top: auto; }
.code-in { text-align: center; font-size: 26px !important; letter-spacing: .18em; font-weight: 600; text-transform: uppercase; min-height: 56px !important; }
.gate-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.gate-foot { margin-top: 28px; color: var(--muted); }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; width: 100%; margin-top: 18px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; }
.who:hover { border-color: var(--ink); }
.who-av { width: 54px; height: 54px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.who b { font-size: 15.5px; }
.who small { color: var(--muted); }
.pin-modal { max-width: 360px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-key { min-height: 62px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); font-size: 24px; font-weight: 600; cursor: pointer; }
.pin-key:active { background: var(--paper-2); }
.pin-key.ok { background: var(--ink); color: var(--paper); font-size: 18px; }

/* ---------- floor (tables) ---------- */
.floor-area + .floor-area { margin-top: 18px; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 12px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--card); text-align: left; cursor: pointer; text-decoration: none; }
.tile:hover { border-color: var(--ink); }
.tile .t-name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.tile .t-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.tile .t-amt { font-weight: 650; font-size: 15px; color: var(--ink); }
.tile.busy { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.tile.billed { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tile.ready::after { content: attr(data-ready); position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; background: var(--green); color: #fff; padding: 2px 7px; border-radius: 999px; }
.tile.qr { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 35%, transparent); }
.tile .t-qr { align-self: flex-start; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 8px; margin: 2px 0; }
.qr-big svg { display: block; width: 220px; height: 220px; margin: 0 auto; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line-2); background: var(--card); }
.legend i.busy { background: var(--amber-soft); }
.legend i.billed { background: var(--accent-soft); }

/* ---------- order screen ---------- */
.view-order, .view-counter { max-width: none; padding: 0 !important; }
.order-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100dvh - var(--bar-h)); }
.menu-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.menu-top { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); background: var(--paper); }
.menu-top .row { display: flex; gap: 10px; align-items: center; }
.menu-top h1 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-top .search { flex: 1; }
.item-scroll { flex: 1; overflow-y: auto; padding: 12px 14px 20px; overscroll-behavior: contain; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.item-tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 84px; padding: 10px 11px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; }
.item-tile:hover { border-color: var(--ink); }
.item-tile:active { transform: scale(.98); }
.item-tile .it-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; display: flex; gap: 6px; align-items: flex-start; }
.item-tile .it-price { margin-top: auto; font-size: 13.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 6px; }
.item-tile .it-code { color: var(--muted); font-size: 12px; }
.item-tile .it-count { position: absolute; top: -7px; right: -7px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.item-tile.off { opacity: .45; cursor: not-allowed; }
.item-tile.off .it-price::after { content: attr(data-off); color: var(--accent-ink); font-weight: 600; }
.cat-h { font-size: 12.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.cat-h:first-child { margin-top: 0; }

.cart-pane { display: flex; flex-direction: column; min-height: 0; background: var(--card); }
.cart-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cart-head .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-head h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; min-width: 0; }
.cart-head .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cart-body { flex: 1; overflow-y: auto; padding: 6px 0 10px; overscroll-behavior: contain; }
.cart-sec { padding: 8px 16px 4px; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line:last-child { border-bottom: 0; }
.cart-line .cl-name { font-weight: 600; font-size: 14.5px; display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.cart-line .cl-sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cart-line .cl-amt { font-weight: 600; text-align: right; white-space: nowrap; }
.cart-line.sent { cursor: pointer; }
.cart-line.sent:hover { background: var(--paper); }
.cart-line.void .cl-name, .cart-line.void .cl-amt { text-decoration: line-through; color: var(--muted); }
.cart-line.new { background: color-mix(in srgb, var(--blue-soft) 50%, var(--card)); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--card); }
.qty button { width: 34px; height: 32px; border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.qty button:active { background: var(--paper-2); }
.qty b { min-width: 26px; text-align: center; font-size: 15px; }
.cart-empty { padding: 30px 20px; text-align: center; color: var(--muted); }
.cart-totals { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.cart-totals .tr { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; color: var(--ink-2); }
.cart-totals .tr.total { font-size: 19px; font-weight: 700; color: var(--ink); padding-top: 6px; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.cart-actions .wide { grid-column: 1 / -1; }
.mob-cart-bar { display: none; }
@media (max-width: 900px) {
  .order-wrap { grid-template-columns: 1fr; height: auto; min-height: calc(100dvh - var(--bar-h)); }
  .menu-pane { border-right: 0; }
  .menu-top { position: sticky; top: var(--bar-h); z-index: 5; }
  .item-scroll { overflow: visible; padding-bottom: 150px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cart-pane { display: none; }
  .cart-pane.open { display: flex; position: fixed; inset: 0; z-index: 70; }
  .mob-cart-bar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(var(--dock-h) + 10px + env(safe-area-inset-bottom)); z-index: 45; gap: 10px; align-items: center; padding: 10px 10px 10px 16px; background: var(--ink); color: var(--paper); border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; border: 0; text-align: left; }
  .mob-cart-bar span { flex: 1; font-weight: 600; }
  .mob-cart-bar b { background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-size: 14px; }
  .view-order { padding-bottom: 0 !important; }
}

/* bill and payment */
.bill-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.bill-lines td { padding: 4px 0; vertical-align: top; }
.bill-lines td.num { padding-left: 10px; }
.bill-sum { border-top: 1px dashed var(--line-2); margin-top: 8px; padding-top: 8px; }
.bill-sum .tr { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; color: var(--ink-2); }
.bill-sum .tr.total { font-size: 22px; font-weight: 700; color: var(--ink); padding-top: 8px; }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .pay-grid { grid-template-columns: 1fr; } }
.pay-methods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-methods button { min-height: 48px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-weight: 650; cursor: pointer; font-size: 14px; }
.pay-methods button[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pay-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pay-row b { flex: 1; text-transform: capitalize; }
.change { font-size: 18px; font-weight: 700; color: var(--green); }
.upi-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); color: #17140f; }
.upi-qr img, .upi-qr svg { width: 180px; height: 180px; }
.cash-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.receipt-preview { display: block; width: 320px; max-width: 100%; min-height: 200px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* orders list */
.olist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ocard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.ocard:hover { border-color: var(--ink); }
.ocard .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ocard h3 { margin: 0; font-size: 17px; font-weight: 700; }
.ocard .items { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ocard.phone { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* ---------- kitchen display ---------- */
.view-kitchen { max-width: none; }
.kds-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.kds-top .pos-h1 { margin-right: 6px; }
.kds-cols { 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-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.ticket-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.ticket-head h3 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-head .kno { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ticket-head .age { font-weight: 800; font-size: 15px; padding: 3px 8px; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.ticket.warn .ticket-head .age { background: var(--amber-soft); color: var(--amber); }
.ticket.late .ticket-head .age { background: var(--accent); color: #fff; }
.ticket.late { border-color: var(--accent); }
.ticket.is-new { animation: flash 1.2s ease 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px var(--blue); } }
.ticket-sub { padding: 6px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.ticket-items { list-style: none; margin: 0; padding: 4px 0; }
.ticket-items li { display: flex; gap: 10px; padding: 8px 12px; cursor: pointer; align-items: flex-start; border-bottom: 1px dashed var(--line); }
.ticket-items li:last-child { border-bottom: 0; }
.ticket-items .q { font-weight: 800; font-size: 19px; min-width: 30px; }
.ticket-items .n { flex: 1; font-size: 17px; font-weight: 600; line-height: 1.25; }
.ticket-items .n small { display: block; font-size: 13.5px; font-weight: 500; color: var(--accent-ink); margin-top: 2px; }
.ticket-items .n em { display: block; font-style: normal; font-size: 13px; color: var(--muted); font-weight: 500; }
.ticket-items li.ready .n, .ticket-items li.ready .q { text-decoration: line-through; opacity: .5; }
.ticket-items li.void .n, .ticket-items li.void .q { text-decoration: line-through; color: var(--accent-ink); }
.ticket-items li.void .n::after { content: " " attr(data-void); font-size: 12px; font-weight: 800; }
.ticket-note { margin: 0 12px 8px; padding: 6px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 13.5px; font-weight: 600; }
.ticket-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.ticket-foot .pos-btn { min-height: 46px; }
.ticket-foot .wide { grid-column: 1 / -1; }
.ticket.done { opacity: .6; box-shadow: none; }
.kds-dark .pos-bar { background: color-mix(in srgb, var(--paper) 94%, transparent); }
.kds-dark .pos-brand svg rect { fill: #f4efe6; }
.kds-dark .pos-brand svg path { stroke: #121110; }

/* availability */
.avail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.avail { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.avail span { flex: 1; font-weight: 550; min-width: 0; }
.avail.off { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.avail.off span { text-decoration: line-through; color: var(--muted); }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }

/* simple bar charts (reports) */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars .b { flex: 1; min-width: 0; background: var(--ink); border-radius: 3px 3px 0 0; position: relative; min-height: 1px; }
.bars .b:hover { background: var(--accent); }
.bars-x { display: flex; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hbar:last-child { border-bottom: 0; }
.hbar i { grid-column: 1 / -1; display: block; height: 5px; border-radius: 3px; background: var(--ink); opacity: .85; }

/* stock screen */
.inv-tabs { margin: 0 0 14px; }
.inv-tools { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }
.inv-acts { margin-top: 12px; }
.inv-lines { margin-bottom: 8px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 110px 110px 40px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .inv-line { grid-template-columns: 1fr 1fr 1fr 40px; } .inv-line select { grid-column: 1 / -1; } }
.rec-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 0 12px; margin: 0 0 12px; }
.rec-sec .cart-sec { padding: 8px 12px 4px; }
.rec-sec > p { margin: 0 12px 6px; }
.rec-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 40px; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.rec-add { display: grid; grid-template-columns: minmax(0, 1fr) 100px 76px auto; gap: 6px; padding: 10px 12px 0; }
@media (max-width: 640px) { .rec-add { grid-template-columns: 1fr 76px auto; } .rec-add select:first-child { grid-column: 1 / -1; } }
.inv-count input { max-width: 120px; min-height: 38px !important; margin-left: auto; }
.inv-count-foot { margin-top: 14px; }
.neg { color: var(--accent-ink); }

/* Z-report preview (day close) */
.zprev { font-size: 14px; }
.zprev h2 { font-size: 17px; margin: 0 0 4px; }
.zprev p { margin: 4px 0; }
.zprev .c { text-align: center; }
.zprev .r { text-align: right; }
.zprev table { width: 100%; border-collapse: collapse; }
.zprev td { padding: 2px 0; }
.zprev hr { border: 0; border-top: 1px dashed var(--line-2); margin: 8px 0; }

@media print { body.pos > *:not(#print-frame) { display: none !important; } }
