/* ==========================================================================
   SATIVERSE design system — Phase 0 mockups
   Tokens are CSS custom properties; each restaurant (tenant) overrides the
   brand tokens via [data-theme] presets + its own --brand/--accent values.
   ========================================================================== */

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* neutral scale (warm) */
  --bg: #f7f3ee;
  --surface: #ffffff;
  --surface-2: #fbf8f4;
  --line: #ebe4da;
  --line-strong: #d9cfc2;
  --ink: #1f1a17;
  --ink-2: #4b433d;
  --muted: #857a70;

  /* brand (tenant-overridable) */
  --brand: #7a1f35;        /* Lady M — wine */
  --brand-ink: #ffffff;
  --brand-soft: #f6e8eb;
  --accent: #c8963e;       /* gold */
  --accent-soft: #f8efdf;
  --brand-2: #9b2c47;      /* lighter brand for gradients */
  --accent-ink: #2a1c06;   /* text on the accent colour */

  /* status */
  --ok: #2f7a4f;    --ok-soft: #e3f2e8;
  --warn: #b7791f;  --warn-soft: #fbf0db;
  --info: #2c5f8a;  --info-soft: #e2edf6;
  --bad: #b23a3a;   --bad-soft: #f8e3e3;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(31, 26, 23, .06);
  --shadow: 0 6px 24px -8px rgba(31, 26, 23, .18);
  --shadow-lg: 0 24px 60px -20px rgba(31, 26, 23, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---- tenant theme presets ---------------------------------------------- */
[data-theme="garden"] {
  --brand: #2f5d46; --brand-2: #3f7a5c; --brand-soft: #e5efe8;
  --accent: #e0a526; --accent-ink: #2b1e02; --accent-soft: #fbf1d9;
  --bg: #f3f5f0; --surface-2: #f8faf6; --line: #e1e7dd; --line-strong: #cbd5c5;
  --ink: #1a221d; --ink-2: #43504a; --muted: #7a877f;
}
[data-theme="ocean"] {
  --brand: #0f4c5c; --brand-2: #16697f; --brand-soft: #e0eef1;
  --accent: #ff7f50; --accent-ink: #3a1405; --accent-soft: #ffe9df;
  --bg: #f0f5f6; --surface-2: #f6fafb; --line: #d9e6e9; --line-strong: #c3d6db;
  --ink: #10232a; --ink-2: #3d545c; --muted: #748a91;
}
[data-theme="plum"] {
  --brand: #4a2545; --brand-2: #663460; --brand-soft: #f1e5ef;
  --accent: #f4a582; --accent-ink: #3b170a; --accent-soft: #fdebe2;
  --bg: #f8f2f5; --surface-2: #fcf7fa; --line: #ecdfe7; --line-strong: #dccbd6;
  --ink: #241820; --ink-2: #54434e; --muted: #8d7b87;
}
[data-theme="sunset"] {
  --brand: #b5532f; --brand-2: #cc6a43; --brand-soft: #f8e6dd;
  --accent: #e9c46a; --accent-ink: #2d2203; --accent-soft: #faf0d6;
  --bg: #fbf5ee; --surface-2: #fdf9f4; --line: #efe2d4; --line-strong: #e0cfbd;
  --ink: #2a1b14; --ink-2: #5a463b; --muted: #94806f;
}
[data-theme="citrus"] {
  --brand: #4f5d2f; --brand-2: #65763d; --brand-soft: #e9ecdc;
  --accent: #e9d94a; --accent-ink: #2a2602; --accent-soft: #f8f4cf;
  --bg: #f6f6ee; --surface-2: #fafaf4; --line: #e4e5d5; --line-strong: #d1d3bd;
  --ink: #1f2216; --ink-2: #4a4f3a; --muted: #828771;
}
[data-theme="royal"] {
  --brand: #1d2d50; --brand-2: #2c4273; --brand-soft: #e3e8f3;
  --accent: #c9a227; --accent-ink: #271e02; --accent-soft: #f6eed4;
  --bg: #f3f4f8; --surface-2: #f8f9fc; --line: #e0e4ee; --line-strong: #cbd1df;
  --ink: #141a2b; --ink-2: #414a62; --muted: #7a8299;
}
[data-theme="midnight"] {
  --bg: #121212; --surface: #1c1b1a; --surface-2: #232120;
  --line: #2f2c2a; --line-strong: #3d3936;
  --ink: #f4efe9; --ink-2: #cfc6bd; --muted: #958b82;
  --brand: #e8873a; --brand-2: #f29b55; --brand-ink: #1a0f06; --brand-soft: #3a2616;
  --accent: #f2c14e; --accent-ink: #231a04; --accent-soft: #3a311a;
  --ok-soft: #1f3528; --warn-soft: #3a2e17; --info-soft: #1b2a38; --bad-soft: #3a1d1d;
  --shadow: 0 6px 24px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
}

/* staff dark mode */
[data-mode="dark"] {
  --bg: #111315; --surface: #191c1f; --surface-2: #1f2327;
  --line: #2a2f34; --line-strong: #363c42;
  --ink: #eef1f3; --ink-2: #c3c9ce; --muted: #8a939b;
  --brand-soft: #3a1a22; --accent-soft: #3a311a;
  --ok-soft: #1c3226; --warn-soft: #3a2e17; --info-soft: #1b2a38; --bad-soft: #3a1d1d;
  --shadow: 0 6px 24px -8px rgba(0,0,0,.6);
}

/* ---- base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px -10px var(--brand); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1f1a17; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 16px; padding: 0 24px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.icon-btn svg, .btn svg { width: 20px; height: 20px; }

/* ---- chips, badges ----------------------------------------------------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: all .2s var(--ease);
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: #8a5f12; border-color: transparent; }
[data-mode="dark"] .badge.brand { color: #f3b7c4; }
[data-mode="dark"] .badge.accent { color: var(--accent); }
[data-theme="midnight"] .badge.accent { color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---- cards & forms ----------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card.pad { padding: 18px; }
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 4px; gap: 4px;
}
.seg button {
  border: 0; background: transparent; border-radius: 10px;
  padding: 10px 8px; font-weight: 700; font-size: 14px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button small { font-weight: 600; font-size: 11px; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 46px; height: 28px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong);
  transition: background .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ==========================================================================
   CUSTOMER STOREFRONT (mobile-first, framed on desktop)
   ========================================================================== */
.store-body {
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--brand-soft), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, var(--accent-soft), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: var(--bg); position: relative;
  padding-bottom: 120px;
}
@media (min-width: 720px) {
  .store-body { padding: 28px 0; }
  .app { min-height: calc(100vh - 56px); border-radius: 32px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
}

.hero {
  position: relative; height: 230px; color: #fff;
  background: var(--brand);
  overflow: hidden;
}
.hero {
  background:
    radial-gradient(420px 260px at 85% 20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    linear-gradient(140deg, color-mix(in srgb, var(--brand) 85%, #000), var(--brand));
}
.hero .art { position: absolute; right: -70px; top: -40px; width: 320px; height: 320px; transform: rotate(-12deg); }
[data-icon] { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
[data-icon] > svg { width: 18px; height: 18px; flex: none; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.55) 100%);
}
.hero-top { position: absolute; z-index: 2; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; }
.hero-top .icon-btn { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(8px); }
.hero-text { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 18px; }
.hero-text h1 { font-family: var(--font-display); font-size: 34px; font-weight: 600; }
.hero-text p { margin: 4px 0 0; opacity: .9; font-size: 14px; }
.logo-mark {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--surface); color: var(--brand);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 24px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}

.section { padding: 18px 20px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }

.status-strip {
  margin: -22px 16px 0; position: relative; z-index: 3;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px;
}

.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 14px; height: 48px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.search svg { width: 18px; height: 18px; color: var(--muted); }

/* build-your-own promo */
.builder-promo {
  display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center;
  padding: 18px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000));
  color: var(--brand-ink); text-decoration: none; overflow: hidden; position: relative;
}
.builder-promo h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.builder-promo p { margin: 6px 0 12px; opacity: .85; font-size: 13px; }
.builder-promo .pill { display: inline-flex; gap: 6px; align-items: center; background: var(--accent); color: #1f1a17; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; }

/* dish cards */
.dish-list { display: grid; gap: 12px; }
.dish {
  display: grid; grid-template-columns: 1fr 104px; gap: 14px;
  padding: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: left; width: 100%;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.dish:hover { box-shadow: var(--shadow); }
.dish:active { transform: scale(.99); }
.dish h3 { font-size: 16px; font-weight: 800; }
.dish p { margin: 4px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish .price { font-weight: 800; }
.dish .thumb { width: 104px; height: 104px; border-radius: 14px; overflow: hidden; position: relative; background: var(--surface-2); }
.dish .add {
  position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); color: var(--ink); display: grid; place-items: center;
  box-shadow: var(--shadow); font-size: 20px; font-weight: 700;
}
.dish.soldout { opacity: .55; }
.dish.soldout .add { display: none; }
.labels { display: flex; flex-wrap: wrap; gap: 6px; }

.popular { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.popular::-webkit-scrollbar { display: none; }
.pop-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: left; padding: 0; }
.pop-card .thumb { height: 120px; }
.pop-card div.body { padding: 10px 12px 12px; }
.pop-card h4 { font-size: 14px; font-weight: 800; }

/* food art (placeholder for restaurant photos) */
.food-art { width: 100%; height: 100%; display: block; }

/* sticky cart bar */
.cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(140%);
  bottom: 16px; width: min(448px, calc(100% - 32px)); z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: transform .35s var(--ease);
}
.cart-bar.show { transform: translateX(-50%) translateY(0); }
.cart-bar .count { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #1f1a17; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.cart-bar .go { margin-left: auto; background: var(--brand); color: var(--brand-ink); padding: 10px 18px; border-radius: 999px; font-weight: 800; }
[data-theme="midnight"] .cart-bar { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }

/* bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(20, 14, 10, .45); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 50; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 60;
  width: min(480px, 100%); max-height: 92vh; overflow: auto;
  transform: translate(-50%, 105%); transition: transform .4s var(--ease);
  background: var(--surface); border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-lg);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 10px auto 0; }
.sheet .media { height: 210px; margin: 10px 14px 0; border-radius: 20px; overflow: hidden; }
.sheet .content { padding: 18px 20px 120px; }
.sheet .foot {
  position: sticky; bottom: 0; padding: 14px 20px 18px;
  background: linear-gradient(180deg, transparent, var(--surface) 30%);
  display: flex; gap: 12px; align-items: center;
}

/* option groups */
.opt-group { margin-top: 20px; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.opt-head h4 { font-size: 16px; font-weight: 800; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.opt:last-child { border-bottom: 0; }
.opt input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.opt .name { flex: 1; font-weight: 600; }
.opt .add-price { color: var(--muted); font-weight: 700; font-size: 14px; }
.opt.out { opacity: .45; pointer-events: none; }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); font-size: 18px; font-weight: 700; box-shadow: var(--shadow-sm); }
.qty span { min-width: 24px; text-align: center; font-weight: 800; }

/* page header (inner pages) */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--font-display); font-size: 20px; font-weight: 600; }

/* meal builder */
.plate-stage {
  position: relative; padding: 18px 20px 6px; display: grid; place-items: center;
}
.plate-stage svg { width: 250px; height: 250px; filter: drop-shadow(0 18px 28px rgba(0,0,0,.18)); }
.plate-stage .total-float {
  position: absolute; right: 22px; top: 18px; text-align: right;
}
.plate-stage .total-float b { font-size: 22px; display: block; font-weight: 800; }
.steps { display: flex; gap: 6px; padding: 8px 20px 0; }
.steps .s { flex: 1; height: 5px; border-radius: 9px; background: var(--line); transition: background .3s; }
.steps .s.done { background: var(--brand); }
.steps .s.cur { background: var(--accent); }
.step-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px 0; scrollbar-width: none; }
.step-tabs::-webkit-scrollbar { display: none; }
.step-tabs button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; color: var(--muted); }
.step-tabs button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.step-tabs button.ok::before { content: "✓ "; }
.ing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ing {
  position: relative; text-align: left; padding: 12px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--surface);
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center;
  transition: border-color .2s, background .2s, transform .15s;
}
.ing:active { transform: scale(.98); }
.ing .sw { width: 44px; height: 44px; border-radius: 12px; }
.ing b { display: block; font-size: 14px; line-height: 1.2; }
.ing small { color: var(--muted); font-weight: 700; }
.ing.on { border-color: var(--brand); background: var(--brand-soft); }
.ing .n { position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 800; display: none; place-items: center; }
.ing.on .n { display: grid; }
.ing.out { opacity: .4; pointer-events: none; }
.ing.out small::after { content: " · Out today"; color: var(--bad); }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-line.total { border-top: 1px dashed var(--line-strong); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 17px; }

/* checkout */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.cart-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { width: 54px; height: 54px; border-radius: 12px; overflow: hidden; }
.cart-item .choices { color: var(--muted); font-size: 12.5px; }
.fee-note { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; color: var(--ink-2); }
.zone-list { display: grid; gap: 8px; }
.zone { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.zone input { accent-color: var(--brand); width: 20px; height: 20px; }
.zone.on { border-color: var(--brand); background: var(--brand-soft); }
.zone .f { margin-left: auto; font-weight: 800; }

/* tracking */
.track-hero { text-align: center; padding: 28px 20px 8px; }
.track-hero .ring {
  width: 132px; height: 132px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--brand) var(--p, 25%), var(--line) 0);
  transition: --p 1s;
}
.track-hero .ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
.track-hero .ring span { position: relative; font-size: 44px; }
.order-no { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: .02em; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 40px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .b { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; font-size: 12px; color: #fff; transition: all .3s; }
.timeline li.done .b { background: var(--ok); border-color: var(--ok); }
.timeline li.done::before { background: var(--ok); }
.timeline li.cur .b { border-color: var(--brand); box-shadow: 0 0 0 6px var(--brand-soft); animation: pulse 1.6s infinite; }
.timeline b { display: block; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px transparent; } }

/* demo theme switcher */
.demo-switch {
  position: fixed; z-index: 70; left: 16px; bottom: 16px;
  display: flex; gap: 6px; align-items: center;
  background: rgba(20, 16, 14, .86); color: #fff; padding: 6px; border-radius: 999px;
  font-size: 12px; font-weight: 700; box-shadow: var(--shadow-lg);
}
.demo-switch span { padding: 0 6px 0 8px; opacity: .7; }
.demo-switch button { border: 0; border-radius: 999px; padding: 7px 12px; background: transparent; color: #fff; font-size: 12px; font-weight: 700; }
.demo-switch button.on { background: #fff; color: #111; }
@media (max-width: 719px) {
  .demo-switch { bottom: 84px; left: 12px; padding: 4px; opacity: .9; }
  .demo-switch span { display: none; }
  .demo-switch button { padding: 6px 10px; font-size: 11px; white-space: nowrap; }
  .demo-switch button:not(.on) { display: none; }
  .demo-switch button.on::after { content: " ↻"; }
}

/* ==========================================================================
   STAFF PORTAL + PLATFORM CONSOLE
   ========================================================================== */
.staff-body { background: var(--bg); min-height: 100vh; }
.staff { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 0;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; min-width: 0;
}
/* the links scroll on short screens; the signed-in box always stays visible at the bottom */
.side-links { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px 8px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.side-backdrop, .menu-btn, .side-close { display: none; }
.side .brandline > div { min-width: 0; flex: 1; }
.side .brandline b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .brandline { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side .brandline .logo-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; margin: 0; background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.side .brandline b { display: block; font-size: 15px; }
.side a.nav {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: 14.5px;
}
.side a.nav svg { width: 19px; height: 19px; opacity: .8; }
.side a.nav:hover { background: var(--surface-2); }
.side a.nav.on { background: var(--brand-soft); color: var(--brand); }
[data-mode="dark"] .side a.nav.on { color: #f3b7c4; }
.side .nav-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.side .foot { flex: none; margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.main { min-width: 0; }
.mainbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.mainbar h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.content { padding: 22px 24px 40px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.kpi .d { font-size: 12.5px; font-weight: 700; }

@media (min-width: 961px) and (max-height: 820px) {
  .side { padding-top: 12px; }
  .side .brandline { padding-bottom: 10px; }
  .side a.nav { padding: 8px 12px; }
  .side .nav-label { padding: 10px 12px 4px; }
  .side .foot { padding: 10px; }
}
@media (max-width: 960px) {
  .staff { grid-template-columns: minmax(0, 1fr); }
  /* phones + tablets: the menu slides in from the left (☰ in the top bar) */
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(300px, 86vw); transform: translateX(-104%); transition: transform .22s ease; box-shadow: var(--shadow-lg, 0 20px 60px rgb(0 0 0 / .25)); }
  .nav-toggle:checked ~ .staff .side { transform: none; }
  .side-backdrop { position: fixed; inset: 0; z-index: 55; background: rgb(20 14 12 / .45); }
  .nav-toggle:checked ~ .staff .side-backdrop { display: block; }
  body:has(.nav-toggle:checked) { overflow: hidden; }
  .menu-btn, .side-close { display: inline-grid; cursor: pointer; }
  .side-close { margin-left: auto; width: 36px; height: 36px; }
  .nav-toggle:focus-visible ~ .staff .menu-btn { outline: 3px solid var(--brand); outline-offset: 2px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
  .mainbar { padding: 12px 16px; }
}

@media (max-width: 600px) {
  .mainbar { flex-wrap: wrap; }
  .mainbar .seg { width: 100% !important; order: 5; }
  .mainbar .chips { order: 5; width: 100%; }
  .band-row { grid-template-columns: 1fr 1fr 1fr 34px; gap: 8px; }
  .band-row > span.muted:not(.from) { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .v { font-size: 20px; }
}

/* POS */
.pos { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pos-item {
  text-align: left; padding: 0; overflow: hidden; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .12s, box-shadow .2s;
}
.pos-item:active { transform: scale(.97); }
.pos-item:hover { box-shadow: var(--shadow); }
.pos-item .thumb { height: 84px; }
.pos-item .b { padding: 10px 12px; }
.pos-item b { display: block; font-size: 14px; line-height: 1.25; }
.ticket { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 110px); }
.ticket .lines { overflow: auto; padding: 0 16px; flex: 1; min-height: 120px; }
.tline { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tline .q { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 700; }
.keypad button:active { background: var(--surface-2); }
.amount-display { font-size: 38px; font-weight: 800; letter-spacing: -.02em; text-align: right; padding: 8px 4px 14px; }
.pay-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(15, 12, 10, .55); opacity: 0; pointer-events: none; transition: opacity .25s; }
.pay-modal.show { opacity: 1; pointer-events: auto; }
.pay-card { width: min(440px, 100%); background: var(--surface); border-radius: 28px; padding: 24px; text-align: center; box-shadow: var(--shadow-lg); transform: scale(.96); transition: transform .3s var(--ease); }
.pay-modal.show .pay-card { transform: scale(1); }
.qr-box { width: 236px; height: 236px; margin: 16px auto; padding: 14px; background: #fff; border-radius: 20px; border: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.qr-box svg, .qr-box img { width: 100%; height: 100%; }
.qr-box .paid-overlay { position: absolute; inset: 0; border-radius: 20px; background: var(--ok); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: all .4s var(--ease); }
.qr-box.paid .paid-overlay { opacity: 1; transform: scale(1); }
.paid-overlay .tick { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; font-size: 44px; margin: 0 auto 8px; }
.waiting { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 14px; }
.waiting .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pos > * { min-width: 0; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr); } .ticket { position: static; max-height: none; } }

/* orders board */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 10px; min-height: 60vh; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; font-weight: 800; }
.col-head .c { margin-left: auto; font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.oc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); animation: popin .4s var(--ease); }
.oc.new { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.oc .no { font-size: 18px; font-weight: 800; }
.oc ul { margin: 8px 0; padding: 0; list-style: none; font-size: 13.5px; }
.oc li { padding: 3px 0; }
.oc li small { display: block; color: var(--muted); padding-left: 22px; }
.oc .note { font-size: 12.5px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 6px 8px; font-weight: 700; }
.oc .act { display: flex; gap: 8px; margin-top: 10px; }
.timer { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes popin { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
/* kitchen mode */
.kitchen .board { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.kitchen .col { display: contents; }
.kitchen .col-head, .kitchen .col > p { display: none; }
.kitchen .oc { font-size: 16px; padding: 16px; border-width: 2px; margin: 0; }
.kitchen .oc ul { font-size: 17px; font-weight: 700; }
.kitchen .oc .price, .kitchen .oc .pay { display: none; }
.kitchen .oc[data-s="ready"], .kitchen .oc[data-s="done"] { display: none; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }

/* band editor */
.band-row { display: grid; grid-template-columns: 1.3fr 28px 1.3fr 1fr 40px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.band-row .from { font-weight: 700; color: var(--ink-2); }
.money-in { position: relative; }
.money-in::before { content: "₦"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.money-in .input { padding-left: 28px; min-height: 42px; }
.band-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.band-bar div { transition: flex .4s var(--ease); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.toast {
  position: fixed; z-index: 90; right: 20px; top: 20px; max-width: 340px;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px;
  box-shadow: var(--shadow-lg); font-weight: 700; font-size: 14px;
  transform: translateY(-140%); transition: transform .35s var(--ease);
}
.toast.show { transform: translateY(0); }

/* mockup index */
.idx { max-width: 1100px; margin: 0 auto; padding: 40px 20px 80px; }
.idx-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; margin-bottom: 36px; }
.idx-hero h1 { font-family: var(--font-display); font-size: clamp(40px, 6vw, 64px); font-weight: 600; letter-spacing: -.02em; }
.idx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.idx-card { display: block; text-decoration: none; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.idx-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.idx-card .n { font-size: 12px; font-weight: 800; color: var(--brand); letter-spacing: .08em; }
.idx-card h3 { font-size: 18px; font-weight: 800; margin: 6px 0; }
.idx-card p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 800px) { .idx-hero { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.side .foot .row + .row > * { flex: 1 1 0; min-width: 0; }
.side .foot .avatar { flex: none; }
.side .foot .btn { white-space: nowrap; padding-inline: 10px; }
.side .foot b.small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
