:root {
  --bg: #f3f5f7;
  --ink: #16181d;
  --muted: #667085;
  --line: #e6e8ee;
  --card: #ffffff;
  --accent: #e10600;
  --accent-deep: #b10500;
  --pine: #111827;
  --pine-2: #1f2937;
  --ok: #067647;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
  --radius: 16px;
  --sans: "Segoe UI", "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --serif: var(--sans);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.h5-wrap { width: min(480px, 100%); margin: 0 auto; }

.app-h5 { background: #e8ebf0; }
.app-h5 .h5-wrap {
  background: var(--bg);
  min-height: 100vh;
  padding: 72px 16px calc(108px + var(--safe-b));
}
.appbar {
  position: fixed; z-index: 30; top: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); height: 60px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,0.94); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar, .gate-nav, .platform-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; min-width: 0; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: white;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.ghost-link, .text-btn { color: var(--pine-2); background: none; border: 0; padding: 8px 0; cursor: pointer; text-decoration: none; font-weight: 600; }

.card, .dish, .ticket, .zone, .stat, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card, .panel, .ticket { padding: 16px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); line-height: 1.5; }
.price { font-variant-numeric: tabular-nums; font-weight: 700; }
.seal {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 700;
  background: #ecfdf3; color: var(--ok);
}
.hero { padding: 4px 0 8px; }
.hero h1, .page-title { font-weight: 750; letter-spacing: -0.03em; }
.hero h1 { font-size: 30px; line-height: 1.15; margin: 8px 0; }
.page-title { font-size: 26px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span, .check span { font-size: 13px; color: var(--muted); font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], input[type="date"], input[type="time"], input[type="url"], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 14px; min-height: 46px; font-size: 16px; outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08); }

.btn, button.btn, .cart-bar .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 16px; min-height: 46px;
  text-decoration: none; cursor: pointer; background: #eef1f4; color: var(--ink); font-weight: 700;
}
.btn-primary { background: var(--accent); color: white; }
.btn-pine { background: var(--ink); color: white; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--ink); color: white;
  font-size: 22px; line-height: 1; cursor: pointer;
}

.tabs { display: flex; gap: 8px; margin: 16px 0; background: #fff; padding: 4px; border-radius: 14px; border: 1px solid var(--line); }
.tabs button, .tabs a { flex: 1; border-radius: 10px; text-align: center; padding: 8px 10px; color: var(--ink); }
.tabs button.active, .tabs a.active { background: var(--ink); color: white; }
.alert { border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; font-weight: 600; }
.alert.ok { background: #ecfdf3; color: var(--ok); }
.alert.bad { background: #fef3f2; color: var(--accent-deep); }

.chips { display: flex; gap: 8px; overflow: auto; padding: 4px 0 10px; position: sticky; top: 60px; z-index: 10; background: var(--bg); }
.chips a { white-space: nowrap; text-decoration: none; background: white; border-radius: 999px; padding: 8px 14px; border: 1px solid var(--line); font-weight: 650; }
.dish { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 12px; margin-bottom: 10px; align-items: center; }
.dish-visual, .ph {
  width: 88px; height: 88px; border-radius: 14px; object-fit: cover;
  background: #111827; color: white;
  display: grid; place-items: center; font-size: 28px; font-weight: 700;
}
.tag { display: inline-block; background: #fff4ed; color: #c4320a; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.cart-bar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(72px + var(--safe-b));
  width: min(448px, calc(100% - 24px));
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--ink); color: white; border-radius: 16px; padding: 8px 8px 8px 16px;
  text-decoration: none; box-shadow: 0 12px 30px rgba(17, 24, 39, 0.28);
}
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(480px, 100%);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar a { text-align: center; text-decoration: none; padding: 12px 0 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.tabbar a.active { color: var(--accent); }

.ticket { background: #fff; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.dash { border-top: 1px dashed var(--line); margin: 8px 0; }
.choice { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
dialog { border: 0; border-radius: 20px; padding: 18px; width: min(420px, calc(100% - 24px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(17, 24, 39, 0.48); }

.timeline { display: flex; justify-content: space-between; gap: 6px; margin: 16px 0; }
.timeline span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.timeline span.on { color: var(--ink); font-weight: 750; }
.step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin: 0 auto 6px; }
.timeline span.on .step-dot { background: var(--accent); }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: #fff; color: var(--ink); padding: 18px 12px;
  border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.side .brand { padding: 6px 10px 14px; }
.side .brand b { color: var(--ink); }
.side nav { display: grid; gap: 2px; }
.side a:not(.brand) { display: block; color: #344054; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 650; }
.side a.active, .side a:not(.brand):hover { background: #f2f4f7; color: var(--ink); }
.workspace { min-width: 0; }
.admin-bar {
  position: sticky; top: 0; left: auto; transform: none; width: auto; z-index: 20;
}
.main { padding: 22px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 28px; margin-top: 6px; letter-spacing: -0.03em; }
.admin-tabs { display: none; }
.zone { padding: 14px 16px; }
.zone h2 { font-size: 20px; }
.stop { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.seq { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: white; display: grid; place-items: center; font-weight: 700; }
.done { opacity: 0.62; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: #fafbfc; }
.qr svg { width: 180px; height: auto; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.lang-switch { display: inline-flex; gap: 4px; background: #f2f4f7; border-radius: 999px; padding: 3px; }
.lang-switch button { border: 0; background: transparent; border-radius: 999px; min-height: 34px; padding: 4px 12px; cursor: pointer; font-weight: 700; }
.lang-switch button.on { background: var(--ink); color: white; }
.stat em { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 650; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(420px, 100%); padding: 22px; }
.gate .brand { margin-bottom: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .stop { grid-template-columns: auto 1fr; }
  .stop .stack { grid-column: 1 / -1; grid-auto-flow: column; }
  .admin-tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40;
    left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(8px + var(--safe-b));
  }
  .admin-tabs a { color: var(--muted); text-decoration: none; text-align: center; font-size: 12px; font-weight: 700; padding: 8px 0; }
  .admin-tabs a.active { color: var(--accent); }
  .main { padding: 16px 14px calc(88px + var(--safe-b)); }
  .hero h1 { font-size: 28px; }
}

.plat { background: #f0f2f5; color: #1f2329; }
.plat-top { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #1f2d3d; color: #fff; }
.plat-top a { color: #fff; font-weight: 700; text-decoration: none; }
.plat-top button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.plat-top-actions { display: flex; align-items: center; gap: 16px; }
.plat-store .plat-top-actions form { display: flex; align-items: center; margin: 0; }
.plat-store .plat-top .lang-switch {
  background: #fff;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.plat-store .plat-top .lang-switch button {
  background: transparent;
  color: #304156;
  border: 0;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 12px;
  font-weight: 700;
  line-height: 1;
}
.plat-store .plat-top .lang-switch button.on { background: #1f2d3d; color: #fff; }
.plat-store .plat-top-actions > form button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.7);
  color: #fff;
  background: transparent;
}
.plat-shell { display: grid; grid-template-columns: 180px 1fr; min-height: calc(100vh - 48px); }
.plat-side { background: #304156; padding: 8px 0; }
.plat-side a { display: block; color: #d7dde6; text-decoration: none; padding: 12px 18px; }
.plat-side a.on, .plat-side a:hover { background: #263445; color: #fff; }
.plat-main { padding: 16px; }
.plat-title { font-size: 20px; margin: 0 0 8px; }
.plat-note { margin: 8px 0 12px; }
.plat-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.plat-filter select, .plat-filter input { width: auto; min-height: 36px; }
.plat-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.plat-kpis article { background: #fff; border: 1px solid #e5e6eb; padding: 10px 12px; }
.plat-kpis span { display: block; color: #667085; font-size: 12px; }
.plat-kpis b { font-size: 20px; }
.plat-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plat-charts .plat-box:last-child { grid-column: 1 / -1; }
.plat-box { background: #fff; border: 1px solid #e5e6eb; padding: 12px; }
.plat-box h2 { font-size: 15px; margin-bottom: 8px; }
.plat-box svg { width: 100%; height: auto; background: #fafafa; }
.plat-legend { color: #667085; font-size: 12px; margin-top: 6px; }
.plat-legend i { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 8px; }
.plat-dist { display: grid; grid-template-columns: 140px 1fr 180px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.plat-dist div { background: #f2f3f5; height: 12px; }
.plat-dist b { display: block; height: 12px; background: #1677ff; }
.plat-table { width: 100%; border-collapse: collapse; background: #fff; }
.plat-table th, .plat-table td { border: 1px solid #e5e6eb; padding: 8px 10px; text-align: left; font-size: 13px; }
.plat-table th { background: #fafafa; }
.plat-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.plat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plat-stack { display: grid; gap: 12px; }
.plat-change { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.plat-change span { display: block; color: #667085; font-size: 12px; }
.plat-change b { font-size: 22px; }
.plat-sub { margin: 14px 0 8px; font-size: 15px; }
.delta-up { color: #067647; }
.delta-down { color: #b42318; }
.plat-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e6eb; margin-bottom: 12px; }
.plat-tabs button, .plat-tabs a { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: inherit; text-decoration: none; }
.plat-tabs button.active, .plat-tabs a.active { color: #1677ff; border-bottom-color: #1677ff; font-weight: 700; }
.plat-drawer { position: fixed; inset: 0 0 0 auto; width: min(760px, 100vw); height: 100vh; max-height: 100vh; margin: 0; border: 0; border-left: 1px solid #e5e6eb; border-radius: 0; padding: 0; }
.plat-drawer::backdrop { background: rgba(15, 23, 42, 0.35); }
.plat-drawer-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #e5e6eb; background: #fff; position: sticky; top: 0; }
.plat-drawer-body { padding: 16px; overflow: auto; height: calc(100vh - 52px); }
@media (max-width: 900px) {
  .plat-shell { grid-template-columns: 1fr; }
  .plat-side { display: flex; overflow: auto; }
  .plat-side a { white-space: nowrap; }
  .plat-kpis, .plat-charts, .plat-form-grid, .plat-dist, .plat-change { grid-template-columns: 1fr; }
}
