/* Сырьё - дизайн-система v2 (19.10.2026).
   Сцена: снабженец стройки или пилорамы днём сравнивает цены с ноутбука в офисе или с телефона на объекте.
   Светлое рабочее поле, тёмно-хвойная навигация слева, один акцент - хвойный зелёный, сигнальный янтарь
   только для Торгового дома и важных отметок. Шрифт - Inter (кириллица, ровные табличные цифры), одна гарнитура.
   ⛔ Модули сюда не пишут: свои стили - в css/<модуль>.css, только на этих токенах. */

@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2212; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Нейтрали с лёгким уходом в хвою (hue 150) */
  --bg: oklch(0.972 0.004 150);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.982 0.003 150);
  --surface-3: oklch(0.955 0.006 150);
  --line: oklch(0.915 0.006 150);
  --line-strong: oklch(0.86 0.008 150);
  --ink: oklch(0.21 0.018 155);
  --ink-2: oklch(0.33 0.016 155);
  --muted: oklch(0.47 0.014 155);
  --faint: oklch(0.62 0.01 155);

  /* Бренд: хвоя */
  --brand: oklch(0.47 0.115 150);
  --brand-hover: oklch(0.41 0.11 150);
  --brand-press: oklch(0.36 0.1 150);
  --brand-soft: oklch(0.95 0.035 150);
  --brand-soft-2: oklch(0.91 0.055 150);
  --brand-ink: oklch(0.32 0.09 150);
  --on-brand: oklch(0.99 0.01 150);

  /* Сигнальный янтарь: Торговый дом, «лучшая цена» */
  --signal: oklch(0.8 0.15 78);
  --signal-soft: oklch(0.96 0.045 85);
  --signal-ink: oklch(0.45 0.1 65);

  /* Второй акцент: орех (древесина) - рынок, поставщикам, ценовые блоки */
  --wood: oklch(0.42 0.075 45);
  --wood-deep: oklch(0.21 0.03 35);
  --wood-ink: oklch(0.36 0.07 42);
  --wood-soft: oklch(0.965 0.016 55);
  --wood-soft-2: oklch(0.91 0.03 55);

  /* Состояния */
  --ok: oklch(0.52 0.12 155);
  --ok-soft: oklch(0.95 0.04 155);
  --warn: oklch(0.55 0.12 70);
  --warn-soft: oklch(0.96 0.05 85);
  --danger: oklch(0.55 0.19 27);
  --danger-soft: oklch(0.96 0.025 25);
  --info: oklch(0.5 0.11 245);
  --info-soft: oklch(0.96 0.02 245);

  /* Навигация: тёмная хвоя */
  --sb-bg: oklch(0.205 0.028 158);
  --sb-bg-2: oklch(0.25 0.03 158);
  --sb-line: oklch(0.3 0.025 158);
  --sb-text: oklch(0.86 0.015 150);
  --sb-muted: oklch(0.66 0.02 150);
  --sb-active-bg: oklch(0.33 0.055 152);
  --sb-active-text: oklch(0.98 0.01 150);
  --sb-accent: oklch(0.82 0.14 145);

  /* Совместимость со стилями модулей (старые имена) */
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --accent-soft: var(--brand-soft);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-xs: 6px; --r-sm: 8px; --radius: 12px; --r-lg: 16px; --r-pill: 999px;
  --radius-sm: var(--r-sm);
  --shadow-1: 0 1px 2px oklch(0.2 0.02 155 / 0.06);
  --shadow-2: 0 1px 2px oklch(0.2 0.02 155 / 0.05), 0 6px 20px -6px oklch(0.2 0.02 155 / 0.12);
  --shadow-3: 0 2px 4px oklch(0.2 0.02 155 / 0.06), 0 18px 40px -12px oklch(0.2 0.02 155 / 0.22);
  --shadow: var(--shadow-2);
  --ring: 0 0 0 3px oklch(0.47 0.115 150 / 0.22);

  --sb-w: 264px;
  --sb-w-collapsed: 72px;
  --top-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 10; --z-topbar: 20; --z-scrim: 30; --z-sidebar: 40; --z-toast: 60;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--ink); line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 1em; text-wrap: pretty; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
/* Метка способа доставки в строках заявок (macros.delivery): цвет - от строки, где стоит */
.dlv { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.dlv .ico { flex: 0 0 auto; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.ico { flex: 0 0 auto; display: inline-block; vertical-align: -0.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--brand-soft-2); }

/* Каркас (меню слева, бегущая строка, верхняя строка) - static/css/shell.css */
.content { flex: 1 1 auto; width: 100%; padding: 28px 28px 48px; }
.content-public { max-width: 1240px; }
.content-app { max-width: 1320px; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 28px 28px; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* Старые обёртки страниц внутри нового каркаса */
.container { max-width: none; padding: 0; margin: 0; }
.page { padding: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }

/* Заголовок страницы */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }

/* ---------- Карточки и блоки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-1); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 16px; font-weight: 650; margin: 0 0 14px; color: var(--ink); }
.card-flush { padding: 0; overflow: hidden; }
.section { margin-top: 32px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; }
.kv { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 500; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .value { font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat .label { color: var(--muted); font-size: 13.5px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico { color: var(--faint); margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 14.5px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; letter-spacing: -0.005em;
  box-shadow: var(--shadow-1); transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px oklch(0.3 0.08 150 / 0.3), inset 0 1px 0 oklch(1 0 0 / 0.12); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-primary:active { background: var(--brand-press); }
.btn-secondary { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); box-shadow: none; }
.btn-secondary:hover { background: var(--brand-soft-2); color: var(--brand-ink); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--danger); border-color: oklch(0.88 0.05 25); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: oklch(0.85 0.07 25); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 680px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--danger); font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: 400 16px/1.4 var(--font);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: oklch(0.78 0.01 150); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[aria-invalid=true], .field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
select { appearance: none; padding-right: 36px; 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='%23667067' 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 12px center; }
textarea { min-height: 100px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 18px; height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; flex: 0 0 auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0; }
legend { padding: 0 6px; font-weight: 650; font-size: 14px; }
.steps { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; counter-reset: step; }
.steps .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 550; counter-increment: step; }
.steps .step::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.steps .step.current { border-color: var(--brand); color: var(--ink); }
.steps .step.current::before { background: var(--brand); color: var(--on-brand); }
.steps .step.done { color: var(--brand-ink); }
.steps .step.done::before { content: "✓"; background: var(--brand-soft-2); color: var(--brand-ink); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 12.5px; white-space: nowrap; letter-spacing: 0.01em; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.highlight td { background: var(--brand-soft); }
.table .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.table a { font-weight: 550; }

/* ---------- Метки ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; line-height: 1.3; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; border: 0; }
.badge-ok { background: var(--ok-soft); color: oklch(0.4 0.1 155); }
.badge-warn { background: var(--warn-soft); color: oklch(0.45 0.1 65); }
.badge-danger { background: var(--danger-soft); color: oklch(0.48 0.17 27); }
.badge-info { background: var(--info-soft); color: oklch(0.43 0.1 245); }
.badge-accent { background: var(--brand-soft); color: var(--brand-ink); }
.badge-signal { background: var(--signal-soft); color: var(--signal-ink); }
.badge-verified { background: var(--brand-soft); color: var(--brand-ink); }
.badge-verified::before { content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center/contain no-repeat; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Сообщения ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; }
.alert-ok { background: var(--ok-soft); border-color: transparent; color: oklch(0.36 0.09 155); }
.alert-warn { background: var(--warn-soft); border-color: transparent; color: oklch(0.42 0.1 65); }
.alert-danger { background: var(--danger-soft); border-color: transparent; color: oklch(0.45 0.16 27); }
.alert-info { background: var(--info-soft); border-color: transparent; color: oklch(0.4 0.1 245); }
.content > .alert:first-child { margin-bottom: 20px; }
.locked { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-sm); padding: 12px 14px; color: var(--muted); font-size: 14px; }

/* ---------- Вкладки и сегменты ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 550; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active, .tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--brand); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-sm); }
.segmented a, .segmented button { padding: 6px 12px; border-radius: var(--radius); color: var(--ink-2); font-weight: 550; font-size: 13.5px; border: 0; background: transparent; cursor: pointer; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented .active, .segmented [aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Пагинация ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 550; }
.pager a:hover { border-color: var(--line-strong); text-decoration: none; }
.pager .current { background: var(--ink); color: var(--surface); border-color: var(--ink); }

details > summary { cursor: pointer; }

/* ---------- Адаптив: правила только внутри media ---------- */
.mobile-only { display: none !important; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.main { min-width: 0; display: flex; flex-direction: column; }

@media (max-width: 1180px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .mobile-only { display: inline-flex !important; }
  .content { padding: 22px 20px 40px; }
  .foot { padding: 18px 20px 24px; }
}
@media (max-width: 720px) {
  h1 { font-size: 23px; }
  h2 { font-size: 18px; }
  .desktop-only { display: none !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .content { padding: 18px 16px 36px; }
  .card { padding: 16px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .page-head { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.foot { border-top: 1px solid var(--line); }
