@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f7f5f2;
  --card: #ffffff;
  --ink: #17140f;
  --muted: #837c70;
  --line: rgba(23,20,15,.09);
  /* Brand palette — defaults only; theme_style_tag() (includes/functions.php)
     overrides all of these with the tenant's chosen color. Never hardcode a
     brand color anywhere else. */
  --accent: #FF6D00;
  --accent-rgb: 255,109,0;
  --accent-soft: rgba(255,109,0,.12);
  --accent-light: rgb(255,146,64);
  --accent-dark: rgb(217,93,0);
  --accent-ink: #ffffff;
  --danger: #d33636;
  --danger-soft: #fdeceb;
  --ok: #1a8a4a;
  --ok-soft: #e9f7ef;
  --warn: #c98a00;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(23,20,15,.04), 0 1px 10px rgba(23,20,15,.03);
  --shadow-md: 0 8px 24px -8px rgba(23,20,15,.14);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }
.muted { color: var(--muted); }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at top,#2a2a2a,#0a0a0a); }
.login-card { background: var(--card); border-radius: 20px; padding: 34px 28px; width: 100%; max-width: 340px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); text-align: center; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(150deg,var(--accent-light),var(--accent)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent-ink); font-size: 20px; }
.login-card h1 { font-size: 19px; margin: 0 0 2px; }
.login-card p { margin: 0 0 20px; font-size: 13px; }
.login-card label { display: block; text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.login-card input { width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 15px; }
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button { width: 100%; margin-top: 6px; padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; box-shadow: var(--shadow-md); }
.login-card button:hover { background: var(--accent-dark); }
.alert-error { background: var(--danger-soft); color: #9c1c1c; padding: 9px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert-ok { background: var(--ok-soft); color: #1a6b3a; padding: 9px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

/* ---------- App shell ----------
   Full-width layout: a collapsible sidebar + a sticky top bar of quick
   actions (admin/_nav.php, behaviour in assets/js/admin.js).
     ≥ 768px  sidebar rail beside the page: full (240px) or icons only
              (72px, html.nav-collapsed — remembered per device)
     < 768px  sidebar is an off-canvas drawer (html.nav-open) */
:root { --sb-w: 240px; --sb-rail: 72px; }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: var(--sb-w); display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); overflow: hidden; transition: width .2s ease, transform .22s ease, box-shadow .22s ease; }
.sidebar-brand { flex: none; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 18px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 15px; white-space: nowrap; }
.sidebar-brand img, .sidebar-mono { flex: none; width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.sidebar-mono { display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.sidebar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: #bbb; box-shadow: none; }
.sidebar-links { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px; overflow-y: auto; overflow-x: hidden; }
.sidebar-links a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.sidebar-links a:hover { background: #f5f2ec; color: var(--ink); }
.sidebar-links a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-links a.active::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar-links .ticon { display: flex; flex: none; }
.sidebar-links .ticon svg { width: 18px; height: 18px; }
.tlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 18px; text-align: center; }
.sidebar-links .nav-badge { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.sidebar-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); white-space: nowrap; }
.sidebar-footer a.logout { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-decoration: none; }
.sidebar-footer a.logout:hover { color: var(--danger); }
.version-tag { font-size: 10.5px; color: var(--muted); opacity: .7; }
.sidebar-scrim { display: none; }
/* min-width: 0 so a wide descendant (a chip rail, a menu grid) can't force
   .app-body wider than its share and overflow the page sideways. */
.app-body { flex: 1; min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin-left: var(--sb-w); transition: margin-left .2s ease; }

@media (min-width: 768px) {
  html.nav-collapsed .sidebar { width: var(--sb-rail); }
  html.nav-collapsed .app-body { margin-left: var(--sb-rail); }
  html.nav-collapsed .sidebar-name, html.nav-collapsed .sidebar-brand .dot,
  html.nav-collapsed .tlabel, html.nav-collapsed .version-tag { display: none; }
  html.nav-collapsed .sidebar-brand { justify-content: center; padding: 0; }
  html.nav-collapsed .sidebar-links a { justify-content: center; padding: 11px 0; }
  html.nav-collapsed .sidebar-links .ticon { position: relative; }
  html.nav-collapsed .sidebar-links .nav-badge { right: -12px; top: -8px; transform: none; }
  html.nav-collapsed .sidebar-footer { justify-content: center; padding: 12px 0; }
}

.topbar { position: sticky; top: 0; z-index: 40; flex: none; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-toggle { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.topbar-toggle:hover { border-color: rgba(var(--accent-rgb), .5); color: var(--accent); }
.topbar-name { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 15px; }
.topbar > .dot { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.qa-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.qa-btn:hover { border-color: rgba(var(--accent-rgb), .5); color: var(--accent); }
.qa-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px -4px rgba(var(--accent-rgb), .55); }
.qa-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-ink); }
.qa-icon-only { width: 38px; padding: 0; }
.qa-btn .ticon { position: relative; display: flex; }
.qa-badge { position: absolute; top: -9px; right: -11px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 800; line-height: 17px; text-align: center; }
.qa-status { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: 20px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.qa-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.qa-status.is-open { background: var(--ok-soft); color: #1a6b3a; }
.qa-status.is-paused { background: #fff4e5; color: #8a5300; }
.qa-status.is-closed { background: var(--danger-soft); color: #9c1c1c; }
.qa-status:disabled { opacity: .6; cursor: wait; }
.qa-user { position: relative; flex: none; }
.qa-avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 800; }
.qa-avatar:hover, .qa-avatar[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); }
.qa-user-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.qa-user-menu[hidden] { display: none; }
.qa-user-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.qa-user-head b { display: block; font-size: 14px; }
.qa-user-head span { font-size: 12px; color: var(--muted); }
.qa-user-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.qa-user-menu a:hover { background: #f5f2ec; }
.qa-user-menu a.qa-logout:hover { color: var(--danger); }

/* --page-pad-x is shared with full-bleed children (e.g. Menu's sticky
   category rail), so they always cancel the page padding exactly. */
.page { --page-pad-x: 28px; flex: 1; width: 100%; padding: 24px var(--page-pad-x); }
.page h1 { margin: 4px 0 16px; font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .02em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
/* Form-heavy pages (Settings, Super Settings): cards flow into two
   columns on wide screens instead of stretching one form across 1600px. */
@media (min-width: 1180px) {
  .page-cols { column-count: 2; column-gap: 18px; }
  .page-cols > * { break-inside: avoid; }
  .page-cols > .page-head, .page-cols > .page-span { column-span: all; }
  .page-cols > .card { display: inline-block; width: 100%; margin-top: 0; }
}

@media (max-width: 1023px) {
  .page { --page-pad-x: 20px; padding: 20px var(--page-pad-x); }
  .topbar { padding: 0 18px; }
}
@media (max-width: 767px) {
  .sidebar { width: 280px; transform: translateX(-105%); }
  html.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  html.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  html.nav-open body { overflow: hidden; }
  .app-body { margin-left: 0; }
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .topbar-name { display: block; }
  /* The sidebar's connection dot is off-screen in the drawer, so the top
     bar shows one — but only when the connection is lost. */
  .topbar > .dot.off { display: block; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
  .topbar-actions { gap: 6px; }
  .qa-label { display: none; }
  .qa-status .qa-label { display: inline; }
  .qa-btn { width: 38px; padding: 0; }
  .qa-status { padding: 0 12px; }
  .page { --page-pad-x: 14px; padding: 16px var(--page-pad-x); }
  .page h1 { font-size: 24px; }
}
@media (max-width: 359px) {
  .topbar-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .app-body, .sidebar-scrim { transition: none; }
}
@media print {
  .sidebar, .sidebar-scrim { display: none !important; }
  .app-body { margin-left: 0 !important; }
}

/* ---------- Buttons / forms ---------- */
/* white-space: nowrap so a button's own label never wraps onto a second
   line inside itself — a tight page-head was squeezing "Import / Export"
   into "Import /" / "Export" rather than letting the row wrap. Buttons
   should stay one line; layout wrapping belongs at the container level
   (.row already has flex-wrap for that). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 13.5px; color: var(--ink); white-space: nowrap; transition: all .15s ease; }
.btn:hover { border-color: rgba(23,20,15,.22); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 4px 12px -4px rgba(var(--accent-rgb),.5); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: #fff; color: var(--danger); border-color: rgba(211,54,54,.35); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
/* Everything except the inputs that have their own native chrome —
   listing types individually kept silently missing password/email. */
.field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]),
.field textarea, .field select {
  width: 100%; padding: 10px 11px; border-radius: 9px; border: 1px solid var(--line); font-size: 14.5px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 64px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; padding: 8px 14px; border-radius: 20px; }
.status-pill.is-open { background: var(--ok-soft); color: #1a6b3a; }
.status-pill.is-closed { background: var(--danger-soft); color: #9c1c1c; }

/* ---------- Cards / lists ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.cat-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-card .name { font-weight: 800; font-size: 15px; }
.cat-card .meta { font-size: 12px; color: var(--muted); }

.item-row { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.item-row img.thumb, .thumb-placeholder { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #f0ede6; flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 10px; }
.item-row .info { flex: 1; min-width: 0; }
.item-row .info .name { font-weight: 700; font-size: 14.5px; }
.item-row .info .prices { font-size: 12.5px; color: var(--muted); }
.item-row .actions { display: flex; gap: 6px; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 20px; }
.pill-off { background: #eee; color: #888; }
.pill-veg { background: var(--ok-soft); color: #1a6b3a; }
.pill-nonveg { background: var(--danger-soft); color: #9c1c1c; }
.pill-badge { background: var(--accent-soft); color: var(--accent); }

/* ---------- Orders board ---------- */
/* Filter tabs — replaces the old "show completed" checkbox with a proper
   at-a-glance triage bar (counts update every poll, same 6s cycle as the
   cards themselves). Horizontally scrollable so it never wraps awkwardly
   on a narrow phone screen. */
.order-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.order-tabs::-webkit-scrollbar { display: none; }
.order-tab { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.order-tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.order-tab .tab-count { font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 10px; background: rgba(23,20,15,.08); color: inherit; }
.order-tab.active .tab-count { background: rgba(255,255,255,.22); }

/* Compact cards: tighter padding/type so more orders fit on screen at once
   — this board is a working tool, not a showcase. */
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-items: stretch; }
/* Grid items stretch to the row's tallest card by default — the card is a
   flex column so .order-actions (margin-top: auto) always sits flush at
   its own bottom edge, lining up across a row no matter how many items or
   how long a customer note the card above it has. */
.order-card { display: flex; flex-direction: column; background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px 11px; box-shadow: var(--shadow-sm); }
.order-card.status-pending { background: #fffaf0; border-color: #f3dfb0; }
.order-card.status-accepted { background: #eefaf5; border-color: #bfe6d4; }
.order-card.status-preparing { background: #f7f1fc; border-color: #e2cef4; }
.order-card.status-ready { background: #eff9f2; border-color: #c3e8cd; }
.order-card.status-served { background: #f7f6f4; border-color: var(--line); }
.order-card.status-completed { background: #f7f6f4; border-color: var(--line); opacity: .65; }
.order-card.status-cancelled { background: #fdf2f1; border-color: #f3cfcb; opacity: .8; }
/* A brand-new, not-yet-acted-on order is the one thing on this board that
   needs a human right now — the small pulsing dot next to the badge (see
   .pending-dot) draws the eye without glowing or bordering the whole card. */
.pending-dot { position: relative; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 5px; }
.pending-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
  animation: pending-dot-ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes pending-dot-ping {
  0% { transform: scale(.6); opacity: .55; }
  75%, 100% { transform: scale(2.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pending-dot::before { animation: none; opacity: 0; }
}
.order-card .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.order-card .table-no { font-weight: 800; font-size: 13.5px; }
.order-card .time { font-size: 10.5px; color: var(--muted); }
.order-card ul { list-style: none; margin: 6px 0; padding: 0; font-size: 12.5px; }
.order-card li { display: flex; justify-content: space-between; padding: 1px 0; }
.order-card .total { font-weight: 800; text-align: right; margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 4px; font-size: 13px; }
/* Icon-only actions in a fixed 4-column row — every status has at most 4
   (2 status actions + print + edit), so this always lays out as one tidy
   row instead of the old two-row text-button stack. margin-top: auto pins
   it to the card's bottom edge regardless of how tall the content above is. */
.order-card .order-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: auto; padding-top: 8px; }
.icon-btn { display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.8); color: var(--ink); }
.icon-btn:hover { border-color: rgba(23,20,15,.22); }
.icon-btn:active { transform: scale(.94); }
.icon-btn-danger { color: var(--danger); border-color: rgba(211,54,54,.3); background: var(--danger-soft); }
.icon-btn.is-busy { opacity: .5; animation: icon-busy 0.9s ease-in-out infinite; }
@keyframes icon-busy { 50% { opacity: .2; } }

/* ---------- Receipt printer (orders page) ---------- */
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.printer-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 280px; padding: 8px 13px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 800; }
.printer-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.printer-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #c9c3b8; flex: none; }
.printer-chip.is-on .printer-chip-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.printer-options { display: flex; flex-direction: column; gap: 8px; }
/* Scoped under .printer-options so it outranks `.field label { display: block }`. */
.printer-options .printer-option { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
.printer-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.printer-option input { margin-top: 3px; accent-color: var(--accent); }
.printer-option b { display: block; font-size: 13.5px; }
.printer-option small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
#printer-modal [hidden] { display: none !important; }
.print-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); max-width: min(92vw, 420px); padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 200; }
.print-toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-toast.err { background: var(--danger); }
@media (min-width: 860px) { .print-toast { bottom: 28px; } }
.status-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.7); }
.status-pending .status-badge { color: #a06400; }
.status-accepted .status-badge { color: #22875a; }
.status-preparing .status-badge { color: #7a2fb8; }
.status-ready .status-badge { color: #1a8a4a; }
.status-cancelled .status-badge { color: #b6362f; }

.pos-tag { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; margin-right: 5px; border-radius: 6px; background: var(--ink); color: #fff; vertical-align: 1px; }
.pos-tag-due { background: var(--danger); }
.icon-btn-pos { color: var(--accent); text-decoration: none; }
.veg-dot { width: 11px; height: 11px; border: 1.5px solid #2fa84f; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.veg-dot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #2fa84f; }
.veg-dot.nonveg { border-color: #d33; }
.veg-dot.nonveg::after { background: #d33; border-radius: 0; clip-path: polygon(50% 0,100% 100%,0 100%); width: 7px; height: 7px; }

/* ---------- POS (counter billing add-on) — full-screen till ----------
   The page never scrolls: the dish grid and the bill's lines do, so the
   totals and the Bill & Print / Bill & Pay buttons are always on screen.
   Split view from 768px up; below that the bill is a full-screen sheet. */
.pos-body { height: 100vh; height: 100dvh; overflow: hidden; }
.pos-body [hidden] { display: none !important; }
.pos-app { padding-bottom: 0; height: 100vh; height: 100dvh; }
.pos-app .app-body { margin-left: 0 !important; flex: 1; min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; }
.pos-app { --bill-w: 340px; }

.pos-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--line); }
.pos-brand { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; font-weight: 800; font-size: 15px; color: var(--ink); }
.pos-back { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: #f3f1ed; color: var(--ink); }
.pos-brand:hover .pos-back { background: var(--accent-soft); color: var(--accent); }
.pos-brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; flex: none; }
.pos-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-brand .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.pos-brand .dot.off { background: #bbb; box-shadow: none; }
.pos-top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.pos-top-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 800; color: var(--ink); text-decoration: none; white-space: nowrap; }
.pos-top-btn:hover { border-color: rgba(23,20,15,.22); }
.pos-top-btn .ticon { position: relative; display: flex; }
.pos-top-btn .nav-badge { position: absolute; top: -8px; right: -11px; margin: 0; }
.pos-top .printer-chip { height: 36px; }
.pos-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; }

.pos-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--bill-w); }

/* Menu side */
.pos-menu { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 14px 0; }
.pos-toolbar { display: flex; gap: 8px; }
.pos-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.pos-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 10px 0; font-size: 15px; font-family: inherit; background: transparent; color: var(--ink); }
.pos-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pos-view { flex: none; display: flex; gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.pos-view button { width: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.pos-view button.active { background: var(--accent-soft); color: var(--accent); }
.pos-cats { flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px 0; }
.pos-cats::-webkit-scrollbar { display: none; }
.pos-cat { flex: none; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.pos-cat.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pos-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; align-content: start; padding: 2px 2px 16px; overscroll-behavior: contain; }
.pos-grid-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13.5px; padding: 48px 12px; }

/* No overflow:hidden on the tile itself — in a fixed-height scrolling grid
   it lets the rows collapse; the photo box clips its own corners instead. */
.pos-tile { position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--ink); transition: transform .08s ease, border-color .15s ease, box-shadow .15s ease; }
.pos-tile:hover { border-color: rgba(23,20,15,.22); }
.pos-tile:active { transform: scale(.97); }
.pos-tile.in-bill { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pos-tile-img { position: relative; display: block; flex: none; aspect-ratio: 4 / 3; background: #f0ede6; overflow: hidden; border-radius: 11px 11px 0 0; }
.pos-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-tile-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; letter-spacing: .02em; background: hsl(var(--h) 72% 93%); color: hsl(var(--h) 42% 40%); }
.pos-tile-img .veg-dot { position: absolute; top: 7px; right: 7px; width: 15px; height: 15px; background: #fff; border-radius: 4px; }
.pos-tile-qty { position: absolute; top: 7px; left: 7px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; line-height: 24px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.pos-tile-body { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; }
.pos-tile-name { font-weight: 700; font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.pos-tile-badge { align-self: flex-start; font-size: 9.5px; font-weight: 800; padding: 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.pos-tile-price { margin-top: auto; font-size: 14px; font-weight: 800; }
.pos-tile-price s { color: var(--muted); font-weight: 600; font-size: 12px; margin-right: 5px; }
.pos-tile-price small { color: var(--muted); font-weight: 700; }
.pos-tile-out { margin-top: auto; color: var(--danger); font-size: 12.5px; font-weight: 700; }
.pos-tile.is-out { cursor: not-allowed; box-shadow: none; }
.pos-tile.is-out:active { transform: none; }
.pos-tile.is-out .pos-tile-img { filter: grayscale(1); opacity: .5; }
.pos-tile.is-out .pos-tile-name { color: var(--muted); }

/* Compact list view: small thumbnail, one row per dish */
.pos-grid[data-view="list"] { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.pos-grid[data-view="list"] .pos-tile { flex-direction: row; align-items: center; border-radius: 10px; }
.pos-grid[data-view="list"] .pos-tile-img { flex: none; width: 46px; height: 46px; aspect-ratio: auto; margin: 6px; border-radius: 8px; }
.pos-grid[data-view="list"] .pos-tile-ph { font-size: 15px; }
.pos-grid[data-view="list"] .pos-tile-img .veg-dot { top: 2px; right: 2px; width: 12px; height: 12px; }
.pos-grid[data-view="list"] .veg-dot::after { width: 4px; height: 4px; }
.pos-grid[data-view="list"] .pos-tile-qty { top: auto; bottom: 2px; left: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 10.5px; line-height: 18px; }
.pos-grid[data-view="list"] .pos-tile-body { flex-direction: row; align-items: center; gap: 8px; padding: 6px 12px 6px 2px; min-width: 0; }
.pos-grid[data-view="list"] .pos-tile-name { flex: 1; min-width: 0; }
.pos-grid[data-view="list"] .pos-tile-badge { display: none; }
.pos-grid[data-view="list"] .pos-tile-price, .pos-grid[data-view="list"] .pos-tile-out { margin: 0; flex: none; }

/* Bill side */
.pos-bill { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; border-left: 1px solid var(--line); }
.pos-bill-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.pos-bill-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pos-bill-title b { font-size: 16px; white-space: nowrap; }
.pos-bill-sub { font-size: 12px; color: var(--muted); }
.pos-bill-sub .pos-tag { margin-right: 3px; }
.pos-icon-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pos-icon-btn:hover { border-color: rgba(23,20,15,.25); }
.pos-icon-btn:disabled { opacity: .35; cursor: default; }
.pos-bill-close { display: none; }
.pos-bill-meta { flex: none; display: flex; gap: 8px; padding: 0 14px 8px; }
.pos-bill-meta select { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); font: inherit; font-size: 13px; font-weight: 600; background: #fff; color: var(--ink); }
.pos-meta-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 55%; padding: 8px 11px; border-radius: 9px; border: 1px dashed rgba(23,20,15,.22); background: #fff; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pos-meta-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-meta-btn.active { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pos-customer { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 0 14px 8px; }
.pos-customer input, .pos-discount input { width: 100%; min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); font: inherit; font-size: 14px; color: var(--ink); }
.pos-customer input:focus, .pos-discount input:focus, .pos-bill-meta select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

.pos-last { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 14px 8px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: #1a6b3a; font-size: 13px; }
.pos-last.is-due { background: #fff4e5; color: #8a5300; }
.pos-last-change { font-size: 22px; font-weight: 800; margin-top: 2px; }
.pos-last-actions { display: flex; gap: 6px; }

.pos-lines { flex: 1; min-height: 64px; overflow-y: auto; padding: 0 14px; border-top: 1px solid var(--line); overscroll-behavior: contain; }
.pos-empty { height: 100%; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #b9b2a5; font-size: 13px; font-weight: 700; }
.pos-line { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.pos-line-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.pos-line-name { min-width: 0; font-weight: 700; word-break: break-word; }
.pos-line-name .muted { font-weight: 600; }
.pos-line-total { flex: none; font-weight: 800; }
.pos-line-bottom { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pos-stepper { flex: none; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.pos-stepper button { width: 30px; height: 30px; border: 0; background: #faf9f7; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.pos-stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.pos-stepper input { width: 42px; height: 30px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: inherit; font-size: 13.5px; font-weight: 800; color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.pos-stepper input::-webkit-inner-spin-button, .pos-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pos-stepper input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.pos-line-unit { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.pos-line-del { width: 30px; height: 30px; color: var(--danger); border-color: rgba(211,54,54,.25); }

.pos-foot { flex: none; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fcfbf9; }
.pos-discount-row { margin-bottom: 6px; }
.pos-discount { display: flex; align-items: center; gap: 6px; }
.pos-seg { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #f0ede8; }
.pos-seg button { flex: 1; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; font-weight: 800; font-size: 13.5px; color: var(--muted); }
.pos-seg button.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 6px -2px rgba(var(--accent-rgb),.6); }
.pos-seg-sm { flex: none; }
.pos-seg-sm button { padding: 6px 10px; min-width: 34px; }
.pos-trow { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13.5px; }
.pos-trow span:last-child { font-weight: 700; }
.pos-trow small { font-size: 10.5px; font-weight: 700; }
.pos-trow-muted { font-size: 12.5px; color: var(--muted); }
.pos-trow-disc { color: var(--ok); }
.pos-grand { margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 20px; font-weight: 800; }
.pos-grand span:last-child { font-weight: 800; color: var(--ink); }
.pos-print-toggle { margin: 8px 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.pos-error { margin-bottom: 8px; }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 8px; border: 0; border-radius: 12px; color: #fff; font-size: 15px; transition: filter .15s ease, transform .08s ease; }
.pos-act b { font-weight: 800; }
.pos-act small { font-size: 11px; font-weight: 600; opacity: .85; }
.pos-act:hover { filter: brightness(1.06); }
.pos-act:active { transform: scale(.98); }
.pos-act:disabled { opacity: .38; cursor: not-allowed; transform: none; filter: none; }
/* Brand color on the money button; the pay-later one stays neutral dark. */
.pos-act-print { background: var(--ink); color: #fff; }
.pos-act-pay { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -6px rgba(var(--accent-rgb),.6); }

/* Pop-ups */
.pos-sizes { display: flex; flex-direction: column; gap: 8px; }
.pos-size { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 700; color: var(--ink); }
.pos-size:hover { border-color: var(--accent); background: var(--accent-soft); }
.pos-size s { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.pos-pay-modal { max-width: 420px; }
.pos-pay-due { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: #f7f5f2; font-weight: 700; color: var(--muted); }
.pos-pay-due b { font-size: 28px; color: var(--ink); }
.pos-pay-methods button { padding: 12px; font-size: 15px; }
.pos-cash { margin-top: 12px; }
.pos-cash-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pos-cash-row input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; font-size: 18px; font-weight: 700; text-align: right; color: var(--ink); }
.pos-cash-row input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.pos-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; margin: 10px 0 4px; }
.pos-change { min-height: 30px; text-align: right; font-size: 14px; font-weight: 700; color: var(--ok); }
.pos-change b { font-size: 24px; margin-left: 4px; }
.pos-change.is-short { color: var(--danger); }
.pos-pay-confirm { width: 100%; margin-top: 12px; padding: 14px; font-size: 16px; border-radius: 12px; }
.pos-pay-confirm:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.pos-unpaid-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.pos-unpaid-row:last-child { border-bottom: 0; }
.pos-unpaid-info { flex: 1; min-width: 0; }
.pos-unpaid-info .muted { font-size: 12px; margin-top: 2px; }
.pos-unpaid-total { flex: none; font-size: 15px; }
.pos-unpaid-actions { flex: none; display: flex; gap: 6px; }
.pos-today-cash { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--ok-soft); color: #1a6b3a; font-size: 13.5px; }
.pos-today-cash b { font-size: 17px; }
.pos-today-due { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #fff4e5; color: #8a5300; font-size: 13px; }

/* Phone bar that opens the bill sheet */
.pos-billbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; display: none; align-items: center; gap: 10px; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-md); }
.pos-billbar b { font-size: 16px; }
.pos-billbar-go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--accent-light); }

@media (min-width: 1280px) { .pos-app { --bill-w: 380px; } }
@media (min-width: 1600px) {
  .pos-app { --bill-w: 420px; }
  .pos-grid:not([data-view="list"]) { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 1023px) {
  .pos-app { --bill-w: 320px; }
  .pos-grid:not([data-view="list"]) { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .pos-top-label { display: none; }
  .pos-top-btn { padding: 0 11px; }
}
@media (max-width: 767px) {
  .pos-main { grid-template-columns: minmax(0, 1fr); }
  .pos-menu { padding: 10px 12px 0; }
  .pos-grid { padding-bottom: 90px; }
  .pos-grid:not([data-view="list"]) { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .pos-bill { position: fixed; inset: 0; z-index: 90; border-left: 0; padding-top: env(safe-area-inset-top); transform: translateY(100%); transition: transform .22s ease; }
  .pos-bill.open { transform: none; }
  .pos-bill-close { display: inline-flex; }
  .pos-billbar:not([hidden]) { display: flex; }
  .pos-top { padding: 8px 10px; gap: 8px; }
  .pos-top .printer-chip { padding: 0 10px; }
  .pos-top .printer-chip-text { display: none; }
  .pos-top-btn { padding: 0 10px; }
}
@media (max-width: 400px) {
  .pos-brand-name { display: none; }
  .pos-grid:not([data-view="list"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .pos-bill { transition: none; } }

/* ---------- Stock board (86'd items) ---------- */
.stock-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 0 6px; }
.stock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stock-row:last-child { border-bottom: 0; }
.stock-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; min-width: 0; }
.stock-row.is-out .stock-name { color: var(--muted); text-decoration: line-through; }
.stock-row.is-hidden-item { opacity: .6; }
.stock-toggle { display: inline-flex; align-items: center; gap: 8px; flex: none; cursor: pointer; }
.stock-toggle input { width: 18px; height: 18px; accent-color: var(--danger); }
.stock-toggle-label { font-size: 12px; font-weight: 800; color: var(--muted); min-width: 56px; text-align: right; }
.stock-row.is-out .stock-toggle-label { color: var(--danger); }

/* ---------- Waiter calls ---------- */
.call-strip { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.call-card { display: flex; align-items: center; gap: 12px; background: #fff4e5; border: 1px solid #ffdda8; border-radius: var(--radius); padding: 12px 14px; }
.call-card .call-icon { color: #b06c00; flex: none; display: flex; }
.call-card .call-body { flex: 1; min-width: 0; }
.call-card .call-table { font-weight: 800; font-size: 14.5px; }
.call-card .call-meta { font-size: 12px; color: #9a6400; }

/* ---------- Modals (shared by menu + orders) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: flex-end; justify-content: center; z-index: 100; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 18px 18px 0 0; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; padding: 20px; }
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.modal-close { position: sticky; top: -20px; float: right; background: none; border: 0; font-size: 20px; color: var(--muted); }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } .modal { border-radius: 18px; } }

/* ---------- Order edit modal ---------- */
.edit-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.edit-line:last-child { border-bottom: 0; }
.edit-line.is-new { color: var(--accent); }
.edit-line-name { flex: 1; min-width: 0; font-weight: 700; }
.edit-line-name .muted { font-weight: 600; font-size: 12px; }
.edit-stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.edit-stepper button { width: 28px; height: 28px; border: 0; background: #faf9f7; font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1; }
.edit-stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.edit-stepper b { min-width: 24px; text-align: center; font-size: 13px; }
.edit-total-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { display: flex; justify-content: center; margin-bottom: 12px; color: #c9c2b4; }

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow-sm); }
.qr-card .qr-img { width: 100%; max-width: 170px; margin: 0 auto; aspect-ratio: 1; }
.qr-card .qr-img svg { display: block; width: 100%; height: 100%; }
.qr-card .tno { font-weight: 800; margin-top: 8px; }
.qr-card-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: center; }

@media print {
  .topbar, .tabbar, .page-head, .no-print { display: none !important; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
}

