@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f6f1e9;
  --surface: #fffdf9;
  --surface-2: #efe7da;
  --text: #1d1a16;
  --muted: #7a6f63;
  --line: #e6dccd;
  --accent: #b5502b;
  --accent-strong: #9a3f1f;
  --accent-soft: #f6e3d8;
  --on-accent: #ffffff;
  --ink: #1d1a16;
  --on-ink: #fbf6ef;
  --ok: #2f7a4a;
  --ok-soft: #e1f0e5;
  --warn: #a76a12;
  --warn-soft: #fbeed3;
  --danger: #b42318;
  --danger-soft: #fde4e1;
  --info: #2b5c9e;
  --info-soft: #e2ebf8;
  --shadow-sm: 0 1px 2px rgb(60 35 15 / 0.05);
  --shadow: 0 1px 2px rgb(60 35 15 / 0.04), 0 6px 16px -6px rgb(60 35 15 / 0.08), 0 22px 44px -22px rgb(60 35 15 / 0.14);
  --shadow-hover: 0 2px 4px rgb(60 35 15 / 0.05), 0 12px 24px -8px rgb(60 35 15 / 0.12), 0 32px 60px -24px rgb(60 35 15 / 0.2);
  --shadow-lg: 0 24px 70px -18px rgb(40 20 5 / 0.38);
  --radius: 22px;
  --radius-sm: 14px;
  /* One motion language everywhere: quick start, long soft landing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --fast: 0.2s;
  --medium: 0.4s;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131110;
    --surface: #1d1a17;
    --surface-2: #28231f;
    --text: #f4ede4;
    --muted: #a3978a;
    --line: #342d27;
    --accent: #e58a5f;
    --accent-strong: #f0a27c;
    --accent-soft: #3a2519;
    --on-accent: #1a0f08;
    --ink: #f4ede4;
    --on-ink: #1a1512;
    --ok: #74cf93;
    --ok-soft: #173020;
    --warn: #f2c062;
    --warn-soft: #33280f;
    --danger: #f28b82;
    --danger-soft: #3a1a17;
    --info: #8db4ee;
    --info-soft: #172840;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgb(255 255 255 / 0.05), 0 16px 40px -20px rgb(0 0 0 / 0.6);
    --shadow-hover: 0 0 0 1px rgb(255 255 255 / 0.09), 0 24px 50px -20px rgb(0 0 0 / 0.75);
    --shadow-lg: 0 24px 70px -12px rgb(0 0 0 / 0.75);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1, h2, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1320px; }
svg.icon { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }

/* ---------- Controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 500;
  transition:
    transform var(--fast) var(--ease), background-color var(--medium) var(--ease),
    border-color var(--medium) var(--ease), color var(--medium) var(--ease),
    box-shadow var(--medium) var(--ease), opacity var(--medium) var(--ease);
}
button:hover { border-color: var(--muted); }
button:active { transform: scale(0.97); transition-duration: 0.08s; }
button:disabled { opacity: 0.5; cursor: default; transform: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover {
  background: var(--accent-strong); border-color: var(--accent-strong);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
button.block { width: 100%; padding: 0.95rem 1.2rem; font-size: 1rem; }
button.icon-btn { width: 2.4rem; height: 2.4rem; padding: 0; }

input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; }
label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--muted); margin-bottom: 0.9rem; }
label > input, label > select, label > textarea { margin-top: 0.35rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.8rem; font-weight: 600;
  white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.status-new { background: var(--info-soft); color: var(--info); }
.status-preparing { background: var(--warn-soft); color: var(--warn); }
.status-ready { background: var(--ok-soft); color: var(--ok); }
.status-served { background: var(--surface-2); color: var(--muted); }
.status-cancelled { background: var(--danger-soft); color: var(--danger); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; }
.error:empty { min-height: 0; }

/* ---------- Customer: hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 2.4rem 0 1.4rem;
  background:
    radial-gradient(110% 80% at 100% 0%, var(--accent-soft) 0%, transparent 62%),
    radial-gradient(70% 55% at 0% 0%, color-mix(in srgb, var(--accent-soft) 55%, transparent) 0%, transparent 65%),
    var(--bg);
}
.eyebrow {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
.hero-brand { display: flex; align-items: center; gap: 1rem; }
.hero-brand > div { min-width: 0; }
.hero h1 { font-size: clamp(1.9rem, 7.5vw, 2.7rem); margin-top: 0.25rem; overflow-wrap: anywhere; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.1rem; }

/* Search: filters dishes as you type */
.search { position: relative; margin-top: 1.3rem; }
.search .icon { position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.05rem; pointer-events: none; }
.search input {
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  border-radius: 999px;
  border-color: transparent;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search input:focus { border-color: var(--accent); }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.resume {
  display: flex; align-items: center; gap: 0.8rem;
  margin-top: 1rem; padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
}
.resume .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent); animation: pulse 1.8s infinite; }
.resume span:last-child { margin-left: auto; color: var(--accent); font-weight: 600; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Customer: category tabs ---------- */
.tabs-bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.tabs {
  position: relative;
  display: flex; gap: 0.4rem; overflow-x: auto;
  padding-top: 0.7rem; padding-bottom: 0.7rem;
  scrollbar-width: none; scroll-behavior: smooth;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; z-index: 1;
  flex: none;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 500; font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--medium) var(--ease);
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--on-ink); }
/* The dark pill glides to whichever tab is active */
.tab-indicator {
  position: absolute; left: 0; top: 0.7rem;
  height: calc(100% - 1.4rem);
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.5s var(--ease), width 0.5s var(--ease);
  pointer-events: none;
}

/* ---------- Customer: dishes ---------- */
.category { padding-top: 1.9rem; scroll-margin-top: 3.6rem; }
.category-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0.3rem 0.75rem; }
.category h2 { font-size: 1.5rem; }

/* One soft panel per category, dishes separated by hairlines */
.dish-list {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dish {
  position: relative;
  display: flex; gap: 1rem; align-items: center;
  padding: 1.05rem 1.15rem;
  cursor: pointer;
  transition: background-color var(--medium) var(--ease);
}
.dish + .dish::before {
  content: ""; position: absolute; top: 0; left: 1.15rem; right: 1.15rem;
  height: 1px; background: var(--line);
}
@media (hover: hover) { .dish:hover { background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); } }
.dish:active { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
/* Dishes float in one after another, on first load only */
.intro .dish { animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.dish-info { flex: 1; min-width: 0; }
.dish h3 { font-size: 1rem; font-weight: 600; }
.dish .desc {
  margin-top: 0.25rem;
  color: var(--muted); font-size: 0.86rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-meta { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.55rem; }
.price { font-weight: 700; color: var(--accent); }
.time { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.8rem; }

.dish-media { position: relative; flex: none; width: 96px; height: 96px; }
.dish-media img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; }
/* Photos fade in once loaded, over a soft placeholder */
.dish-media img { background: var(--surface-2); opacity: 0; transition: opacity 0.6s var(--ease); }
.dish-media img.loaded { opacity: 1; }
.dish-media [data-stepper] { position: absolute; right: -6px; bottom: -6px; }
.dish-side { flex: none; }

/* Letter tile used where there's no picture (logos in admin, superadmin) */
.dish-placeholder {
  display: grid; place-items: center;
  width: 100%; height: 100%; border-radius: 16px;
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 600;
  color: rgb(255 255 255 / 0.92);
}

.stepper {
  display: inline-flex; align-items: center;
  background: var(--accent); color: var(--on-accent);
  border-radius: 999px;
  box-shadow: 0 4px 14px -4px rgb(120 45 15 / 0.55);
  animation: pop 0.35s var(--ease-spring);
}
.stepper button {
  width: 2.25rem; height: 2.25rem; padding: 0;
  border: none; background: transparent; color: inherit;
  font-size: 1.25rem; font-weight: 600; line-height: 1;
}
.stepper button:hover { background: rgb(255 255 255 / 0.14); }
.stepper span { min-width: 1.1rem; text-align: center; font-weight: 700; font-size: 0.95rem; }
.stepper.single button { width: 2.5rem; height: 2.5rem; font-size: 1.45rem; }
/* In the list, an un-added dish gets a soft tinted "+"; it turns solid once in the order */
.dish-side .stepper.single { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.dish-side .stepper.single button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ---------- Customer: dish detail sheet ---------- */
.dish-sheet .sheet-handle { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; background: rgb(255 255 255 / 0.55); }
.dish-photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.dish-sheet .sheet-body { padding-top: 1.4rem; }
.dish-sheet.no-photo .sheet-body { padding-top: 2.4rem; }
.dish-sheet h2 { font-size: 1.75rem; padding-right: 2.5rem; }
.dish-sheet .desc { margin-top: 0.5rem; color: var(--muted); line-height: 1.55; }
.dish-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.dish-facts .price-chip { background: var(--accent-soft); color: var(--accent); }
.dish-buy { display: flex; align-items: center; gap: 0.8rem; }
.dish-buy .stepper { flex: none; box-shadow: none; background: var(--surface-2); color: var(--text); animation: none; }
.dish-buy .stepper button { width: 2.8rem; height: 2.8rem; }
.dish-buy .stepper button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.dish-buy .stepper span { min-width: 1.6rem; font-size: 1.05rem; }
.dish-buy .primary { flex: 1; padding: 0.95rem 1.2rem; font-size: 1rem; }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 2.4rem; height: 2.4rem; padding: 0;
  border: none;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

@keyframes pop { from { transform: scale(0.7); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* Shimmering placeholders while content loads */
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-dish { display: flex; gap: 1rem; padding: 1rem; margin-bottom: 0.75rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.skeleton-dish .lines { flex: 1; display: grid; gap: 0.55rem; align-content: start; padding-top: 0.2rem; }
.skeleton-dish .media { width: 108px; height: 108px; border-radius: 16px; flex: none; }
.skeleton.line { height: 0.8rem; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }

/* ---------- Customer: cart ---------- */
.spacer { height: 7rem; }
/* Slides up when the first dish is added, back down when the cart empties */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  pointer-events: none;
  transform: translateY(130%);
  opacity: 0;
  transition: transform 0.55s var(--ease), opacity 0.4s var(--ease);
}
.cart-bar.show { transform: none; opacity: 1; }
.cart-bar.show .cart-pill { pointer-events: auto; }
.cart-pill {
  pointer-events: none;
  display: flex; align-items: center; gap: 0.8rem;
  width: 100%; max-width: 728px; margin: 0 auto;
  padding: 0.6rem 0.6rem 0.6rem 0.65rem;
  border: none; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  box-shadow: var(--shadow-lg);
  font-size: 1rem;
}
.cart-pill:hover { background: var(--ink); }
.cart-pill .count {
  display: grid; place-items: center;
  min-width: 2.4rem; height: 2.4rem; padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700;
}
.cart-pill .label { font-weight: 600; }
.cart-pill .total { margin-left: auto; padding-right: 0.9rem; font-weight: 700; }
.cart-pill.bump { animation: bump 0.45s var(--ease-spring); }
.cart-pill.bump .count { animation: pop 0.45s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.025); } }

dialog {
  border: none; padding: 0;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgb(20 12 5 / 0.45); backdrop-filter: blur(4px); }
dialog[open]::backdrop { animation: fade-in 0.4s var(--ease); }
dialog.closing::backdrop { animation: fade-out 0.3s var(--ease) forwards; }
dialog.sheet {
  width: 100%; max-width: 560px;
  max-height: 92dvh;
  margin: auto auto 0;
  border-radius: 26px 26px 0 0;
  overflow: auto;
}
dialog.sheet[open] { animation: sheet-up 0.5s var(--ease); }
dialog.sheet.closing { animation: sheet-down 0.3s var(--ease) forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 26px; max-height: 86dvh; }
  dialog.sheet[open] { animation: zoom-in 0.4s var(--ease); }
  dialog.sheet.closing { animation: zoom-out 0.25s var(--ease) forwards; }
}
@keyframes zoom-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes zoom-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 0; }
@media (min-width: 640px) { .sheet-handle { display: none; } }
.sheet-body { padding: 1rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.sheet-head h2 { font-size: 1.6rem; }

.line { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.line .name { flex: 1; min-width: 0; font-weight: 500; }
.line .name .muted { font-weight: 400; }
.line .amount { font-weight: 600; min-width: 4.5rem; text-align: right; }
.line .stepper { box-shadow: none; }
.line .stepper button { width: 2rem; height: 2rem; font-size: 1.1rem; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 1rem 0 1.2rem; }
.total-row strong { font-family: var(--font-display); font-size: 1.6rem; }
.pay-note { display: flex; align-items: center; gap: 0.5rem; margin: 0.2rem 0 1rem; color: var(--muted); font-size: 0.85rem; }

/* ---------- Customer: order status ---------- */
.order-page { padding: 1.4rem 0 3rem; display: grid; gap: 1rem; }
.order-top { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0 0; }
.back { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--text); }

.status-card { text-align: center; padding: 2.2rem 1.4rem 1.8rem; overflow: hidden; }
.status-card h2 { font-size: 1.7rem; }
.status-card p { margin-top: 0.4rem; color: var(--muted); }
.status-card .eta { margin-top: 1.2rem; padding: 0.5rem 1rem; color: var(--text); font-size: 0.88rem; }

/* Text slides in after the illustration */
.reveal { animation: rise 0.5s ease both; }
.status-card h2.reveal { animation-delay: 0.25s; }
.status-card p.reveal { animation-delay: 0.4s; }
.status-card .eta.reveal { animation-delay: 0.55s; }

/* Illustration: still warm glow behind, only the pot itself moves */
.art {
  position: relative;
  width: 168px; height: 168px; margin: 0 auto 1.4rem;
  display: grid; place-items: center;
  border-radius: 50%;
  animation: pop-in 0.8s var(--ease) both;
}
.art::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
}
.art svg { position: relative; z-index: 1; width: 136px; height: 136px; overflow: visible; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85) translateY(6px); } to { opacity: 1; transform: none; } }

/* Cooking pot: just two calm movements, rising steam and a slow lid lift */
.cooking { --pot-light: #ee9a6c; --pot-dark: #b5502b; }
@media (prefers-color-scheme: dark) { .cooking { --pot-light: #f2a57c; --pot-dark: #c9643a; } }
.cooking .pot { fill: url(#pot-body); }
.cooking .handle { fill: var(--pot-dark); }
.cooking .shine { fill: none; stroke: rgb(255 255 255 / 0.35); stroke-width: 4; stroke-linecap: round; }
.cooking .flames path { fill: url(#flame-outer); }

.cooking .lid { fill: var(--pot-dark); animation: lid 4s ease-in-out infinite; }

.cooking .steam path {
  fill: none; stroke: var(--muted); stroke-width: 3.5; stroke-linecap: round;
  opacity: 0;
  animation: steam 4s ease-in-out infinite;
}
.cooking .steam path:nth-child(2) { animation-delay: 1.33s; }
.cooking .steam path:nth-child(3) { animation-delay: 2.66s; }

@keyframes lid { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes steam {
  0% { opacity: 0; transform: translateY(6px); }
  40% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-12px); }
}

/* Ready / served: circle and check draw themselves once */
.done circle, .done path, .cancelled circle, .cancelled path { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.done circle { stroke: var(--ok); stroke-dasharray: 277; stroke-dashoffset: 277; animation: draw 0.9s var(--ease) 0.15s forwards; }
.done .check { stroke: var(--ok); stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw 0.6s var(--ease) 0.75s forwards; }
.art.done::after { background: radial-gradient(circle, var(--ok-soft) 0%, transparent 68%); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.cancelled circle, .cancelled path { stroke: var(--danger); }
.art.cancelled::after { background: radial-gradient(circle, var(--danger-soft) 0%, transparent 68%); }

@media (prefers-reduced-motion: reduce) {
  .art, .art *, .reveal { animation: none !important; }
  .cooking .steam path { opacity: 0.6; }
  .done circle, .done .check { stroke-dashoffset: 0; }
}

.receipt h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.receipt .line { border-bottom-style: dashed; }
.receipt .note { margin-top: 0.8rem; }

/* ---------- Live indicator ---------- */
.live {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
}
.live::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--muted); opacity: 0.5;
}
.live.on { color: var(--ok); }
.live.on::before { background: var(--ok); opacity: 1; box-shadow: 0 0 0 0 var(--ok); animation: live-pulse 2s infinite; }
.live .when-on { display: none; }
.live.on .when-on { display: inline; }
.live.on .when-off { display: none; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.toast {
  position: fixed; z-index: 50; left: 50%; top: 16px;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--ink); color: var(--on-ink);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  animation: toast-in 0.5s var(--ease);
}
.toast.leaving { animation: toast-out 0.35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -12px); } }

.ticket.fresh { animation: rise 0.5s var(--ease) both, fresh 2.4s ease 0.5s 2; }
@keyframes fresh { 50% { box-shadow: 0 0 0 3px var(--accent); } }

/* ---------- Smooth page changes (View Transitions) ---------- */
/* Going between pages crossfades instead of flashing (Chrome, Edge, Safari 18+). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out 0.22s var(--ease) both; }
::view-transition-new(root) { animation: page-in 0.45s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
/* Kitchen tickets glide to their new column */
::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: var(--ease); }

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

/* ---------- Staff: shared ---------- */
.staff-top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.staff-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.85rem; padding-bottom: 0.85rem; flex-wrap: wrap; }
.staff-top h1 { font-size: 1.5rem; }
.staff-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.staff-nav a { padding: 0.45rem 0.9rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.staff-nav a:hover { color: var(--text); background: var(--surface-2); }
.staff-nav a.active { background: var(--ink); color: var(--on-ink); }

/* ---------- Kitchen ---------- */
.board { display: grid; grid-template-columns: 1fr; gap: 1.2rem; padding: 1.2rem 0 2rem; align-items: start; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); } }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 0.8rem; min-height: 8rem; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 0.3rem 0.4rem 0.8rem; }
.column-head h2 { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 0.5rem; }
.column-head .swatch { width: 0.6rem; height: 0.6rem; border-radius: 50%; }
.column-empty { padding: 1.6rem 0.5rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

.ticket {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  padding: 1rem;
  margin-bottom: 0.7rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: box-shadow var(--medium) var(--ease);
}
.ticket.late { box-shadow: 0 0 0 2px var(--danger); }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.table-no { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.table-no small { display: block; font-family: var(--font-body); font-size: 0.72rem; font-weight: 500; color: var(--muted); margin-top: 0.3rem; }
.timer { font-variant-numeric: tabular-nums; }
.timer.ok { background: var(--ok-soft); color: var(--ok); }
.timer.soon { background: var(--warn-soft); color: var(--warn); }
.timer.late { background: var(--danger-soft); color: var(--danger); }
.ticket ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.ticket li { display: flex; gap: 0.6rem; font-size: 0.95rem; }
.ticket li .qty {
  flex: none; min-width: 1.8rem; height: 1.6rem; display: grid; place-items: center;
  border-radius: 8px; background: var(--surface-2); font-weight: 700; font-size: 0.82rem;
}
.note {
  display: flex; gap: 0.5rem;
  background: var(--warn-soft); color: var(--text);
  border-radius: 10px; padding: 0.6rem 0.75rem; font-size: 0.88rem;
}
.ticket-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ticket-actions .primary { flex: 1; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; padding: 1.2rem 0 2rem; align-items: start; }
@media (min-width: 980px) { .admin-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.side { display: grid; gap: 1.2rem; }
@media (min-width: 980px) { .side { position: sticky; top: 5rem; } }
.card h2 { font-size: 1.35rem; }
.card-sub { margin: 0.3rem 0 1.1rem; color: var(--muted); font-size: 0.88rem; }
.row { display: flex; gap: 0.75rem; }
.row > * { flex: 1; }
.actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

.admin-cat { margin-top: 1.4rem; }
.admin-cat h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.admin-item { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.admin-item:last-child { border-bottom: none; }
.admin-item .thumb { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; }
.admin-item .dish-placeholder.thumb { font-size: 1.3rem; }
.admin-item .info { flex: 1; min-width: 0; }
.admin-item .info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item.off .info, .admin-item.off .thumb { opacity: 0.45; }
.admin-item .tools { display: flex; align-items: center; gap: 0.2rem; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.2s;
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch-label { display: flex; align-items: center; gap: 0.7rem; color: var(--text); font-size: 0.92rem; }

.cat-line { display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }

/* ---------- Login / register ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.auth-art {
  display: none;
  position: relative; overflow: hidden;
  padding: 3.5rem;
  flex-direction: column; justify-content: flex-end;
  color: #fbf6ef;
  background:
    radial-gradient(90% 70% at 0% 0%, rgb(255 210 170 / 0.35), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgb(60 20 5 / 0.55), transparent 60%),
    linear-gradient(150deg, #c4612f, #8e3415);
}
@media (min-width: 900px) { .auth-art { display: flex; } }
.auth-art::before {
  content: ""; position: absolute; inset: 2rem;
  border: 1px solid rgb(255 255 255 / 0.18); border-radius: 28px;
  pointer-events: none;
}
.auth-art .eyebrow { color: rgb(255 240 225 / 0.85); }
.auth-art h2 { font-size: clamp(2.6rem, 4.4vw, 3.8rem); margin: 0.6rem 0 1.6rem; }
.auth-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.auth-art li { display: flex; gap: 0.7rem; align-items: center; color: rgb(255 245 235 / 0.92); }
.auth-art li::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #ffd9b8; flex: none; }

.auth-main { display: grid; place-items: center; padding: 2.5rem 16px; }
.auth-card { width: 100%; max-width: 420px; animation: rise 0.35s ease both; }
.auth-card h1 { font-size: 2.4rem; margin: 0.35rem 0 0.4rem; }
.auth-sub { margin-bottom: 1.8rem; }
.auth-section {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 1.4rem 0 0.8rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.auth-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .error { margin: 0.2rem 0 0.8rem; }
.auth-switch { text-align: center; margin-top: 1.4rem; color: var(--muted); font-size: 0.92rem; }
.auth-switch a { font-weight: 600; text-decoration: none; }
.slug-preview { margin: -0.4rem 0 0.9rem; min-height: 1.2em; }

/* ---------- Staff banner + account ---------- */
.banner {
  display: flex; gap: 0.8rem; align-items: flex-start;
  margin-top: 1.2rem; padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--text);
}
.banner strong { display: block; }
.banner .icon { color: var(--warn); font-size: 1.2rem; margin-top: 0.1rem; }
.account { display: inline-flex; align-items: center; gap: 0.5rem; padding-left: 0.6rem; margin-left: 0.2rem; border-left: 1px solid var(--line); }
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 0.85rem;
}

/* ---------- Superadmin ---------- */
a.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 500;
}
a.button:hover { border-color: var(--muted); }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
a.button.primary:hover { background: var(--accent-strong); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding-top: 1.2rem; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; display: grid; gap: 0.15rem; }
.stat span { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.stat strong { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 0.78rem; }

.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 1.2rem; padding: 1.2rem 0 2.5rem; }
.prop { display: flex; flex-direction: column; gap: 1.1rem; }
.intro .prop, .intro .stat { animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.prop.off { opacity: 0.6; }
.prop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.prop-head h2 { font-size: 1.45rem; }
.prop-link { display: block; margin-top: 0.25rem; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; background: var(--surface-2); border-radius: 14px; padding: 0.8rem; }
.prop-stats div { display: grid; text-align: center; min-width: 0; }
.prop-stats strong { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-stats span { color: var(--muted); font-size: 0.72rem; }
.prop-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.section-title {
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 0.6rem;
  margin: 2rem 0 0;
}
.prop.pending { box-shadow: var(--shadow), 0 0 0 2px var(--warn-soft); }
.pending-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.8rem; background: var(--surface-2); border-radius: 14px; padding: 0.9rem 1rem; }
.pending-info div { display: grid; gap: 0.1rem; min-width: 0; }
.pending-info span { color: var(--muted); font-size: 0.75rem; }
.pending-info a { font-size: 0.85rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logins { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.logins-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.logins-head span { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.logins-head button { padding: 0.3rem 0.7rem; }
.login-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; }
.login-who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.login-who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-row .icon-btn { width: 2rem; height: 2rem; }

.cred { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.cred > span { width: 6.5rem; flex: none; color: var(--muted); font-size: 0.85rem; }
.cred a, .cred code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 0.9rem; }
.cred code { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em; }

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; padding-bottom: 2rem; }
.qr-card {
  margin: 0; text-align: center;
  background: #fffdf9; color: #1d1a16;
  border-radius: 18px; padding: 1.2rem 1rem 1rem;
  box-shadow: 0 0 0 1px #e6dccd;
}
.qr-card .qr-name { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.qr-card img { width: 100%; max-width: 170px; margin: 0.7rem auto; display: block; }
.qr-card .qr-table { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.qr-card .qr-hint { font-size: 0.78rem; color: #7a6f63; }

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  #qr-codes, #qr-codes * { visibility: visible; }
  #qr-codes { position: absolute; inset: 0; grid-template-columns: repeat(3, 1fr); }
  .qr-card { break-inside: avoid; }
}

/* ---------- Restaurant logos ---------- */
.hero-logo {
  display: block; flex: none;
  width: 72px; height: 72px;
  border-radius: 22px; object-fit: cover;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.order-brand { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.2rem; }
.order-logo { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; box-shadow: var(--shadow-sm); }

.brand { display: grid; grid-template-columns: auto 1fr; column-gap: 0.8rem; align-items: center; }
.brand-logo { grid-row: span 2; width: 44px; height: 44px; border-radius: 13px; object-fit: cover; box-shadow: var(--shadow-sm); }

.logo-editor { display: flex; align-items: center; gap: 1.1rem; }
.logo-preview { width: 88px; height: 88px; flex: none; }
.logo-preview img, .logo-preview .dish-placeholder {
  width: 100%; height: 100%; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow);
}
.logo-preview .dish-placeholder { font-size: 2.2rem; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.prop-logo { width: 48px; height: 48px; flex: none; border-radius: 14px; object-fit: cover; }
.prop-logo.dish-placeholder { font-size: 1.4rem; }
.prop-head { align-items: center; }

.qr-card .qr-logo { width: 48px; height: 48px; border-radius: 13px; object-fit: cover; display: block; margin: 0 auto 0.5rem; }

/* ---------- Dishes added to an order that's already being made ---------- */
.ticket li.added-label {
  margin-top: 0.35rem; padding-top: 0.5rem;
  border-top: 1px dashed var(--line);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
.ticket li.added .qty { background: var(--accent-soft); color: var(--accent); }
.receipt .added-heading {
  margin-top: 0.9rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
.add-hint {
  display: flex; gap: 0.5rem;
  margin: 0 0 0.8rem; padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--text);
  font-size: 0.86rem;
}

/* ---------- Menu only (ordering turned off) ---------- */
body.menu-only [data-stepper],
body.menu-only .cart-bar,
body.menu-only .dish-buy { display: none !important; }

/* ---------- Usual preparation time ---------- */
.prep-chip:empty { display: none; }
body.menu-only .prep-chip { display: none; }
#prep-field { margin-top: 1.1rem; }
.prep-input { display: flex; align-items: center; gap: 0.6rem; margin: 0.35rem 0; }
.prep-input input { width: 6.5rem; margin: 0; }
.prep-input > span:not(.saved-note) { color: var(--text); }
.saved-note { color: var(--ok); font-size: 0.85rem; font-weight: 600; animation: fade-in 0.3s var(--ease); }

/* ---------- Discounts ---------- */
.old-price { color: var(--muted); font-size: 0.85rem; text-decoration-thickness: 1.5px; }
.discount-badge {
  padding: 0.12rem 0.5rem; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
  font-size: 0.75rem; font-weight: 700;
}
.dish-meta { flex-wrap: wrap; gap: 0.55rem; }
.discount-chip { background: var(--ok-soft); color: var(--ok); }
.discount-chip s { opacity: 0.75; margin-right: 0.15rem; }
.admin-price { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.admin-price .price { color: var(--muted); font-weight: 500; }
.admin-price .old-price { font-size: 0.8rem; }
.discount-preview { margin: -0.4rem 0 0.9rem; color: var(--ok); font-weight: 500; }
