:root {
  --bg: #ffffff; --soft: #f7f7f8; --line: #e8e8ec; --ink: #16161a; --muted: #6b6b76;
  --accent: #f26b1d; --accent-soft: #fff1e8; --ok: #17a34a; --ok-soft: #e8f7ee;
  --warn: #c27803; --warn-soft: #fff6dd; --bad: #d92d20; --bad-soft: #fdecea; --blue: #2563eb; --blue-soft: #e8f0ff;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 16, 26, .05), 0 6px 20px rgba(16, 16, 26, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.top { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand i { font-style: normal; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b2b33; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: default; }

.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }

/* каталог */
.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 800; }
.hero p { color: var(--muted); max-width: 520px; margin: 12px auto 26px; font-size: 17px; }
.search { max-width: 520px; margin: 0 auto; position: relative; }
.search .input { padding: 15px 18px 15px 46px; border-radius: 14px; font-size: 16px; box-shadow: var(--shadow); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding: 18px 0 60px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; text-align: left; transition: box-shadow .2s, transform .2s, border-color .2s; display: block; width: 100%; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #dcdce2; }
.card .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 26px; margin-bottom: 14px; }
.card h3 { font-size: 17px; }
.card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.card .go { margin-top: 14px; color: var(--accent); font-weight: 600; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

.modal-bg { position: fixed; inset: 0; background: rgba(16, 16, 26, .45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal-bg.on { display: flex; }
.modal { background: #fff; border-radius: 18px; padding: 26px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h2 { font-size: 20px; }
.modal p { color: var(--muted); margin: 6px 0 18px; }
.modal .row { display: flex; gap: 10px; margin-top: 14px; }
.modal .row .btn { flex: 1; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* кабинет */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fff; }
.tabs .wrap { display: flex; gap: 4px; }
.tab { border: 0; background: none; padding: 14px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.page { padding: 26px 0 70px; }
.page h2 { font-size: 22px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--soft); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h3 { font-size: 16px; margin-bottom: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar div { width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; opacity: .9; }
.bar small { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.bar:hover div { opacity: 1; }
.list { display: grid; gap: 10px; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li small { color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.b-new { background: var(--blue-soft); color: var(--blue); } .b-taken { background: var(--warn-soft); color: var(--warn); }
.b-delivered { background: var(--ok-soft); color: var(--ok); } .b-cancelled { background: var(--bad-soft); color: var(--bad); }
.b-on { background: var(--ok-soft); color: var(--ok); } .b-off { background: var(--soft); color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll { overflow-x: auto; }
.table tr.cx td { opacity: .5; }
.dish { display: grid; grid-template-columns: 1fr 110px auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dish:last-of-type { border-bottom: 0; }
.dish.off .input.name { color: var(--muted); text-decoration: line-through; }
@media (max-width: 640px) { .dish { grid-template-columns: 1fr 90px; } }
.addrow { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.addrow .input { flex: 1; min-width: 140px; }
.note { color: var(--muted); font-size: 13px; margin-top: 10px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.toast.on { opacity: 1; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head-row h2 { margin: 0; }
select.input { width: auto; padding: 8px 12px; }
