/* ============================================================
   FoodDelivery — shared design system
   Typography: Sora (display) · Public Sans (UI/body) · IBM Plex Mono (numbers/tickets)
   Two palettes: light (Customer, Admin) and dark "field mode" (POS, Rider) —
   POS and Rider run dark on purpose: a kitchen pass and a rider's phone in
   daylight both need high contrast and low glare, not a lighter brand skin.
   ============================================================ */

:root{
  /* brand (shared across both themes) */
  --brand: #FF5A36;
  --brand-ink-on-light: #9A3418;
  --brand-contrast: #ffffff;

  /* light theme (default) */
  --ink: #1A1714;
  --ink-soft: #4A433D;
  --paper: #FBF8F5;
  --paper-raised: #FFFFFF;
  --paper-sunken: #F3EEE8;
  --muted: #7A716A;
  --border: #E8E1D9;
  --border-strong: #D8CEC3;

  --brand-soft: #FFE7DD;
  --success: #1E8449;
  --success-soft: #DDF2E4;
  --warning: #A96A0B;
  --warning-soft: #FBEBCC;
  --critical: #C23A22;
  --critical-soft: #FBE1D9;
  --info: #2A5F94;
  --info-soft: #DFEAF6;

  --shadow-sm: 0 1px 2px rgba(30,22,14,0.06);
  --shadow-md: 0 4px 16px rgba(30,22,14,0.08);
  --shadow-lg: 0 12px 40px rgba(30,22,14,0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* motion — one snappy "settle" curve used everywhere instead of the
     browser default linear/ease, so every transition feels like part of
     the same system rather than ad hoc per-element timing. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

/* dark "field mode" — POS kitchen console + Rider app */
body.theme-dark{
  --ink: #F3EEE7;
  --ink-soft: #C9C0B6;
  --paper: #17130F;
  --paper-raised: #221C16;
  --paper-sunken: #0F0C09;
  --muted: #9C9187;
  --border: #362D24;
  --border-strong: #4A3E32;

  --brand: #FF7A52;
  --brand-soft: #3C2116;
  --success: #4ADE80;
  --success-soft: #163524;
  --warning: #F4B942;
  --warning-soft: #3A2B0E;
  --critical: #F2705F;
  --critical-soft: #3A1B14;
  --info: #6FAEE8;
  --info-soft: #17293B;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 18px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:15.5px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{
  font-family:var(--font-display);
  color:var(--ink);
  margin:0 0 6px;
  letter-spacing:-0.01em;
  text-wrap:balance;
}
h1{ font-size:clamp(24px,3vw,32px); font-weight:700; }
h2{ font-size:20px; font-weight:700; }
h3{ font-size:16px; font-weight:600; }
p{ margin:0 0 10px; }
.mono{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; }
a{ color:inherit; }
::selection{ background:var(--brand-soft); }

/* Consistent keyboard-focus ring everywhere, without adding an outline to
   every mouse click (:focus-visible skips that) — invisible until you
   actually need it, present when you do. */
:focus-visible{ outline:2.5px solid var(--brand); outline-offset:2px; border-radius:4px; }

/* ---------- motion ---------- */
@keyframes fd-fade-in-up{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }
@keyframes fd-pop-in{ from{ opacity:0; transform:scale(.92); } to{ opacity:1; transform:scale(1); } }
@keyframes fd-pulse-ring{
  0%{ box-shadow:0 0 0 0 var(--brand-soft); }
  70%{ box-shadow:0 0 0 9px rgba(255,90,54,0); }
  100%{ box-shadow:0 0 0 0 rgba(255,90,54,0); }
}
@keyframes fd-shimmer{ 0%{ background-position:-200% 0; } 100%{ background-position:200% 0; } }
@keyframes fd-spin{ to{ transform:rotate(360deg); } }
.fd-enter{ animation:fd-fade-in-up .32s var(--ease-out) both; }

/* Loading placeholder — a soft shimmer sweep instead of a static gray box,
   for anything still fetching (photos, first paint of a live list). */
.skeleton{
  background:linear-gradient(100deg, var(--paper-sunken) 30%, var(--border) 50%, var(--paper-sunken) 70%);
  background-size:200% 100%; animation:fd-shimmer 1.4s ease-in-out infinite;
  border-radius:var(--radius-sm);
}

/* ---------- toasts (replaces browser alert()/confirm() everywhere) ---------- */
#toast-container{
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%);
  z-index:9999; display:flex; flex-direction:column-reverse; gap:8px;
  width:min(92vw, 420px); pointer-events:none;
}
.toast{
  pointer-events:auto; display:flex; align-items:center; gap:10px;
  background:var(--ink); color:var(--paper); padding:13px 18px;
  border-radius:var(--radius-md); font-size:13.5px; font-weight:600;
  box-shadow:var(--shadow-lg); opacity:0; transform:translateY(14px) scale(.96);
  transition:opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.toast.show{ opacity:1; transform:translateY(0) scale(1); }
.toast .toast-icon{ font-size:15px; line-height:1; flex-shrink:0; }
.toast-success{ background:var(--success); color:#06240F; }
.toast-error{ background:var(--critical); color:#fff; }
.toast-warning{ background:var(--warning); color:#2A1B00; }
body.theme-dark .toast-warning{ color:#1A1200; }
@media (max-width:520px){ #toast-container{ bottom:14px; width:calc(100vw - 24px); } }

/* ---------- topbar ---------- */
header.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 24px;
  background:var(--paper-raised);
  border-bottom:1px solid var(--border);
  backdrop-filter:blur(6px);
}
header.topbar .brand{
  display:flex; align-items:center; gap:9px;
  font-family:var(--font-display); font-weight:700; font-size:16.5px;
}
header.topbar .brand .mark{
  width:28px; height:28px; border-radius:9px;
  background:var(--brand); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; box-shadow:var(--shadow-sm);
}
header.topbar .brand .tag{
  font-family:var(--font-mono); font-size:10.5px; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--muted); font-weight:500;
  border-left:1px solid var(--border); padding-left:9px; margin-left:2px;
}
header.topbar nav{ display:flex; gap:4px; }
header.topbar nav a{
  color:var(--muted); text-decoration:none; font-size:13.5px; font-weight:600;
  padding:7px 13px; border-radius:var(--radius-full);
}
header.topbar nav a.active{ color:var(--brand-contrast); background:var(--brand); }
header.topbar nav a:not(.active):hover{ color:var(--ink); background:var(--paper-sunken); }
@media (max-width:520px){
  header.topbar{ padding:11px 14px; }
  header.topbar .brand .tag{ display:none; }
  header.topbar .brand{ font-size:14.5px; }
  header.topbar nav{ gap:1px; }
  header.topbar nav a{ padding:6px 8px; font-size:12px; }
}

main{ max-width:1080px; margin:0 auto; padding:28px 22px 100px; }
main.narrow{ max-width:640px; }
main.wide{ max-width:1240px; }
p.hint{ color:var(--muted); font-size:14px; margin-top:-2px; }

/* ---------- layout helpers ---------- */
.grid{ display:grid; gap:16px; }
.grid.cols-2{ grid-template-columns:1fr 1fr; }
.grid.cols-3{ grid-template-columns:repeat(3,1fr); }
.grid.cols-4{ grid-template-columns:repeat(4,1fr); }
.grid.auto{ grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); }
@media (max-width:820px){ .grid.cols-2,.grid.cols-3,.grid.cols-4{ grid-template-columns:1fr; } }
.stack{ display:flex; flex-direction:column; gap:10px; }
.row-between{ display:flex; align-items:center; justify-content:space-between; gap:12px; }

/* ---------- cards ---------- */
.card{
  background:var(--paper-raised);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:20px 22px;
  box-shadow:var(--shadow-sm);
}
.card.tight{ padding:14px 16px; }
#view-confirm{ animation:fd-fade-in-up .4s var(--ease-out) both; }
#view-confirm > div:first-child{ animation:fd-pop-in .5s var(--ease-spring) .1s both; }
.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:14px; }
.section-head .count{ font-family:var(--font-mono); font-size:12.5px; color:var(--muted); }

/* ---------- forms ---------- */
label{
  display:block; font-size:11.5px; font-weight:700; color:var(--muted);
  margin-bottom:5px; text-transform:uppercase; letter-spacing:0.05em;
}
input,select,textarea{
  width:100%; padding:11px 13px; border:1.5px solid var(--border);
  border-radius:var(--radius-sm); font-size:15px; background:var(--paper);
  color:var(--ink); font-family:var(--font-body); transition:border-color .15s;
}
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--brand); }
textarea{ resize:vertical; min-height:64px; }
.field{ margin-bottom:14px; }

/* ---------- buttons ---------- */
button{
  font-family:var(--font-body); font-size:14.5px; font-weight:700;
  padding:11px 18px; border-radius:var(--radius-sm); border:1.5px solid transparent;
  cursor:pointer; transition:transform .12s var(--ease-spring), opacity .15s, background .15s, box-shadow .15s, border-color .15s;
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
}
button:active{ transform:scale(0.96); }
button.btn-primary:hover, button.btn-secondary:hover{ transform:translateY(-1px); }
button.btn-primary:hover{ box-shadow:var(--shadow-md); }
button:disabled{ transform:none !important; }
/* Inline spinner for a button mid-async-action — pair with .is-loading and
   an empty <span class="btn-spinner"></span> child; the label text stays in
   the DOM (opacity 0) so the button doesn't change width when it loads. */
button.is-loading{ pointer-events:none; position:relative; color:transparent !important; }
button.is-loading .btn-spinner{
  position:absolute; inset:0; margin:auto; width:16px; height:16px;
  border:2px solid rgba(255,255,255,0.4); border-top-color:#fff; border-radius:50%;
  animation:fd-spin .6s linear infinite;
}
button.ghost.is-loading .btn-spinner, button.btn-secondary.is-loading .btn-spinner{
  border-color:var(--border-strong); border-top-color:var(--ink);
}
button.btn-primary{ background:var(--brand); color:#fff; box-shadow:var(--shadow-sm); }
button.btn-primary:hover{ opacity:0.92; }
button.btn-secondary{ background:var(--paper-sunken); color:var(--ink); border-color:var(--border); }
button.btn-secondary:hover{ background:var(--border); }
button.ghost{ background:transparent; border-color:var(--border-strong); color:var(--ink); }
button.ghost:hover{ background:var(--paper-sunken); }
button.btn-danger{ background:var(--critical-soft); color:var(--critical); }
button.btn-lg{ padding:16px 22px; font-size:16px; border-radius:var(--radius-md); width:100%; }
button:disabled{ opacity:0.45; cursor:not-allowed; transform:none; }
button.icon-only{ padding:8px 10px; }

/* ---------- pills / badges ---------- */
.pill{
  display:inline-flex; align-items:center; gap:4px;
  font-size:11px; font-weight:700; padding:4px 10px; border-radius:var(--radius-full);
  text-transform:uppercase; letter-spacing:0.03em; white-space:nowrap;
}
.pill-brand{ background:var(--brand-soft); color:var(--brand-ink-on-light); }
body.theme-dark .pill-brand{ color:var(--brand); }
.pill-info{ background:var(--info-soft); color:var(--info); }
.pill-success{ background:var(--success-soft); color:var(--success); }
.pill-warning{ background:var(--warning-soft); color:var(--warning); }
.pill-critical{ background:var(--critical-soft); color:var(--critical); }
.pill-neutral{ background:var(--paper-sunken); color:var(--muted); }
.pill-dot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
/* A live/online/connected signal gets a slow ambient pulse — an actual
   heartbeat, not just a static dot — so "is this thing still live" is
   answerable at a glance without staring at it. */
.pill-success .pill-dot{ animation:fd-dot-pulse 2s ease-in-out infinite; }
@keyframes fd-dot-pulse{ 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.45; transform:scale(1.25); } }

/* ---------- lists / rows ---------- */
.list{ display:flex; flex-direction:column; gap:9px; }
.row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius-md);
  background:var(--paper);
  animation:fd-fade-in-up .3s var(--ease-out) both;
  transition:border-color .15s var(--ease-out), background .15s var(--ease-out), transform .15s var(--ease-out);
}
.row:hover{ border-color:var(--border-strong, var(--border)); background:var(--paper-raised); }
.row .title{ font-weight:700; font-size:14.5px; }
.row .meta{ font-size:12.5px; color:var(--muted); margin-top:1px; }

/* ---------- tabs ---------- */
.tabs{ display:flex; gap:4px; background:var(--paper-sunken); padding:4px; border-radius:var(--radius-full); width:fit-content; margin-bottom:18px; }
.tabs button{ padding:8px 18px; border-radius:var(--radius-full); background:transparent; color:var(--muted); font-size:13.5px; box-shadow:none; }
.tabs button.active{ background:var(--paper-raised); color:var(--ink); box-shadow:var(--shadow-sm); }

/* ---------- toggle switch ---------- */
.switch{ position:relative; display:inline-flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.switch .track{
  width:46px; height:26px; border-radius:var(--radius-full); background:var(--border-strong);
  position:relative; transition:background .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.switch .track::after{
  content:''; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%;
  background:#fff; box-shadow:var(--shadow-sm); transition:transform .3s var(--ease-spring);
}
.switch:active .track::after{ width:23px; } /* a little squash on press, like a real toggle */
.switch.on .track{ background:var(--success); box-shadow:0 0 0 5px var(--success-soft); }
.switch.on .track::after{ transform:translateX(20px); }

/* ---------- empty / error / toast ---------- */
.empty{ color:var(--muted); font-size:14px; padding:28px 16px; text-align:center; border:1.5px dashed var(--border-strong); border-radius:var(--radius-md); }
.error{ color:var(--critical); font-size:13px; margin-top:8px; }
.toast{ position:fixed; bottom:22px; right:22px; background:var(--ink); color:var(--paper); padding:13px 20px; border-radius:var(--radius-md); font-size:14px; box-shadow:var(--shadow-lg); z-index:50; }

/* ============================================================
   Customer app
   ============================================================ */
.restaurant-card{
  display:flex; flex-direction:column; text-decoration:none; color:inherit;
  border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden;
  background:var(--paper-raised); cursor:pointer; transition:transform .15s, box-shadow .15s;
}
.restaurant-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.restaurant-card{ animation:fd-fade-in-up .4s var(--ease-out) both; }
.menu-item{ animation:fd-fade-in-up .34s var(--ease-out) both; }
.restaurant-card-skeleton{ border-radius:var(--radius-lg); overflow:hidden; border:1px solid var(--border); background:var(--paper-raised); }
.restaurant-card-skeleton .photo{ aspect-ratio:400/260; }
.restaurant-card-skeleton .line{ height:12px; margin:14px 16px; }
.restaurant-card-skeleton .line.w60{ width:60%; }
.restaurant-card-skeleton .line.w40{ width:40%; margin-top:8px; }
.restaurant-card .photo{
  position:relative; overflow:hidden;
  height:128px; display:flex; align-items:center; justify-content:center; font-size:40px;
}
.restaurant-card .photo .emoji{ position:relative; z-index:0; }
.restaurant-card .photo img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1;
  background:transparent;
}
.restaurant-card .photo .price-hint{
  position:absolute; top:9px; right:9px; z-index:2; background:rgba(20,16,14,0.62); color:#fff;
  font-family:var(--font-mono); font-size:10.5px; letter-spacing:.04em; padding:3px 8px; border-radius:var(--radius-full);
}
.restaurant-card .body{ padding:14px 16px 16px; }
.restaurant-card .name{ font-family:var(--font-display); font-weight:700; font-size:16px; margin-bottom:3px; }
.restaurant-card .sub{ font-size:12.5px; color:var(--muted); }

.category-label{
  font-family:var(--font-mono); font-size:11px; letter-spacing:0.1em; text-transform:uppercase;
  color:var(--muted); margin:22px 0 10px;
}
.category-label:first-child{ margin-top:0; }
.menu-item{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:13px 0; border-bottom:1px solid var(--border); cursor:pointer;
}
.menu-item:last-child{ border-bottom:none; }
.menu-item:hover .name{ color:var(--brand-ink-on-light); }
.menu-item .thumb{
  position:relative; overflow:hidden; flex-shrink:0;
  width:60px; height:60px; border-radius:var(--radius-md);
  display:flex; align-items:center; justify-content:center; font-size:22px;
}
.menu-item .thumb .emoji{ position:relative; z-index:0; }
.menu-item .thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.menu-item .info{ flex:1; min-width:0; }
.menu-item .name{ font-weight:700; font-size:14.5px; }
.menu-item .desc{ font-size:12px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:38ch; }
.menu-item .price{ font-family:var(--font-mono); color:var(--muted); font-size:13.5px; margin-top:3px; }
.menu-item .options-hint{ font-size:11px; color:var(--brand-ink-on-light); font-weight:600; margin-top:2px; }
.qty-stepper{ display:flex; align-items:center; gap:0; border:1.5px solid var(--border-strong); border-radius:var(--radius-full); overflow:hidden; animation:fd-pop-in .18s var(--ease-spring) both; }
.qty-stepper button{ background:var(--paper-sunken); border:none; border-radius:0; width:34px; height:34px; padding:0; font-size:16px; box-shadow:none; }
.qty-stepper .qty{ width:26px; text-align:center; font-family:var(--font-mono); font-weight:700; font-size:14px; }
.add-btn{ background:var(--paper-sunken); border:1.5px solid var(--border-strong); border-radius:var(--radius-full); padding:7px 16px; font-size:13px; color:var(--ink); }
.add-btn:hover{ border-color:var(--brand); color:var(--brand-ink-on-light); transform:translateY(-1px); }

.cart-panel{ position:sticky; top:80px; }
.cart-line{ display:flex; justify-content:space-between; font-size:13.5px; padding:5px 0; gap:10px; animation:fd-fade-in-up .22s var(--ease-out) both; }
.cart-line .name{ font-weight:600; }
.cart-total-row{ display:flex; justify-content:space-between; font-weight:700; font-size:15.5px; border-top:1px solid var(--border); margin-top:10px; padding-top:10px; }

.cart-bar{
  display:none; position:fixed; left:0; right:0; bottom:0; z-index:30;
  background:var(--ink); color:#fff; padding:14px 18px;
  align-items:center; justify-content:space-between;
  box-shadow:0 -8px 24px rgba(0,0,0,0.18);
}
.cart-bar button{ background:var(--brand); color:#fff; }
@keyframes fd-sheet-in{ from{ transform:translateY(100%); } to{ transform:translateY(0); } }
@media (max-width:820px){
  .cart-panel{ display:none; }
  .cart-panel.mobile-open{
    display:block; position:fixed; left:0; right:0; bottom:0; max-height:82vh; overflow-y:auto;
    border-radius:var(--radius-lg) var(--radius-lg) 0 0; box-shadow:var(--shadow-lg); z-index:40;
    animation:fd-sheet-in .3s var(--ease-out) both;
  }
  /* Slides up from off-screen instead of popping into existence — stays
     display:flex the whole time (position:fixed keeps it out of layout
     either way) so the transform/opacity actually has something to animate. */
  .cart-bar{
    display:flex; transform:translateY(100%); opacity:0; pointer-events:none;
    transition:transform .3s var(--ease-out), opacity .3s var(--ease-out);
  }
  .cart-bar.visible{ transform:translateY(0); opacity:1; pointer-events:auto; }
  .cart-sheet-close{ display:block !important; }
}
.cart-sheet-close{ display:none; margin-bottom:10px; }

/* ============================================================
   POS console (dark)
   ============================================================ */
.ticket-board{ display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:16px; }
.ticket{
  background:var(--paper-raised); border:1px solid var(--border); border-left:4px solid var(--border-strong);
  border-radius:var(--radius-md); padding:16px 17px;
  animation:fd-fade-in-up .32s var(--ease-out) both;
  transition:box-shadow .2s var(--ease-out);
}
.ticket.status-placed{ border-left-color:var(--brand); }
.ticket.status-accepted, .ticket.status-preparing{ border-left-color:var(--info); }
.ticket.status-ready{ border-left-color:var(--warning); }
.ticket.is-new{ animation:fd-fade-in-up .32s var(--ease-out) both, fd-pulse-ring 1.1s var(--ease-out) 2; }
.ticket .head{ display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:12px; color:var(--muted); margin-bottom:10px; }
.ticket .cust{ font-weight:700; font-size:15px; margin-bottom:6px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ticket .addr{ font-size:12.5px; color:var(--muted); margin-bottom:10px; }
.ticket .items{ font-family:var(--font-mono); font-size:13px; margin-bottom:10px; border-top:1px dashed var(--border); border-bottom:1px dashed var(--border); padding:9px 0; }
.ticket .items div{ display:flex; justify-content:space-between; padding:2px 0; }
.ticket .total{ font-weight:700; display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:14.5px; }
.ticket .actions{ margin-top:12px; display:flex; gap:8px; }
.ticket .actions button{ flex:1; font-size:13px; padding:9px 8px; }

.menu-setup-row{ display:flex; align-items:center; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--border); gap:10px; }
.menu-setup-row:last-child{ border-bottom:none; }
.menu-setup-row .price{ font-family:var(--font-mono); color:var(--muted); font-size:13px; }
.menu-setup-row .opt-note{ font-size:11.5px; color:var(--muted); margin-top:2px; }

.option-group-builder{
  border:1.5px solid var(--border); border-radius:var(--radius-md); padding:14px 15px; margin-bottom:12px; background:var(--paper-sunken);
}
.ogb-head{ display:flex; gap:8px; align-items:flex-start; margin-bottom:10px; }
.ogb-head input[type="text"], .ogb-head input:not([type]){ flex:1; }
.ogb-head select{ width:auto; }
.ogb-required{ display:flex; align-items:center; gap:6px; font-size:12.5px; white-space:nowrap; color:var(--muted); }
.ogb-remove{ background:transparent; border:none; box-shadow:none; color:var(--critical); font-size:18px; padding:4px 8px; flex-shrink:0; }
.choice-builder-row{ display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.choice-builder-row input[type="text"], .choice-builder-row input:not([type]){ flex:1; }
.choice-builder-row input[type="number"]{ width:100px; flex-shrink:0; }
.choice-builder-row .cbr-remove{ background:transparent; border:none; box-shadow:none; color:var(--muted); font-size:16px; padding:4px 6px; flex-shrink:0; }
.add-choice-btn{ font-size:12px; padding:6px 12px; }

#print-area{ display:none; }
@media print{
  body *{ visibility:hidden; }
  #print-area, #print-area *{ visibility:visible; color:#000 !important; }
  #print-area{ display:block; position:absolute; top:0; left:0; width:100%; font-family:var(--font-mono); }
}

/* ============================================================
   Rider app (dark, mobile-first)
   ============================================================ */
.shift-bar{ display:flex; align-items:center; justify-content:space-between; }
.job-card{
  background:var(--paper-raised); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:18px 19px; box-shadow:var(--shadow-sm);
  animation:fd-fade-in-up .34s var(--ease-out) both, fd-pulse-ring 1.1s var(--ease-out) 1;
}
#current-job-card{ animation:fd-fade-in-up .34s var(--ease-out) both; }
.job-card .route{ display:flex; flex-direction:column; gap:10px; margin:12px 0 14px; }
.route-point{ display:flex; gap:10px; align-items:flex-start; }
.route-point .dot{ width:9px; height:9px; border-radius:50%; margin-top:5px; flex-shrink:0; }
.route-point.pickup .dot{ background:var(--brand); }
.route-point.dropoff .dot{ background:var(--success); }
.route-point .label{ font-family:var(--font-mono); font-size:10.5px; text-transform:uppercase; letter-spacing:0.08em; color:var(--muted); }
.route-point .addr{ font-size:14px; font-weight:600; }
.route-line{ width:1.5px; height:16px; background:var(--border-strong); margin-left:4px; }

/* ============================================================
   Admin dashboard (light, sidebar)
   ============================================================ */
.admin-shell{ display:grid; grid-template-columns:220px 1fr; max-width:1240px; margin:0 auto; }
.admin-sidebar{ padding:26px 16px; position:sticky; top:65px; align-self:start; height:calc(100vh - 65px); }
.admin-sidebar a{
  display:block; padding:9px 14px; border-radius:var(--radius-sm); text-decoration:none;
  color:var(--muted); font-size:13.5px; font-weight:600; margin-bottom:2px;
}
.admin-sidebar a:hover{ background:var(--paper-sunken); color:var(--ink); }
.admin-main{ padding:26px 24px 100px; min-width:0; }
.stat-tile{
  background:var(--paper-raised); border:1px solid var(--border); border-radius:var(--radius-lg); padding:18px 20px;
  animation:fd-fade-in-up .38s var(--ease-out) both;
  transition:box-shadow .2s var(--ease-out), transform .2s var(--ease-out), border-color .2s var(--ease-out);
}
.stat-tile:hover{ box-shadow:var(--shadow-sm); transform:translateY(-2px); border-color:var(--brand-soft); }
.stat-tile .label{ font-size:12px; color:var(--muted); font-weight:600; margin-bottom:6px; }
.stat-tile .value{ font-family:var(--font-display); font-size:30px; font-weight:700; }
.stat-tile .value.mono{ font-family:var(--font-mono); }
@media (max-width:820px){
  .admin-shell{ grid-template-columns:1fr; }
  .admin-sidebar{ position:static; height:auto; display:flex; gap:4px; overflow-x:auto; padding:14px 16px; border-bottom:1px solid var(--border); }
  .admin-sidebar a{ white-space:nowrap; margin-bottom:0; }
}

/* ============================================================
   Customer app — restaurant hero banner + item detail modal
   ============================================================ */
.menu-hero{
  position:relative; overflow:hidden; height:172px; border-radius:var(--radius-lg);
  display:flex; align-items:flex-end; margin-top:14px;
}
.menu-hero .emoji-fallback{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:56px; opacity:.85;
}
.menu-hero img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.menu-hero .hero-overlay{
  position:relative; z-index:2; width:100%; padding:16px 20px 14px;
  background:linear-gradient(to top, rgba(15,12,10,0.72), rgba(15,12,10,0.05) 70%);
}
.menu-hero .hero-overlay .name{ font-family:var(--font-display); font-weight:800; font-size:23px; color:#fff; }
.menu-hero .hero-overlay .sub{ font-size:12.5px; color:rgba(255,255,255,0.88); margin-top:3px; }
.menu-hero .hero-overlay .pill{ margin-top:8px; }

.modal-overlay{
  position:fixed; inset:0; z-index:70; background:rgba(20,16,14,0.55); backdrop-filter:blur(2px);
  display:flex; align-items:flex-end; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .22s var(--ease-out);
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }
.item-modal{
  width:100%; max-width:480px; max-height:90vh; overflow-y:auto;
  background:var(--paper); border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow:var(--shadow-lg); transform:translateY(28px) scale(.98); transition:transform .28s var(--ease-out);
}
.modal-overlay.open .item-modal{ transform:translateY(0) scale(1); }
@media (min-width:640px){
  .modal-overlay{ align-items:center; padding:24px; }
  .item-modal{ border-radius:var(--radius-lg); max-height:86vh; }
}
.item-modal .modal-photo{ position:relative; height:210px; overflow:hidden; flex-shrink:0; }
.item-modal .modal-photo .emoji-fallback{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:60px; }
.item-modal .modal-photo img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.item-modal .modal-close{
  position:absolute; top:12px; right:12px; z-index:3; width:32px; height:32px; padding:0;
  background:rgba(20,16,14,0.6); color:#fff; border:none; border-radius:50%; font-size:15px; box-shadow:none;
}
.item-modal .modal-body{ padding:18px 20px 24px; }
.item-modal .modal-title{ font-family:var(--font-display); font-weight:700; font-size:19.5px; margin-bottom:5px; }
.item-modal .modal-desc{ font-size:13.5px; color:var(--muted); line-height:1.55; margin-bottom:8px; }
.item-modal .modal-base-price{ font-family:var(--font-mono); font-size:13.5px; color:var(--muted); padding-bottom:16px; border-bottom:1px solid var(--border); margin-bottom:18px; }

.option-group{ margin-bottom:22px; }
.option-group .og-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; gap:10px; }
.option-group .og-name{ font-weight:700; font-size:14.5px; }
.option-group .og-meta{ font-family:var(--font-mono); font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); white-space:nowrap; }
.option-group .og-meta.required{ color:var(--brand-ink-on-light); }
.option-choice{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:11px 13px; border:1.5px solid var(--border); border-radius:var(--radius-md);
  margin-bottom:8px; cursor:pointer; transition:border-color .12s, background .12s;
}
.option-choice:last-child{ margin-bottom:0; }
.option-choice:hover{ border-color:var(--border-strong); }
.option-choice.selected{ border-color:var(--brand); background:var(--brand-soft); }
.option-choice .oc-left{ display:flex; align-items:center; gap:11px; }
.option-choice input{ accent-color:var(--brand); width:17px; height:17px; flex-shrink:0; }
.option-choice .oc-label{ font-size:13.5px; font-weight:600; }
.option-choice .oc-delta{ font-family:var(--font-mono); font-size:12.5px; color:var(--muted); white-space:nowrap; }

.modal-footer{
  position:sticky; bottom:0; background:var(--paper); border-top:1px solid var(--border);
  padding:14px 20px; display:flex; align-items:center; gap:12px;
}
.modal-footer .modal-add-btn{ flex:1; display:flex; align-items:center; justify-content:center; gap:8px; }
.modal-footer .modal-error{ padding:0 20px 12px; margin-top:-6px; }

/* ---------------------------------------------------------------------
   POS portal — Quick Sale, History, Reports, Devices, invoice modal
   --------------------------------------------------------------------- */

.segmented{ display:flex; gap:8px; flex-wrap:wrap; }
.segmented button{
  padding:8px 16px; border-radius:var(--radius-full); border:1.5px solid var(--border-strong);
  background:transparent; color:var(--muted); font-size:13px; font-weight:600; box-shadow:none;
  text-transform:capitalize;
}
.segmented button.active{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand); }
body.theme-dark .segmented button.active{ color:var(--brand); }

.qs-toolbar{ display:flex; gap:10px; }
.qs-toolbar input[type="search"]{ flex:1; }

/* Quick Sale item picker — a grid of tappable boxes (photo, name, price),
   filterable by category pill and free-text search. Mirrors the tile feel
   of the customer app's menu cards, scaled down for a fast-tapping till. */
.qs-item-grid{
  max-height:420px; overflow-y:auto; display:grid;
  grid-template-columns:repeat(auto-fill, minmax(122px, 1fr)); gap:10px;
  padding:2px; margin-bottom:16px;
}
.qs-item-grid .empty{ grid-column:1 / -1; }
.qs-tile{
  border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden;
  cursor:pointer; background:var(--paper-sunken); transition:transform .12s, box-shadow .12s, border-color .12s;
  display:flex; flex-direction:column; position:relative;
}
.qs-tile:hover{ transform:translateY(-2px); box-shadow:var(--shadow-sm); border-color:var(--border-strong); }
.qs-tile:active{ transform:scale(.95); transition-duration:.08s; }
.qs-tile-qty-badge{ animation:fd-pop-in .22s var(--ease-spring); }
.qs-tile-photo{
  position:relative; aspect-ratio:1.3 / 1; display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.qs-tile-photo img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.qs-tile-photo .emoji{ font-size:22px; opacity:.85; }
.qs-tile-body{ padding:8px 9px 9px; }
.qs-tile-name{ font-weight:700; font-size:12.5px; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.5em; }
.qs-tile-price{ font-size:12.5px; color:var(--brand-ink-on-light); font-weight:700; margin-top:4px; }
body.theme-dark .qs-tile-price{ color:var(--brand); }
.qs-tile-badge{ font-size:10.5px; color:var(--muted); margin-top:2px; }
.qs-tile.in-cart{ border-color:var(--brand); box-shadow:0 0 0 1.5px var(--brand) inset; }
.qs-tile-qty-badge{
  position:absolute; top:6px; right:6px; background:var(--brand); color:#fff; font-weight:800; font-size:11.5px;
  min-width:20px; height:20px; border-radius:var(--radius-full); display:flex; align-items:center; justify-content:center;
  padding:0 5px; box-shadow:var(--shadow-sm);
}

.qs-cart{ border-top:1.5px solid var(--border); padding-top:10px; }
.qs-cart-row{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:6px 0; animation:fd-fade-in-up .22s var(--ease-out) both; }
#qs-cart-total.pop{ animation:fd-pop-in .22s var(--ease-spring); }
.qs-cart-row .qty-controls{ display:flex; align-items:center; gap:8px; }
.qs-cart-row .qty-controls button{ width:26px; height:26px; padding:0; border-radius:50%; font-size:14px; box-shadow:none; border-color:var(--border-strong); }
.qs-cart-row .opt-note{ font-size:11.5px; color:var(--muted); margin-left:8px; }

.device-row{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:13px 14px; border:1px solid var(--border); border-radius:var(--radius-md); margin-bottom:10px;
  animation:fd-fade-in-up .28s var(--ease-out) both; transition:border-color .15s, background .15s;
}
.device-row:hover{ border-color:var(--border-strong); background:var(--paper-sunken); }
.device-row .name{ font-weight:700; font-size:14px; display:flex; align-items:center; gap:8px; }
.device-row .meta{ font-size:12px; color:var(--muted); margin-top:3px; }
.device-row .actions{ display:flex; gap:8px; }
.device-row.inactive{ opacity:0.55; }

.history-row{
  display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;
  padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius-md); margin-bottom:10px;
  animation:fd-fade-in-up .28s var(--ease-out) both; transition:border-color .15s, background .15s;
}
.history-row:hover{ border-color:var(--border-strong); background:var(--paper-sunken); }
.history-row .name{ font-weight:700; font-size:13.5px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.history-row .meta{ font-size:12px; color:var(--muted); margin-top:3px; }
.history-row .amount{ font-family:var(--font-mono); font-weight:700; }

.report-stat-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin-bottom:18px; }
.report-stat{ border:1px solid var(--border); border-radius:var(--radius-md); padding:14px; }
.report-stat .label{ font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:0.4px; margin-bottom:6px; }
.report-stat .value{ font-family:var(--font-mono); font-size:19px; font-weight:700; }
.report-day-row{ display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.report-day-row:last-child{ border-bottom:none; }

.invoice-modal{
  width:100%; max-width:420px; max-height:90vh; overflow-y:auto;
  background:var(--paper); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  transform:translateY(28px) scale(.98); transition:transform .28s var(--ease-out);
}
.modal-overlay.open .invoice-modal{ transform:translateY(0) scale(1); }
.receipt-preview{
  margin:14px 20px; padding:14px; background:var(--paper-sunken); border:1px solid var(--border);
  border-radius:var(--radius-md); font-family:var(--font-mono); font-size:12px; line-height:1.5;
  white-space:pre-wrap; overflow-x:auto;
}
