/* Панель заведения: каркас и экраны. Токены и компоненты — в base.css.
   Рабочий инструмент на весь день: телефон у кассы, планшет или компьютер на стойке.
   Фирменный цвет заведения здесь не красит интерфейс, он виден только в логотипе и превью для клиентов. */

:root {
  --star: #c98a00;
  --side-w: 256px;
}
@media (prefers-color-scheme: dark) { :root { --star: #e0a64a; } }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.col { min-width: 0; }
.main { padding: 32px 40px 64px; max-width: 1560px; width: 100%; }
.top, .tabbar { display: none; }

.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 16px;
  padding: 20px 12px 16px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
}
.side-top { padding: 0 12px; }
.side-top .logo { height: 20px; }

.venue-logo {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--sunken); color: var(--text-2); font-weight: 600; font-size: 16px; box-shadow: inset 0 0 0 1px var(--line);
}
.venue-logo img { width: 100%; height: 100%; object-fit: cover; }
.venue-logo-sm { width: 32px; height: 32px; font-size: 14px; }
.venue-card { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-width: 0; }
.vc-text { min-width: 0; }
.vc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-link { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-link:hover { color: var(--accent); }

.accept { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px; padding: 12px; border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--line); }
.accept-text { display: grid; gap: 2px; min-width: 0; }
.accept-title { font-size: 12px; color: var(--muted); }
.accept-state { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.accept-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.accept[data-state='on'] .accept-state::before { background: var(--ok); }
.accept[data-state='blocked'] .accept-state { color: var(--danger); }
.accept[data-state='blocked'] .accept-state::before { background: var(--danger); }

.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; width: 100%; text-align: left;
  border: 0; background: none; border-radius: var(--r-ctl); color: var(--text-2); font-weight: 500; cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--sunken); color: var(--text); }
.nav-item[aria-current='page'] { background: var(--sunken); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--ink-text); font-family: var(--mono); font-size: 12px; }
.nav-item .count.soft { background: var(--sunken); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav-item .count.danger { background: var(--danger); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 2px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions .select { width: auto; height: 40px; }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-bottom: 24px; border-radius: var(--r-card); background: var(--accent-soft); }
.notice-text { display: grid; gap: 2px; min-width: 0; }
.notice-text strong { font-weight: 600; }
.notice-text span { color: var(--text-2); font-size: 13px; }
.notice.warn { background: var(--warn-soft); }
.notice.warn strong { color: var(--warn); }
.notice.danger { background: var(--danger-soft); }
.notice.danger strong { color: var(--danger); }
.notice .btn { flex: none; }

.foot-hint { margin-top: 24px; max-width: 64ch; }
.block-title { font-size: 14px; font-weight: 600; }

/* ---------- заказы: доска ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.lane { display: grid; gap: 12px; align-content: start; min-width: 0; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-weight: 600; }
.lane-head .n { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.lane-head .n.hot { background: var(--ink); color: var(--ink-text); border-radius: 10px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.lane-body { display: grid; gap: 12px; align-content: start; }
.lane-empty { padding: 32px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); color: var(--muted); text-align: center; font-size: 13px; }
.lane-tabs { display: none; margin-bottom: 16px; max-width: 520px; }

.order { padding: 16px; display: grid; gap: 12px; position: relative; }
.order.is-new { box-shadow: inset 3px 0 0 var(--ink); }
.order.is-done, .order.is-cancelled { background: var(--surface-2); }
.order.enter { animation: rise 320ms var(--ease); }
.order.flash { animation: flash 1.4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.o-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.o-num { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.o-time { color: var(--muted); font-size: 12px; margin-left: 8px; }
.o-time.late { color: var(--warn); font-weight: 500; }
.o-client { display: flex; align-items: center; gap: 12px; }
.o-ava { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); font-weight: 600; }
.o-who { min-width: 0; flex: 1; display: grid; }
.o-who strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-who span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.o-items { margin: 0; padding: 12px 0; list-style: none; display: grid; gap: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.o-items li { display: grid; grid-template-columns: 32px 1fr; gap: 4px; }
.o-qty { color: var(--muted); font-variant-numeric: tabular-nums; }
.o-total { display: flex; justify-content: space-between; align-items: baseline; }
.o-total span { color: var(--muted); font-size: 13px; }
.o-total strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.o-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--sunken); color: var(--text-2); font-size: 12px; font-weight: 500; }
.tag .icon { width: 14px; height: 14px; }
.tag.when { background: var(--warn-soft); color: var(--warn); }
.o-line { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); }
.o-line .icon { margin-top: 1px; color: var(--muted); }
.o-note { padding: 8px 12px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); }
.order.is-done .o-note, .order.is-cancelled .o-note { background: var(--surface); }
.o-actions { display: flex; gap: 8px; }
.o-actions .btn-main { flex: 1; }

/* ---------- меню ---------- */
.menu-tools { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.menu-tools .input-lead { flex: 0 1 320px; min-width: 200px; }
.menu-cats { position: sticky; top: 0; z-index: 5; margin: 0 0 16px; padding: 8px 0; background: var(--bg); }
.menu-cats:empty { display: none; }
.mgroup { margin-bottom: 16px; overflow: hidden; scroll-margin-top: 64px; }
.mg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.mg-head h2 { font-size: 14px; font-weight: 600; }
.mg-head h2 .n { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.mg-tools { display: flex; align-items: center; gap: 2px; }
.mg-tools .icon-btn { width: 32px; height: 32px; }
.mg-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); margin-bottom: -1px; }
.dish { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px 12px 12px; border-bottom: 1px solid var(--line); }
.dish.is-off .d-main { opacity: 0.55; }
.d-main { display: flex; align-items: center; gap: 12px; min-width: 0; border: 0; background: none; text-align: left; cursor: pointer; padding: 4px; margin: -4px; border-radius: var(--r-ctl); transition: background-color var(--t-fast); }
.d-main:hover { background: var(--surface-2); }
.d-thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; background: var(--sunken); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.d-thumb img { width: 100%; height: 100%; object-fit: cover; }
.d-text { display: grid; min-width: 0; }
.d-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-meta { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.d-meta .off { color: var(--danger); }
.mg-empty { padding: 20px; color: var(--muted); }

/* ---------- наличие ---------- */
.link-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 16px; }
.lc-text { display: grid; gap: 2px; min-width: 0; }
.lc-text a { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.lc-text a:hover { color: var(--accent); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--sunken); color: var(--text-2); font-size: 13px; font-weight: 500; }
.pill.live { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.scard { padding: 16px; display: grid; gap: 16px; }
.scard.is-stale, .scard.is-off { background: var(--surface-2); }
.sc-head { display: flex; gap: 16px; align-items: center; border: 0; background: none; text-align: left; cursor: pointer; padding: 0; width: 100%; }
.sc-count { flex: none; width: 64px; height: 64px; border-radius: var(--r-card); display: grid; place-content: center; text-align: center; background: var(--sunken); color: var(--text-2); }
.sc-count b { font-size: 24px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-count small { font-size: 11px; }
.scard.is-live .sc-count { background: var(--ok-soft); color: var(--ok); }
.sc-title { font-weight: 600; }
.sc-title .d { font-weight: 400; color: var(--text-2); }
.sc-price { font-variant-numeric: tabular-nums; }
.sc-status { font-size: 12px; color: var(--muted); }
.sc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.restock { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.empty-card { grid-column: 1 / -1; }

/* ---------- отзывы ---------- */
.avg-card { display: flex; align-items: center; gap: 20px; padding: 20px; margin-bottom: 16px; max-width: 420px; }
.avg-num { font-size: 40px; line-height: 44px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stars { display: inline-flex; gap: 2px; }
.star { font-size: 16px; line-height: 1; background: linear-gradient(90deg, var(--star) var(--f), var(--sunken) var(--f)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.review-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.review { padding: 16px; display: grid; gap: 12px; }
.review.is-hidden { background: var(--surface-2); }
.rv-top { display: flex; align-items: center; gap: 12px; }
.rv-who { flex: 1; min-width: 0; display: grid; }
.rv-who span { font-size: 12px; color: var(--muted); }
.rv-text { overflow-wrap: anywhere; }
.rv-reply { padding: 12px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.rv-reply strong { font-size: 12px; color: var(--text-2); font-weight: 500; }

/* ---------- отчёты ---------- */
.report-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.report-tools .seg { min-width: 320px; }
.report-tools .select { width: auto; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range .input { width: 160px; }
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kpi { padding: 20px; display: grid; gap: 4px; align-content: start; }
.kpi .label { font-size: 13px; color: var(--text-2); }
.kpi .value { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12px; color: var(--muted); }
.kpi.lead { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.kpi.lead .label, .kpi.lead .note { color: inherit; opacity: 0.68; }
.kpi.lead .value { font-size: 36px; line-height: 44px; }
.rgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rcol { display: grid; gap: 16px; min-width: 0; }
.rcard { padding: 20px; display: grid; gap: 16px; }
.rcard h3 { font-size: 14px; font-weight: 600; }
.chart { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; align-items: end; height: 200px; }
.chart.small { height: 120px; gap: 2px; }
.bar { height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; background: none; cursor: pointer; }
.bar-fill { display: block; width: 100%; height: var(--h); border-radius: 3px 3px 0 0; background: var(--accent); opacity: 0.85; transition: opacity var(--t-fast); }
.chart.quiet .bar-fill { background: var(--line-strong); opacity: 1; }
.bar:hover .bar-fill, .bar.active .bar-fill { opacity: 1; }
.chart.quiet .bar.active .bar-fill, .chart.quiet .bar:hover .bar-fill { background: var(--accent); }
.chart-axis { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: -8px; }
.chart-axis span { text-align: center; overflow: visible; white-space: nowrap; }
.chart-readout { font-size: 13px; color: var(--text-2); min-height: 20px; }
.rank { display: grid; gap: 12px; }
.rank-row { display: grid; gap: 6px; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; }
.rank-top .m { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-bar { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.rank-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.share-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--sunken); }
.share-bar > i { display: block; min-width: 4px; }
.s0 { background: var(--accent); } .s1 { background: var(--muted); } .s2 { background: var(--line-strong); }
.share-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.share-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.share-row .m { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- подписка ---------- */
.billing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bill-date { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.pay-instructions { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); }
.hist-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.hist-row:first-child { border-top: 0; padding-top: 0; }
.hist-row .t { font-weight: 500; }
.hist-row .d { font-size: 12px; color: var(--muted); }
.hist-row .a { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- настройки ---------- */
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 32px; align-items: start; }
.set-nav { display: grid; gap: 2px; position: sticky; top: 24px; }
.set-nav button { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text-2); font-weight: 500; text-align: left; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.set-nav button:hover { background: var(--sunken); color: var(--text); }
.set-nav button[aria-pressed='true'] { background: var(--sunken); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.set-panels { display: grid; gap: 16px; min-width: 0; }
.panel { display: grid; gap: 16px; }
.block { padding: 20px; display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.block > .hint { margin-top: -8px; }
.channel { display: flex; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.channel:first-of-type { border-top: 0; padding-top: 0; }
.channel-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); }
.channel-title { font-weight: 500; }
.status-on { color: var(--ok) !important; }
.status-off { color: var(--danger) !important; }
.manual-chat-id summary, .branch-add summary { cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.manual-chat-id summary { color: var(--text-2); font-size: 13px; }
.branch-add { padding: 16px 20px; }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.save-bar .form-error { flex: 1; }
.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-drop { flex: none; width: 72px; height: 72px; border-radius: 50%; border: 1px dashed var(--line-strong); background: var(--sunken); display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; color: var(--text-2); }
.logo-drop img { width: 100%; height: 100%; object-fit: cover; }
.logo-initial { font-size: 24px; font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--swatch); cursor: pointer; padding: 0; position: relative; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch[aria-checked='true']::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--text); }
.swatch-custom { background: conic-gradient(#e2541b, #f2b705, #2a9d55, #2563eb, #7c3aed, #db2777, #e2541b); overflow: hidden; }
.swatch-custom.is-custom { background: var(--swatch); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch-custom span { font-size: 18px; line-height: 1; text-shadow: 0 0 3px rgba(0,0,0,.5); pointer-events: none; }
.brand-preview { --p-accent: var(--accent); --p-ink: #fff; --p-soft: var(--accent-soft); padding: 16px; border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--line); }
.bp-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); max-width: 360px; }
.bp-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bp-name { font-weight: 500; }
.bp-add { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--r-ctl); background: var(--p-soft); color: var(--p-text, var(--p-accent)); font-size: 13px; font-weight: 500; }
.bp-cart { display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--r-ctl); background: var(--p-accent); color: var(--p-ink); font-weight: 500; }
.branch-card { padding: 16px; display: grid; gap: 12px; }
.branch-card.is-off { background: var(--surface-2); }
.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bc-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bc-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-meta { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.bc-meta span { display: flex; gap: 8px; align-items: center; }
.bc-edit summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); }
.bc-edit .form { margin-top: 12px; }

/* ---------- окна справа ---------- */
.photo-picker { display: flex; gap: 16px; align-items: center; }
.photo-drop { flex: none; position: relative; width: 96px; height: 96px; border-radius: var(--r-card); border: 1px dashed var(--line-strong); background: var(--sunken); display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; color: var(--text-2); }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-drop-empty { display: grid; justify-items: center; gap: 4px; font-size: 12px; }
.photo-progress { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
.m-items { display: grid; gap: 4px; max-height: 320px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.m-group-title { font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 0 4px; }
.m-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: var(--r-ctl); border: 1px solid transparent; }
.m-item.is-on { background: var(--surface-2); border-color: var(--line); }
.m-item .small { font-size: 12px; color: var(--muted); }
.m-picked { padding: 12px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.m-picked-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }

/* окно «Новый заказ» */
.order-alert { border: 0; padding: 0; width: 440px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); border-radius: var(--r-sheet); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden; }
.order-alert[open] { display: flex; flex-direction: column; animation: dlg-in var(--t-med) var(--ease); }
.order-alert::backdrop { background: rgba(14, 13, 11, 0.6); }
.oa-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.oa-head strong { flex: 1; font-weight: 600; }
.oa-body { padding: 20px; display: grid; gap: 16px; overflow: auto; }
.oa-top { display: flex; align-items: baseline; justify-content: space-between; }
.oa-num { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
.oa-sum { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.oa-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.oa-items { margin: 0; padding: 12px 0; list-style: none; display: grid; gap: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.oa-items li { display: flex; justify-content: space-between; gap: 12px; }
.oa-items strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.oa-comment { display: flex; gap: 8px; padding: 8px 12px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.oa-client { display: grid; gap: 2px; }
.oa-client .tel { font-variant-numeric: tabular-nums; color: var(--accent); }
.oa-actions { display: grid; gap: 8px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.oa-actions .btn-primary { height: 48px; font-size: 16px; }

/* ---------- адаптив ---------- */
@media (min-width: 860px) {
  #more-sheet { display: none !important; }
}

@media (max-width: 1279px) {
  .board { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .lane { display: none; }
  .board[data-lane='new'] .lane[data-lane='new'], .board[data-lane='work'] .lane[data-lane='work'], .board[data-lane='done'] .lane[data-lane='done'] { display: grid; }
  .lane-head { display: none; }
  .lane-tabs { display: flex; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .rgrid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1099px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .set-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 0 -16px; padding: 2px 16px; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav button { flex: none; height: 32px; border: 1px solid var(--line-strong); border-radius: 16px; padding: 0 12px; }
  .set-nav button .icon { display: none; }
  .set-nav button[aria-pressed='true'] { background: var(--ink); color: var(--ink-text); border-color: transparent; box-shadow: none; }
  .billing-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 859px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; height: 56px; box-sizing: content-box;
    padding: env(safe-area-inset-top) 16px 0; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .top-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-accept { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); font-weight: 500; cursor: pointer; }
  .top-accept[data-state='on'] { color: var(--ok); }
  .top-accept[data-state='blocked'] { color: var(--danger); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab { display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; border: 0; background: none; cursor: pointer; }
  .tab[aria-current='page'] { color: var(--text); }
  .tab[aria-current='page'] .icon { stroke-width: 1.9; }
  .tab .badge-dot { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink); color: var(--ink-text); font-family: var(--mono); font-size: 11px; display: grid; place-items: center; }
  .tab .badge-dot.danger { background: var(--danger); color: #fff; }
  .main { padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head h1 { font-size: 24px; line-height: 32px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  #tab-orders .page-actions { justify-content: space-between; }
  .notice { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .board { max-width: none; }
  .mgroup { scroll-margin-top: calc(56px + env(safe-area-inset-top) + 64px); }
  .menu-cats { top: calc(56px + env(safe-area-inset-top)); margin: 0 -16px 12px; padding: 8px 16px; }
  .mg-body { grid-template-columns: minmax(0, 1fr); }
  .mg-head { padding-left: 16px; }
  .menu-tools { gap: 8px; }
  .menu-tools .input-lead { flex-basis: 100%; }
  .link-card { flex-direction: column; align-items: stretch; gap: 12px; }
  .stock-grid, .review-list { grid-template-columns: minmax(0, 1fr); }
  .report-tools .seg { min-width: 0; width: 100%; }
  .report-tools .select { width: 100%; }
  .date-range { width: 100%; } .date-range .input { flex: 1; width: auto; }
  .kpi { padding: 16px; } .kpi .value { font-size: 24px; line-height: 32px; } .kpi.lead { grid-column: 1 / -1; } .kpi.lead .value { font-size: 32px; line-height: 40px; }
  .set-layout { margin-top: 0; }
  .block { padding: 16px; }
  .toasts { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  .drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .order-alert { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
  .save-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); margin: 0 -16px; padding: 12px 16px; }
  .save-bar .btn { flex: 1; }
  .m-items { max-height: 260px; }
  .more-list { display: grid; gap: 2px; }
  .menu-lead { display: none; }
}
.more-list { display: grid; gap: 2px; }
.more-list .nav-item { height: 48px; }

@media (hover: none) { .btn:hover, .nav-item:hover { background: initial; } .btn-primary:hover { opacity: 1; } }
