/* TableTap shared styles: customer menu, merchant dashboard, auth and admin pages. */
:root {
  --brand: #e8590c;
  --brand-hover: #d9480f;
  --brand-soft: #fff4e6;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --line: #e7e5e4;
  --line-2: #d6d3d1;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --veg: #15803d;
  --nonveg: #b91c1c;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 4px 16px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 10px 40px rgba(28, 25, 23, 0.18);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px;
  font: inherit; font-weight: 600; font-size: 0.92rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803d; border-color: #15803d; }
.btn-danger { color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, 0.05); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 0.82rem; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 1rem; }
.btn-block { width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.15); }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .form-grid.two { grid-template-columns: 1fr; } }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-row label, .check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.92rem; }
.error-text { color: var(--danger); font-size: 0.88rem; min-height: 1.2em; }

/* toggle switch: <label class="switch"><input type="checkbox"><span></span></label> */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; cursor: pointer; border-radius: 22px;
  background: var(--line-2); transition: background 0.15s;
}
.switch span::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- cards, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  font-size: 0.75rem; font-weight: 700; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-new { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-preparing { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-ready { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-served { background: #f5f5f4; color: var(--muted); border-color: transparent; }
.badge-cancelled { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-unpaid { background: #f5f5f4; color: var(--muted); border-color: transparent; }

/* veg / non-veg marker (square with dot, Indian convention) */
.veg-dot {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 14px; height: 14px; border: 1.5px solid var(--veg); border-radius: 3px;
}
.veg-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--veg); }
.veg-dot.nonveg { border-color: var(--nonveg); }
.veg-dot.nonveg::after { background: var(--nonveg); border-radius: 0; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid var(--nonveg); background: none; }

/* ---------- dialog / toast ---------- */
dialog {
  border: none; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(28, 25, 23, 0.45); }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 200px); }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; max-width: 440px; padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.logo-mark svg { width: 18px; height: 18px; }

/* ---------- landing ---------- */
.landing-nav { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 18px 16px; }
.hero { max-width: 1100px; margin: 0 auto; padding: 48px 16px 32px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.02em; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); margin-top: 16px; max-width: 34em; }
.hero-visual { background: linear-gradient(140deg, #fff4e6, #ffe8cc); border-radius: 24px; padding: 28px; display: grid; place-items: center; }
.phone { width: 230px; background: #fff; border-radius: 28px; padding: 14px; box-shadow: var(--shadow-lg); border: 6px solid var(--ink); }
.phone .ph-line { height: 10px; border-radius: 6px; background: var(--line); margin: 8px 0; }
.phone .ph-item { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.phone .ph-thumb { width: 38px; height: 38px; border-radius: 8px; background: #ffd8a8; flex: none; }
.phone .ph-btn { margin-top: 12px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; font-size: 0.8rem; display: grid; place-items: center; }
.steps { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; margin-bottom: 10px; }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .steps { grid-template-columns: 1fr; }
}

/* =========================================================== DASHBOARD */
.dash { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 4px 8px 16px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  font: inherit; font-weight: 600; color: var(--ink-2); background: transparent;
  border: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.nav-btn svg { width: 18px; height: 18px; flex: none; }
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn.active { background: var(--brand-soft); color: var(--brand); }
.nav-btn .count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.75rem; text-align: center; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.85rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: rgba(247, 246, 243, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.2rem; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.live.on { color: var(--ok); }
.live.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.live.off { color: var(--danger); }
.live.off::before { background: var(--danger); }
.view { padding: 20px 24px 40px; }
.view-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.banner { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-soft); color: #78350f; font-size: 0.92rem; margin-bottom: 16px; }
.banner.info { background: var(--info-soft); color: #1e3a8a; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.stat .v { font-size: 1.5rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v.small-v { font-size: 0.95rem; font-weight: 600; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.column { background: #efedea; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; }
.column-head .n { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.column-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.order { padding: 12px 14px; margin-bottom: 10px; border-left: 4px solid var(--info); }
.order.st-preparing { border-left-color: #f59e0b; }
.order.st-ready { border-left-color: var(--ok); }
.order.fresh { animation: pulse 1.2s ease-out 3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232, 89, 12, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(232, 89, 12, 0); } }
.order-top { display: flex; align-items: center; gap: 8px; }
.table-tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 800; font-size: 0.95rem; }
.order-meta { font-size: 0.8rem; color: var(--muted); }
.order-items { list-style: none; margin: 10px 0; padding: 0; font-size: 0.92rem; }
.order-items li { display: flex; gap: 8px; padding: 3px 0; }
.order-items .q { font-weight: 800; min-width: 28px; }
.order-items .inote { display: block; font-size: 0.8rem; color: var(--warn); }
.order-note { font-size: 0.85rem; padding: 6px 10px; border-radius: 6px; background: var(--warn-soft); color: #78350f; margin-bottom: 10px; }
.order-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 10px; }
.order-foot .total { font-weight: 800; margin-right: auto; }

/* menu manager */
.menu-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.cat-list { padding: 8px; position: sticky; top: 80px; }
.cat-row { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 10px; border-radius: var(--radius-sm); }
.cat-row:hover { background: var(--surface-2); }
.cat-row .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .n { color: var(--muted); font-size: 0.8rem; margin-right: 4px; }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--line); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.menu-section { margin-bottom: 24px; }
.menu-section h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.item-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: none; }
.item-row.off .item-name, .item-row.off .thumb { opacity: 0.5; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; border: 1px solid var(--line); }
.thumb-empty { display: grid; place-items: center; color: var(--line-2); }
.item-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.item-desc { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* tables & QR */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.qr-card { padding: 14px; text-align: center; }
.qr-card.off { opacity: 0.6; }
.qr-card img.qr { width: 160px; height: 160px; margin: 6px auto 10px; image-rendering: pixelated; }
.qr-card .label { font-size: 1.15rem; font-weight: 800; }
.qr-card .actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* history table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th { text-align: left; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--surface-2); }
.data-table .r { text-align: right; }
.table-scroll { overflow-x: auto; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 2px; }
.seg button { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 12px; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.seg button.active { background: var(--ink); color: #fff; }

/* admin: application cards */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--info); }
.app-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 0.88rem; }
.app-card dt { color: var(--muted); }
.app-card dd { margin: 0; overflow-wrap: anywhere; }
.app-card .msg { font-size: 0.88rem; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; }
.app-card .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }

/* merchant: waiting-for-approval screen */
.status-screen { max-width: 520px; text-align: left; }
.status-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--info-soft); }
.status-icon.bad { background: var(--danger-soft); }
.status-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.status-steps li { display: flex; gap: 10px; align-items: flex-start; }
.status-steps .dot { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; background: var(--line); color: var(--muted); }
.status-steps .dot.done { background: var(--ok); color: #fff; }
.status-steps .dot.cur { background: var(--info); color: #fff; }

/* mobile dashboard: sidebar becomes a bottom tab bar */
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; top: auto; height: auto;
    flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--line);
  }
  .sidebar .logo, .sidebar-foot { display: none; }
  .nav-btn { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 0.7rem; align-items: center; text-align: center; position: relative; }
  .nav-btn .count { position: absolute; top: 0; right: 50%; transform: translateX(18px); margin: 0; }
  .main { padding-bottom: 72px; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .board { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .menu-layout { grid-template-columns: 1fr; }
  .cat-list { position: static; }
}

/* =========================================================== CUSTOMER MENU */
.cm { max-width: 640px; margin: 0 auto; min-height: 100vh; background: var(--surface); padding-bottom: 96px; }
.cm-head { padding: 20px 16px 14px; background: linear-gradient(160deg, #fff4e6 0%, #fff 70%); border-bottom: 1px solid var(--line); }
.cm-head h1 { font-size: 1.5rem; }
.table-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.85rem; }
.cm-tools { display: flex; gap: 8px; align-items: center; padding: 12px 16px 0; }
.cm-tools .input { min-height: 40px; border-radius: 999px; padding-left: 14px; }
.chips { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; background: rgba(255,255,255,0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cm-section { padding: 8px 16px 4px; scroll-margin-top: 64px; }
.cm-section h2 { font-size: 1.1rem; padding: 14px 0 4px; }
.dish { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.dish:last-child { border-bottom: none; }
.dish-info { flex: 1; min-width: 0; }
.dish-name { font-weight: 700; font-size: 1rem; margin-top: 4px; }
.dish-price { font-weight: 600; margin-top: 2px; }
.dish-desc { color: var(--muted); font-size: 0.86rem; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-side { width: 112px; flex: none; display: flex; flex-direction: column; align-items: center; }
.dish-img { width: 112px; height: 100px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.dish-side .add, .dish-side .stepper { margin-top: -18px; }
.dish-side.noimg .add, .dish-side.noimg .stepper { margin-top: 12px; }
.add {
  min-width: 92px; height: 36px; border-radius: 8px; border: 1px solid #fdba74; background: #fff;
  color: var(--brand); font: inherit; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; box-shadow: var(--shadow);
}
.add:hover { background: var(--brand-soft); }
.add:disabled { color: var(--muted); border-color: var(--line-2); cursor: not-allowed; box-shadow: none; background: var(--surface-2); }
.stepper { display: inline-flex; align-items: center; height: 36px; border-radius: 8px; background: var(--brand); color: #fff; box-shadow: var(--shadow); overflow: hidden; }
.stepper button { width: 32px; height: 100%; border: none; background: transparent; color: #fff; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: rgba(0,0,0,0.1); }
.stepper .q { min-width: 26px; text-align: center; font-weight: 800; }
.stepper.sm { height: 30px; }
.stepper.sm button { width: 28px; font-size: 1rem; }
.dish.soldout .dish-name, .dish.soldout .dish-img { opacity: 0.5; }
.soldout-tag { font-size: 0.75rem; font-weight: 700; color: var(--danger); }

.cart-bar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(608px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 14px; background: var(--ok); color: #fff; border: none;
  font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-lg);
}
.cart-bar .sub { font-size: 0.8rem; font-weight: 500; opacity: 0.9; }
.cart-bar .go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.orders-bar { background: var(--ink); }

.sheet { width: min(640px, 100vw); max-width: 100vw; margin: auto auto 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet .dialog-body { max-height: calc(92vh - 150px); }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .nm { flex: 1; min-width: 0; font-weight: 600; }
.bill { margin-top: 14px; font-size: 0.92rem; }
.bill .ln { display: flex; justify-content: space-between; padding: 3px 0; }
.bill .ln.total { font-weight: 800; font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }

.track { padding: 14px; margin-bottom: 12px; }
.timeline { display: flex; align-items: flex-start; margin: 14px 0 6px; }
.timeline .s { flex: 1; text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--muted); position: relative; }
.timeline .s::before { content: ''; display: block; width: 14px; height: 14px; margin: 0 auto 6px; border-radius: 50%; background: var(--line-2); position: relative; z-index: 1; }
.timeline .s::after { content: ''; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.timeline .s:first-child::after { display: none; }
.timeline .s.done { color: var(--ok); }
.timeline .s.done::before, .timeline .s.done::after { background: var(--ok); }
.timeline .s.cur::before { box-shadow: 0 0 0 4px var(--ok-soft); }

.full-msg { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.full-msg .icon { font-size: 2.5rem; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* =========================================================== PRINT QR */
.print-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px; max-width: 900px; margin: 0 auto; }
.print-card { border: 2px solid var(--ink); border-radius: 16px; padding: 16px; text-align: center; page-break-inside: avoid; break-inside: avoid; background: #fff; }
.print-card .rname { font-weight: 800; font-size: 1.05rem; }
.print-card img { width: 100%; max-width: 200px; margin: 8px auto; }
.print-card .tno { font-size: 1.6rem; font-weight: 900; }
.print-card .hint { font-size: 0.8rem; color: var(--ink-2); }
.print-toolbar { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 16px; flex-wrap: wrap; }
@media (max-width: 700px) { .print-sheet { grid-template-columns: repeat(2, 1fr); } }
@media print {
  body { background: #fff; }
  .print-toolbar { display: none; }
  .print-sheet { padding: 0; gap: 10mm; }
}
