:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #101418;
  --muted: #66717d;
  --line: #e3e7eb;
  --brand: #0e7c66;
  --brand-2: #0a5f4f;
  --accent: #daf4ec;
  --warning: #a86200;
  --warning-bg: #fff3d8;
  --danger: #b33131;
  --success: #0d7a43;
  --shadow: 0 18px 50px rgba(16, 20, 24, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 32px)); margin: 0 auto; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.center { text-align: center; }

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(246,247,249,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(227,231,235,.75); }
.topbar-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.04em; font-size: 1.2rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; background: var(--text); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button { border: 0; background: transparent; padding: 9px 12px; border-radius: 11px; color: var(--muted); }
.nav a:hover, .nav a.active, .nav button:hover { background: var(--surface); color: var(--text); }

.btn { appearance: none; border: 0; border-radius: 14px; padding: 12px 17px; font-weight: 700; background: var(--text); color: white; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.btn:hover { transform: translateY(-1px); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.brand { background: var(--brand); }
.btn.ghost { background: transparent; color: var(--text); border: 1px dashed var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 8px 11px; border-radius: 10px; font-size: .85rem; }
.btn.full { width: 100%; }

.hero { padding: 84px 0 52px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.eyebrow { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: var(--accent); color: var(--brand-2); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
h1, h2, h3 { margin: 0; letter-spacing: -.045em; }
h1 { font-size: clamp(2.8rem, 7vw, 5.7rem); line-height: .98; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; }
h3 { font-size: 1.18rem; }
.lead { font-size: 1.12rem; color: var(--muted); line-height: 1.7; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 32px; padding: 24px; box-shadow: var(--shadow); }
.phone-preview { border: 1px solid var(--line); background: #fff; border-radius: 28px; overflow: hidden; max-width: 380px; margin: 0 auto; }
.phone-head { padding: 22px; background: #0f1418; color: #fff; }
.phone-body { padding: 18px; display: grid; gap: 12px; }
.action-tile { padding: 15px; border-radius: 16px; background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; }

.section { padding: 64px 0; }
.section-head { margin-bottom: 26px; display: grid; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 8px 28px rgba(16,20,24,.04); }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.locked { position: relative; overflow: hidden; }
.card.locked::after { content: "PRO"; position: absolute; top: 14px; right: 14px; background: #171b20; color: white; font-weight: 800; font-size: .72rem; padding: 5px 8px; border-radius: 999px; }
.metric { font-size: 2rem; font-weight: 850; letter-spacing: -.05em; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; font-weight: 700; }
.pill.success { background: #dff7e9; color: var(--success); }
.pill.warning { background: var(--warning-bg); color: var(--warning); }
.pill.pro { background: #161b1f; color: #fff; }

.app-shell { min-height: 100vh; }
.app-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: calc(100vh - 70px); }
.sidebar { padding: 22px 14px; border-right: 1px solid var(--line); background: #fbfcfd; position: sticky; top: 70px; height: calc(100vh - 70px); }
.sidebar-nav { display: grid; gap: 6px; }
.sidebar-nav a { padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 650; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: white; color: var(--text); box-shadow: 0 3px 12px rgba(16,20,24,.05); }
.sidebar-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.app-main { padding: 30px; min-width: 0; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(2rem,4vw,3.4rem); }

.field { display: grid; gap: 8px; }
.field label { font-weight: 750; font-size: .9rem; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: white; color: var(--text); outline: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.10); }
textarea.input { min-height: 100px; resize: vertical; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: grid; gap: 8px; min-height: 126px; align-content: center; border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: white; cursor: pointer; transition: .2s ease; }
.choice input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.08); background: #fbfffd; }
.choice-icon { font-size: 1.5rem; }
.toggle-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.switch { width: 46px; height: 27px; position: relative; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cad0d5; border-radius: 999px; transition: .2s; }
.switch span::after { content: ''; width: 21px; height: 21px; background: white; border-radius: 50%; position: absolute; left: 3px; top: 3px; transition: .2s; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(19px); }

.progress-dots { display: flex; gap: 7px; margin-bottom: 24px; }
.progress-dots span { height: 5px; flex: 1; background: var(--line); border-radius: 99px; }
.progress-dots span.active, .progress-dots span.done { background: var(--brand); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.order-card { display: grid; gap: 12px; }
.order-status { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-NEW { color: #8a5500; }
.status-ACCEPTED, .status-PREPARING { color: #235ba8; }
.status-READY, .status-COMPLETED { color: var(--success); }
.status-CANCELLED { color: var(--danger); }

.ai-meter { background: white; border: 1px solid var(--line); padding: 12px 14px; border-radius: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.ai-bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.ai-bar > span { height: 100%; background: var(--brand); display: block; }

.catalog-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.catalog-item:last-child { border-bottom: 0; }
.price { font-weight: 850; font-size: 1.1rem; }
.options-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.option-chip { padding: 5px 8px; border-radius: 999px; background: var(--surface-2); font-size: .76rem; }

.public-shell { min-height: 100vh; background: #f7f5f1; }
.public-header { padding: 24px 0; }
.business-title { font-size: clamp(2.2rem,7vw,4.5rem); }
.menu-grid { display: grid; gap: 14px; }
.menu-item { background: white; border: 1px solid #e8e2d8; border-radius: 22px; padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.menu-category { margin: 28px 0 10px; font-size: .85rem; color: #756e64; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; }
.floating-cart { position: sticky; bottom: 14px; margin: 18px auto; width: min(720px, calc(100% - 24px)); background: #101418; color: white; border-radius: 18px; padding: 14px 16px; box-shadow: 0 18px 45px rgba(0,0,0,.18); display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 20; }
.quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.quick-action { padding: 14px; border-radius: 16px; background: white; border: 1px solid #e8e2d8; text-align: left; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: end center; padding: 20px; z-index: 80; }
.modal-panel { width: min(600px,100%); max-height: 84vh; overflow: auto; background: white; border-radius: 26px 26px 18px 18px; padding: 22px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }

.qr-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.qr-card img { width: 180px; aspect-ratio: 1; display: block; margin: 0 auto 12px; }

.toast { position: fixed; right: 18px; bottom: 18px; background: #101418; color: #fff; padding: 13px 16px; border-radius: 14px; z-index: 100; box-shadow: var(--shadow); }
.notice { padding: 14px 16px; border-radius: 14px; background: var(--accent); color: var(--brand-2); border: 1px solid #bee8dc; }
.notice.warning { background: var(--warning-bg); color: var(--warning); border-color: #f1d59e; }
.notice.danger { background: #ffe6e6; color: var(--danger); border-color: #f5b8b8; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

@media (max-width: 900px) {
  .hero-grid, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; overflow-x: auto; }
  .sidebar-nav { display: flex; min-width: max-content; }
  .sidebar-footer { display: none; }
  .app-main { padding: 20px 16px 80px; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .qr-grid { grid-template-columns: 1fr 1fr; }
  .topbar .nav .desktop-only { display: none; }
}

@media (max-width: 560px) {
  .container, .narrow { width: min(100% - 22px, 100%); }
  .hero { padding-top: 46px; }
  .choice-grid, .qr-grid, .quick-actions { grid-template-columns: 1fr; }
  .menu-item { grid-template-columns: 1fr; }
  .form-card { padding: 18px; border-radius: 22px; }
  .topbar-inner { height: 62px; }
  .public-header { padding-top: 16px; }
}
