/* Prime Service — рабочее место закупщика. Ч/б с красным акцентом из логотипа. */

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap;
  src: url("fonts/onest-400-cyrillic.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap;
  src: url("fonts/onest-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2212; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap;
  src: url("fonts/onest-500-cyrillic.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap;
  src: url("fonts/onest-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2212; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap;
  src: url("fonts/onest-600-cyrillic.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap;
  src: url("fonts/onest-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2212; }

:root {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #4a4a4a;
  --ink-3: #8a8a8a;
  --line: #e4e2de;
  --line-strong: #cfccc6;
  --accent: #c9171c;
  --accent-ink: #ffffff;
  --surface-2: #fafaf8;
  --ok: #1f7a3d;
  --ok-soft: #eef7f1;
  --warn: #8a5a00;
  --warn-soft: #fdf5e6;
  --err: #b3261e;
  --err-soft: #fbefee;
  --accent-soft: #fcefee;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 10px;
  --gap: 16px;
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input, textarea { caret-color: var(--accent); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* ── демо-плашка ── */
.demo-bar {
  background: var(--accent); color: var(--accent-ink);
  text-align: center; font-size: 13px; font-weight: 500; padding: 6px 16px;
}

/* ── вход ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .08em; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.brand-sub { color: var(--ink-3); font-size: 13px; margin: 6px 0 24px; letter-spacing: 0; font-weight: 400; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; color: var(--ink-2); }
.field input {
  height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface);
}
.field input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.btn {
  height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 500; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); height: 34px; padding: 0 12px; }
.form-error { color: var(--err); font-size: 13px; min-height: 20px; margin: 4px 0 10px; }

/* ── оболочка ── */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--ink); color: #fff;
}
.top-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; gap: 24px;
}
.top .brand { color: #fff; font-size: 14px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; color: #bdbdbd; padding: 8px 12px; border-radius: 8px;
  white-space: nowrap; font-size: 14px;
}
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; background: #2a2a2a; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #bdbdbd; white-space: nowrap; }
.who .btn.ghost { color: #fff; border-color: #444; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
.lead { color: var(--ink-2); margin: 0 0 24px; max-width: 70ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .k { font-size: 13px; color: var(--ink-3); }
.card .v { font-size: 26px; font-weight: 600; margin-top: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel { margin-top: 16px; }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 500; }
.panel-body { padding: 16px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }

.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap;
}
.badge.ok { border-color: #b9dcc4; color: var(--ok); background: #eef7f1; }
.badge.err { border-color: #f0c2bf; color: var(--err); background: #fbefee; }
.badge.mine { border-color: var(--ink); color: var(--ink); }

.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--line-strong); }
.steps .done .dot { background: var(--ok); }
.steps .now .dot { background: var(--accent); }
.steps .when { color: var(--ink-3); font-size: 13px; margin-left: auto; white-space: nowrap; }

@media (max-width: 720px) {
  .top-inner { gap: 12px; }
  .top .brand span { display: none; }
  .who .name { display: none; }
  h1 { font-size: 21px; }
  th, td { padding: 9px 12px; }
}

/* ══ Экраны этапа 1: справочник, цены, отчёт, заказ ══════════════════════════ */

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .lead { margin-bottom: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.sub { color: var(--ink-3); font-size: 13px; }
.strong { font-weight: 600; }
.pos { color: var(--ok); }
.neg { color: var(--err); }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── кнопки и поля ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), opacity .15s; }
.btn:hover:not(:disabled) { background: #2b2b2b; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-3); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.top .btn.ghost:hover:not(:disabled) { background: #2a2a2a; }
.btn.link { background: none; border: 0; height: auto; padding: 0; color: var(--ink); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.btn.link:hover:not(:disabled) { background: none; text-decoration-color: var(--ink); }
.btn.is-busy { opacity: .6; cursor: progress; }

.input, .select, .textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); width: 100%; min-width: 0;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #767676; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.textarea { height: auto; min-height: 180px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input.num { text-align: right; }
.field-inline { display: grid; gap: 6px; min-width: 0; }
.field-inline > span { font-size: 13px; color: var(--ink-2); }
.search { position: relative; }
.search > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 38px; }
.search.lg .input { height: 48px; font-size: 16px; border-radius: 10px; }

/* ── вкладки и фильтры ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; padding: 10px 12px 11px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; transition: color .15s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count { color: var(--ink-3); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-size: 13px; white-space: nowrap; color: var(--ink-2); transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; height: 38px; padding: 0 14px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar .push { margin-left: auto; }
.search.lg + .toolbar { margin-top: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1 1 380px; min-width: 0; }
.params { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(140px, 1fr)) auto auto; gap: 12px; align-items: end; }

/* ── сообщения ── */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.note .icon { margin-top: 2px; }
.note.warn { background: var(--warn-soft); border-color: #efdcb4; color: #5c4100; }
.note.info { background: var(--surface); }
.note + .note, .note + .panel, .panel + .note { margin-top: 12px; }
.empty { padding: 32px 16px; text-align: center; color: var(--ink-2); }
.empty h3 { font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.skeleton { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, #eeece8 25%, #f6f5f2 50%, #eeece8 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton + .skeleton { margin-top: 10px; }
.skel-block { padding: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── покрытие справочника ── */
.meter-panel { padding: 18px 16px 16px; margin-bottom: 20px; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.meter-top .big { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.meter { position: relative; height: 10px; border-radius: 999px; background: #ebe9e5; margin: 12px 0 10px; }
.meter .fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 999px; background: var(--ink);
  transition: width .6s var(--ease); }
.meter .target { position: absolute; top: -4px; bottom: -4px; left: var(--t, 95%); width: 2px; background: var(--accent); border-radius: 1px; }

/* ── очередь справочника ── */
.queue { list-style: none; margin: 0; padding: 0; }
.queue > li { padding: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px;
  transition: opacity .2s var(--ease), background-color .3s; }
.queue > li:last-child { border-bottom: 0; }
.queue > li.leaving { opacity: 0; }
.q-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.q-name { font-weight: 600; overflow-wrap: anywhere; }
.q-meta { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.q-meta span + span::before { content: "·"; margin: 0 6px; color: var(--line-strong); }
.q-spend { text-align: right; white-space: nowrap; }
.q-spend .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.q-spend .k { color: var(--ink-3); font-size: 12px; }
.prop { display: grid; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.prop-main { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: baseline; }
.prop-label { color: var(--ink-3); font-size: 13px; }
.prop-sku { font-weight: 500; }
.factor { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prop-why { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge.warn { border-color: #efdcb4; color: var(--warn); background: var(--warn-soft); }
.badge.ink { border-color: var(--ink); background: var(--ink); color: #fff; }
.badge.accent { border-color: #f0c2bf; color: var(--accent); background: var(--accent-soft); }

.editor { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.editor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.factor-input { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.factor-input .input { width: 110px; }
.picks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 260px; overflow: auto; }
.picks li + li { border-top: 1px solid var(--line); }
.picks button { width: 100%; text-align: left; background: var(--surface); border: 0; padding: 9px 12px; cursor: pointer; display: grid; gap: 1px; }
.picks button:hover { background: var(--surface-2); }
.picks button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.picks button[aria-pressed="true"] .sub { color: #cfcfcf; }
.bulk-confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }

/* ── выпадающие подсказки ── */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; max-height: 320px; overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04); }
.combo-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--surface-2); }
.combo-list .kind { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.combo-list .none { color: var(--ink-3); cursor: default; }
.picked { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.picked .name { font-weight: 600; font-size: 16px; }

/* ── сводка и раскладка «основное + сбоку» ── */
.stats { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.stat { padding: 14px 16px; flex: 1 1 200px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .k { font-size: 13px; color: var(--ink-3); }
.stat .v { font-size: 20px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .d { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.split.wide-aside { grid-template-columns: minmax(0, 1fr) 360px; }
.aside { display: grid; gap: 16px; position: sticky; top: 72px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv li:last-child { border-bottom: 0; }
.kv .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── таблицы ── */
table.data td { font-variant-numeric: tabular-nums; }
table.data tbody tr.click { cursor: pointer; transition: background-color .12s; }
table.data tbody tr.click:hover { background: var(--surface-2); }
table.data tbody tr.open { background: var(--surface-2); }
table.data tr.cat td { background: var(--surface-2); font-weight: 600; font-size: 13px; padding-top: 14px; color: var(--ink); }
table.data tr.total td { font-weight: 600; border-top: 2px solid var(--ink); }
table.data tr.detail > td { padding: 0 16px 16px; background: var(--surface-2); }
table.data th.group { text-align: center; border-bottom: 1px solid var(--line); }
table.data tr.best { background: #f4faf6; }
.chev { transition: transform .2s var(--ease); color: var(--ink-3); }
tr.open .chev { transform: rotate(180deg); }
.detail-box { display: grid; gap: 16px; padding: 12px 0 0; }
.detail-box .table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.detail-box th, .detail-box td { padding: 7px 12px; font-size: 13px; }
.sticky-col { position: sticky; left: 0; z-index: 1; }
table.report { min-width: 1080px; }
table.report td.sticky-col, table.report th.sticky-col { background: var(--surface); min-width: 240px; max-width: 320px; }
table.report tr.cat td.sticky-col, table.report tr.open td.sticky-col, table.report tr.click:hover td.sticky-col { background: var(--surface-2); }
.tag-new { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); margin-left: 6px; white-space: nowrap; }

/* ── заказ ── */
.order-form { display: grid; gap: 14px; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.olines { list-style: none; margin: 0; padding: 0; }
.oline { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.oline:last-child { border-bottom: 0; }
.oline.miss { background: var(--accent-soft); }
.oline-raw { font-size: 13px; color: var(--ink-3); }
.oline-raw .n { font-variant-numeric: tabular-nums; margin-right: 6px; }
.oline-head { display: flex; justify-content: space-between; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.oline-sku { font-weight: 600; }
.oline-qty { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oline-qty .input { width: 96px; height: 34px; }
.oline-sum { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oline-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.oline-facts .k { color: var(--ink-3); }
.last5 { display: inline-flex; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.cheaper { color: var(--accent); font-weight: 500; }
.oline .supplier { max-width: 440px; height: 34px; }
.suppliers-box .sup { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.suppliers-box .sup:last-of-type { border-bottom: 0; }
.sup-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.sup-lines { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.sup-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.sup-lines .r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.grand { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 2px solid var(--ink); font-weight: 600; }

/* ── всплывающее уведомление ── */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px); opacity: 0; z-index: 50;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px 10px 16px; display: flex; gap: 14px; align-items: center;
  max-width: min(560px, calc(100vw - 32px)); font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .btn { height: 30px; background: #2a2a2a; border-color: #444; flex: none; }
.toast.err { background: var(--err); }

/* ── главная ── */
.entry-panel { margin-bottom: 16px; }
.entry { list-style: none; margin: 0; padding: 0; }
.entry a { display: grid; grid-template-columns: 140px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .12s; }
.entry li:last-child a { border-bottom: 0; }
.entry a:hover { background: var(--surface-2); }
.entry .t { font-weight: 600; }
.entry .d { color: var(--ink-2); }
.entry .icon { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 1000px) {
  .split, .split.wide-aside { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .params { grid-template-columns: 1fr 1fr; }
  .params > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  main { padding: 16px 12px 48px; }
  .page-head { margin-bottom: 14px; }
  .q-head { flex-direction: column; gap: 4px; }
  .q-spend { text-align: left; }
  .queue > li, .oline { padding: 14px 12px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px; }
  .stat:first-child { grid-column: 1 / -1; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(3) { border-left: 1px solid var(--line); }
  .stat .v { font-size: 18px; }
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .chips.scroll::-webkit-scrollbar { display: none; }
  .toolbar > .field-inline, .toolbar > .search, .toolbar > .grow { flex: 1 1 100%; min-width: 0; }
  .toolbar > .field-inline .seg { display: flex; }
  .toolbar > .field-inline .seg button { flex: 1; }
  table.stack td.m-rest .sub { display: none; }
  .params { grid-template-columns: 1fr; }
  .toolbar .push { margin-left: 0; }
  .entry a { grid-template-columns: 1fr auto; }
  .entry .d { grid-column: 1; grid-row: 2; font-size: 13px; }
  .entry .icon { grid-row: 1 / span 2; grid-column: 2; }
  /* цены: строка таблицы — блок из нескольких строк */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.stack td { padding: 0; border: 0; }
  table.stack td.m-price { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; font-size: 15px; }
  table.stack td.m-sup { grid-column: 1; grid-row: 1; font-weight: 500; }
  table.stack td.m-date { grid-column: 2; grid-row: 2; text-align: right; color: var(--ink-3); font-size: 13px; }
  table.stack td.m-rest { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--ink-2); }
  table.stack td.m-sku { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
  table.stack td.m-qty { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); text-align: left; }
  table.stack td.m-hide { display: none; }
  table.stack tr.detail { display: block; padding: 0; }
  table.stack tr.detail > td { padding: 0 12px 12px; }
  .oline .supplier { max-width: none; }
}

/* ── смена пароля ── */
.pw-title { font-size: 20px; margin: 18px 0 6px; }
.pw-lead { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }
.pw-rules { color: var(--ink-3); font-size: 13px; margin: -4px 0 6px; }
.pw-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.pw-links a, .linklike { color: var(--ink-2); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; margin-left: auto; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ── пожелание в строке заказа ── */
.oline-note { font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.oline-note .k { color: var(--ink-3); }

/* ── бланк ресторана в заказе ── */
.blank-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.blank-head .combo { flex: 0 1 320px; }
.blank-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.blank { font-size: 14px; }
.blank th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.blank td { padding: 6px 12px; vertical-align: middle; }
.blank tr.sec td { background: var(--bg); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.blank .b-name { font-weight: 500; }
.blank .b-q { width: 110px; }
.blank .blank-q { width: 96px; height: 34px; }
.blank .blank-q.filled { border-color: var(--ink); font-weight: 500; }
.textarea.sm { min-height: 84px; }

/* ── печать бланка ── */
.print-page { background: #fff; }
.print-bar { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mp { max-width: 900px; margin: 0 auto; padding: 16px; }
.mp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 12px; }
.mp-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.mp-rest { font-size: 20px; font-weight: 600; }
.mp-fill { font-size: 13px; display: grid; gap: 6px; }
.mp-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mp-table th, .mp-table td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
.mp-table th { font-size: 10.5px; text-transform: uppercase; color: #333; }
.mp-table .c-name { width: 24%; font-weight: 600; }
.mp-table .c-q { width: 12%; }
.mp-table tr.mp-sec td { background: #e6e6e6; font-weight: 600; text-align: center; }
.mp-table tr { break-inside: avoid; }
.mp-extra { margin-top: 18px; min-height: 120px; border-top: 1px solid #999; padding-top: 6px; font-size: 12px; color: #555; }
@media print {
  @page { size: A4; margin: 12mm; }
  .print-bar { display: none; }
  .mp { max-width: none; padding: 0; }
  .mp-table tr.mp-sec td { background: #e6e6e6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
