:root {
  --gold-1: #f6d365;
  --gold-2: #fda085;
  --gold: #f4c542;
  --orange: #f97316;
  --ink: #2f1600;
  --ink-2: #5b2200;
  --radius: 16px;
}

* { -webkit-tap-highlight-color: transparent; }
.min-w-0 { min-width: 0; }
.item-name, .item-sub { overflow-wrap: anywhere; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}

/* ---------- Demo ribbon ---------- */
.demo-ribbon {
  position: sticky; top: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 12px;
  font-size: .8rem; font-weight: 600;
  background: #1a1406; color: #f6d365;
}
.demo-ribbon a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Guest theme ---------- */
body.guest {
  background: linear-gradient(180deg, #F8D51C 0%, #DE3918 100%) fixed;
  color: var(--ink);
}
.app-shell { max-width: 960px; margin: 0 auto; padding: 20px 16px 120px; }

.glass {
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
}
.muted { color: rgba(56, 24, 0, 0.8); }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: #1a1406; color: var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.brand-name { font-weight: 900; line-height: 1.1; }
.brand-sub { font-size: .8rem; opacity: .85; }

.btn-gold {
  border: 1px solid rgba(255,255,255,.25);
  color: #1a1406; font-weight: 800;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
}
.btn-gold:hover, .btn-gold:focus { color: #1a1406; filter: brightness(1.05); }
.btn-gold:disabled { opacity: .55; }
.btn-dark-ink { background: #1a1406; color: #f6d365; font-weight: 800; border: 0; }
.btn-dark-ink:hover { background: #000; color: #f6d365; }
.btn-ghost { background: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.6); color: var(--ink); font-weight: 700; }
.btn-ghost:hover { background: rgba(255,255,255,.5); color: var(--ink); }

.badge-gold { color: #1a1406 !important; background: linear-gradient(135deg, var(--gold-1), var(--gold-2)) !important; }
.badge-ink { background: #1a1406 !important; color: #f6d365 !important; }

.btn-big { padding: 1.1rem; border-radius: 18px; font-size: 1.1rem; min-height: 60px; }
.choice-card { transition: transform .12s ease; }
.choice-card:hover { transform: translateY(-2px); }

.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.table-grid a {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px;
  font-weight: 900; font-size: 1.3rem; text-decoration: none; color: var(--ink);
  background: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.6);
}
.table-grid a:hover { background: rgba(255,255,255,.55); }

/* category chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .88rem;
  background: rgba(255,255,255,.3); border: 1px solid rgba(255,255,255,.6); color: var(--ink);
}
.chip.active { background: #1a1406; color: #f6d365; border-color: #1a1406; }

.lang-switch { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.6); }
.lang-switch button { border: 0; background: rgba(255,255,255,.3); padding: 5px 10px; font-weight: 800; font-size: .78rem; color: var(--ink); }
.lang-switch button.active { background: #1a1406; color: #f6d365; }

.section-title { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.section-title .t { font-weight: 900; text-transform: uppercase; color: var(--ink-2); font-size: .9rem; letter-spacing: .3px; }
.section-title .rule { flex: 1; height: 2px; background: linear-gradient(90deg, rgba(91,34,0,.35), rgba(91,34,0,0)); }

.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; margin-bottom: 10px; }
.menu-item.sold-out { opacity: .55; }
.photo {
  width: 68px; height: 68px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center; font-size: 2.1rem;
  background: radial-gradient(circle at 30% 25%, #fff6d6, #ffd98a 55%, #f7a65a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.item-name { font-weight: 900; color: var(--ink-2); line-height: 1.15; }
.item-sub { font-size: .78rem; color: rgba(56,24,0,.7); }
.item-price { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: .9rem; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 32px; height: 32px; border-radius: 10px; border: 0; font-weight: 900; font-size: 1.1rem; line-height: 1;
  background: #1a1406; color: #f6d365;
}
.stepper .q { min-width: 22px; text-align: center; font-weight: 900; font-variant-numeric: tabular-nums; }

.floating-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 1000;
  width: min(928px, calc(100vw - 32px));
}
.floating-bar .btn { width: 100%; border-radius: 16px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

/* bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20,10,0,.55); z-index: 1200; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(560px, 100vw); max-height: 88vh; overflow: auto;
  background: #fff8e6; color: var(--ink); border-radius: 22px 22px 0 0; padding: 20px 16px 16px;
  animation: up .18s ease-out;
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.opt-group { margin-bottom: 16px; }
.opt-group .g { font-weight: 900; margin-bottom: 8px; display: flex; justify-content: space-between; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 6px;
  border-radius: 12px; background: #fff; border: 1.5px solid #f1dfb4; cursor: pointer;
}
.opt input { width: 1.2em; height: 1.2em; accent-color: #d69a1b; }
.opt:has(input:checked) { border-color: #d69a1b; background: #fff3cf; }
.opt .p { margin-left: auto; font-size: .85rem; font-weight: 700; }

.line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(91,34,0,.15); }
.line:last-child { border-bottom: 0; }

.check-badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; background: #1a1406; color: #f6d365; margin: 0 auto 12px; }

/* ---------- Landing ---------- */
.hero h1 { font-weight: 900; letter-spacing: -.5px; }
.feature { display: flex; gap: 10px; align-items: flex-start; }
.feature .i { font-size: 1.3rem; }
.stack span { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; border-radius: 999px; background: #1a1406; color: #f6d365; font-size: .8rem; font-weight: 700; }

/* ---------- Admin theme ---------- */
body.admin { background: #0b0b0b; color: #f2f2f2; }
.admin-shell { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.admin .panel { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 16px; }
.admin .muted { color: #a3a3a3; }
.admin .brand { color: #fff; }
.admin .brand:hover { color: #fff; }
.admin .brand-mark { background: var(--gold); color: #1a1406; }
.admin .form-control, .admin .form-select { background: #111; border-color: #333; color: #f2f2f2; }
.admin .form-control:focus, .admin .form-select:focus { background: #111; color: #fff; border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(244,197,66,.2); }
.admin .form-control::placeholder { color: #777; }
.admin .table { --bs-table-bg: transparent; --bs-table-color: #eee; --bs-table-border-color: #2a2a2a; }
.admin .table thead th { color: #a3a3a3; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; border: 1px solid #333; background: #1a1a1a; color: #ddd;
  padding: 9px 16px; border-radius: 12px; font-weight: 700;
}
.tabs button.active { background: var(--gold); color: #1a1406; border-color: var(--gold); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .75rem; }
.tabs button.active .count { background: #1a1406; color: var(--gold); }

.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.order-card { background: #1a1a1a; border: 1px solid #2f2f2f; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; }
.order-card.fresh { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.order-card .head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.order-card .tbl { font-size: 1.5rem; font-weight: 900; color: var(--gold); line-height: 1; }
.order-card ul { list-style: none; padding: 0; margin: 0 0 12px; flex: 1; }
.order-card li { padding: 6px 0; border-top: 1px dashed #333; }
.order-card .qty { display: inline-block; min-width: 28px; font-weight: 900; color: var(--gold); }
.order-card .opts { font-size: .8rem; color: #a3a3a3; padding-left: 28px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.pill-eat { background: var(--gold); color: #1a1406; }
.pill-take { background: var(--orange); color: #fff; }
.age { font-size: .8rem; color: #a3a3a3; }
.age.late { color: #ff8a65; font-weight: 700; }

.btn-admin-gold { background: var(--gold); color: #1a1406; font-weight: 800; border: 0; }
.btn-admin-gold:hover { background: #ffd65c; color: #1a1406; }
.btn-admin-ghost { background: transparent; border: 1px solid #444; color: #ddd; font-weight: 600; }
.btn-admin-ghost:hover { background: #222; color: #fff; border-color: #555; }
.btn-admin-danger { background: transparent; border: 1px solid #5a2a22; color: #ff8a65; font-weight: 600; }
.btn-admin-danger:hover { background: #2a1512; color: #ffb199; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 16px; padding: 14px 16px; }
.kpi .l { font-size: .78rem; color: #a3a3a3; text-transform: uppercase; letter-spacing: .4px; }
.kpi .v { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%);
  background: #000; border: 1px solid #333; border-radius: 10px; padding: 6px 10px;
  font-size: .8rem; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.chart-tip b { color: #fff; font-variant-numeric: tabular-nums; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-bottom: 10px; }
.bar-row .track { grid-column: 1 / -1; height: 8px; background: #262626; border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--gold); border-radius: 4px; }

.switch { position: relative; width: 44px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #444; border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: #22a35a; }
.switch input:checked + span::before { transform: translateX(20px); }

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.qr-card { background: #fff; color: #111; border-radius: 16px; padding: 16px; text-align: center; }
.qr-card .qr { display: flex; justify-content: center; margin: 8px 0; }
.qr-card .qr img, .qr-card .qr canvas { width: 150px; height: 150px; }
.qr-card a { font-size: .75rem; word-break: break-all; }

.empty { text-align: center; padding: 48px 16px; color: #a3a3a3; }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }

@media print {
  body.admin { background: #fff; }
  .no-print, .demo-ribbon { display: none !important; }
  .qr-card { border: 1px solid #ccc; break-inside: avoid; }
}
