/* Интерфейс агента (редизайн 2026-09): дизайн-система, каркас, компоненты.
   Порядок: шрифты → токены → база → каркас (меню) → компоненты → движение →
   старые страницы (их разметку перерисуют следующие задачи). Цвета в правилах —
   только var() токенов :root (§2.1 и помеченное дополнение из макетов); литералы
   цветов есть лишь внутри :root. Все файлы локальные (static/), внешних адресов нет. */

/* ---------- Шрифты: Fira Sans / Fira Code, SIL OFL, по наборам символов ----------
   latin — основная латиница и цифры; latin-ext — в том числе знак ₽ (U+20BD есть
   только в этих файлах); cyrillic — кириллица. */
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-400.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: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/fira-sans-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-500.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: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fira-sans-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-600.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: "Fira Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fira-sans-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-700.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: "Fira Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/fira-sans-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/fira-sans-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fira-code-latin-500.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: "Fira Code";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fira-code-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fira-code-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fira-code-latin-600.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: "Fira Code";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fira-code-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fira-code-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Токены (спецификация §2.1–§2.4) ---------- */
:root {
  /* §2.1 — палитра спецификации (не менять) */
  --sidebar-bg: #171B26;
  --sidebar-fg: #AAB1C2;
  --sidebar-fg-active: #FFFFFF;
  --sidebar-active-bg: #262D3D;
  --accent: #22C3A6;
  --accent-strong: #12A58A;
  --bg: #F3F4F7;
  --card: #FFFFFF;
  --border: #E4E7EC;
  --text: #1C2029;
  --muted: #6B7385;
  --pos: #0F7B63;
  --neg: #C92A2A;
  --warn: #A15C00;
  --wb: #CB11AB;
  --ozon: #005BFF;
  /* «Заказы · 14 дней» на «Ценах»: фон выходных и отменённая часть столбика. */
  --ord-weekend: rgba(107, 115, 133, .06);
  --ord-cancel: rgba(255, 255, 255, .55);

  /* §2.3–§2.4 — форма и движение */
  --r-card: 12px;
  --r-ctl: 8px;
  --r-chip: 16px;
  --r-dlg: 16px;
  /* Ширина меню слева — раскрытого и свёрнутого: её берут и меню, и
     центровка плавающей панели правок (ревью b608137, m7). */
  --sb-w: 200px;
  --sb-w-col: 64px;
  --t-menu: 220ms;
  --t-page: 240ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.1);
  --font: "Fira Sans", "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  --font-mono: "Fira Code", Consolas, monospace;

  /* дополнение к §2.1 (из макетов): motion.html, pages-v6.html.
     Цвета статусов уведомлений, приглушённый текст меню, второстепенные
     линии и подкраски. Подкраски — смесь токенов §2.1, а не новые цвета. */
  --on-color: #FFFFFF;
  --sidebar-dim: #7F879A;
  --sidebar-hover: rgba(255, 255, 255, .04);
  /* Подпункты «Претензий»: панель под пунктом и выбранный подпункт. */
  --sidebar-sub-bg: color-mix(in srgb, var(--sidebar-active-bg) 75%, var(--sidebar-bg));
  --sidebar-sub-cur: color-mix(in srgb, var(--sidebar-fg-active) 7%, var(--sidebar-active-bg));
  --text-2: #555C6B;
  --line: #DDE0E6;
  --border-soft: #F0F1F4;
  --head-bg: #FAFBFC;
  --toast-ok: var(--accent-strong);
  --toast-err: #E5484D;
  --toast-warn: #F5A524;
  --toast-inf: #1E88E5;
  --neg-bg: color-mix(in srgb, var(--neg) 9%, white);
  --warn-bg: #FFF4E0;
  --pos-bg: #E6F7F1;
  --row-hover: color-mix(in srgb, var(--bg) 40%, white);
  --row-neg: color-mix(in srgb, var(--neg) 4%, white);
  --row-warn: color-mix(in srgb, var(--warn-bg) 50%, white);
  --shadow-btn: 0 2px 8px rgba(0, 0, 0, .08);
  --shadow-tip: 0 6px 16px rgba(0, 0, 0, .2);
  --shadow-pop: 0 12px 32px rgba(17, 20, 28, .14);
  --shadow-dlg: 0 24px 60px rgba(0, 0, 0, .28);
  /* «Цены» (pages-v2.html): метка «вы» в истории смен и фон раскрытой истории. */
  --info: #0B5CAD;
  --info-bg: #E3F1FF;
  --ev-bg: color-mix(in srgb, var(--pos) 3%, white);
  /* «Экономика» (pages-v6.html): полосы «Куда уходит выручка» — удержания
     площадок (светло-красные) и расходы магазина (янтарные), дорожка полосы. */
  --flow-fee: #F08C8C;
  --flow-cost: #F5B971;
  --flow-track: #EEF0F4;
  /* «Остатки», пакетная правка (owner feedback 7): строка с правкой — лёгкий
     тон акцента (бирюза, не синий), тень плавающей панели. */
  --row-pending: color-mix(in srgb, var(--accent) 11%, white);
  --shadow-bar: 0 10px 30px rgba(17, 20, 28, .16), 0 2px 6px rgba(17, 20, 28, .08);
  /* Карточки-фильтры (owner feedback 9): включённая — лёгкий тон акцента. */
  --kpi-active-bg: color-mix(in srgb, var(--accent) 8%, white);
  /* «Экономика» (spec 2026-10-05): полоса удержания, вернувшего деньги («+»). */
  --pos-bar: color-mix(in srgb, var(--pos) 55%, white);
  /* Календарь периода (spec 2026-10-05): дни внутри выбранного периода. */
  --cal-range: color-mix(in srgb, var(--accent) 16%, white);
  /* «Заказ товара»: строка «медленного» товара — приглушённый фон. */
  --row-slow: color-mix(in srgb, var(--bg) 70%, white);
  /* «Экономика», вкладка «За 1 единицу» (spec 2026-10-07): столбцы прибыли. */
  --col-hl: color-mix(in srgb, var(--accent) 7%, white);
}

/* ---------- База ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 "Fira Sans", "Segoe UI", sans-serif;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-strong);
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

h3 {
  font-size: 14px;
  font-weight: 600;
}

.num {
  font-family: "Fira Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.pos,
.up {
  color: var(--pos);
}

.neg,
.down {
  color: var(--neg);
}

/* Текст только для экранного диктора: на экране не виден и места не занимает. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Каркас: меню слева + рабочая область (§3) ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sb-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  transition: width var(--t-menu) var(--ease);
  z-index: 5;
}

.sb-col #sidebar {
  width: var(--sb-w-col);
}

.brandbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 14px;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
}

.brandbox img {
  display: block;
  width: 88px;
  height: auto;
  transition: width var(--t-menu) var(--ease);
}

.sb-col .brandbox img {
  width: 40px;
}

.brandbox small {
  margin-top: 4px;
  font-size: 10px;
  color: var(--sidebar-dim);
  letter-spacing: .07em;
  text-transform: uppercase;
  text-align: center;
  transition: opacity .15s;
}

.sb-col .brandbox small {
  opacity: 0;
}

.nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Подсветка активного пункта «переезжает» (app.js двигает её transform-ом).
   Без JS — подсвечен сам пункт (aria-current). */
.nav-ind {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  border-radius: var(--r-ctl);
  background: var(--sidebar-active-bg);
  box-shadow: inset 3px 0 0 var(--accent);
  transition: transform var(--t-menu) var(--ease);
  z-index: 0;
  pointer-events: none;
}

.nav.has-ind .nav-ind {
  display: block;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.nav-item span {
  overflow: hidden;
  transition: opacity .15s;
}

.nav-item:hover {
  color: var(--sidebar-fg-active);
  background: var(--sidebar-hover);
}

.nav-item[aria-current="page"] {
  color: var(--sidebar-fg-active);
  font-weight: 600;
  background: var(--sidebar-active-bg);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav.has-ind .nav-item[aria-current="page"] {
  background: none;
  box-shadow: none;
}

.sb-col .nav-item span {
  opacity: 0;
  width: 0;
}

/* Подпись пункта при наведении в свёрнутом меню. */
.nav-item .tt {
  display: none;
}

.sb-col .nav-item:hover .tt,
.sb-col .nav-item:focus-visible .tt {
  display: block;
  position: fixed;
  transform: translate(46px, 0);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--on-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  box-shadow: var(--shadow-tip);
  pointer-events: none;
  z-index: 30;
}

/* ---------- Подпункты «Претензий» (owner 14.10.2026) ----------
   Раскрытое меню: под пунктом — панель своим фоном (.open: на страницах
   раздела сразу, на других — по щелчку); сам пункт — на фоне меню.
   Свёрнутое: панель всплывает у значка при наведении (или фокусе) с
   заголовком раздела; на странице раздела (.here) значок подсвечен. */
.nav-chev {
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: .7;
  transform: rotate(-90deg);
  transition: transform var(--t-menu) var(--ease), opacity .15s;
}

.nav-group.open .nav-chev {
  transform: none;
}

.nav-parent {
  width: 100%;
}

.nav-group.here .nav-parent {
  color: var(--sidebar-fg-active);
  font-weight: 600;
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
}

.nav-group.open .nav-sub {
  display: flex;
  margin: 2px 0 4px;
  padding: 4px 6px 6px;
  border-radius: 10px;
  background: var(--sidebar-sub-bg);
  box-shadow: inset 0 0 0 1px var(--sidebar-hover);
}

.nav-sub-title {
  display: none;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 32px;
  padding: 0 10px 0 36px;
  border-radius: var(--r-ctl);
  color: var(--sidebar-fg);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.nav-sub-item:hover {
  color: var(--sidebar-fg-active);
  background: var(--sidebar-hover);
}

.nav-sub-item[aria-current="page"] {
  color: var(--sidebar-fg-active);
  font-weight: 600;
  background: var(--sidebar-sub-cur);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-cnt {
  padding: 1px 6px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--sidebar-fg-active) 12%, transparent);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

.sb-col .nav-chev {
  opacity: 0;
  width: 0;
}

.sb-col .nav-group {
  position: relative;
}

.sb-col .nav-group.here .nav-parent {
  background: var(--sidebar-active-bg);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sb-col .nav-group .nav-sub,
.sb-col .nav-group.open .nav-sub {
  display: none;
}

.sb-col .nav-group:hover .nav-sub,
.sb-col .nav-group:focus-within .nav-sub {
  display: flex;
  position: absolute;
  top: -6px;
  left: calc(100% + 12px);
  z-index: 30;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  border-radius: 10px;
  background: var(--sidebar-sub-bg);
  box-shadow: inset 0 0 0 1px var(--sidebar-hover), var(--shadow-tip);
}

/* Мостик через зазор до панели — мышь не «роняет» наведение по пути. */
.sb-col .nav-group .nav-sub::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -14px;
  width: 14px;
}

.sb-col .nav-sub-title {
  display: block;
  padding: 4px 10px 6px;
  color: var(--sidebar-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sb-col .nav-sub-item {
  padding-left: 12px;
}

@media (max-width: 767px) {
  .nav-sub-item {
    height: 40px;
  }
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mode-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-active-bg);
  font-size: 11px;
  color: var(--sidebar-dim);
  white-space: nowrap;
  overflow: hidden;
}

.mode-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.mode-line span {
  transition: opacity .15s;
}

.sb-col .mode-line span {
  opacity: 0;
}

.mode-line b {
  font-weight: 600;
  color: var(--sidebar-fg);
}

.mode-line .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.dot.live {
  background: var(--accent);
}

.dot.live + span b {
  color: color-mix(in srgb, var(--accent) 70%, white);
}

.dot.dry {
  background: var(--sidebar-dim);
}

.dot.paused {
  background: var(--toast-warn);
}

.dot.blocked {
  background: var(--toast-err);
}

.mode-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.mode-badge.paused {
  background: color-mix(in srgb, var(--toast-warn) 16%, transparent);
  color: color-mix(in srgb, var(--toast-warn) 70%, white);
}

.mode-badge.blocked {
  background: color-mix(in srgb, var(--toast-err) 18%, transparent);
  color: color-mix(in srgb, var(--toast-err) 55%, white);
}

.collapse-btn {
  width: 100%;
  color: var(--sidebar-dim);
}

.collapse-btn .ic {
  transition: transform var(--t-menu) var(--ease);
}

.sb-col .collapse-btn .ic {
  transform: rotate(180deg);
}

main {
  flex: 1;
  min-width: 0;
  padding: 18px 22px 28px;
}

/* Появление страницы: подъём 8 px + прозрачность (§2.4). Заполнение —
   backwards, не both: оставшийся после анимации transform (пусть и нулевой)
   делал бы <main> опорой для position: fixed, и плавающая панель «Остатков»
   уезжала бы вниз страницы вместо низа окна. Конечный кадр и так совпадает
   с обычным видом. */
.page-enter {
  animation: page-enter var(--t-page) var(--ease) backwards;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Шапка страницы ---------- */
.page-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.page-head h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.page-head-sp {
  flex: 1;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Карточки итогов ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 11px 14px;
  min-width: 0;
  animation: page-enter .3s var(--ease) both;
}

.kpi:nth-child(2) { animation-delay: 40ms; }
.kpi:nth-child(3) { animation-delay: 80ms; }
.kpi:nth-child(4) { animation-delay: 120ms; }
.kpi:nth-child(5) { animation-delay: 160ms; }
.kpi:nth-child(6) { animation-delay: 200ms; }

/* Компактный вид (снимок 1200×800): карточки сразу на месте, без очереди. */
main.compact .kpi {
  animation: none;
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.kpi-value {
  font-size: 21px;
  font-weight: 600;
  white-space: nowrap;
}

.kpi-value.pos { color: var(--pos); }
.kpi-value.neg { color: var(--neg); }
.kpi-value.warn { color: var(--warn); }

.kpi-delta {
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 20px;
  padding: 1px 7px;
}

.kpi-delta.up {
  color: var(--pos);
  background: var(--pos-bg);
}

.kpi-delta.down {
  color: var(--neg);
  background: var(--neg-bg);
}

.kpi-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

/* Карточка-фильтр (owner feedback 9): кнопка того же вида, что карточка
   (перебивает общие `main button`: высоту, перенос, жирность); при
   наведении приподнимается, включённая — бирюзовая рамка и лёгкий тон.
   Подъём — свойством translate, а не transform: transform держит анимация
   появления карточки (page-enter, fill both) и перебила бы его. */
.kpi-filter {
  display: block;
  width: 100%;
  height: auto;
  font: inherit;
  color: inherit;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: translate .15s var(--ease), box-shadow .15s, border-color .15s, background .15s;
}

.kpi-filter:hover {
  translate: 0 -2px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-btn);
}

.kpi-filter[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--kpi-active-bg);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.kpi-filter[aria-pressed="true"]:hover {
  box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-btn);
}

.kpi-filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Карточки, панели ---------- */
/* min-width: 0 — карточка в сетке или флексе сжимается вместе с окном: иначе
   её «минимум по содержимому» (холст графика, длинная строка) держит ширину
   и выталкивает соседей за край экрана. */
.card,
.panel {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.card {
  overflow: hidden;
}

.panel {
  padding: 13px 15px;
}

.card > h2,
.card > h3,
.panel > h2,
.panel > h3,
.panel > h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--warn-bg);
  color: var(--warn);
}

.pill.pos { background: var(--pos-bg); color: var(--pos); }
.pill.neg { background: var(--neg-bg); color: var(--neg); }
.pill.muted { background: var(--bg); color: var(--muted); }

/* ---------- Таблицы (§3): белая карточка, шапка 11 px заглавными ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

main table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

main th {
  padding: 9px 12px;
  background: var(--head-bg);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

main td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

main tbody tr:last-child td {
  border-bottom: 0;
}

main tbody tr {
  transition: background .12s;
}

main tbody tr:hover {
  background: var(--row-hover);
}

main td.num,
main th.num,
main td.r,
main th.r {
  text-align: right;
  white-space: nowrap;
}

/* Сортировка по столбцу (static/app.js): заголовок — кнопка на всю подпись,
   без рамки и фона обычной кнопки; ▲/▼ — у выбранного столбца, у остальных —
   бледная ↕ как подсказка, что столбец сортируется. */
main th .th-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  /* Перенос подписи — как у самой ячейки шапки (у широких таблиц — в две строки). */
  white-space: inherit;
  cursor: pointer;
}

main th .th-sort:hover,
main th[aria-sort] .th-sort {
  color: var(--text);
  box-shadow: none;
}

main th .th-sort:active {
  transform: none;
}

main th .sort-ind {
  display: inline-block;
  min-width: 1ch;
  font-size: 9px;
  color: var(--accent-strong);
}

main th[data-sort]:not([aria-sort]) .sort-ind::after {
  content: "↕";
  color: var(--muted);
  opacity: .5;
}

main td.num {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.row-zero,
.row-neg {
  background: var(--row-neg);
}

.row-warn {
  background: var(--row-warn);
}

/* ---------- Чипсы и фильтры ---------- */
/* Выбор склада (spec 2026-10-23 §8.1): рядом с выбором периода — отделён чертой. */
.page-actions .wh-picker:has(+ .period-picker) {
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
}

/* На телефоне выбор склада и периода — разными строками: черта не нужна. */
@media (max-width: 767px) {
  .page-actions .wh-picker:has(+ .period-picker) {
    padding-right: 0;
    margin-right: 0;
    border-right: 0;
  }
}

/* Выбор магазина — слайдер (spec 2026-10-26 §6.1): перед выбором склада, отделён чертой. */
.page-actions .store-picker {
  display: flex;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
}

@media (max-width: 767px) {
  .page-actions .store-picker {
    padding-right: 0;
    margin-right: 0;
    border-right: 0;
  }
}

.store-seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--head-bg);
}

.store-seg a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s var(--ease);
}

.store-seg a:hover:not(.on) {
  color: var(--text);
}

.store-seg a.on {
  color: var(--on-color);
  font-weight: 600;
}

/* Без скрипта выбранный пункт залит сам; со скриптом заливку несёт подложка. */
.store-seg:not(.js) a.on {
  background: var(--accent-strong);
}

.store-seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 0;
  border-radius: 999px;
  background: var(--accent-strong);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--accent-strong) 45%, transparent);
}

/* Переход включает app.js после первой расстановки: первая подложка встаёт сразу. */
.store-seg.anim .store-seg-thumb {
  transition: left .28s var(--ease-spring), width .28s var(--ease-spring);
}

@media (prefers-reduced-motion: reduce) {
  .store-seg.anim .store-seg-thumb,
  .store-seg a {
    transition: none;
  }
}

.chips,
.period-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--card);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.chip:hover {
  border-color: color-mix(in srgb, var(--muted) 35%, white);
  color: var(--text);
}

.chip.on,
.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--on-color);
}

.chip .count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .75;
}

.dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  font-size: 12px;
}

.dates.on {
  border-color: var(--text);
}

.dates input[type="date"] {
  height: 24px;
  border: 0;
  padding: 0 2px;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--text);
}

/* ---------- Выбор периода: календарь (spec 2026-10-05 §1) ----------
   Кнопка — чип с подписью периода (.on — свой или подровненный период);
   панель на два месяца под ней рисует static/app.js. Начало и конец —
   заливка --accent-strong (белые цифры читаются лучше, чем на --accent),
   края скруглены наружу; дни между — светлый тон акцента без скругления,
   одной полосой; сегодня — тонкая обводка; будущие дни недоступны. Кнопки
   перебивают общие `main button` (высоту, жирность, тень при наведении).
   Прогрессивное улучшение: пока app.js не поставил .cal-ready, видна
   прежняя форма «с — по», а кнопки нет. */
.cal-pick {
  position: relative;
  display: inline-flex;
}

.period-picker:not(.cal-ready) .cal-pick,
.period-picker.cal-ready .dates {
  display: none;
}

.chip.cal-btn {
  font-weight: 400;
}

.chip.cal-btn:hover {
  box-shadow: none;
}

.cal-btn .ic {
  width: 14px;
  height: 14px;
}

.cal-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 18;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-pop);
  animation: cal-in .16s var(--ease);
}

.cal-pop[hidden] {
  display: none;
}

@keyframes cal-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.cal-months {
  display: flex;
  gap: 24px;
}

.cal-m {
  width: 252px;
}

.cal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  margin-bottom: 4px;
}

.cal-h b {
  font-size: 14px;
  font-weight: 600;
}

.cal-nav-sp,
.cal-pop .cal-nav {
  width: 32px;
  height: 32px;
}

.cal-pop .cal-nav {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 18px;
  font-weight: 400;
}

.cal-pop .cal-nav:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
}

.cal-pop .cal-nav:disabled {
  opacity: .3;
}

.cal-g {
  display: grid;
  grid-template-columns: repeat(7, 36px);
  row-gap: 2px;
}

.cal-wd {
  height: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 22px;
  text-align: center;
}

.cal-pop .cal-day {
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.cal-pop .cal-day:hover {
  box-shadow: none;
}

.cal-pop .cal-day:hover:not(:disabled) {
  background: var(--bg);
}

.cal-pop .cal-day:active {
  transform: none;
}

/* «Сегодня» — тонкая обводка, и при наведении тоже (правило ниже hover). */
.cal-pop .cal-day.today {
  box-shadow: inset 0 0 0 1px var(--muted);
}

.cal-pop .cal-day.in,
.cal-pop .cal-day.in:hover:not(:disabled) {
  border-radius: 0;
  background: var(--cal-range);
}

.cal-pop .cal-day.start,
.cal-pop .cal-day.end,
.cal-pop .cal-day.start:hover,
.cal-pop .cal-day.end:hover {
  background: var(--accent-strong);
  color: var(--on-color);
  font-weight: 600;
}

/* «Сегодня» на залитом крае — светлое кольцо внутри заливки, а не серая кайма. */
.cal-pop .cal-day.today.start,
.cal-pop .cal-day.today.end {
  box-shadow: inset 0 0 0 2px var(--accent-strong), inset 0 0 0 3px var(--card);
}

.cal-pop .cal-day.start {
  border-radius: var(--r-ctl) 0 0 var(--r-ctl);
}

.cal-pop .cal-day.end {
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}

.cal-pop .cal-day.start.end {
  border-radius: var(--r-ctl);
}

.cal-pop .cal-day:disabled {
  color: var(--muted);
  opacity: .4;
}

/* Фокус — тёмное кольцо: видно и на заливке краёв, и на светлой полосе. */
.cal-pop .cal-day:focus-visible,
.cal-pop .cal-nav:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.cal-hint {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.filters input[type="text"],
.filters input[type="search"] {
  flex: 1;
  min-width: 220px;
}

.filters label.checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ---------- Кнопки и поля ---------- */
.btn,
main button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s, border-color .15s;
}

.btn:hover,
main button:hover {
  box-shadow: var(--shadow-btn);
}

.btn:active,
main button:active {
  transform: scale(.97);
}

.btn:disabled,
main button:disabled {
  opacity: .55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-color);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent-strong) 90%, black);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  box-shadow: none;
}

.btn-sm,
main td button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}

main input[type="text"],
main input[type="number"],
main input[type="search"],
main input[type="date"],
main input:not([type]),
main select,
main textarea {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  transition: border-color .15s, box-shadow .15s;
}

main textarea {
  height: auto;
  padding: 6px 9px;
}

main input:focus,
main select:focus,
main textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

main input[type="number"] {
  font-family: var(--font-mono);
}

main input[type="file"] {
  font: inherit;
  font-size: 12.5px;
}

/* ---------- Значки площадок (макрос mp_icon) ---------- */
.mp-icon {
  display: inline-block;
  flex: none;
  border-radius: 5px;
  vertical-align: -4px;
  object-fit: cover;
}

.mp-icon-unknown {
  background: var(--border);
  font-size: 9px;
  text-align: center;
}

.mp-wordmark {
  display: block;
  height: 20px;
  width: auto;
}

/* ---------- Подсказка «?» ---------- */
.help-tip {
  position: relative;
  display: inline-flex;
}

.help-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s var(--ease), visibility .15s;
  z-index: 20;
}

.help-pop b {
  display: block;
  margin-bottom: 6px;
}

.help-pop ol {
  margin: 0;
  padding-left: 18px;
}

.help-pop li + li {
  margin-top: 4px;
}

.help-tip:hover .help-pop,
.help-tip:focus-within .help-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- Уведомления (§3): стопка справа сверху, до трёх ---------- */
.toasts {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 330px;
  max-width: calc(100vw - 28px);
  z-index: 50;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  pointer-events: auto;
  animation: toast-in 260ms var(--ease-spring) both;
}

.toast.out {
  animation: toast-out 160ms ease-in both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px) scale(.98);
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: -8px;
  }
}

.toast .ti {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  color: var(--on-color);
}

.toast .ti .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.toast .toast-body {
  flex: 1;
  min-width: 0;
}

.toast b {
  display: block;
  font-size: 13px;
}

.toast .tx {
  font-size: 12px;
  color: var(--text-2);
}

.toast .x {
  width: 22px;
  height: 22px;
  margin: -2px -4px 0 0;
  color: color-mix(in srgb, var(--muted) 70%, white);
}

.toast .x .ic {
  width: 14px;
  height: 14px;
}

.toast .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  animation: toast-bar 4s linear both;
}

@keyframes toast-bar {
  from { width: 100%; }
  to { width: 0; }
}

.toast-ok .ti, .toast-ok .bar { background: var(--toast-ok); }
.toast-err .ti, .toast-err .bar { background: var(--toast-err); }
.toast-warn .ti, .toast-warn .bar { background: var(--toast-warn); }
.toast-inf .ti, .toast-inf .bar { background: var(--toast-inf); }

/* ---------- Окно подтверждения (<dialog>, общее для всех страниц) ---------- */
dialog {
  width: 380px;
  max-width: calc(100vw - 32px);
  padding: 18px 20px;
  border: 0;
  border-radius: var(--r-dlg);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-dlg);
}

dialog[open] {
  animation: dlg-pop 220ms var(--ease-spring) both;
}

dialog::backdrop {
  background: color-mix(in srgb, var(--sidebar-bg) 42%, transparent);
  animation: dlg-fade 180ms both;
}

@keyframes dlg-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.97);
  }
}

@keyframes dlg-fade {
  from { opacity: 0; }
}

.confirm-dialog {
  width: 420px;
}

.confirm-dialog h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.confirm-dialog p {
  margin: 6px 0;
  color: var(--text-2);
  white-space: pre-line;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* Список строк окна (пакетная правка: «Артикул · Было → Станет»). */
.confirm-list {
  max-height: min(320px, 45vh);
  margin: 8px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
}

.confirm-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.confirm-list li:last-child {
  border-bottom: 0;
}

.confirm-list .cl-main {
  min-width: 0;
}

.confirm-list .cl-main small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.confirm-list .cl-value {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Плавающая панель пакетной правки («Остатки») ----------
   Компактная «пилюля» у низа окна, по центру рабочей области (правее меню:
   --sb-w раскрытое, --sb-w-col свёрнутое); fixed — видна при любой прокрутке и на
   короткой таблице. Пока она видна, у страницы запас снизу (has-batch-bar):
   последняя строка таблицы прокручивается выше панели. Появление — подъём и
   прозрачность; translate — центровка, transform — только движение. */
.batch-bar {
  position: fixed;
  bottom: 16px;
  left: calc(50% + var(--sb-w) / 2);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - var(--sb-w) - 32px);
  padding: 8px 8px 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--r-chip);
  background: var(--card);
  box-shadow: var(--shadow-bar);
  translate: -50% 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 180ms var(--ease), transform 220ms var(--ease-spring), left var(--t-menu) var(--ease);
}

.sb-col .batch-bar {
  left: calc(50% + var(--sb-w-col) / 2);
  max-width: calc(100vw - var(--sb-w-col) - 32px);
}

main.has-batch-bar {
  padding-bottom: 96px;
}

.batch-bar[hidden] {
  display: none;
}

.batch-bar.is-open {
  opacity: 1;
  transform: none;
}

.batch-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.batch-bar .btn {
  flex: none;
}

/* ---------- Скелет загрузки: один проход блика ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg) 90%, transparent), transparent);
  animation: shimmer 1.1s .05s 1 both;
}

.skeleton-row {
  height: 14px;
  margin: 14px 16px;
  border-radius: 6px;
  background: var(--bg);
}

.skeleton-row:nth-child(even) {
  width: 60%;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ---------- Скелет строк таблицы на время htmx-запроса (spec §2.4, Task 8) ----------
   `hx-indicator` на форме фильтра нацелен на `#rows-skeleton`: htmx сам вешает
   класс `.htmx-request` на индикатор и на цель подстановки (`#rows`) на время
   запроса — без своего JS. Пока идёт запрос: старые строки скрыты, скелет
   показан; вне запроса — наоборот, скелет всегда `display: none`. */
.rows-skeleton {
  display: none;
}

.rows-skeleton.htmx-request {
  display: table-row-group;
}

table tbody#rows.htmx-request {
  display: none;
}

/* «Экономика»: вторая таблица (вкладка «За 1 единицу») — по тому же запросу. */
table tbody#unit-rows.htmx-request {
  display: none;
}

/* ---------- Раскладки ---------- */
/* minmax(0, …) вместо 1fr: колонка сжимается уже своего содержимого (график,
   строка с многоточием), а не раздвигает страницу вбок. */
.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

/* Экономика (Task 5): уже 1440 px — блок выручки на всю ширину, карточки площадок под ним. */
@media (max-width: 1439px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  main {
    padding: 14px 16px 24px;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Страница «Остатки» (§5.1) ---------- */
/* Чипсы не шире строки фильтров: не влезли рядом с поиском — уходят на
   следующую строку и переносятся сами (узкое окно, телефон). */
.filters .chips {
  flex: 0 1 auto;
  min-width: 0;
}

/* Фото слева, текст справа — без переноса фото на свою строку. */
table.stocks td.product > .prod {
  display: flex;
  align-items: center;
  gap: 10px;
}

table.stocks td.product .prod img {
  margin: 0;
  flex: none;
}

table.stocks td.product small {
  display: block;
}

/* Магазин товара в «Все магазины» (spec 2026-10-26 §6.2): серым словом в строке. */
.prod small .store-tag {
  color: var(--muted);
}

.thumb-empty {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

td.shops .shop-link {
  display: inline-flex;
  margin-right: 4px;
  border-radius: 5px;
  transition: transform .12s;
}

td.shops .shop-link:hover {
  transform: translateY(-1px);
}

table.stocks td.reserved {
  cursor: help;
}

table.stocks td.available.neg {
  font-weight: 600;
}

/* Площадки одна под другой: так колонка узкая и таблица влезает в 1280 px. */
td.push .push-item {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

td.push .push-item + .push-item {
  margin-top: 3px;
}

td.push .push-item span {
  margin-right: 0;
}

td.push .push-item .ic {
  width: 13px;
  height: 13px;
}

/* Окно проверки файла: шире общего окна подтверждения, таблица прокручивается внутри. */
dialog.upload-dialog {
  width: 600px;
}

.upload-modal h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.upload-file {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.upload-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.upload-sum span {
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 12px;
}

.upload-sum b {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
}

.upload-sum span.neg,
.upload-sum span.neg b {
  background: var(--neg-bg);
  color: var(--neg);
}

.upload-scroll {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
}

.upload-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.upload-table td.article b {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.upload-table td.article small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.upload-table td.article small.warn-note {
  color: var(--warn);
}

.upload-show-all {
  margin-top: 6px;
}

.upload-note {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
}

.upload-note.neg {
  color: var(--neg);
}

.upload-warnings {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--warn);
  font-size: 12.5px;
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* «Себестоимость из счёта» на «Ценах» (spec 2026-10-20-cost-invoice): окно
   шире — семь столбцов; таблица на телефоне прокручивается вбок внутри окна. */
dialog.cost-dialog {
  width: min(860px, calc(100vw - 32px));
}

.cost-dialog .upload-scroll {
  max-height: min(460px, 60vh);
  overflow: auto;
}

.cost-table {
  min-width: 720px;
}

.cost-table th.c,
.cost-table td.c {
  width: 32px;
  text-align: center;
}

.cost-table td.num {
  white-space: nowrap;
}

.upload-table.cost-table td.article small.bc {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Строка, где нужно решение человека: подсвечена, пока не вписана кратность. */
.cost-table tr.decide td {
  background: var(--warn-bg);
}

.cost-table tr.off td:not(.c),
.cost-table tr.off td.article b {
  color: var(--muted);
}

.cost-table .k {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

main .cost-table .k input {
  width: 44px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

main .cost-table .k input::-webkit-inner-spin-button,
main .cost-table .k input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.upload-sum span.warn,
.upload-sum span.warn b {
  background: var(--warn-bg);
  color: var(--warn);
}

/* «Приход по счёту поставщика» на «Остатках» (owner 10.11.2026): то же окно,
   что у себестоимости; «Приход» — поле, его можно поправить (пришло не всё). */
main .cost-table input.ri-q {
  width: 64px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

main .cost-table input.ri-q::-webkit-inner-spin-button,
main .cost-table input.ri-q::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.drawer-note.drawer-lead {
  margin: 0 0 8px;
}

/* ---------- Страница «Цены» (§5.2) ---------- */
table.prices td.product > .prod {
  display: flex;
  align-items: center;
  gap: 10px;
}

table.prices td.product .prod img {
  margin: 0;
  flex: none;
}

table.prices td.product small {
  display: block;
}

/* Ссылки на карточки площадок — значками в строке ШК (отдельного столбца нет:
   таблица должна влезать в 1440 px). */
table.prices td.product .bc-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

table.prices .bc-line .shop-link {
  display: inline-flex;
  border-radius: 5px;
}

/* Значок — 16 px, а не размер фото товара (td.product img). */
table.prices td.product .bc-line img.mp-icon {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
}

/* Заголовки в две строки и поля поуже — таблица влезает в 1280 px без прокрутки. */
table.prices th {
  white-space: normal;
  vertical-align: bottom;
}

main table.prices > thead > tr > th,
main table.prices > tbody > tr > td {
  padding-left: 6px;
  padding-right: 6px;
}

/* Строки товаров — по верхнему краю: короткое «нет данных» в «WB» не висит
   посередине рядом с многострочной ячейкой «Ozon», столбцы ровные. */
main table.prices > tbody > tr[data-toggle-history] > td {
  vertical-align: top;
}

/* Нажатие в свободном месте строки раскрывает подстроку — историю смен на
   «Ценах», продажи по площадкам на «Оборачиваемости» (app.js, agentRowToggle);
   поля ввода, кнопки и ссылки внутри строки работают как обычно. */
table.prices tr[data-toggle-history],
table.turnover tr[data-toggle-history] {
  cursor: pointer;
}

main table.prices > tbody > tr[data-toggle-history]:hover,
main table.turnover > tbody > tr[data-toggle-history]:hover {
  background: var(--row-hover);
}

table.prices tr[data-toggle-history] input,
table.turnover tr[data-toggle-history] input {
  cursor: text;
}

main table.prices td.min-price input[name="value"] {
  width: 60px;
}

table.prices td.product {
  min-width: 176px;
}

/* Артикул — кнопка раскрытия истории: ссылка-пунктир, как в макете, а не кнопка-плашка. */
/* Составной артикул набора («42242000_37119000_…») переносится, а не
   раздвигает столбец товара на полэкрана. */
main td .art-toggle {
  position: relative;
  display: flex;
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  align-items: center;
  gap: 4px;
  height: auto;
  margin: 1px 0;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--pos) 45%, white);
  border-radius: 0;
  background: none;
  color: var(--pos);
  font-size: 11.5px;
  font-weight: 600;
}

main td .art-toggle:hover {
  box-shadow: none;
  border-bottom-style: solid;
}

.art-toggle .chev {
  display: inline-block;
  font-size: 10px;
  transition: transform .15s var(--ease);
}

.art-toggle[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

table.prices td.num small,
table.prices td.idx small {
  display: block;
  font-family: var(--font);
  font-size: 11.5px;
  white-space: normal;
}

/* Две цены площадки (owner feedback 10): сверху — цена продавца обычным
   цветом, ниже серым и мельче — цена покупателя, подпись ещё тише. */
table.prices td.num .price-top {
  display: block;
  color: var(--text);
}

table.prices td.num small.price-buyer {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

/* Подпись — перед ценой, одной строкой, без дня продажи (owner feedback 14):
   «с СПП 6 150 ₽», «с баллами 7 390 ₽». */
table.prices td.num small.price-buyer {
  white-space: nowrap;
}

table.prices td.num small.price-buyer > span {
  font-family: var(--font);
  font-size: 10.5px;
}

/* «Остаток» (owner feedback 14): узкий столбец — крупно остаток МСК, ниже
   мелко FBO; подсказка — в стиле .help-pop, справа от числа, по наведению и
   фокусу (как .help-tip). Кнопка без рамки: это число, а не действие. */
table.prices td.stock {
  width: 1%;
}

.stk-tip {
  position: relative;
  display: inline-flex;
}

main td .stk-btn {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: help;
}

main td .stk-btn:hover {
  box-shadow: none;
}

main td .stk-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main td .stk-btn.stk-zero,
.stk-zero {
  color: var(--neg);
}

table.prices td.num small.stk-fbo {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.stk-pop {
  top: 50%;
  right: auto;
  left: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: max-content;
  max-width: 320px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  translate: 0 -50%;
}

.stk-tip:hover .stk-pop,
.stk-tip:focus-within .stk-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Телефон: справа от числа подсказку обрезал бы край карточки (.table-wrap
   прокручивается) — она открывается под числом, к левому краю, с переносом
   строк; поверх закреплённого столбца товара (у него z-index 1). */
@media (max-width: 767px) {
  .stk-pop {
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    width: 210px;
    white-space: normal;
    translate: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stk-pop {
    transition: none;
  }
}

table.prices td.warn-cell {
  color: var(--warn);
  font-weight: 600;
}

/* «было → стало» переносится после стрелки: столбец не шире суммы. */
table.prices td.last-change {
  min-width: 120px;
  white-space: normal;
}

.ev-table .unconfirmed {
  margin-left: 4px;
  font-size: 11px;
  cursor: help;
}

td.last-change .lc-price {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

td.last-change small {
  display: block;
  max-width: 200px;
  font-size: 11.5px;
  white-space: normal;
}

table.prices td.orders-after {
  font-weight: 700;
}

/* Новые цены WB и Ozon — одна ячейка, поля друг под другом со значком площадки. */
td.new-price .np-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

td.new-price .np-line + .np-line {
  margin-top: 4px;
}

main td.new-price input {
  width: 84px;
  text-align: right;
}

/* Раскрытая история: строка на всю ширину с лёгкой подкраской. */
main tbody tr.ev-row,
main tbody tr.ev-row:hover {
  background: var(--ev-bg);
}

main tr.ev-row > td {
  padding: 0;
}

.ev-in {
  padding: 10px 14px 12px 46px;
}

main table.ev-table {
  width: auto;
  min-width: 640px;
}

.ev-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

main .ev-table th {
  padding: 2px 16px 6px 0;
  background: none;
  border: 0;
  font-size: 10.5px;
}

main .ev-table td {
  padding: 4px 16px 4px 0;
  border: 0;
  white-space: nowrap;
}

main .ev-table tbody tr:hover {
  background: none;
}

.ev-table td.ev-at,
.ev-table td.ev-price {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.ev-table td.ev-orders b {
  font-family: var(--font-mono);
  margin-right: 4px;
}

.ev-table td.ev-orders .muted {
  font-size: 11.5px;
}

.who {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.who-web,
.who-file {
  background: var(--info-bg);
  color: var(--info);
}

.who-marketplace {
  background: var(--warn-bg);
  color: var(--warn);
}

.ev-note {
  max-width: 760px;
  margin: 8px 0 6px;
  font-size: 11.5px;
}

.ev-snaps:not(:empty) {
  margin-top: 8px;
}

.price-edit-note .hint {
  margin: 0 0 10px;
}

.price-editor {
  margin-bottom: 12px;
}

.price-editor .apply-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ---------- Без движения по желанию системы ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  *::backdrop {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   Страницы в прежней разметке. Общие таблицы/поля/кнопки выше уже в новом
   стиле; здесь только то, что нужно их собственной раскладке. Следующие
   задачи редизайна переводят страницы на компоненты и убирают свои правила.
   ===================================================================== */

/* Широкие таблицы прокручиваются внутри карточки, а не ломают страницу.
   Нижняя граница ширины — чуть меньше рабочей области при 1280 px с
   раскрытым меню (≈ 1030 px): там таблица ещё целиком, уже — прокрутка
   внутри .table-wrap, а столбцы не сминаются в кашу. */
table.stocks { min-width: 960px; }
table.journal { min-width: 900px; }
table.prices { min-width: 960px; }
table.turnover { min-width: 900px; }

/* Подписи шапки широких таблиц переносятся в две строки, когда тесно. */
table.stocks th,
table.turnover th,
table.econ th {
  white-space: normal;
  vertical-align: bottom;
}

/* Подробные итоги Экономики — 12 столбцов сумм: отступы и цифры чуть меньше,
   чтобы таблица влезала в 1280 px. */
main table.econ.totals > * > tr > * {
  padding-left: 6px;
  padding-right: 6px;
}

main table.econ.totals td.num {
  font-size: 12px;
}

main table.stocks > thead > tr > th,
main table.stocks > tbody > tr > td {
  padding-left: 8px;
  padding-right: 8px;
}

table.stocks th,
table.journal th,
table.prices th,
table.turnover th,
table.econ th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* «Оборачиваемость»: таблица влезает в 1440–1920 px без прокрутки, строки —
   одной высоты: название в одну строку с многоточием (полное — в подсказке),
   значки карточек — своим узким столбцом, числа — вправо, моноширинные. */
main table.turnover > thead > tr > th,
main table.turnover > tbody > tr > td {
  padding-left: 8px;
  padding-right: 8px;
  vertical-align: middle;
}

table.turnover td.product {
  min-width: 0;
}

table.turnover td.product > .tv-prod {
  display: block;
  max-width: clamp(180px, 17vw, 420px);
}

table.turnover .tv-prod b,
table.turnover .tv-prod small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 1280 px с раскрытым меню: название уже, отступы ячеек меньше — таблица
   целиком, без прокрутки вбок. */
@media (max-width: 1365px) {
  table.turnover td.product > .tv-prod {
    max-width: clamp(150px, 12vw, 420px);
  }

  main table.turnover > thead > tr > th,
  main table.turnover > tbody > tr > td {
    padding-left: 6px;
    padding-right: 6px;
  }
}

table.turnover td.cards {
  width: 1%;
  white-space: nowrap;
}

table.turnover td.cards .shop-link {
  display: inline-flex;
  vertical-align: middle;
  border-radius: 4px;
}

table.turnover td.cards .shop-link + .shop-link {
  margin-left: 6px;
}

table.turnover td.advice,
table.turnover td.abc {
  white-space: nowrap;
}

table.turnover td.abc .abc-cell {
  flex-wrap: nowrap;
  gap: 8px;
}

table.turnover td.lead-time form,
table.turnover td.target-days form {
  display: flex;
  align-items: center;
  gap: 4px;
}

main table.turnover td.lead-time input,
main table.turnover td.target-days input {
  width: 52px;
  text-align: right;
}

/* Оборачиваемость: ABC общий/WB/Ozon с иконками площадок в одной ячейке. */
.abc-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.abc-cell .abc-mp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

/* Остатки */
td.product {
  min-width: 220px;
}

td.product > div {
  display: inline-block;
  vertical-align: middle;
}

td.product img {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
}

td.product b {
  font-weight: 600;
}

td.product small {
  color: var(--muted);
  font-size: 11.5px;
}

/* Составной артикул набора и длинный ШК переносятся где угодно — иначе одна
   такая строка задаёт ширину всего столбца товара. */
td.product b,
td.product small {
  overflow-wrap: anywhere;
}

/* Пара WB–Ozon по артикулу: общего ШК нет, подсказка — ШК карточки WB. */
td.product .pair {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

td.product .warn {
  color: var(--warn);
  font-weight: 400;
}

td.shops {
  white-space: nowrap;
}

td.edit form,
td.min-price form {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* «Править» (пакетная правка): поле +N / −N / N и «→ станет» рядом. */
td.edit .adj {
  display: flex;
  align-items: center;
  gap: 6px;
}

main td.edit .adj-input {
  width: 72px;
  text-align: right;
  font-family: var(--font-mono);
}

main td.edit .adj-input.invalid {
  border-color: var(--neg);
}

td.edit .adj-after {
  min-width: 4ch;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  white-space: nowrap;
}

td.edit .err {
  max-width: 180px;
}

main tbody tr.row-pending,
main tbody tr.row-pending:hover {
  background: var(--row-pending);
}
main td.min-price input[name="value"] { width: 80px; }

td.muted {
  color: var(--muted);
}

td.push {
  font-size: 12px;
  white-space: nowrap;
}

td.push span {
  display: inline-block;
  margin-right: 8px;
}

td.push span.ok { color: var(--pos); }
td.push span.fail { color: var(--neg); }
td.push span.none { color: var(--muted); }
td.taken { white-space: nowrap; }

tr.row-red,
tr.urgent {
  background: var(--row-neg);
}

tr.row-yellow {
  background: var(--row-warn);
}

/* Текст отказа правки (4xx) под формой строки. */
.err {
  display: block;
  color: var(--neg);
  font-size: 11.5px;
}

.warn {
  color: var(--neg);
  font-weight: 600;
}

.hint {
  color: var(--text-2);
  font-size: 12.5px;
}

.warn-note,
ul.coverage li.warn-note {
  color: var(--warn);
}

/* Журнал: вкладки и пагинация */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tabs a {
  padding: 6px 10px 10px;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

table.journal td.ok { color: var(--pos); }
table.journal td.fail { color: var(--neg); }

.pager {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.pager a {
  color: var(--text);
}

/* Загрузки */
section.upload {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

section.upload h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

section.upload form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.report.ok { color: var(--pos); }
.report.fail { color: var(--neg); }

table.errors,
table.preview {
  width: auto;
  min-width: 0;
}

table.preview {
  margin-bottom: 8px;
}

table.preview td.warn,
table.warnings td {
  color: var(--warn);
  font-weight: 400;
}

/* Цены: индекс цен Ozon */
.idx-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--muted);
  color: var(--on-color);
  font-size: 11px;
  font-weight: 600;
}

.idx-SUPER { background: var(--pos); }
.idx-GREEN { background: var(--accent-strong); }
.idx-YELLOW { background: var(--toast-warn); color: var(--text); }
.idx-RED { background: var(--neg); }

/* ---------- Страница «Дашборд» (§5.4, Task 6) ---------- */
/* Шесть карточек — 3 × 2, как в макете (pages-v4): у каждой разбивка ниже. */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.dash-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
}

/* «Скачать» в правом нижнем углу карточки (owner feedback 8); подпись под
   числом не заходит под значок. */
.dash-kpi.has-dl {
  position: relative;
}

.dash-kpi.has-dl .kpi-sub {
  padding-right: 30px;
}

.kpi-dl {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
}

.kpi-dl:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.kpi-head {
  display: flex;
  align-self: stretch;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dash-kpi .kpi-label {
  flex: none;
  font-size: 12px;
}

.kpi-note {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-kpi .kpi-value {
  margin: 2px 0;
  font-size: 24px;
}

.kpi-delta small {
  font-size: 11px;
  font-weight: 500;
}

/* «—»: за прошлый период данных нет; и подпись маржи — без цвета «лучше/хуже». */
.kpi-delta.none,
.kpi-delta.zero {
  color: var(--muted);
  background: var(--head-bg);
}

.kpi-split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: stretch;
  gap: 4px 14px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  color: var(--text-2);
  font-size: 12px;
}

.kpi-split > span {
  white-space: nowrap;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

/* Шапка панели графика: заголовок и итог слева, площадки или ссылка справа. */
.chart-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.chart-head .sp {
  flex: 1;
}

.chart-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.chart-total b {
  font-size: 22px;
  font-weight: 600;
}

.series {
  display: flex;
  gap: 8px;
}

.series-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.series-box small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.series-box b {
  font-size: 15px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11.5px;
}

.legend b {
  margin-left: 2px;
  color: var(--text);
}

.link-more {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.link-more:hover {
  text-decoration: underline;
}

/* Chart.js меряет размер по позиционированному родителю: без него canvas и
   контейнер меряют друг друга по кругу, и высота растёт. Высота — от CSS,
   ширина — от колонки: min-width: 0, чтобы родитель сжимался вместе с окном
   (и меню), а ResizeObserver Chart.js перерисовывал график и уже, и шире.
   Класс chart-wrap — у каждого родителя <canvas> (тест test_responsive.py). */
.chart-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 220px;
  /* Пока Chart.js не перерисовал холст под новую ширину (кадр-другой после
     сворачивания меню), старый холст не вылезает за карточку. */
  overflow: hidden;
}

.chart-wrap.chart-orders {
  height: 260px;
}

.dash-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}

.dash-list > div:last-child {
  border-bottom: 0;
}

.dash-list .truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-list b {
  font-weight: 600;
  white-space: nowrap;
}

/* Топ-5 (spec 2026-10-05 §2): «название … | 14 шт | 97 440 ₽» — название
   занимает остаток и обрезается многоточием, штуки и выручка не переносятся. */
.dash-list .top-row .truncate {
  flex: 1;
}

.top-units {
  flex: none;
  white-space: nowrap;
}

/* Выручка — не уже «172 500 ₽»: штуки соседних строк стоят столбиком. */
.dash-list .top-row b {
  min-width: 9ch;
  text-align: right;
}

@media (max-width: 1100px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .dash-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-head {
    flex-wrap: wrap;
  }
}

/* compact=1 (снимок «Сводки» для Telegram): без меню, ровно 1200×800 без
   прокрутки. Шапка и карточки — своей высоты, график забирает остаток. */
main.compact {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 1200px;
  height: 800px;
  margin: 0 auto;
  padding: 20px 26px;
  overflow: hidden;
  animation: none;
}

.shot-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
}

.shot-head img {
  width: auto;
  height: 40px;
}

.shot-title {
  font-size: 20px;
  font-weight: 600;
}

.shot-period {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

main.compact .dash-kpis {
  flex: none;
  margin: 0;
}

main.compact .kpi-sub,
main.compact .kpi-split {
  flex-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-chart {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.shot-chart .chart-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}


/* ---------- Страница «Экономика» (§5.5, Task 5) ---------- */
.coverage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 12px;
  padding: 0;
  list-style: none;
}

.coverage-pills .pill {
  font-weight: 500;
}

.coverage-pills .aligned-note {
  font-weight: 600;
  cursor: help;
}

/* Полосы: подпись / дорожка / сумма / доля (как в макете, 132px 1fr 104px 46px). */
.wf {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-l {
  display: grid;
  grid-template-columns: 150px 1fr 112px 52px;
  gap: 8px;
  align-items: center;
}

.wf-track {
  position: relative;
  height: 14px;
  border-radius: 4px;
  background: var(--flow-track);
}

.wf-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  max-width: 100%;
  border-radius: 4px;
  background: var(--flow-cost);
}

.wf-revenue .wf-track i { background: var(--accent); }
.wf-fee .wf-track i { background: var(--flow-fee); }
.wf-net .wf-track i { background: var(--accent-strong); }
.wf-net.wf-loss .wf-track i { background: var(--neg); }

.wf-v,
.wf-p {
  text-align: right;
  white-space: nowrap;
}

.wf-p,
.mp-card .p {
  color: var(--muted);
  font-size: 11.5px;
}

.wf-p.pos,
.mp-card .p.pos { color: var(--pos); font-weight: 600; }
.wf-p.neg,
.mp-card .p.neg { color: var(--neg); font-weight: 600; }

/* Карточки площадок: цветная верхняя граница, надпись-логотип, строки «сумма ₽ · %». */
.mp-card {
  border-top: 3px solid var(--border);
}

.mp-card-wb { border-top-color: var(--wb); }
.mp-card-ozon { border-top-color: var(--ozon); }

.mp-card-head {
  display: flex;
  align-items: center;
  height: 24px;
  margin-bottom: 4px;
}

.mp-card-head .mp-wordmark {
  height: 18px;
}

.mp-share {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.mrow {
  display: grid;
  grid-template-columns: 1fr auto 48px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}

.mrow .num,
.mrow .p {
  text-align: right;
  white-space: nowrap;
}

.mrow.tot {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--border-soft);
  font-weight: 700;
}

.mp-empty {
  margin: 8px 0 0;
}

/* Кредит Ozon (spec 2026-10-06): удержано и «Прибыль после кредита» — отдельная
   подложка под «Прибылью» карточки; подложка темнее карточки (фон страницы). */
.mp-loan {
  margin-top: 12px;
  padding: 6px 12px 10px;
  border-radius: var(--r-ctl);
  background: var(--bg);
}

.mp-loan .mrow.tot {
  border-top-color: var(--border);
}

.mp-loan-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

/* WB по дням (spec 2026-10-04-wb-daily): пометка справа в шапке карточки,
   пояснение внизу и мелкая пометка у суммы строки товара — приглушённо. */
.mp-card-head .mp-daily {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.mp-daily-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.daily-mark {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
  white-space: nowrap;
}

/* «Экономика» (spec 2026-10-05 §2–§3): сумма с пунктиром — кнопка окна с
   расшифровкой; окно — под строкой внутри своей карточки, на всю её ширину
   (у плитки «Выручка» — шире плитки, но не шире экрана), язык панели
   календаря: рамка, тень --shadow-pop, радиус --r-dlg. Открытая карточка
   поднимается над соседями (.pop-open): у карточек своё наложение после
   анимации появления, и окно иначе ушло бы под соседнюю карточку. */
.pop-host {
  position: relative;
}

.pop-host.pop-open {
  z-index: 20;
}

main .pop-btn {
  display: inline;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline dashed currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
  transition: none;
}

main .pop-btn.neg {
  color: var(--neg);
}

main .pop-btn.pos {
  color: var(--pos);
}

main .pop-btn:hover,
main .pop-btn[aria-expanded="true"] {
  text-decoration-style: solid;
  box-shadow: none;
}

main .pop-btn:active {
  transform: none;
}

main .pop-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mrow .pop-btn {
  justify-self: end;
}

.econ-pop {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 18;
  padding: 12px 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-dlg);
  background: var(--card);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  animation: cal-in .16s var(--ease);
}

.econ-pop[hidden] {
  display: none;
}

.econ-pop:focus {
  outline: none;
}

.kpi .econ-pop {
  left: 0;
  right: auto;
  width: min(380px, calc(100vw - 32px));
}

.econ-pop-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.econ-pop-h b {
  font-size: 13px;
  font-weight: 600;
}

main .econ-pop-x {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

main .econ-pop-x:hover {
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
}

.pop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 4px 0;
}

.pop-row .num {
  text-align: right;
  white-space: nowrap;
}

.pop-note {
  margin: -3px 0 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.pop-row.pop-tot {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--border-soft);
  font-weight: 700;
}

/* «К перечислению» — строка-разделитель карточки площадки. */
.mrow.sub {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  font-weight: 600;
}

/* Удержание, вернувшее деньги («+»: комиссия с учётом СПП и баллов) — зелёная полоса. */
.wf-gain .wf-track i {
  background: var(--pos-bar);
}

@media (prefers-reduced-motion: reduce) {
  .econ-pop {
    animation: none;
  }
}

@media (max-width: 767px) {
  /* Касание ≥ 40 px и окно во всю ширину карточки. */
  main .econ-pop-x {
    width: 40px;
    height: 40px;
  }

  main .pop-btn {
    display: inline-block;
    min-height: 40px;
    padding: 10px 0;
  }

  .econ-pop {
    left: 0;
    right: 0;
  }

  .kpi .econ-pop {
    right: 0;
    width: auto;
  }
}

/* Кольцо доли выручки: Chart.js меряет размер по позиционированному родителю. */
.donut-box {
  position: relative;
  height: 220px;
}

/* Кольцо со сводкой площадок справа (owner feedback 12, утверждённый
   макет; макрос donut_share): панель — колонкой, блок кольца занимает
   остаток высоты и центрирует кольцо и сводку по вертикали — без пустого
   прямоугольника под кольцом, когда соседняя панель выше. Холст 230×230:
   поле под выезд наведённого сегмента задаёт charts.js (layout.padding). */
.donut-panel {
  display: flex;
  flex-direction: column;
}

.donut-share {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 340px);
  gap: 16px;
  align-items: center;
  align-content: center;
  /* На широком экране кольцо и сводка — группой по центру, а не сводка,
     растянутая до правого края. */
  justify-content: center;
}

.donut-share .donut-box {
  width: 230px;
  height: 230px;
}

.share-sum {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Строка площадки: полоса слева — цвет её доли в кольце. Без подсветки
   при наведении (владелец отказался). */
.share-row {
  display: grid;
  gap: 2px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--muted);
}

.share-row.share-wb {
  border-left-color: var(--wb);
}

.share-row.share-ozon {
  border-left-color: var(--ozon);
}

.share-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
}

.share-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Сумма и сразу за ней доля — одной строкой. */
.share-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
}

/* Цифры — текстовым шрифтом с моноширинными цифрами (tabular-nums), а не
   Fira Code: у узкой сводки дашборда (≈ 170 px при 1440) сумма и доля в
   моноширинном шрифте не помещались в одну строку. */
.share-rev,
.share-pct {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.share-rev {
  font-size: 20px;
  font-weight: 500;
}

.share-pct {
  color: var(--muted);
  font-size: 13px;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  color: var(--muted);
}

.share-meta > span {
  white-space: nowrap;
}

.share-meta > span + span::before {
  content: "·";
  margin-right: 6px;
}

.share-muted .share-name,
.share-muted .share-rev {
  color: var(--muted);
}

@media (max-width: 900px) {
  .donut-share {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: center;
  }

  .share-sum {
    width: 100%;
  }
}

/* Кольцо уже, каналы шире; minmax(0, …) — таблица каналов прокручивается
   внутри своей панели, а не раздвигает страницу. */
.econ-lower {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

@media (max-width: 900px) {
  .econ-lower {
    grid-template-columns: minmax(0, 1fr);
  }
}

.channels-scroll {
  overflow-x: auto;
}

.econ-lower .channels .mp-icon,
table.econ.channels .mp-icon {
  margin-right: 4px;
}

.econ-lower .channels .hint {
  margin: 10px 0 0;
  font-size: 11.5px;
}

.section-h {
  margin: 4px 0 10px;
  font-size: 15px;
}

.chip .mp-icon {
  border-radius: 4px;
  vertical-align: middle;
}

/* Влезает в 1280 px без прокрутки; уже — прокрутка внутри карточки. */
table.econ.products {
  min-width: 960px;
}

table.econ.products td.product .prod {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

table.econ.products td.product .bc-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

table.econ.products .shop-link {
  display: inline-flex;
}

/* Значок ссылки — 16 px, а не размер фото товара (td.product img). */
table.econ.products td.product .bc-line img.mp-icon {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
}

/* Маржа на единицу: WB и Ozon друг под другом, три выровненные колонки —
   значок / сумма ₽ / % от цены (сетка 18px auto 48px, как в макете v6).
   У суммы — нижняя граница ширины: значки стоят на одной вертикали и в
   ячейке, и во всех строках таблицы (ячейка выровнена вправо). */
.unit-margin {
  display: inline-grid;
  grid-template-columns: 18px minmax(80px, auto) 48px;
  column-gap: 6px;
  row-gap: 4px;
  align-items: center;
  justify-items: end;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.unit-margin .mp-icon {
  justify-self: start;
  vertical-align: 0;
}

.unit-margin .um-val {
  white-space: nowrap;
  cursor: help;
}

.unit-margin .um-pc {
  color: var(--muted);
  font-family: var(--font);
  font-size: 11.5px;
  white-space: nowrap;
}

.unit-margin .um-reason {
  grid-column: span 2;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11.5px;
  white-space: nowrap;
}

/* ---------- «Экономика»: вкладка «За 1 единицу» (spec 2026-10-07) ----------
   Переключатель вкладок над таблицей товаров (role tablist/tab) и таблица на
   1 шт: 13 столбцов — отступы и цифры чуть меньше (как у подробных итогов),
   влезает в 1440 px; уже — прокрутка внутри .table-wrap. Столбцы «Прибыль товара» и
   «Прибыль с расходами» — жирно, с лёгкой подложкой. Цвета — только токены. */
.econ-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 12px;
  border-bottom: 1px solid var(--border);
}

.econ-tabs [role="tab"] {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 6px 10px 10px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.econ-tabs [role="tab"]:hover {
  color: var(--text);
}

.econ-tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.econ-tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-ctl) var(--r-ctl) 0 0;
}

[role="tabpanel"][hidden] {
  display: none;
}

table.econ.products.unit {
  min-width: 1100px;
}

main table.econ.products.unit > * > tr > * {
  padding-left: 5px;
  padding-right: 5px;
}

main table.econ.products.unit td.num {
  font-size: 12px;
  white-space: nowrap;
}

/* Ширины подобраны, чтобы таблица влезала в 1440 px без прокрутки. */
table.econ.products.unit td.product {
  min-width: 160px;
  max-width: 200px;
}


/* Одна строка на товар (вариант Б): значения площадок — подстроки `.ul`
   одной высоты, ячейки прижаты к низу — подстроки всех ячеек стоят на
   одной линии со значками площадок под названием товара. Подстрока
   заходит на поля ячейки, чтобы подкраска убытка шла сплошной полосой. */
main table.econ.products.unit > tbody > tr > td {
  vertical-align: bottom;
}

/* position: relative — скрытое имя площадки (.vh, absolute) остаётся внутри
   подстроки и прокрутки таблицы, а не раздвигает страницу на телефоне. */
table.econ.products.unit .ul {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 24px;
  margin: 0 -5px;
  padding: 0 5px;
  white-space: nowrap;
}

table.econ.products.unit .ul + .ul {
  border-top: 1px dashed var(--border-soft);
}

table.econ.products.unit td.product .ul {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
}

table.econ.products.unit td.product .prod + .ul {
  margin-top: 4px;
}

/* Убыточная площадка (по «Прибыли с расходами») — только её подстрока:
   лёгкий фон и тонкая полоса слева у значка. */
table.econ.products.unit .ul-loss {
  background: var(--row-neg);
}

table.econ.products.unit td.product .ul-loss {
  box-shadow: inset 2px 0 0 var(--neg);
}

/* Значок площадки — 16 px, а не размер фото товара (td.product img), и
   виден на телефоне, где фото товара прячутся. */
table.econ.products.unit td.product .ul > span[aria-hidden] {
  display: inline-flex;
}

table.econ.products.unit td.product .ul img.mp-icon {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
}

/* «Маржа на ед. сейчас» — как ячейка вкладки «Всего» (.unit-margin): сумма
   моноширинным 12,5 px, % от цены и причина — основным шрифтом 11,5 px. */
table.econ.products.unit td.um-lines .um-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: help;
}

table.econ.products.unit td.um-lines .um-pc,
table.econ.products.unit td.um-lines .um-reason {
  color: var(--muted);
  font-family: var(--font);
  font-size: 11.5px;
}

table.econ.products.unit td.um-lines .um-pc {
  min-width: 44px;
  text-align: right;
}

table.econ.products.unit .hl {
  background: var(--col-hl);
  font-weight: 600;
}

/* ---------- конец вкладки «За 1 единицу» ---------- */

/* Подробные итоги (прежняя таблица) — раскрываются по клику. */
.econ-details {
  margin: 14px 0 8px;
}

.econ-details > summary {
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
  padding: 6px 0;
}

.econ-details > .table-wrap {
  margin-top: 6px;
}

table.econ tr.subtotal td,
table.econ tr.net td {
  border-top: 2px solid var(--border);
  font-weight: 600;
}

main table.econ tr.detail td {
  padding-top: 3px;
  padding-bottom: 3px;
  color: var(--muted);
}

table.econ tr.pending td {
  background: var(--row-warn);
}

.footnotes {
  color: var(--text-2);
  font-size: 12px;
}

.footnotes p {
  margin: 4px 0;
}

/* =====================================================================
   Адаптивность: от 1920 px до телефона 390 px.
   Точки перелома (в media-запросах переменные CSS не работают — значения
   повторены числами, здесь они собраны в одном месте):
     1440 px — Экономика: полосы и карточки площадок в один ряд (выше);
     1200 px — меню по умолчанию свёрнуто до значков (base.html, app.js);
     1100 px — Дашборд: карточки 3 → 2 в ряд, графики друг под другом;
      900 px — планшет: карточки-панели в одну колонку, действия шапки
               страницы — строкой под заголовком;
      768 px — телефон (< 768): меню — выдвижная панель из тонкой шапки,
               карточки итогов по одной в ряд, касание ≥ 40 px, широкие
               таблицы прокручиваются внутри своей карточки с первым
               столбцом на месте.
   compact=1 (снимок 1200×800) — без меню и шапки телефона; правила ниже
   его не трогают: 1200 px не попадает ни в один max-width здесь.
   ===================================================================== */

/* Таблицы в частичках (проверка цен, отчёт о файле, история цены) — без
   карточки, но тоже прокручиваются вбок внутри себя, а не всей страницей. */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

/* Тонкая шапка, кнопка «×» в меню и затемнение — только на телефоне. */
.topbar,
.sb-close,
.sb-backdrop {
  display: none;
}

/* Дашборд и Экономика: панели графиков — не шире колонки. */
.dash-grid > *,
.grid-2 > *,
.grid-3 > * {
  min-width: 0;
}

@media (max-width: 1199px) {
  /* Кольцо и таблица каналов: рядом таблице тесно — друг под другом. */
  .econ-lower {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  /* Действия шапки страницы (кнопки, выбор периода) — строкой под заголовком. */
  .page-head-sp {
    display: none;
  }

  .page-actions {
    flex: 1 1 100%;
  }

  .filters .chips {
    flex: 1 1 100%;
  }
}

@media (max-width: 767px) {
  /* ---------- Каркас: шапка с кнопкой меню, меню — выдвижная панель ---------- */
  .app {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 12px 0 6px;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg-active);
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-ctl);
    background: none;
    color: inherit;
    cursor: pointer;
  }

  .menu-btn:hover {
    background: var(--sidebar-hover);
  }

  .menu-btn .ic {
    width: 22px;
    height: 22px;
  }

  .topbar-brand {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .topbar-brand img {
    display: block;
    width: 64px;
    height: auto;
  }

  .topbar-title {
    margin-left: auto;
    overflow: hidden;
    color: var(--sidebar-fg);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #sidebar,
  .sb-col #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, 85vw);
    height: auto;
    padding-top: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--t-menu) var(--ease), visibility 0s linear var(--t-menu);
    z-index: 40;
  }

  .sb-open #sidebar {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-dlg);
    transition: transform var(--t-menu) var(--ease);
  }

  .sb-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: color-mix(in srgb, var(--sidebar-bg) 42%, transparent);
    animation: dlg-fade 180ms both;
  }

  .sb-close {
    display: inline-flex;
    align-self: flex-end;
    width: 44px;
    height: 44px;
    margin-bottom: -8px;
    color: var(--sidebar-fg);
  }

  .sb-close:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-fg-active);
  }

  /* Свернуть меню на телефоне нечего — панель и так выдвижная. */
  .collapse-btn {
    display: none;
  }

  .nav-item,
  .nav-ind {
    height: 44px;
  }

  main {
    padding: 12px 16px 24px;
  }

  /* ---------- Карточки и сетки ---------- */
  .kpi-row,
  .dash-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-head {
    flex-wrap: wrap;
  }

  .series {
    flex-wrap: wrap;
  }

  .chart-wrap.chart-orders {
    height: 220px;
  }

  /* Экономика: полосы — подпись, сумма и доля строкой, дорожка под ними. */
  .wf-l {
    grid-template-columns: minmax(0, 1fr) auto 48px;
    row-gap: 4px;
  }

  .wf-l .wf-track {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  /* ---------- Касание ≥ 40 px ---------- */
  .btn,
  main button,
  .btn-sm,
  main td button {
    height: 40px;
  }

  .chip {
    height: 40px;
    padding: 0 14px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .dash-kpi.has-dl .kpi-sub {
    padding-right: 44px;
  }

  /* 16 px — телефон не увеличивает страницу при фокусе в поле. */
  main input[type="text"],
  main input[type="number"],
  main input[type="search"],
  main input[type="date"],
  main input:not([type]),
  main select,
  main textarea {
    height: 40px;
    font-size: 16px;
  }

  .filters input[type="text"],
  .filters input[type="search"] {
    min-width: 0;
    flex-basis: 100%;
  }

  .dates {
    flex-wrap: wrap;
    height: auto;
    min-height: 40px;
  }

  .dates input[type="date"] {
    height: 40px;
  }

  /* Календарь периода: месяцы друг под другом, панель во всю ширину без
     полей 16 px (сдвиг влево — app.js), дни — касание 40 px. */
  .cal-pop {
    width: calc(100vw - 32px);
    padding: 12px;
  }

  .cal-months {
    flex-direction: column;
    gap: 12px;
  }

  .cal-m {
    width: auto;
  }

  .cal-g {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .cal-nav-sp,
  .cal-pop .cal-nav {
    width: 40px;
    height: 40px;
  }

  .cal-pop .cal-day {
    height: 40px;
    font-size: 15px;
  }

  .link-more {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  .tabs a {
    padding: 11px 12px 12px;
  }

  main input[type="file"]::file-selector-button {
    min-height: 40px;
  }

  label.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
  }

  .econ-details > summary {
    padding: 11px 0;
  }

  .pager a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  /* Мелкие ссылки-значки и текстовые кнопки в строках: зона нажатия шире
     самого значка (псевдоэлемент), строка таблицы не растёт. */
  main th .th-sort::after,
  main td .art-toggle::after,
  td .shop-link::after {
    content: "";
    position: absolute;
    inset: -10px -6px;
  }

  td .shop-link {
    position: relative;
  }

  /* ---------- Таблицы: прокрутка внутри карточки, первый столбец на месте ---------- */
  .table-wrap,
  .table-scroll,
  .channels-scroll {
    overscroll-behavior-x: contain;
  }

  /* :where — без добавки к весу: шапка и подкрашенные строки ниже перекрывают фон. */
  main table.stocks > * > tr > :first-child:where(:not([colspan])),
  main table.prices > * > tr > :first-child:where(:not([colspan])),
  main table.turnover > * > tr > :first-child:where(:not([colspan])),
  main table.orders > * > tr > :first-child:where(:not([colspan])),
  main table.econ.products > * > tr > :first-child:where(:not([colspan])),
  main table.journal > * > tr > :first-child:where(:not([colspan])) {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card);
    box-shadow: 1px 0 0 var(--border);
  }

  main table.stocks > thead > tr > th:first-child,
  main table.prices > thead > tr > th:first-child,
  main table.turnover > thead > tr > th:first-child,
  main table.orders > thead > tr > th:first-child,
  main table.econ.products > thead > tr > th:first-child,
  main table.journal > thead > tr > th:first-child {
    z-index: 2;
    background: var(--head-bg);
  }

  /* Подкрашенные строки — та же подкраска у закреплённой ячейки. */
  main tr.row-zero > td:first-child,
  main tr.row-neg > td:first-child,
  main tr.row-red > td:first-child,
  main tr.urgent > td:first-child {
    background: var(--row-neg);
  }

  main tr.row-warn > td:first-child,
  main tr.row-yellow > td:first-child {
    background: var(--row-warn);
  }

  main tr.row-pending > td:first-child {
    background: var(--row-pending);
  }

  /* Столбец товара уже: рядом с ним на экране видны числа. */
  td.product,
  table.prices td.product {
    min-width: 168px;
    max-width: 200px;
  }

  td.product img,
  td.product .thumb-empty {
    display: none;
  }

  table.turnover td.product > .tv-prod {
    max-width: 180px;
  }

  /* ---------- Окна и подсказки — в пределах экрана ---------- */
  dialog {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px;
    overflow-y: auto;
  }

  .confirm-dialog-actions,
  .upload-actions {
    flex-wrap: wrap;
  }

  /* Подсказка «?» — во всю ширину шапки страницы, под ней: у кнопки,
     прижатой к краю экрана, окно 300 px уходило бы за край. */
  .page-head {
    position: relative;
  }

  .page-head .help-tip {
    position: static;
  }

  .page-head .help-pop {
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: auto;
  }
}

/* ---------- «Оборачиваемость»: продажи по площадкам (раскрытие строки) ----------
   Вариант A владельца: тонкая полоса долей и строка на площадку; подробности —
   подсказка в стиле .help-pop по наведению, фокусу с клавиатуры или нажатию
   (data-open, скрипт turnover.html). Только токены. */
table.turnover td.product > .tv-prod {
  position: relative;
  padding-left: 18px;
}

main td .tv-toggle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: var(--muted);
  translate: 0 -50%;
}

main td .tv-toggle:hover {
  box-shadow: none;
  color: var(--pos);
}

.tv-toggle .chev {
  display: inline-block;
  font-size: 10px;
  transition: transform .15s var(--ease);
}

.tv-toggle[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

main tr.mp-row > td {
  padding: 0;
}

.mp-sales {
  padding: 10px 14px 12px 34px;
}

.mp-bar {
  display: flex;
  max-width: 420px;
  height: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--flow-track);
}

.mp-seg-wb {
  background: var(--wb);
}

.mp-seg-ozon {
  background: var(--ozon);
}

.mp-none {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.mp-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mp-line {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin-left: -6px;
  padding: 3px 6px;
  border-radius: var(--r-ctl);
  font-size: 12.5px;
  cursor: default;
}

.mp-line > span {
  white-space: nowrap;
}

.mp-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 58px;
  font-weight: 600;
}

.mp-units {
  min-width: 118px;
}

.mp-rev {
  min-width: 84px;
  font-family: var(--font-mono);
  text-align: right;
}

.mp-meta {
  color: var(--muted);
  font-size: 12px;
}

.mp-line:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mp-line[data-open],
.mp-line:focus-visible {
  background: var(--row-hover);
}

/* Подсказка — справа от строки, по её середине; у последней строки — по
   нижнему краю, чтобы у последнего товара таблицы не уходила под край
   карточки (.table-wrap прокручивается и обрезает выступающее). */
.mp-pop {
  top: 50%;
  right: auto;
  left: calc(100% + 10px);
  width: max-content;
  max-width: 480px;
  padding: 8px 12px;
  translate: 0 -50%;
}

.mp-line:last-child:not(:first-child) .mp-pop {
  top: auto;
  bottom: 0;
  translate: none;
}

.mp-pop dl {
  display: grid;
  grid-template-columns: auto auto auto auto;
  column-gap: 10px;
  row-gap: 3px;
  margin: 0;
}

.mp-pop dt {
  color: var(--muted);
}

.mp-pop dd {
  margin: 0 8px 0 0;
  font-weight: 600;
  white-space: nowrap;
}

.mp-line[data-open] .mp-pop,
.mp-line:focus-visible .mp-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (hover: hover) {
  .mp-line:hover {
    background: var(--row-hover);
  }

  .mp-line:hover .mp-pop {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

.mp-line[data-dismissed] .mp-pop {
  opacity: 0;
  visibility: hidden;
}

/* Телефон: блок — по ширине экрана и на месте при прокрутке таблицы вбок,
   полоса — во всю ширину, строки переносятся; подсказка — под строкой в
   потоке (раскрывает её нажатие), а не сбоку за краем экрана. */
@media (max-width: 767px) {
  .mp-sales {
    position: sticky;
    left: 0;
    width: calc(100vw - 34px);
    padding: 10px 12px 12px;
  }

  .mp-bar {
    max-width: none;
  }

  .mp-line {
    width: auto;
    column-gap: 10px;
  }

  .mp-name {
    min-width: 0;
  }

  .mp-units,
  .mp-rev {
    min-width: 0;
  }

  .mp-pop,
  .mp-line:last-child:not(:first-child) .mp-pop {
    position: static;
    display: none;
    flex-basis: 100%;
    width: auto;
    max-width: none;
    margin-top: 4px;
    translate: none;
  }

  .mp-pop dl {
    grid-template-columns: 1fr auto;
  }

  .mp-line[data-open] .mp-pop,
  .mp-line:focus-visible .mp-pop {
    display: block;
  }

  .mp-line[data-dismissed] .mp-pop {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-pop,
  .tv-toggle .chev {
    transition: none;
  }
}
/* ---------- конец: продажи по площадкам ---------- */

/* ---------- «Остатки»: выдвижная панель «Обновить через Excel» (owner feedback 13) ----------
   Справа во всю высоту поверх затемнения; выезд — переход transform
   (app.js: [hidden] + класс is-open). Выше меню телефона (40), ниже
   уведомлений (50); окно «Было → Станет» — <dialog>, оно всегда сверху. */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: color-mix(in srgb, var(--sidebar-bg) 42%, transparent);
  animation: dlg-fade 180ms both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: 100vw;
  background: var(--card);
  box-shadow: var(--shadow-dlg);
  transform: translateX(100%);
  transition: transform var(--t-menu) var(--ease);
}

.drawer[hidden] {
  display: none;
}

.drawer.is-open {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 12px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.drawer-head h2 {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.drawer-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 22px;
  padding: 18px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-step h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.tpl-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tpl-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.tpl-card b {
  font-size: 14px;
  font-weight: 600;
}

.tpl-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tpl-card a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.tpl-card a:hover {
  text-decoration: underline;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 150px;
  padding: 20px 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-card);
  background: var(--head-bg);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}

/* Перетаскивание ловит сама зона, не значок и не строки внутри. */
.dropzone > * {
  pointer-events: none;
}

.dropzone .ic {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  color: var(--muted);
}

/* Ошибка файла — красная рамка; наведение и файл над зоной её перекрывают. */
.dropzone.has-error {
  border-color: var(--neg);
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
}

.dropzone.is-over .ic {
  color: var(--accent-strong);
}

.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dz-main {
  font-size: 14px;
  font-weight: 600;
}

.dz-sub {
  color: var(--muted);
  font-size: 12px;
}

.dz-err {
  margin: 8px 0 0;
  color: var(--neg);
  font-size: 12px;
}

.drawer-note {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* На телефоне панель — во всю ширину. */
@media (max-width: 767px) {
  .drawer {
    width: 100%;
  }
}

/* ---------- Выход в меню и страница входа (spec 2026-10-05, «Вариант B») ----------
   «Выйти» — строка меню над режимом работы: значок, подпись и логин справа;
   в свёрнутом меню — только значок (подсказка .tt, как у пунктов меню). */
.logout-form {
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--sidebar-active-bg);
}

/* Линия над «Выйти» заменяет линию над режимом работы — одна, а не две. */
.logout-form + .mode-box {
  border-top: 0;
}

.logout-btn {
  width: 100%;
}

.logout-user {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--sidebar-dim);
  transition: opacity .15s;
}

.sb-col .logout-user {
  display: none;
}

/* Страница входа: слева тёмная панель бренда, справа форма по центру. */
.login-body {
  background: var(--card);
}

.login {
  display: grid;
  grid-template-columns: minmax(320px, 44%) 1fr;
  min-height: 100vh;
  /* Телефон: 100vh выше видимой области (панели браузера) — лишняя прокрутка. */
  min-height: 100dvh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 40px 40px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.login-logo img {
  display: block;
  width: 132px;
  height: auto;
}

.login-logo small {
  font-size: 11px;
  color: var(--sidebar-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-tagline {
  max-width: 340px;
  margin: 0;
  color: var(--sidebar-fg-active);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.login-mps {
  display: flex;
  gap: 14px;
}

.login-mps .mp-icon {
  border-radius: 8px;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
  animation: page-enter var(--t-page) var(--ease) backwards;
}

.login-form h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
}

.login-sub {
  margin: -10px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--neg) 25%, transparent);
  border-radius: var(--r-ctl);
  background: var(--neg-bg);
  color: var(--neg);
  font-size: 13px;
  font-weight: 500;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.login-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.login-pass {
  position: relative;
}

.login-pass input {
  padding-right: 88px;
}

.login-show {
  position: absolute;
  top: 5px;
  right: 5px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.login-show:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.login-submit {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  font-size: 14px;
}

.login-submit:active {
  transform: scale(.98);
}

/* Телефон: тёмная панель — узкая полоса сверху (логотип и подпись), форма
   ниже на всю ширину. */
@media (max-width: 767px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .login-brand {
    flex-direction: row;
    justify-content: center;
    padding: 18px 16px;
  }

  .login-logo {
    flex-direction: row;
    gap: 12px;
  }

  .login-logo img {
    width: 88px;
  }

  .login-tagline,
  .login-mps {
    display: none;
  }

  .login-main {
    align-items: flex-start;
    padding: 32px 16px;
  }

  .login-form {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-form {
    animation: none;
  }

  .login-submit:active {
    transform: none;
  }
}

/* ---------- «Заказ товара» (spec 2026-10-03) ----------
   Форма суммы и дней, чипы «Не заказываем у поставщика», таблица с полем
   «Шт к заказу» и итог с полосой бюджета. Правленая вручную строка — тот же
   тон акцента, что строка с правкой на «Остатках» (--row-pending);
   «медленные» — приглушённым фоном (--row-slow). */
.order-form-panel,
.order-exclude {
  margin-bottom: 12px;
}

.order-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.order-form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
}

main .order-form #order-budget {
  width: 170px;
  font-family: var(--font-mono);
}

main .order-form #order-days {
  width: 110px;
}

.order-form-panel .hint {
  margin: 0;
}

.order-exclude h4 {
  margin: 0 0 8px;
}

.ex-chip {
  gap: 6px;
  max-width: 100%;
  padding-right: 4px;
  cursor: default;
}

.ex-chip b {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.ex-title {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

main .ex-chip .ex-remove {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
}

main .ex-chip .ex-remove:hover {
  background: var(--neg-bg);
  color: var(--neg);
  box-shadow: none;
}

.ex-chip .ex-remove .ic {
  width: 14px;
  height: 14px;
}

.ex-add-open {
  border-style: dashed;
  color: var(--accent-strong);
}

.ex-add {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ex-add[hidden],
.ex-add-open[hidden] {
  display: none;
}

main .ex-add input {
  width: 220px;
}

.ex-empty {
  font-size: 12px;
}

.order-result.htmx-request {
  opacity: .55;
  transition: opacity .15s;
}

table.orders {
  min-width: 860px;
}

table.orders td.product b {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

table.orders td.product small {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.orders .slow-note {
  color: var(--warn);
  font-style: normal;
}

table.orders td.mps {
  white-space: nowrap;
}

table.orders td.mps .mp-icon + .mp-icon {
  margin-left: 4px;
}

main table.orders td.qty-cell input.qty {
  width: 84px;
  text-align: right;
}

main table.orders input.qty.invalid {
  border-color: var(--neg);
}

/* «+N к расчёту» — штуки сверх дней из остатка бюджета (шаг 6), под полем. */
table.orders .topup-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  white-space: nowrap;
}

main tbody tr.order-slow,
main tbody tr.order-slow:hover {
  background: var(--row-slow);
}

main tbody tr.row-edited,
main tbody tr.row-edited:hover {
  background: var(--row-pending);
}

/* Остатки поставщика (owner 13.10.2026): блок над формой, столбец и пометки в заказе. */
.sup-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.sup-panel h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.sup-state {
  color: var(--text-2);
  font-size: 13px;
}

.sup-state b {
  color: var(--text);
}

.sup-sp {
  flex: 1;
}

.sup-stale {
  color: var(--neg);
  font-weight: 600;
}

table.orders .sup-cell {
  color: var(--text-2);
}

table.orders .sup-cell.short {
  color: var(--neg);
  font-weight: 600;
}

table.orders .cap-note {
  display: block;
  color: var(--neg);
  font-size: 11px;
}

.order-note {
  margin: 10px 2px 0;
}

.order-note .nc-item b {
  font-family: var(--font-mono);
  font-weight: 600;
}

.order-empty p {
  margin: 0;
}

/* Итог прилипает к низу окна: правя длинную таблицу, сумму видно всегда. */
.order-total {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  margin-top: 12px;
  box-shadow: var(--shadow-bar);
}

.ot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.ot-sum {
  font-size: 15px;
}

.ot-budget {
  color: var(--text-2);
  font-size: 12.5px;
}

.order-total.over .ot-budget {
  color: var(--neg);
  font-weight: 600;
}

.budget-bar {
  height: 8px;
  margin: 10px 0 12px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--flow-track);
}

.budget-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width .25s var(--ease), background .2s;
}

.order-total.over .budget-fill {
  background: var(--neg);
}

.ot-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ot-actions form {
  display: contents;
}

@media (max-width: 767px) {
  .order-form .field {
    flex: 1 1 140px;
  }

  main .order-form #order-budget,
  main .order-form #order-days {
    width: 100%;
  }

  .order-form #order-calc {
    flex: 1 1 100%;
  }

  .ex-title {
    max-width: 130px;
  }

  main .ex-add input {
    width: 100%;
    flex: 1 1 100%;
  }

  .order-total {
    bottom: 8px;
  }

  .ot-actions .btn {
    flex: 1 1 0;
  }

  /* Закреплённый столбец артикула (общее правило таблиц выше) — с подкраской строки. */
  main table.orders tr.order-slow > td:first-child {
    background: var(--row-slow);
  }

  main table.orders tr.row-edited > td:first-child {
    background: var(--row-pending);
  }

  table.orders td.product small {
    max-width: 150px;
  }
}

/* ---------- конец: «Заказ товара» ---------- */

@media (prefers-reduced-motion: reduce) {
  /* Меню на телефоне и панель «Обновить через Excel» выезжают без движения
     (общее правило выше глушит и это; здесь — явно, чтобы не потерялось при
     правке общего). */
  #sidebar,
  .sb-open #sidebar,
  .sb-backdrop:not([hidden]),
  .drawer,
  .drawer.is-open,
  .drawer-backdrop,
  .dropzone,
  .budget-fill,
  .order-result.htmx-request,
  .batch-bar {
    transition: none;
    animation: none;
  }

  /* Карточка-фильтр не приподнимается — только рамка и тень. */
  .kpi-filter:hover {
    translate: none;
  }
}

/* Панель пакетной правки на телефоне — почти во всю ширину, с полями по краям;
   текст сверху, кнопки поровну под ним. */
@media (max-width: 767px) {
  .batch-bar,
  .sb-col .batch-bar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    flex-wrap: wrap;
    width: auto;
    max-width: none;
    padding: 10px 12px;
    border-radius: var(--r-card);
    translate: none;
  }

  main.has-batch-bar {
    padding-bottom: 136px;
  }

  .batch-text {
    flex: 1 1 100%;
  }

  .batch-bar .btn {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* ---------- «Претензии» (spec 2026-10-06 §3, §7) ----------
   Строка библиотеки наших фото, проверка артикулов нарушителя, черновик:
   карточки, реквизиты продавца, сетка пар «их фото — наше фото» с меткой
   («почти копия» — тон успеха, «похоже» — предупреждения, «слабо» —
   приглушённый) и галочкой. Без наведений со сдвигом — ничего не обрезается. */
.claims-lib,
.claims-check,
.claim-result-box > .claim-result,
.claims-applicant,
.claims-registry {
  margin-bottom: 12px;
}

.claims-lib {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 12.5px;
}

.claims-lib-title {
  font-weight: 600;
}

.claims-lib-stats {
  color: var(--text-2);
}

.claims-lib-progress {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.claims-check > h2,
.claims-registry > h2,
.claim-result h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.claims-check-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}

.claims-articles {
  display: flex;
  flex: 1 1 420px;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}

main .claims-articles textarea {
  width: 100%;
  min-height: 52px;
  font-family: var(--font-mono);
  resize: vertical;
}

.claims-check .hint {
  margin: 8px 0 0;
}

.claims-status {
  min-height: 1.4em;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.claims-status.ok { color: var(--pos); }
.claims-status.warn { color: var(--warn); }
.claims-status.err { color: var(--neg); }

.claim-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 12px;
}

.claim-head h2 .pill {
  margin-left: 6px;
  vertical-align: 1px;
}

.claim-found,
.claim-likely {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.claim-likely {
  padding: 4px 10px;
  border-radius: var(--r-ctl);
  background: var(--pos-bg);
  color: var(--pos);
}

.claim-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.claim-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--head-bg);
  font-size: 12.5px;
}

.claim-card a {
  font-weight: 600;
  color: var(--text);
}

.claim-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.claim-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.claim-result h3 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.claim-result h3 .hint {
  margin-left: 6px;
  font-weight: 400;
}

/* «Сравнить с библиотекой заново» — справа в строке заголовка пар. */
.claim-pairs h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}

.claim-pairs h3 .pair-rematch {
  margin-left: auto;
  font-weight: 500;
}

.claim-seller,
.claim-pairs,
.claim-shots {
  margin-bottom: 14px;
}

.claim-seller-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.claim-seller-grid .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}

.claim-seller-grid .claim-seller-wide {
  grid-column: 1 / -1;
}

main .claim-seller-grid input {
  width: 100%;
}

.claim-seller .hint,
.claim-pairs > .hint,
.claim-shots .hint,
.claim-params .hint {
  margin: 6px 0 0;
}

.pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pair {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--card);
}

/* Пара целиком — кнопка «крупно» (окно #pair-dialog). */
main .pair-zoom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 8px;
  width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

main .pair-zoom:hover,
main .shot-pick:hover {
  box-shadow: none;
}

.pair-fig {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pair img,
.pair-missing {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--bg);
  object-fit: contain;
}

.pair-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.pair-cap {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pair-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.pair-label {
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.pair-copy .pair-label { background: var(--pos-bg); color: var(--pos); }
.pair-similar .pair-label { background: var(--warn-bg); color: var(--warn); }
.pair-weak .pair-label { background: var(--bg); color: var(--muted); }
/* «Наш дизайн» — шапка и фон наших карточек (owner 16.10.2026). */
.pair-design .pair-label { background: var(--info-bg); color: var(--info); }

.pair-check {
  margin: 0;
}

.pair-check label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pair-check input {
  accent-color: var(--accent-strong);
}

.pair-check input:disabled,
.pair-check input:disabled + * {
  cursor: default;
}

/* Скриншоты: две зоны (нарушитель, наша карточка) — адрес и артикул для
   плашки, поле вставки (Ctrl+V, перетаскивание, выбор файла) и превью.
   Зона, куда уйдёт Ctrl+V без фокуса, — с цветной рамкой поля (.is-target). */
.shot-zones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shot-zone {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--head-bg);
}

.shot-zone h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
}

/* «Наша карточка»: артикул поставщика, «Открыть на WB», «Снять нашу карточку». */
.our-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin: 0 0 10px;
}

.our-pick .field {
  display: flex;
  flex: 0 1 200px;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  font-size: 12px;
  color: var(--text-2);
}

.our-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.our-open[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

.our-found {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-2);
  font-size: 12.5px;
}

.our-found:empty {
  display: none;
}

.our-found.err {
  color: var(--neg);
}

.shot-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
}

.shot-fields .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}

main .shot-fields input,
main .shot-fields select {
  width: 100%;
}

.shot-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 14px 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}

.shot-drop .ic {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.shot-drop small {
  color: var(--muted);
  font-size: 11.5px;
}

.shot-zone.is-target .shot-drop,
.shot-drop:focus-visible {
  border-color: var(--accent-strong);
}

.shot-drop:focus-visible {
  outline-offset: 0;
}

.shot-drop.is-over {
  border-style: solid;
  border-color: var(--accent-strong);
  background: var(--row-pending);
}

.shot-drop.is-busy {
  opacity: .6;
  cursor: progress;
}

main .shot-pick {
  display: inline;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.shot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.shot-list:empty {
  display: none;
}

.shot {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
}

.shot-open {
  display: block;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 6px 6px 0 0;
  background: var(--bg);
  object-fit: contain;
}

.shot-meta {
  display: block;
  overflow: hidden;
  padding: 4px 6px;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
}

.shot-del:hover {
  color: var(--neg);
}

.claim-deadline {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
}

main .claim-deadline input {
  width: 110px;
}

/* Пара крупно: окно на всю ширину экрана, фото рядом (на телефоне — друг под другом). */
dialog.pair-dialog {
  width: 960px;
}

.pair-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pair-dialog-head h3 {
  margin: 0;
  font-size: 14px;
}

.pair-dialog-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pair-dialog-photos figure {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.pair-dialog-photos img {
  width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  background: var(--bg);
  object-fit: contain;
}

.pair-dialog-photos img:not([src]) {
  display: none;
}

.pair-dialog-photos figcaption {
  color: var(--muted);
  font-size: 12px;
}

/* summary — обычный элемент списка: с display: flex Chromium прячет треугольник
   раскрытия, и не видно, что блок раскрывается. */
.claims-applicant > summary {
  cursor: pointer;
}

.claims-applicant > summary .hint {
  margin-left: 8px;
}

.claim-incomplete {
  margin: 4px 0 0;
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 600;
}

.pair-label small {
  font-weight: 400;
  opacity: .8;
}

.claims-section-title {
  font-size: 13px;
  font-weight: 600;
}

.claims-applicant > .hint,
.claims-registry > .hint {
  margin: 8px 0 0;
}

/* Реестр претензий (_claim_registry.html): чипы статуса справа от заголовка,
   таблица; просроченная отправленная — тоном ошибки (строка и срок).
   Дата отправки видна, только когда выбран статус «отправлена». */
.claims-registry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.claims-registry-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.claims-table td {
  font-size: 12.5px;
}

.claims-table .claims-seller {
  min-width: 180px;
}

.claims-table .claims-seller small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.claims-table .claims-nms {
  font-family: var(--font-mono);
  font-size: 12px;
}

.claims-table tr.claim-overdue {
  background: var(--row-neg);
}

.claim-late {
  color: var(--neg);
  font-weight: 600;
  white-space: nowrap;
}

.claims-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.claims-actions form {
  margin: 0;
}

.claim-status-form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

main .claim-status-form select,
main .claim-status-form input[type="date"] {
  height: 28px;
  font-size: 12px;
}

.claim-status-form:not(:has(option[value="sent"]:checked)) .claim-sent-on {
  display: none;
}

.claims-delete {
  color: var(--neg);
}

/* Документы черновика: «Сформировать», «Скачать пакет», вкладки и окно
   предпросмотра PDF. Пока идёт формирование (до минуты) — «Формирую…». */
.claim-docs {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.claim-docs-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.claim-docs .hint {
  margin: 6px 0 0;
}

/* Черновик правили после «Сформировать»: документы устарели. */
.claim-docs .claim-docs-outdated {
  font-weight: 600;
}

.claim-generate-busy {
  display: none;
}

.claim-generate.htmx-request {
  pointer-events: none;
  opacity: .75;
}

.claim-generate.htmx-request .claim-generate-idle {
  display: none;
}

.claim-generate.htmx-request .claim-generate-busy {
  display: inline;
}

.claim-docs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0 6px;
}

.claim-docs-tabs a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  font-size: 12px;
  text-decoration: none;
}

.claim-docs-tabs a[aria-current="true"] {
  border-color: var(--accent-strong);
  background: var(--row-pending);
  color: var(--text);
  font-weight: 600;
}

.claim-preview {
  display: block;
  width: 100%;
  height: 78vh;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg);
}

/* Блок «Заявитель»: реквизиты сеткой, выписка ЕГРИП (файл, дата, листы). */
.applicant-form,
.applicant-egrip {
  margin-top: 12px;
}

.applicant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.applicant-grid .applicant-wide {
  grid-column: span 3;
}

.applicant-grid .field,
.applicant-egrip .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}

main .applicant-grid input,
main .egrip-fields input {
  width: 100%;
}

.applicant-sub {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.applicant-egrip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

.egrip-upload {
  flex: 1 1 280px;
  min-width: 0;
  margin: 0;
}

.egrip-upload input[type="file"] {
  max-width: 100%;
  font: inherit;
  font-size: 12.5px;
}

.egrip-fields {
  display: grid;
  grid-template-columns: 160px 90px;
  gap: 8px 12px;
}

.applicant-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}

.applicant-actions .hint {
  margin: 0;
}

@media (max-width: 900px) {
  .claim-seller-grid,
  .shot-zones {
    grid-template-columns: 1fr;
  }

  .applicant-grid {
    grid-template-columns: 1fr;
  }

  .applicant-grid .applicant-wide {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .claims-lib-progress {
    flex-basis: 100%;
    text-align: left;
  }

  .claims-check-form #claims-check-btn {
    width: 100%;
  }

  .pair-grid,
  .pair-dialog-photos {
    grid-template-columns: 1fr;
  }

  .shot-fields {
    grid-template-columns: 1fr;
  }

  .egrip-fields {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .claim-preview {
    height: 70vh;
    min-height: 320px;
  }

  .pair-dialog-photos img {
    max-height: 38vh;
  }

  /* Реестр на телефоне — карточками: строка таблицы в столбик, подпись
     столбца перед значением. */
  .claims-table thead {
    display: none;
  }

  .claims-table,
  .claims-table tbody,
  .claims-table tr,
  .claims-table td {
    display: block;
  }

  .claims-table tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
  }

  main .claims-table td {
    padding: 2px 0;
    border: 0;
    text-align: left;
  }

  .claims-table td[data-label]::before {
    content: attr(data-label) " · ";
    color: var(--muted);
  }

  .claims-actions {
    margin-top: 6px;
  }
}

/* ---------- «Цены»: СПП сейчас и окно «История СПП» (spec 2026-10-08-spp-history) ---------- */

/* « · −NN %» за ценой покупателя в ячейках WB/Ozon — приглушённо. */
.spp-pct {
  color: var(--muted);
  font-weight: 500;
}

/* Окно — у верхнего края (как в макете), затемнение плотнее общего. */
dialog.spp-dialog {
  width: 860px;
  max-width: calc(100vw - 32px);
  margin-top: 48px;
  padding: 20px 22px;
}

dialog.spp-dialog::backdrop {
  background: color-mix(in srgb, var(--sidebar-bg) 55%, transparent);
}

/* Только для чтения с экрана: смена месяца и товара в окне. */
.spp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.spp-loading {
  margin: 0;
  font-size: 18px;
}

.spp-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.spp-head h2 {
  margin: 0;
  font-size: 18px;
}

.spp-head .sp {
  flex: 1;
}

.spp-sel,
.spp-find {
  height: 34px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text);
  font: inherit;
}

/* Товар и поиск сжимаются, а не переносят месяцы на вторую строку. */
.spp-sel {
  flex: 0 1 260px;
  min-width: 0;
}

.spp-find {
  flex: 0 1 130px;
  min-width: 0;
}

.spp-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.spp-month {
  min-width: 118px;
  text-align: center;
}

.spp-nav button,
.spp-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.spp-nav button:hover:not(:disabled),
.spp-x:hover {
  background: var(--row-hover);
  color: var(--text);
}

.spp-nav button:disabled {
  opacity: .35;
  cursor: default;
}

.spp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.spp-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.spp-legend .spp-sw-wb {
  background: var(--wb);
}

.spp-legend .spp-sw-oz {
  background: var(--ozon);
}

/* Календарь: 7 дней + «неделя» с мини-графиком. */
.spp-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) 150px;
  gap: 6px;
}

.spp-dh {
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.spp-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 58px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  font-variant-numeric: tabular-nums;
}

.spp-day .n {
  color: var(--muted);
  font-size: 11px;
}

.spp-day .w,
.spp-day .o {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.spp-day .w {
  color: var(--wb);
}

.spp-day .o {
  color: var(--ozon);
}

.spp-day.e {
  border: 0;
}

.spp-day.today {
  border-color: var(--accent);
}

.spp-day.fut {
  opacity: .35;
}

.spp-wk {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-ctl);
  background: var(--head-bg);
}

.spp-wk path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spp-l-wb {
  stroke: var(--wb);
}

.spp-l-oz {
  stroke: var(--ozon);
}

/* Телефон: «неделя» уходит под свою неделю во всю ширину (как в макете). */
@media (max-width: 767px) {
  dialog.spp-dialog {
    max-width: calc(100vw - 24px);
    margin-top: 12px;
    padding: 14px 12px;
  }

  .spp-head {
    gap: 8px;
  }

  /* Заголовок и крестик — первой строкой, товар и месяцы — под ними. */
  .spp-head h2 {
    flex: 1;
    order: -2;
  }

  .spp-x {
    order: -1;
  }

  .spp-head .sp {
    display: none;
  }

  .spp-sel,
  .spp-find {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .spp-nav {
    margin-right: auto;
  }

  .spp-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .spp-dh-wk {
    display: none;
  }

  .spp-day {
    min-height: 52px;
    padding: 4px 3px;
  }

  .spp-day .w,
  .spp-day .o {
    font-size: 11.5px;
  }

  .spp-wk {
    grid-column: 1 / -1;
    height: 52px;
  }
}

/* Поиск копий наших фото (претензии, owner 14.10.2026): закладка и результаты. */
.claims-screen .scr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.claims-screen .scr-head h2 {
  margin: 0;
}

.scr-sp {
  flex: 1;
}

.bm {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1.5px dashed var(--accent);
  border-radius: var(--r-ctl);
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: grab;
}

.scr-howto {
  margin: 6px 0 0;
}

.scr-got {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0 4px;
  font-size: 13.5px;
}

table.scr {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.scr th {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
  text-transform: uppercase;
}

table.scr td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* Новые копии одного продавца — одна претензия (owner 15.10.2026). */
table.scr tr.scr-group td {
  padding: 10px 8px 6px;
  border-bottom: 0;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

table.scr .scr-gsub {
  color: var(--muted);
}

table.scr tr.scr-in td {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

table.scr tr.scr-in td:first-child {
  border-left: 3px solid var(--accent);
}

table.scr tr.scr-in:not(.scr-last) td {
  border-bottom-color: transparent;
}

.scr-more a {
  color: var(--accent-strong);
}

table.scr .scr-title,
table.scr .scr-sub {
  display: block;
  color: var(--text-2);
}

.scr-ph {
  white-space: nowrap;
}

.scr-th {
  width: 48px;
  height: 48px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--head-bg);
  object-fit: cover;
  vertical-align: middle;
}

.mt {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.mt.copy {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-strong);
}

.mt.sim {
  background: var(--warn-bg);
  color: var(--warn);
}

.mt.design {
  background: var(--info-bg);
  color: var(--info);
}

.scr-more {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.scr-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ---------- «Цены» v4 (owner 21.10.2026, макет prices-profit-v5) ----------
   Строка — товар; в каждом столбце блок WB над блоком Ozon одной высоты
   (.mpb), между товарами — полоса цвета фона. «Станет» считает сервер
   (_price_quote.html). Панель новых цен (.price-bar) — внизу экрана. */
table.prices-v4 {
  table-layout: fixed;
}

table.prices-v4 col.c-item { width: 280px; }
table.prices-v4 col.c-ord { width: 150px; }
table.prices-v4 col.c-site { width: 210px; }
table.prices-v4 col.c-ours { width: 250px; }
table.prices-v4 col.c-new { width: 150px; }

table.prices-v4 > tbody > tr.pr > td {
  vertical-align: top;
  padding: 6px 12px;
  border-bottom: 0;
}

/* Полоса между товарами — цветом фона; WB и Ozon одного товара — пунктир. */
table.prices-v4 > tbody > tr.pr-first > td {
  border-top: 8px solid var(--bg);
}

table.prices-v4 > tbody > tr.pr-first:first-child > td {
  border-top: 0;
}

table.prices-v4 > tbody > tr.pr:not(.pr-first) > td {
  border-top: 1px dashed var(--border);
}

table.prices-v4 td.pr-item {
  padding-top: 10px;
  padding-bottom: 10px;
}

table.prices-v4 td.pr-item {
  border-right: 1px solid var(--border-soft);
  background: var(--head-bg);
}

.prices-v4 .pr-title {
  font-weight: 600;
  line-height: 1.3;
}

.prices-v4 .pr-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.prices-v4 .pr-sub b {
  color: var(--text);
}

/* Себестоимость вручную: сумма — кнопка с карандашом, по нажатию — поле на её месте. */
.prices-v4 .cost-val {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 -2px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.prices-v4 .cost-val .ic {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.prices-v4 .cost-val:hover,
.prices-v4 .cost-val:hover .ic {
  color: var(--accent-strong);
}

.prices-v4 .cost-val:hover {
  background: var(--bg);
}

.prices-v4 .cost-val:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.prices-v4 .cost-form {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
}

main .prices-v4 .cost-form input {
  width: 76px;
  height: 24px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.prices-v4 .cost-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
}

.prices-v4 .cost-form button:hover {
  background: var(--bg);
}

.prices-v4 .cost-form button.ok {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--on-color);
}

.prices-v4 .cost-form button .ic {
  width: 13px;
  height: 13px;
}

.prices-v4 .pr-kv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.prices-v4 .kv {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.prices-v4 .kv b {
  font: 600 14px var(--font-mono);
  white-space: nowrap;
}

.prices-v4 .kv span {
  overflow: hidden;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.prices-v4 a.kv span {
  color: var(--accent-strong);
}

.prices-v4 a.kv:hover,
.prices-v4 a.kv:focus-visible {
  border-color: var(--accent);
}

.prices-v4 .kv.red {
  border-color: color-mix(in srgb, var(--neg) 30%, white);
  background: var(--neg-bg);
}

.prices-v4 .kv.red b {
  color: var(--neg);
}

.prices-v4 .kv.warn {
  border-color: color-mix(in srgb, var(--warn) 30%, white);
  background: var(--warn-bg);
}

.prices-v4 .kv.warn b {
  color: var(--warn);
}

.prices-v4 .pr-idx {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.prices-v4 .pr-idx .idx-badge {
  font-size: 11px;
  padding: 0 6px;
}

.prices-v4 .mpb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 6px 0;
}

.prices-v4 .mpb.col {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.prices-v4 .mp-go {
  flex: none;
  display: inline-flex;
  border-radius: 9px;
}

.prices-v4 .mp-go img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.prices-v4 a.mp-go:hover,
.prices-v4 a.mp-go:focus-visible {
  box-shadow: var(--shadow-btn);
}

.prices-v4 .buyer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.prices-v4 .buyer .b-now,
.prices-v4 .buyer .b-new {
  font: 600 14px var(--font-mono);
}

.prices-v4 .buyer .b-new {
  color: var(--accent-strong);
}

.prices-v4 .buyer .b-new:empty {
  display: none;
}

.prices-v4 .buyer .b-new:not(:empty) + .b-now {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: line-through;
}

.prices-v4 .buyer small {
  font-size: 11px;
  color: var(--muted);
}

.prices-v4 .pr-price {
  font: 600 15px var(--font-mono);
}

.prices-v4 .pr-meta {
  font-size: 12px;
  color: var(--muted);
}

.prices-v4 .pf {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.prices-v4 .pf.pos {
  color: var(--pos);
  background: var(--pos-bg);
}

.prices-v4 .pf.neg {
  color: var(--neg);
  background: var(--neg-bg);
}

.prices-v4 .pf.na {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--border-soft);
  white-space: normal;
}

.prices-v4 .pf .pc {
  font-weight: 500;
  opacity: .85;
}

.prices-v4 .pf .go {
  opacity: .7;
}

.prices-v4 a.pf:hover,
.prices-v4 a.pf:focus-visible {
  box-shadow: 0 0 0 1.5px currentColor;
}

.prices-v4 .np-inp {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
}

.prices-v4 .np-inp:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.prices-v4 .np-inp input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 600 15px var(--font-mono);
}

.prices-v4 .np-inp span {
  font-weight: 600;
  color: var(--muted);
}

.prices-v4 .quote {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.prices-v4 .quote .fitl {
  color: var(--muted);
}

.prices-v4 .quote .fitl b {
  color: var(--text);
}

.prices-v4 .quote .delta {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
}

.prices-v4 .quote .delta.pos {
  color: var(--pos);
}

.prices-v4 .quote .delta.neg {
  color: var(--neg);
}

.prices-v4 .quote .tag {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11.5px;
}

.prices-v4 .quote .tag.bad {
  background: var(--neg-bg);
  color: var(--neg);
}

.prices-v4 .quote .tag.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.prices-v4 .pr-last {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
}

.prices-v4 .pr-last .lc-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.prices-v4 .pr-last small {
  display: block;
}

.price-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-bar);
  font-size: 13px;
  transform: translateX(-50%);
}

.price-bar[hidden] {
  display: none;
}

/* «Заказы · 14 дней» (owner 22.10.2026): число заказов площадки и столбики по
   дням; отменённая часть дня — светлее, выходные — лёгкий фон. */
.ord { display: flex; flex-direction: column; gap: 4px; }
.ord-n { display: flex; align-items: baseline; gap: 6px; }
.ord-n b { font-size: 18px; }
.ord-n small { color: var(--muted); font-size: 11px; }
.ord-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 30px;
  border-bottom: 1px solid var(--line);
}
.ord-bars i { flex: 1; display: flex; align-items: flex-end; height: 100%; cursor: default; }
.ord-bars i.wk { background: var(--ord-weekend); }
.ord-bars b {
  display: flex; flex-direction: column; width: 100%; border-radius: 2px 2px 0 0; overflow: hidden;
}
.ord-wb .ord-bars b { background: var(--wb); }
.ord-ozon .ord-bars b { background: var(--ozon); }
.ord-bars s { display: block; width: 100%; background: var(--ord-cancel); }

/* ---------- «Пользователи» и «Сменить пароль» (spec 2026-10-26-web-users §7) ---------- */
table.users td.acts { text-align: right; white-space: nowrap; }
table.users td.acts form { display: inline; }
table.users td.acts .btn + .btn,
table.users td.acts .btn + form { margin-left: 6px; }
table.users tr.off td:not(.acts) { color: var(--muted); }
.user-form { display: flex; flex-direction: column; gap: 16px; }
.user-form [hidden] { display: none; }
.user-form .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.user-form select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text);
  font: inherit;
}
.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-soft);
}
.pass-form { display: flex; flex-direction: column; gap: 16px; max-width: 400px; padding: 20px; }
.pass-form .login-submit { align-self: flex-start; }

/* ---- Куда доставляют: кластеры Ozon, регионы WB (owner 09.11.2026) ---- */
.cl-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 460px)); gap: 12px 48px; padding: 0 14px 12px 34px; }
.cl-block { min-width: 0; font-size: 12.5px; }
.cl-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cl-head .muted { font-size: 12px; }
.cl-list { display: flex; flex-direction: column; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; }
.cl-list li { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 52px 40px; align-items: center; gap: 10px; }
.cl-bar { display: flex; height: 6px; border-radius: 3px; background: var(--flow-track); overflow: hidden; min-width: 60px; }
.cl-bar > span { background: var(--cl-color, var(--ozon)); }
.cl-bar > .cl-fbo { background: color-mix(in srgb, var(--cl-color, var(--ozon)) 40%, transparent); }
.cl-ozon { --cl-color: var(--ozon); }
.cl-wb { --cl-color: var(--wb); }
.cl-n { text-align: right; }
.cl-pct { text-align: right; color: var(--muted); }
.cl-from { margin-top: 4px; }
.cl-dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 28px; }
.cl-dash .cl-list li { grid-template-columns: minmax(140px, 230px) 1fr 64px 40px; font-size: 13px; }
.cl-side h3 { margin: 0 0 8px; font-size: 13px; }
.cl-side-note { margin: 10px 0 0; font-size: 12px; }
.cl-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--cl-color, var(--ozon)); vertical-align: -1px; }
.cl-key-fbo { background: color-mix(in srgb, var(--cl-color, var(--ozon)) 40%, transparent); }
@media (max-width: 760px) {
  .cl-dash { grid-template-columns: 1fr; }
  .cl-pair { grid-template-columns: 1fr; }
  .cl-list li, .cl-dash .cl-list li { grid-template-columns: minmax(90px, 1fr) 1fr 52px 36px; gap: 8px; }
}

/* --- Сборка FBS (spec 2026-11-12) --- */
.asm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.asm-head h1 { margin: 0; font-size: 20px; }
.asm-wh { display: flex; gap: 6px; }
.asm-tabs { display: flex; gap: 4px; }
.asm-tab { padding: 6px 12px; border-radius: var(--r-ctl); color: var(--muted); text-decoration: none; }
.asm-tab.on { background: var(--card); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.asm-kpis { display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.asm-kpi { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 8px 12px; }
.asm-kpi b { display: block; font-size: 20px; font-weight: 500; }
.asm-kpi span { font-size: 12px; color: var(--muted); }
.asm-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); }
.asm-table th { font-size: 12px; color: var(--muted); font-weight: 400; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.asm-table td { padding: 8px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.asm-row { cursor: pointer; }
.asm-row:hover { background: var(--row-hover); }
tr.u-red { background: var(--row-neg); }
tr.u-yellow { background: var(--row-warn); }
.u-red { color: var(--neg); font-weight: 500; }
.u-yellow { color: var(--warn); font-weight: 500; }
.asm-art { font-size: 15px; font-weight: 500; letter-spacing: .2px; }
.asm-art a { color: inherit; text-decoration: none; }
.asm-art.big { font-size: 17px; }
.asm-sub { color: var(--muted); font-size: 12px; }
.asm-mp { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.asm-empty { color: var(--muted); text-align: center; padding: 16px; }
.asm-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.asm-num { font-size: 14px; }
.asm-card-head .asm-when { margin-left: auto; }
.asm-scan input { width: 100%; font-size: 16px; padding: 12px; border: 2px solid var(--accent); border-radius: var(--r-card); }
.asm-msg { border-radius: var(--r-ctl); padding: 8px 12px; margin: 10px 0; }
.asm-msg.err { background: var(--neg-bg); color: var(--neg); }
.asm-msg.ok { background: var(--pos-bg); color: var(--pos); }
.asm-msg.warn { background: var(--warn-bg); color: var(--warn); }
.asm-msg.inf { background: var(--info-bg); color: var(--info); }
.asm-lines tr.done { background: var(--pos-bg); }
.asm-mark { width: 28px; text-align: center; color: var(--pos); }
.asm-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.asm-danger { color: var(--neg); border-color: var(--neg); }
.asm-pull { background: var(--neg-bg); border: 1px solid var(--neg); border-radius: var(--r-ctl); padding: 10px 12px; color: var(--neg); margin-bottom: 12px; }
.asm-pull-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.asm-pull-row .btn { margin-left: auto; }
.asm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.asm-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.asm-box-head { display: flex; align-items: center; gap: 8px; }
.asm-ozon-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asm-points, .asm-settings { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.asm-dialog { border: 1px solid var(--border); border-radius: var(--r-dlg); padding: 16px; max-width: 460px; }
.asm-reason { display: block; margin: 6px 0; }
.asm-cancel textarea { width: 100%; margin-top: 8px; }
.asm-journal td { font-size: 12px; }
.asm-notes { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: 320px; }
.asm-note { position: relative; display: block; background: var(--sidebar-bg); color: var(--sidebar-fg-active); border-radius: var(--r-card); padding: 10px 32px 10px 12px; text-decoration: none; box-shadow: var(--shadow-pop); font-size: 12px; line-height: 1.5; }
.asm-note b { display: block; font-size: 13px; font-weight: 500; }
.asm-note-art { font-size: 14px; font-weight: 500; }
.asm-note-when { color: var(--sidebar-fg); }
.asm-note-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--sidebar-fg); font-size: 16px; cursor: pointer; }
@media (max-width: 767px) { .asm-notes { left: 16px; width: auto; } .asm-kpis { flex-wrap: wrap; } }
.fbs .page-head { row-gap: 8px; }
.fbs-market-grid { margin-top: 12px; }
.fbs .fbs-market { display: grid; gap: 12px; text-decoration: none; color: var(--text); }
.fbs .fbs-market:hover { border-color: var(--accent-strong); }
.fbs-market .num { font-size: 32px; }
.fbs-market-title { display: flex; align-items: center; gap: 10px; }
.fbs-back { margin: 10px 0; }
.fbs .fbs-scan { display: grid; gap: 8px; margin: 12px 0; }
.fbs-toolbar, .fbs-handoff-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fbs-toolbar { margin: 12px 0; }
.fbs-handoff-actions { margin-left: auto; }
.fbs-prod { display: flex; align-items: center; gap: 10px; }
.fbs-prod + .fbs-prod { margin-top: 8px; }
.fbs-prod img { flex: none; width: 32px; height: 32px; border-radius: 6px; object-fit: contain; }
.fbs-prod small { display: block; color: var(--muted); }
.fbs-row-action { display: block; margin-top: 6px; }
.fbs-shipment { margin: 12px 0; }
.fbs-shipment-order { padding: 10px 0; border-top: 1px solid var(--border); }
.fbs-shipment-order .fbs-prod { margin-top: 8px; }
.fbs-shipment-order .btn { margin-top: 8px; }
.fbs #fbs-scan-error:empty { display: none; }
.fbs-printer-window { margin: 16px; }
.fbs-print-frame { position: absolute; top: 0; left: -10000px; width: 58mm; height: 40mm; border: 0; }
