:root {
  --bg: #faf7f2; --surface: #ffffff; --surface-2: #f3eee6; --text: #1c1917; --muted: #6b635b;
  --line: #e7e0d6; --accent: #e8590c; --accent-ink: #ffffff; --ok: #2f9e44; --warn: #f08c00; --err: #e03131;
  --radius: 16px; --shadow: 0 1px 2px rgb(28 25 23 / .06), 0 8px 24px rgb(28 25 23 / .06);
  --font: 'Manrope', system-ui, sans-serif; --display: 'Unbounded', 'Manrope', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100e; --surface: #1c1917; --surface-2: #26221f; --text: #f5f0ea; --muted: #a8a097;
    --line: #342f2a; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12100e; --surface: #1c1917; --surface-2: #26221f; --text: #f5f0ea; --muted: #a8a097;
  --line: #342f2a; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-weight: 600; text-decoration: none; transition: transform .15s, background .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--err); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); }
textarea { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.error { color: var(--err); font-size: 14px; min-height: 1.4em; margin-top: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); }
.badge.new { background: #fff4e6; color: #d9480f; } .badge.cooking { background: #fff9db; color: #e67700; }
.badge.ready { background: #ebfbee; color: #2b8a3e; } .badge.done { background: var(--surface-2); }
.badge.cancelled { background: #fff5f5; color: #c92a2a; }

/* ---------- landing ---------- */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 20px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: inline-grid; place-items: center;
  color: #fff; font-style: normal; font-size: 14px; }
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 18px; color: var(--muted); max-width: 540px; }
.phone { justify-self: center; width: 290px; aspect-ratio: 9/19; border-radius: 40px; border: 10px solid #1c1917;
  background: var(--surface); box-shadow: 0 30px 60px rgb(0 0 0 / .2); overflow: hidden; padding: 18px 14px; }
.phone .ph-title { font-family: var(--display); font-size: 18px; margin-bottom: 10px; }
.phone .ph-chip { display: inline-block; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 11px; margin: 0 4px 8px 0; }
.phone .ph-chip.on { background: var(--accent); color: #fff; }
.phone .ph-item { display: flex; gap: 10px; padding: 8px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; font-size: 12px; }
.phone .ph-item b { display: block; }
.phone .ph-img { width: 52px; height: 52px; border-radius: 10px; flex: none; background: linear-gradient(135deg, #ffa94d, #e8590c); }
.phone .ph-img.g { background: linear-gradient(135deg, #8ce99a, #2f9e44); } .phone .ph-img.b { background: linear-gradient(135deg, #a5d8ff, #1c7ed6); }
.phone .ph-cart { margin-top: 12px; background: var(--accent); color: #fff; border-radius: 12px; padding: 10px; text-align: center; font-weight: 700; font-size: 13px; }
section { padding: 56px 0; }
section > .wrap > h2 { font-size: clamp(26px, 3.4vw, 38px); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.feature h3 { font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.plan { display: flex; flex-direction: column; }
.plan.hot { border: 2px solid var(--accent); }
.plan .price { font-family: var(--display); font-size: 30px; margin: 8px 0; }
.plan ul { padding-left: 18px; color: var(--muted); flex: 1; }
.funnel { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.funnel span { padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
footer { padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; margin: 16px 0 8px; }
.tabs button { border: 0; background: transparent; min-height: 40px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 0 8px 16px; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0;
  border-radius: 10px; background: transparent; cursor: pointer; font-weight: 600; text-align: left; color: var(--muted); }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.nav-btn .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: 12px; padding: 0 8px; }
.main { padding: 28px; min-width: 0; }
.main h1 { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat .v { font-family: var(--display); font-size: 26px; }
.stat .l { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.dish-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dish-row img, .dish-row .noimg { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.dish-row .info { flex: 1; min-width: 0; }
.dish-row .info b { display: block; }
.stopped { opacity: .5; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.order ul { padding-left: 18px; margin: 8px 0; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.qr-box { display: grid; place-items: center; background: #fff; padding: 12px; border-radius: 12px; margin: 10px 0; }
.qr-box img, .qr-box canvas { width: 160px; height: 160px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 8px; }
.chart > div { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); }
dialog { border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); width: min(560px, 100% - 32px); box-shadow: 0 30px 80px rgb(0 0 0 / .3); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog form { padding: 24px; }
.mobile-nav { display: none; }

/* ---------- guest menu ---------- */
.menu-head { padding: 28px 0 8px; }
.menu-head h1 { font-size: clamp(26px, 6vw, 38px); margin-bottom: 4px; }
.cats { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.cats button { flex: none; min-height: 40px; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.cats button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.menu-sec { padding: 0; }
.menu-sec h2 { font-size: 22px; margin: 24px 0 12px; scroll-margin-top: 70px; }
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dish { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; width: 100%; }
.dish img, .dish .noimg { width: 104px; height: 104px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.dish .body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dish .body b { font-size: 16px; }
.dish .desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dish .price { font-weight: 800; }
.dish-detail img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.dish-detail .pad { padding: 20px 24px 24px; }
.cart-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, 100% - 32px); z-index: 20;
  display: flex; justify-content: space-between; align-items: center; background: var(--accent); color: #fff; border: 0;
  border-radius: 16px; padding: 14px 20px; font-weight: 700; cursor: pointer; box-shadow: 0 12px 30px rgb(232 89 12 / .35); min-height: 56px; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 800; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .n { flex: 1; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; max-width: 560px; margin: auto; }
.consent p { margin: 0 0 12px; font-size: 14px; }
.menu-foot { padding: 40px 0 120px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .phone { display: none; }
  .admin { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
  .mobile-nav .nav-btn { width: auto; flex: none; }
  .main { padding: 20px 16px; }
  .dishes { grid-template-columns: 1fr; }
  .dish img, .dish .noimg { width: 88px; height: 88px; }
}
