/* wb-web — дизайн-система «Тихий журнал»
   Светлая поверхность, данные главные, цвет только со смыслом.
   Без внешних шрифтов и скриптов (CSP сервиса). */

/* ---------- 1. Токены ---------- */
:root {
  /* фон и поверхности */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e9edf2;
  --line: #e3e7ec;
  --line-strong: #cfd6de;

  /* текст */
  --text: #1f2a37;
  --text-strong: #141c26;
  --text-muted: #5b6776;   /* 5.4:1 на --bg */
  --text-faint: #6b7684;   /* только подписи осей, 4.6:1 на белом */

  /* смысловые акценты (палитра Сергея) */
  --green: #4a9e6a;
  --blue: #4a7eaa;
  --violet: #7a67b8;
  --yellow: #b8933a;
  --red: #b85555;

  /* тёмные варианты для текста на светлом (контраст ≥4.5 и на подложке бейджа) */
  --green-text: #357a4f;
  --blue-text: #3f6d96;
  --violet-text: #6a58a6;
  --yellow-text: #7a5f22;
  --red-text: #a04848;

  /* подложки бейджей */
  --green-bg: rgba(74, 158, 106, .12);
  --blue-bg: rgba(74, 126, 170, .12);
  --violet-bg: rgba(122, 103, 184, .12);
  --yellow-bg: rgba(184, 147, 58, .12);
  --red-bg: rgba(184, 85, 85, .12);

  /* типографика */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --fs-label: 14px;   /* минимум для любого текста */
  --fs-body: 15px;
  --fs-h3: 17px;
  --fs-h2: 20px;
  --fs-h1: 24px;
  --fs-num: 24px;     /* минимум для показателя */
  --fs-num-lg: 32px;

  /* отступы: шаг 4 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --shadow: 0 1px 2px rgba(31,42,55,.04), 0 4px 12px rgba(31,42,55,.04);
  --ease: cubic-bezier(.2,.7,.3,1);
  --t: 180ms;

  --gutter: 16px;
  --maxw: 1360px;
  --topbar-h: 56px;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { color: var(--text-strong); margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; border-radius: 4px; }
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface-3); padding: 8px 12px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 3. Каркас ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; gap: var(--s4); min-height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--text-strong); font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; border: 1px solid var(--line-strong); }
.topbar__spacer { flex: 1; }
.user { display: flex; align-items: center; gap: var(--s2); color: var(--text-muted); font-size: var(--fs-label); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--violet-bg); color: var(--violet-text); display: grid; place-items: center; font-weight: 650; font-size: 14px; }

/* навигация вкладками (верх на десктопе, низ на телефоне) */
.nav { display: flex; gap: var(--s1); }
.nav a {
  display: flex; align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s3);
  border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--fs-label); font-weight: 550;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--text-strong); }
.nav svg { width: 18px; height: 18px; flex: none; }

.bottomnav { display: none; }
@media (max-width: 767px) {
  .topbar .nav, .user__name { display: none; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; color: var(--text-muted); font-size: 14px;
  }
  .bottomnav a[aria-current="page"] { color: var(--text-strong); }
  .bottomnav a[aria-current="page"] svg { stroke: var(--blue-text); }
  .bottomnav svg { width: 22px; height: 22px; }
  .bottomnav a:hover { text-decoration: none; }
  main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

main { padding-top: var(--s6); padding-bottom: var(--s10); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s6); margin-bottom: var(--s5); }
.page-head__sub { color: var(--text-muted); font-size: var(--fs-label); margin-top: var(--s1); }

.section { margin-top: var(--s8); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.section__hint { color: var(--text-muted); font-size: var(--fs-label); }

.grid { display: grid; gap: var(--s3); }
.grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .grid { gap: var(--s4); } .grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- 4. Карточка ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--shadow);
  min-width: 0;
}
@media (min-width: 768px) { .card { padding: var(--s5); } }
.card__title { font-size: var(--fs-label); color: var(--text-muted); font-weight: 550; display: flex; align-items: center; gap: var(--s2); }

/* ---------- 5. KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: var(--s2); position: relative; overflow: hidden; }
.kpi__label { font-size: var(--fs-label); color: var(--text-muted); display: flex; justify-content: space-between; gap: var(--s2); }
.kpi__value { font: 650 var(--fs-num)/1.1 var(--font); color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
@media (min-width: 1024px) { .kpi__value { font-size: 28px; } }
.kpi__unit { font-size: 16px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.kpi__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 28px; }
.kpi--accent-red { border-color: rgba(184,85,85,.45); }
.kpi--accent-red::before, .kpi--accent-yellow::before, .kpi--accent-green::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.kpi--accent-red::before { background: var(--red); }
.kpi--accent-yellow::before { background: var(--yellow); }
.kpi--accent-green::before { background: var(--green); }

.delta { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.delta--up { color: var(--green-text); }
.delta--down { color: var(--red-text); }
.delta--flat { color: var(--text-muted); }
/* «рост ДРР» плохо — зелёный/красный задаются по смыслу, не по знаку */

/* блок кабинета: заголовок + 4 KPI */
.cabinet { display: flex; flex-direction: column; gap: var(--s3); }
.cabinet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.cabinet__name { display: flex; align-items: center; gap: var(--s2); font-weight: 650; color: var(--text-strong); font-size: var(--fs-h3); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot--bp { background: var(--blue); }
.dot--madina { background: var(--violet); }

/* ---------- 6. Спарклайн / график ---------- */
.spark { width: 88px; height: 28px; flex: none; }
.spark path { fill: none; vector-effect: non-scaling-stroke; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { stroke: none; }
.spark--green path.line { stroke: var(--green); } .spark--green .area { fill: var(--green-bg); }
.spark--red path.line { stroke: var(--red); } .spark--red .area { fill: var(--red-bg); }
.spark--blue path.line { stroke: var(--blue); } .spark--blue .area { fill: var(--blue-bg); }
.spark--muted path.line { stroke: var(--text-faint); } .spark--muted .area { fill: rgba(91,103,118,.08); }

.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-faint); font-size: 14px; font-family: var(--font); }
.chart--narrow .axis { font-size: 16px; }   /* узкий график ужимается до ~310px — 16 в viewBox ≈ 14px на экране */
.chart .s-orders { fill: none; stroke: var(--blue); stroke-width: 2; }
.chart .s-profit { fill: none; stroke: var(--green); stroke-width: 2; }
.chart .s-drr { fill: none; stroke: var(--yellow); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .bar-stock { fill: var(--surface-3); }
.chart .floor { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 3 4; }
.chart .marker { fill: var(--bg); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--fs-label); color: var(--text-muted); margin-top: var(--s3); }
.legend span { display: inline-flex; align-items: center; gap: var(--s2); }
.legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--yellow) 0 5px, transparent 5px 9px); }

/* ---------- 7. Бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
}
.badge svg { width: 14px; height: 14px; flex: none; }
.badge--abc { min-width: 28px; padding: 0 6px; justify-content: center; border-radius: 7px; font-weight: 700; }
.badge--A { background: var(--green-bg); color: var(--green-text); border-color: rgba(74,158,106,.35); }
.badge--B { background: var(--blue-bg); color: var(--blue-text); border-color: rgba(74,126,170,.35); }
.badge--C { background: var(--surface-3); color: var(--text-muted); border-color: var(--line-strong); }

.badge--runout { background: var(--yellow-bg); color: var(--yellow-text); }      /* скоро кончится */
.badge--overstock { background: var(--violet-bg); color: var(--violet-text); }   /* затоварка */
.badge--loss { background: var(--red-bg); color: var(--red-text); }              /* ниже безубытка */
.badge--ok { background: var(--green-bg); color: var(--green-text); }
.badge--neutral { background: var(--surface-3); color: var(--text-muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* свежесть данных */
.fresh { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-label); color: var(--text-muted); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.fresh .dot { width: 8px; height: 8px; background: var(--green); }
.fresh--stale { color: var(--red-text); border-color: rgba(184,85,85,.45); }
.fresh--stale .dot { background: var(--red); }
/* кнопка «Обновить данные» (base.html): красная рамка — остатки/продажи старше 3 ч */
.refresh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: var(--fs-label); color: var(--text-muted); }
.refresh-bar__btn[disabled] { opacity: .6; cursor: default; }
.refresh-bar--old .refresh-bar__btn:not([disabled]) { border-color: var(--red); color: var(--red-text); background: var(--red-bg); }
.refresh-bar--old .refresh-bar__ago, .refresh-bar__err { color: var(--red-text); }

/* ---------- 8. Фильтры ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.seg button {
  min-height: 38px; padding: 0 14px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background var(--t) var(--ease), color var(--t) var(--ease);
  touch-action: manipulation;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-strong); }

.select { position: relative; display: inline-flex; align-items: center; }
.select select {
  appearance: none; -webkit-appearance: none;
  min-height: 44px; padding: 0 40px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 15px; cursor: pointer; color: var(--text);
}
.select::after {
  content: ""; position: absolute; right: 14px; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: translateY(-2px) rotate(45deg);
}
.select select:hover { border-color: var(--line-strong); }
.field-label { font-size: 14px; color: var(--text-muted); }

.search {
  min-height: 44px; padding: 0 14px 0 40px; width: 100%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6776' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m16 16-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  border: 1px solid var(--line); border-radius: var(--r); font-size: 16px; /* 16px: iOS не зумит */
}
.search::placeholder { color: var(--text-faint); }
.filter-none { padding: var(--s3) var(--s4); font-size: 15px; }   /* поиск по таблице ничего не нашёл (app.js) */

@media (max-width: 767px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters .seg { grid-column: 1 / -1; display: flex; }
  .filters .seg button { flex: 1; justify-content: center; }
  .filters .select, .filters .select select { width: 100%; }
  .filters .search-box { grid-column: 1 / -1; }
}

/* ---------- 9. Вкладки (внутри страницы) ---------- */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; min-height: 44px; padding: 0 var(--s3); border: 0; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 15px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--s2);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text-strong); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue-text); }
.tab__count { font-size: 14px; color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.tabpanel[hidden] { display: none; }

/* ---------- 10. «Что оптимизировать» ---------- */
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.todo__item {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: var(--s3); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s3) var(--s4) var(--s3) 0; overflow: hidden;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.todo__item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.todo__bar { align-self: stretch; border-radius: 0 3px 3px 0; }
.todo__item--p1 .todo__bar { background: var(--red); }
.todo__item--p2 .todo__bar { background: var(--yellow); }
.todo__item--p3 .todo__bar { background: var(--blue); }
.todo__main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.todo__title { color: var(--text-strong); font-weight: 600; }
.todo__title a { color: inherit; }
.todo__why { color: var(--text-muted); font-size: 14px; }
.todo__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.todo__side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.todo__money { font: 650 var(--fs-num)/1.1 var(--font); font-variant-numeric: tabular-nums; }
.todo__money--loss { color: var(--red-text); }
.todo__money--gain { color: var(--green-text); }
.todo__money--frozen { color: var(--violet-text); }
.todo__money-label { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.prio { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.prio--p1 { color: var(--red-text); } .prio--p2 { color: var(--yellow-text); } .prio--p3 { color: var(--blue-text); }
@media (max-width: 520px) {
  .todo__item { grid-template-columns: 4px minmax(0, 1fr); }
  .todo__side { grid-column: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: var(--s2); text-align: left; }
}

/* ---------- 11. Таблица ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.table-scroll {
  overflow: auto; max-height: 70vh;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.table th, .table td { padding: 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td.r, .table th.r { text-align: right; }
.table td { font-variant-numeric: tabular-nums; }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--text-muted); font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
}
/* закреплённая первая колонка (артикул) */
.table .col-sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table thead .col-sticky { z-index: 3; background: var(--surface-2); }
.table .col-sticky::after { content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 1px; background: var(--line-strong); }
.table tbody tr { transition: background var(--t) var(--ease); }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .sku { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.table .sku__img { width: 36px; height: 46px; border-radius: 6px; background: var(--surface-3); flex: none; overflow: hidden; }
.table .sku__name { color: var(--text-strong); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.table .sku__name a { color: inherit; }
.table .sku__id { color: var(--text-muted); font-size: 14px; }
.table .v-loss { color: var(--red-text); font-weight: 600; }
.table .v-good { color: var(--green-text); }
.table .v-warn { color: var(--yellow-text); font-weight: 600; }

/* сортировка: кнопка внутри th, состояние в aria-sort */
.sort {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; border-radius: 4px; color: inherit;
}
.sort:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; }
.sort:hover { color: var(--text); }
.sort__icon { width: 10px; height: 14px; flex: none; opacity: .5; }
.sort__icon path { fill: currentColor; }
th[aria-sort="ascending"] .sort, th[aria-sort="descending"] .sort { color: var(--text-strong); }
th[aria-sort="ascending"] .sort__icon, th[aria-sort="descending"] .sort__icon { opacity: 1; }
th[aria-sort="ascending"] .sort__icon .dn { opacity: .25; }
th[aria-sort="descending"] .sort__icon .up { opacity: .25; }
th.r .sort { flex-direction: row-reverse; }

/* Excel-подобный фильтр числовой колонки: воронка не заменяет сортировку. */
.col-filter {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-left: 4px; border-radius: 4px; color: var(--text-muted); cursor: pointer; vertical-align: middle;
}
.col-filter:hover { color: var(--text); background: var(--surface-3); }
.col-filter:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 1px; }
.col-filter svg { width: 16px; height: 16px; fill: currentColor; }
.col-filter.is-active { color: var(--violet-text); background: var(--violet-bg); }
.col-filter__panel {
  position: fixed; z-index: 1000; width: 240px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow); text-align: left;
}
.col-filter__panel[hidden] { display: none; }
.col-filter__panel select, .col-filter__panel input {
  box-sizing: border-box; width: 100%; min-height: 40px; margin-bottom: 8px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit;
}
.col-filter__actions { display: flex; gap: 8px; justify-content: flex-end; }
.col-filter__actions .btn { min-height: 38px; padding: 0 10px; font-size: 14px; }

/* мини-полоса запаса в ячейке */
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter__track { width: 56px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 3px; }
.meter--low .meter__fill { background: var(--yellow); }
.meter--ok .meter__fill { background: var(--green); }
.meter--high .meter__fill { background: var(--violet); }

.table-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); color: var(--text-muted); font-size: 14px; flex-wrap: wrap; }

/* ---------- 12. Кнопки (только навигация / копирование, без действий с ценой) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 16px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
  touch-action: manipulation;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); margin-bottom: var(--s3); }
.crumbs a { color: var(--text-muted); display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--text); }

/* ---------- 13. Карточка товара ---------- */
.product { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .product { grid-template-columns: 300px minmax(0, 1fr); gap: var(--s6); align-items: start; } }

.photo { aspect-ratio: 3 / 4; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); position: relative; }
.photo svg { width: 100%; height: 100%; display: block; }
.photo__badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
@media (max-width: 1023px) {
  .product__aside { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s4); align-items: start; }
  .photo { border-radius: var(--r); }
}
@media (min-width: 600px) and (max-width: 1023px) { .product__aside { grid-template-columns: 180px minmax(0, 1fr); } }
.product__aside { position: relative; }
@media (min-width: 1024px) { .product__aside { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: var(--s4); } }

.facts { display: flex; flex-direction: column; gap: var(--s2); font-size: 15px; }
.facts div { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px dashed var(--line); }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; color: var(--text-strong); text-align: right; font-variant-numeric: tabular-nums; }
.product__title { font-size: var(--fs-h2); }
@media (min-width: 1024px) { .product__title { font-size: var(--fs-h1); } }

.grid--metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .grid--metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1680px) { .grid--metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.metric__note { font-size: 14px; color: var(--text-muted); }

/* шкала цены: безубыток — текущая — рекомендуемая */
.pricebar { position: relative; height: 10px; border-radius: 5px; margin: 40px 0 36px;
  background: linear-gradient(90deg, var(--red-bg) 0 var(--floor), var(--green-bg) var(--floor) 100%); }
.pricebar__mark { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 4px; height: 22px; border-radius: 2px; }
.pricebar__mark--floor { background: var(--red); }
.pricebar__mark--now { background: var(--text-strong); width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); box-sizing: content-box; }
.pricebar__mark--rec { background: var(--green); }
.pricebar__lbl { position: absolute; transform: translateX(-50%); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pricebar__lbl--top { bottom: 18px; }
.pricebar__lbl--bot { top: 18px; }

.advice {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: var(--s4);
}
.advice__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-bg); display: grid; place-items: center; color: var(--blue-text); }
.advice__icon svg { width: 20px; height: 20px; }
.advice__text { color: var(--text); line-height: 1.6; }
.advice__text b { color: var(--text-strong); font-weight: 650; }
.advice__note { margin-top: var(--s2); font-size: 14px; color: var(--text-muted); }

.callout { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); font-size: 15px; }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout--warn { background: var(--yellow-bg); color: var(--yellow-text); }
.callout--loss { background: var(--red-bg); color: var(--red-text); }

.hist-table td:first-child { color: var(--text-muted); }

/* утилиты */
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.hide-sm { } @media (max-width: 767px) { .hide-sm { display: none !important; } }

/* ---------- 14. Узкие экраны: спарклайн под цифрой, фильтры 3:2 ---------- */
@media (max-width: 520px) {
  .kpi__foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .kpi__foot .spark { width: 100%; height: 24px; }
  .kpi__foot .delta { white-space: normal; }
  .filters { grid-template-columns: 1fr 1fr; }
  .select select { padding: 0 28px 0 10px; font-size: 16px; }
  .select::after { right: 11px; }
}

/* таблица на телефоне: узкая закреплённая колонка, чтобы цифры было видно сразу */
@media (max-width: 767px) {
  .table th, .table td { padding: 10px; }
  .table .col-sticky { width: 140px; min-width: 140px; max-width: 140px; }
  .table .sku__img { display: none; }
  .table .sku__name { white-space: normal; max-width: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .table .sku__id { white-space: normal; }
  .table-scroll { max-height: 75vh; }
}

/* график истории: на телефоне отдельная узкая версия (крупные подписи, меньше делений) */
.chart--narrow { display: none; }
@media (max-width: 600px) { .chart--wide { display: none; } .chart--narrow { display: block; } }

/* ---------- 15. Этап 0 (08.10): меню в строку, единый фильтр, «что делать», Сводка «Пульт», дни свежие слева ---------- */
/* меню: короткие подписи, без иконок на десктопе, одна строка */
.nav { flex-wrap: nowrap; gap: 2px; min-width: 0; }
.nav a { white-space: nowrap; padding: 0 10px; }
@media (min-width: 768px) { .nav svg { display: none; } }
.nav__sep { width: 1px; align-self: center; height: 20px; background: var(--line-strong); margin: 0 6px; flex: none; }
@media (max-width: 1279px) { .user__name { display: none; } }
.user__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }   /* 1280–1350: не в 2 строки */

/* единый фильтр */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
  padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.fbar .seg { border-color: transparent; background: var(--surface-2); }
.fbar__div { width: 1px; height: 28px; background: var(--line); }
.fbar__page { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-left: auto; }
.fbar__reset { font-size: 14px; color: var(--text-muted); padding: 0 var(--s2); min-height: 44px; display: inline-flex; align-items: center; }
.fbar__count { font-size: 14px; color: var(--text-muted); }
.select--on select { border-color: var(--blue); background: var(--blue-bg); }
@media (max-width: 767px) {
  .fbar { display: grid; grid-template-columns: 1fr 1fr; }
  .fbar .seg { grid-column: 1 / -1; display: flex; flex-wrap: wrap; } .fbar .seg button { flex: 1; justify-content: center; }
  .fbar .select, .fbar .select select { width: 100%; }
  .fbar__div { display: none; }
  .fbar__page { grid-column: 1 / -1; margin: 0; } .fbar__page .seg { flex: 1; }
  .fbar__count { grid-column: 1 / -1; }
}

/* «Что делать» — общий блок для всех вкладок */
.act { padding: 0; overflow: hidden; }
.act__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.act__head h2 { font-size: var(--fs-h3); }
.act__list { list-style: none; margin: 0; padding: 0; }
.act__item { display: grid; grid-template-columns: 4px 28px minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s5) var(--s3) 0; border-bottom: 1px solid var(--line); }
.act__item:last-child { border-bottom: 0; }
.act__bar { align-self: stretch; }
.act--p1 .act__bar { background: var(--red); } .act--p2 .act__bar { background: var(--yellow); } .act--p3 .act__bar { background: var(--blue); }
.act__n { font: 650 15px/1 var(--font); color: var(--text-muted); text-align: center; }
.act__title { color: var(--text-strong); font-weight: 650; }
.act__why { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.act__who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 14px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.chip b { font-weight: 650; }
.act__money { text-align: right; }
.act__money b { display: block; font: 650 var(--fs-num)/1.1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.act__money span { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.m-loss { color: var(--red-text); } .m-frozen { color: var(--violet-text); } .m-warn { color: var(--yellow-text); }
.act__go { min-height: 40px; white-space: nowrap; }
.act__more { padding: var(--s3) var(--s5); font-size: 14px; color: var(--text-muted); background: var(--surface-2); }
.act--ok { padding: var(--s4) var(--s5); color: var(--green-text); background: var(--green-bg); }
@media (max-width: 767px) {
  .act__head { padding: var(--s3) var(--s4); }
  .act__item { grid-template-columns: 4px minmax(0, 1fr) auto; padding-right: var(--s4); row-gap: var(--s2); }
  .act__n { display: none; }
  .act__item > div:nth-child(3) { grid-column: 2; }
  .act__money { grid-column: 2 / span 2; grid-row: 2; text-align: left; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline; }
  .act__money b { display: inline; }
  .act__go { grid-column: 3; grid-row: 1; align-self: start; }
}

/* Сводка «Пульт»: KPI, менеджеры карточками, категории с полосой доли */
.kpis { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); } }
.mgrs { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .mgrs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .mgrs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); } }
.mgr { display: flex; flex-direction: column; gap: var(--s3); }
.mgr__head { display: flex; justify-content: space-between; align-items: baseline; }
.mgr__name { font-weight: 650; font-size: var(--fs-h3); color: var(--text-strong); }
.mgr__val { font: 650 28px/1.1 var(--font); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mgr__share { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.mgr__share i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.mgr__grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s2); }
.mgr__grid div { display: flex; flex-direction: column; }
.mgr__grid span { font-size: 14px; color: var(--text-muted); }
.mgr__grid b { font: 650 var(--fs-num)/1.15 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mgr__issues { display: flex; flex-direction: column; gap: 4px; padding-top: var(--s3); border-top: 1px dashed var(--line); font-size: 14px; }
.mgr__issues a { display: flex; justify-content: space-between; color: var(--text); }
.mgr__issues a b { font-variant-numeric: tabular-nums; }
.mgr--muted { background: var(--surface-2); }
.barcell { display: flex; align-items: center; gap: var(--s3); justify-content: flex-end; white-space: nowrap; }
.barcell i { display: block; height: 8px; border-radius: 4px; background: var(--blue); opacity: .55; }
.barcell .track { width: 120px; display: flex; justify-content: flex-start; }
@media (max-width: 767px) { .barcell .track { display: none; } }
.d-up { color: var(--green-text); } .d-down { color: var(--red-text); font-weight: 600; }
.row-more td { background: var(--surface-2); color: var(--text-muted); font-size: 14px; }
.row-more summary { cursor: pointer; }

/* таблица дней: свежие слева, сегодня неполный */
.d-today { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px) !important; color: var(--text-muted); }
thead .d-today { color: var(--text-strong); }
.d-today { border-right: 2px dashed var(--line-strong); }
.dhead { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.dhead small { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.c-up { color: var(--green-text); } .c-down { color: var(--red-text); }
@media (max-width: 767px) { .table td.col-sticky { white-space: normal; } }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--blue-text); cursor: pointer; text-align: left; }
.mgr__grid .v-loss { color: var(--red-text); } .mgr__grid .v-warn { color: var(--yellow-text); } .mgr__grid .v-good { color: var(--green-text); }

/* ---------- 16. Блок 2 (08.10): отгрузка v2 по размерам, файл для кабинета WB ---------- */
.ship-file { flex-direction: column; align-items: stretch; gap: 6px; }
.ship-file .btn { white-space: normal; text-align: center; line-height: 1.25; padding: 8px 12px; }
.ship-file__go { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-text); }
.ship-file__off { opacity: .6; cursor: not-allowed; }
.ship-table td.r b { font-size: 15px; }
.ship-file .btn svg { flex: none; }
.fbar__page .seg button { white-space: nowrap; }
.horizon-custom { display: inline-flex; align-items: center; gap: 6px; }
.horizon-custom input { width: 104px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; }
.horizon-custom .btn { min-height: 38px; }
@media (max-width: 767px) { .kpi--wide { grid-column: 1 / -1; } }

/* 375: «Все менеджеры» в селекте фильтра целиком, подписи нижнего меню в одну строку */
@media (max-width: 767px) {
  .fbar { column-gap: var(--s2); }
  .fbar .select select { padding: 0 24px 0 8px; }
  .fbar .select::after { right: 9px; }
  .bottomnav a { white-space: nowrap; }
}

/* ---------- 17. Исправления проверки 08.10 ---------- */
/* меню сверху: на 768–1279 часть пунктов уходит в «Ещё» — строка не шире экрана, не наезжает на аватар */
.nav__more { position: relative; display: none; flex: none; }
.nav__more summary { list-style: none; display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-muted); font-size: var(--fs-label); font-weight: 550; cursor: pointer; white-space: nowrap; }
.nav__more summary::-webkit-details-marker { display: none; }
.nav__more summary::after { content: "▾"; margin-left: 4px; font-size: 14px; }
.nav__more summary:hover, .nav__more[open] summary { background: var(--surface-2); color: var(--text); }
.nav__menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; min-width: 200px; display: flex; flex-direction: column;
  padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.nav__menu a { display: none; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-muted);
  font-size: var(--fs-label); font-weight: 550; white-space: nowrap; }
.nav__menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__menu a[aria-current="page"] { background: var(--surface-3); color: var(--text-strong); }
@media (min-width: 768px) and (max-width: 1279px) {
  .nav__more { display: block; }
  .nav > .fold-mid { display: none; }
  .nav__menu a.fold-mid { display: flex; }
  .nav__more.on-fold-mid summary { background: var(--surface-3); color: var(--text-strong); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .nav > .fold-lo { display: none; }
  .nav__menu a.fold-lo { display: flex; }
  .nav__more.on-fold-lo summary { background: var(--surface-3); color: var(--text-strong); }
  .brand__text { display: none; }
}
@media (max-width: 767px) { .nav__more { display: none; } }

/* меню снизу (телефон): основные пункты + «Ещё» с остальными (Оборот, Цена, Доступы) */
.bottombar { display: none; }
@media (max-width: 767px) {
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar .bottomnav { display: flex; position: static; flex: 1; min-width: 0; border: 0; background: none; padding: 0; }
  .bottombar .bottomnav a, .bnav-more summary { flex: 1 1 auto; padding: 0 1px; }
  .bnav-more { position: relative; display: flex; flex: none; }
  .bnav-more summary { list-style: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; padding: 0 6px; color: var(--text-muted); font-size: 14px; cursor: pointer; white-space: nowrap; }
  .bnav-more summary::-webkit-details-marker { display: none; }
  .bnav-more svg { width: 22px; height: 22px; }
  .bnav-more.is-on summary { color: var(--text-strong); }
  .bnav-more.is-on summary svg { stroke: var(--blue-text); }
  .bnav-more__menu { position: absolute; right: 4px; bottom: calc(100% + 6px); min-width: 210px; display: flex; flex-direction: column;
    padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
  .bnav-more__menu a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm);
    color: var(--text); font-size: 14px; }
  .bnav-more__menu a[aria-current="page"] { background: var(--surface-3); color: var(--text-strong); }
  .bnav-more__menu svg { width: 18px; height: 18px; }
}
.act--empty { padding: var(--s4) var(--s5); font-size: 14px; }
/* Динамика на телефоне: сводные колонки строкой под названием, узкая закреплённая колонка — дни видны сразу */
.dyn__mini { display: none; }
@media (max-width: 767px) {
  .dyn .dyn__s { display: none; }
  .dyn__mini { display: block; margin-top: 2px; font-size: 14px; color: var(--text-muted); white-space: normal; }
  .dyn .col-sticky { width: 128px; min-width: 128px; max-width: 128px; }
  .dyn th, .dyn td { padding-left: 8px; padding-right: 8px; }
  .dyn thead th { white-space: normal; }
  .dyn .dhead small { display: block; }
}
/* «Динамика СПП» (/price, /p): витрина — сплошная, в заказах — пунктир, категория — серая */
.chart .s-spp { fill: none; stroke: var(--blue); stroke-width: 2; }
.chart .s-spp-ord { fill: none; stroke: var(--violet); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .s-spp-cat { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.legend i.spp { background: var(--blue); }
.legend i.spp-ord { background: repeating-linear-gradient(90deg, var(--violet) 0 5px, transparent 5px 9px); }
.legend i.spp-cat { background: var(--line-strong); }
.seg a { min-height: 38px; padding: 0 14px; border-radius: 7px; color: var(--text-muted); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; text-decoration: none; }
.seg a[aria-pressed="true"] { background: var(--surface-3); color: var(--text-strong); }
.spp-days td { white-space: nowrap; }
/* РНП по артикулу (/p): строки-группы, подпись источника под названием метрики */
.rnp tr.grp td { background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.rnp td.col-sticky { white-space: normal; min-width: 200px; }
.rnp td.col-sticky .sku__id { white-space: normal; }
@media (max-width: 767px) { .rnp td.col-sticky { min-width: 0; } }

/* ---------- 18. Компактные колонки (11.10): шапка в 2 строки, ширина колонки ≈ данные, лишнее место — «Товару» ---------- */
/* только таблицы с закреплённой колонкой (товарные/категорийные); Фото, Доступы, реестры штрафов — как были */
.table:where(:has(th.col-sticky)) thead th { white-space: normal; vertical-align: bottom; text-wrap: balance; }
.table:where(:has(th.col-sticky)) thead th:where(:not(.col-sticky, :has(> .dhead))) { width: 1px; min-width: 5.5em; }
.table thead th.th-wide { min-width: 7em; }      /* шапки из 3 слов: «Рост посл. дня», «Маржа в акции, %», «СС закупа, ₽» */
.table thead th.th-wider { min-width: 8.5em; }   /* «Запас до безубытка, %», «Заказы 7 дн к прошлым 7», «Остаток ВБ в СС, ₽» */
.table td.cell-text { white-space: normal; min-width: 14em; }   /* длинный текст в ячейке: «Действие», «Совет», «Тип» */
.table thead th.th-fill { width: auto; }         /* «Действие» на /turnover забирает остаток ширины — таблица влезает в 1280 */
.table td.cell-fill { min-width: 8em; }
.dhead { white-space: nowrap; }                  /* «10 окт / сб» не рвётся — на любой ширине, как до 11.10 */
.dyn td.dyn__s > .fs14 { display: block; }       /* «(+10%)» в План/факт — второй строкой: строка и так в 2 строки (название + артикул) */
@media (min-width: 768px) {
  .dhead small { white-space: normal; }          /* «11 окт · до 13:50» под «Сегодня» — в 2 строки (вариант А) */
  .table .sku__name { max-width: none; min-width: 220px; contain: inline-size; }  /* название заполняет ширину колонки, а не 220 px */
  .table .sku > :last-child { flex: 1 1 auto; }  /* /today: блок «название + артикул» тянется на всю колонку */
}
@media (max-width: 767px) { .dyn thead th { min-width: 0; } .dyn .dhead { white-space: normal; } }   /* Динамика на телефоне — как раньше (узкие дни, шапка дней переносится) */

/* ===== /plan — пульт плана из базы (эскиз A «Таблица-пульт» + строки-группы tr.grp), классы pp-* только этой страницы ===== */
/* «отстаёт» на /plan — приглушённый оранжевый (Сергей 15.10: «красный — на оранжевый»): #c27c3e — полоски и крупные цифры,
   #a35f28 — мелкий текст (контраст 5:1 на белом). Классы --red остаются по статусу ячейки листа (🔴), цвет — оранжевый */
.card.pp-alert { background: var(--yellow-bg); color: var(--yellow-text); border-color: rgba(184,147,58,.45); font-size: 14px;
                 padding: var(--s2) var(--s3); margin-top: var(--s2); line-height: 1.4; }
.card.pp-alert p { margin: 0; }
.pp-note, .pp-title { font-size: 14px; margin: 0; line-height: 1.45; }
.pp-note { margin-top: var(--s2); }
@media (min-width: 768px) { .pp-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }   /* одна строка, целиком — в title */
.pp-head { margin-top: var(--s2); display: flex; flex-direction: column; gap: var(--s2); }
.pp-head .fbar { padding: var(--s2); }
.pp-head + #table { margin-top: var(--s5); }
.pp-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s4); }
.pp-meta .pp-title { flex: 1 1 36em; min-width: 0; }
@media (min-width: 768px) { .pp-meta .pp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }   /* мета — одна строка, целиком в title */
.pp-meta details[open] { flex-basis: 100%; }   /* раскрытое — на всю ширину под строкой */
.pp-warn, .pp-legend, .pp-out { padding: 0; }
.pp-out { margin-top: var(--s4); }
.pp-warn summary, .pp-legend summary { font-size: 14px; font-weight: 600; cursor: pointer; color: var(--blue-text); white-space: nowrap; min-height: 32px; display: flex; align-items: center; }
.pp-out summary { padding: var(--s4) var(--s5); font-size: 15px; font-weight: 600; cursor: pointer; }
.pp-warn summary { color: var(--yellow-text); }
.pp-warn ul { margin: 0; padding: 0 0 var(--s2) 18px; font-size: 14px; line-height: 1.5; }
.pp-out ul { margin: 0; padding: 0 var(--s5) var(--s4) calc(var(--s5) + 18px); font-size: 14px; line-height: 1.5; }
.pp-legend p { margin: 0; padding: 0 0 var(--s2); font-size: 14px; line-height: 1.55; color: var(--text); }
/* «Как читать пульт» — глоссарий по группам (16.10): термин жирным — пояснение, одна мысль — одна строка */
.pp-gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s2) var(--s5); padding: 0 0 var(--s3); }
.pp-gloss h3 { margin: var(--s2) 0 2px; font-size: 14px; font-weight: 650; color: var(--text-strong); }
.pp-gloss ul { margin: 0; padding: 0 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--text); }
.pp-gloss__notes { grid-column: 1 / -1; }
.pp-sum { padding: var(--s2) var(--s4); display: flex; flex-direction: column; gap: 6px; }
.pp-sum__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; }
.pp-sum__i { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 2px var(--s4) 2px 0; margin-right: var(--s4);
             border-right: 1px solid var(--line); }
.pp-sum__i:last-child { border-right: 0; margin-right: 0; }
.pp-sum__k { font-size: 14px; color: var(--text-muted); }
.pp-sum__v { font: 650 19px/1.25 var(--font); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-sum__st { font-size: 14px; white-space: nowrap; }
.pp-sum__st + .pp-sum__st { margin-left: var(--s3); }
.pp-sum__st b { font: 650 19px/1.25 var(--font); font-variant-numeric: tabular-nums; }
.pp-sum__st--red { color: #a35f28; } .pp-sum__st--green { color: var(--green-text); }
.pp-sum__st--blue { color: var(--blue-text); } .pp-sum__st--grey { color: var(--text-muted); }
.pp-sum__st--yellow { color: var(--yellow-text); }
/* главная плитка — доля товаров в плане, крупно и цветом по доле (pult.share_tone); рядом мельче — «в плане по дням» со стрелкой */
.pp-sum__i--hero { padding: 4px var(--s3); border-radius: var(--r-sm); border-right: 0; box-shadow: inset 4px 0 0 currentColor; }
.pp-sum__i--hero .pp-sum__k { color: var(--text); font-weight: 600; }
.pp-sum__i--hero .pp-sum__v { font-size: 26px; font-weight: 750; color: inherit; }
.pp-sum__i--trend .pp-sum__v { font-size: 16px; font-weight: 600; }
.pp-sum__arr { font: 750 18px/1 var(--font); color: inherit; }
.pp-sum__i--trend .pp-sum__k, .pp-sum__i--trend .pp-sum__v { color: var(--text-muted); }
.pp-tone--low { color: #c27c3e; } .pp-sum__i--hero.pp-tone--low { background: #fbf3ec; }
.pp-tone--mid { color: #b8933a; } .pp-sum__i--hero.pp-tone--mid { background: #faf5ea; }
.pp-tone--high { color: #4a9e6a; } .pp-sum__i--hero.pp-tone--high { background: #edf6f0; }
.pp-sum__sub { flex-basis: 100%; font-size: 13px; color: var(--text-muted); }
/* телефон — ниже общих правил, иначе .pp-sum__i выше перекрывает: плитки столбиком без разделителя, длинное значение
   («15% → 15% → ≈15% (+0 п.п.)») переносится, а не тянет страницу вбок */
@media (max-width: 767px) { .pp-sum__i { border-right: 0; } .pp-sum__v { white-space: normal; } }
.pp-st { font-weight: 650; white-space: nowrap; }
.pp-st--red { color: #a35f28; } .pp-st--green { color: var(--green-text); }
.pp-st--blue { color: var(--blue-text); } .pp-st--grey { color: var(--text-muted); }
.pp-bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; width: 150px; }
.pp-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--text-muted); }
.pp-bar--red > i { background: #c27c3e; } .pp-bar--green > i { background: var(--green); } .pp-bar--blue > i { background: var(--blue); }
.pp-muted { color: var(--text-muted); }
.pp-out ul { list-style: none; padding-left: var(--s5); }
.pp-out li { margin: var(--s2) 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); }   /* фото + название как в таблице, причина справа */
.pp-out__why { color: var(--text-muted); }
.pp-go { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }   /* /plan: переходы по товару из строки */
.pp-go a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
           background: var(--surface); color: var(--accent-text); font-size: 14px; white-space: nowrap; }
.pp-go a:hover { background: var(--surface-2); border-color: var(--line-strong); text-decoration: none; }
/* ---------- /plan: таблица E (16.10) ---------- */
/* Макет E: одна таблица, всегда полная (без свёртки), ширина по содержимому, линии между столбцами, «Товар/Менеджер» липкий слева,
   шапка из трёх строк (группы, столбцы, «Итого») липкая сверху — top 2-й и 3-й строк ставит plan_table.js. */
.ppx-bar { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s3); }
.ppx-bar__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.ppx-bar__top .search { max-width: 320px; }
.ppx-live { color: var(--text-muted); font-size: 14px; }
.ppx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ppx-chips__lbl { color: var(--text-muted); font-size: 13px; margin-right: 4px; }
.ppx-chips .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 14px; }
.ppx-chips .chip .p { font-weight: 650; }
.ppx-chips .chip .n { font-weight: 700; color: var(--text); }
.ppx-chips .chip.on { background: #efecf7; border-color: #7a67b8; color: #5b4a9a; }
.ppx-chips .chip.dis { opacity: .45; }
.ppx-chips .rg { border-left-width: 4px; }
.ppx-chips .rg0, .ppx-chips .rg1, .ppx-chips .rg2, .ppx-chips .rg3 { border-left-color: #c27c3e; }
.ppx-chips .rg4 { border-left-color: #4a9e6a; } .ppx-chips .rg5 { border-left-color: #4a7eaa; } .ppx-chips .rg6 { border-left-color: var(--line); }
.ppx-card { padding: 0; overflow: hidden; }
.ppx-wrap { overflow: auto; max-height: calc(100vh - var(--topbar-h) - 24px); }
.ppx { --ppx-s1w: 84px; --ppx-vl: #e3e6ec; --ppx-gl: #b9c0cc; width: auto; font-size: 13px; border-collapse: separate; border-spacing: 0; }   /* своей ширины, не 100% */
.ppx th, .ppx td { padding: 4px 5px; vertical-align: middle; border-bottom: 1px solid var(--line); border-left: 1px solid var(--ppx-vl); }
/* линии как в MPSTATS/XWay: светлая между всеми столбцами, темнее — на границе групп (gs — первый столбец группы) */
.ppx th.gs, .ppx td.gs { border-left-color: var(--ppx-gl); }
.ppx tr > :first-child { border-left: 0; }
.ppx thead th, .ppx thead td { position: sticky; top: 0; z-index: 4; background: var(--surface-2); vertical-align: bottom; }
.ppx thead tr.ppx-g th { font-weight: 650; font-size: 13px; text-align: left; white-space: nowrap; }
.ppx thead tr.ppx-c th { font-weight: 600; white-space: normal; min-width: 0; line-height: 1.25; }
.ppx thead tr.ppx-t td { font-weight: 650; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.ppx thead tr.ppx-t td.ppx-w-pct { white-space: normal; }
.ppx .ppx-g--sku, .ppx .ppx-g--ref { background: #f1f2f4; } .ppx .ppx-g--price { background: #e9edf3; }
.ppx .ppx-g--plan { background: #e9f3ec; } .ppx .ppx-g--act { background: #efecf7; } .ppx .ppx-g--stock { background: #f8efe6; }
.ppx .ppx-g--fun { background: #e8eff6; } .ppx .ppx-g--money { background: #faf5ea; }
/* заголовки столбцов — тот же оттенок группы, совсем бледно (16.10) */
.ppx thead tr.ppx-c th.g-plan { background: #f4f9f5; } .ppx thead tr.ppx-c th.g-act { background: #f7f5fb; }
.ppx thead tr.ppx-c th.g-stock { background: #fcf7f2; } .ppx thead tr.ppx-c th.g-fun { background: #f3f7fb; }
.ppx thead tr.ppx-c th.g-price { background: #f4f6f9; } .ppx thead tr.ppx-c th.g-money { background: #fdfaf4; }
.ppx-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.ppx-sort:hover { color: var(--accent-text); }
.ppx th[aria-sort="descending"] .ppx-sort::after { content: " ↓"; }
.ppx th[aria-sort="ascending"] .ppx-sort::after { content: " ↑"; }
/* липкий слева «Товар/Менеджер»: фото (sku_cell, видно только фото) на всю ширину ячейки, под ним менеджер (Сергей 16.10) */
/* липкий слева: непрозрачный фон, z-index выше ячеек строки (3), но ниже шапки (4–6) — при прокрутке вбок ничего не просвечивает */
.ppx .ppx-s1 { position: sticky; left: 0; z-index: 3; background: var(--surface); width: var(--ppx-s1w); min-width: var(--ppx-s1w); max-width: var(--ppx-s1w);
               white-space: normal; overflow-wrap: anywhere; box-shadow: inset -1px 0 0 var(--ppx-gl), 4px 0 6px -4px rgba(0,0,0,.18); }
.ppx thead .ppx-s1 { z-index: 6; background: var(--surface-2); }
.ppx thead .ppx-g--sku.ppx-s1 { width: auto; max-width: none; overflow: visible; background: #f1f2f4; box-shadow: none; }
.ppx td.ppx-who .sku2__body { display: none; }
.ppx td.ppx-who .sku2 { display: block; min-width: 0; max-width: none; }
.ppx td.ppx-who .sku2__img { display: block; width: 100%; height: 96px; object-fit: cover; border-radius: var(--r-sm); }
.ppx .ppx-who__m { display: block; margin-top: 3px; font-size: 13px; line-height: 1.2; color: var(--text-muted); text-align: center; }
.ppx tbody tr:hover td { background: var(--surface-2); }
.ppx .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ppx a.wb { color: var(--accent-text); }
.ppx td.v-loss { background: rgba(194,124,62,.17); color: #a35f28; font-weight: 600; }
.ppx .v-good { color: #2f6e48; }
.ppx .ppx-neg { color: #a35f28; }
.ppx td.up { background: rgba(74,158,106,.16); color: #2f6e48; }
.ppx td.dn { background: rgba(184,85,85,.15); color: #8c3c3c; }
.ppx .pp-muted, .ppx .muted { color: var(--text-muted); }
.ppx td.ppx-pct { white-space: normal; line-height: 1.3; }
.pp-pct { font-size: 15px; font-weight: 700; }
.pp-pct--red { color: #a35f28; } .pp-pct--green { color: #2f6e48; } .pp-pct--blue { color: #4a7eaa; } .pp-pct--yellow { color: #b8933a; }
.pp-pct--grey { color: var(--text-muted); }
.pp-bar--yellow > i { background: #b8933a; } .pp-bar--grey > i { background: var(--text-muted); }
.ppx .pp-bar { width: 100%; min-width: 70px; margin-top: 3px; }
.ppx td.ppx-txt { white-space: normal; line-height: 1.3; }
/* ширины (16.10, ревью скриншота 1440): узкие текстовые — с обрезкой и полным текстом в title; действия — с переносом */
.ppx .ppx-w-nm { width: 84px; min-width: 84px; }
.ppx .ppx-w-art, .ppx td.ppx-w-art { width: 110px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.ppx .ppx-w-cat, .ppx td.ppx-w-cat { width: 90px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.ppx .ppx-w-act { width: 220px; min-width: 220px; max-width: 220px; }   /* 190→220 и 170→240: медиана строки 245→195 px (замер 16.10) */
.ppx .ppx-w-why { width: 240px; min-width: 240px; max-width: 240px; }
/* «Кончится…» — только дата (хвост в title), длинный текст листа переносится, а не растягивает столбец */
.ppx .ppx-w-date { width: 72px; max-width: 88px; }
.ppx td.ppx-w-date { white-space: normal; line-height: 1.25; }
.ppx-clamp { display: block; }   /* текст действий целиком (Сергей 16.10) — строки выше, это принято */
.ppx-tag { display: inline-block; margin-bottom: 2px; padding: 0 6px; border-radius: 999px; font-size: 13px; background: rgba(184,85,85,.15); color: #8c3c3c; }
/* переходы — маленькие кнопки с иконкой и подписью под текстом «Главного действия» (Сергей 16.10) */
.ppx .pp-go.ppx-go { margin-top: 4px; gap: 3px; }   /* 5 кнопок — в 2 ряда при ширине действия 220 px */
.ppx .pp-go.ppx-go a { gap: 3px; min-height: 22px; padding: 0 5px; font-size: 13px; line-height: 1; color: var(--text-muted); background: var(--surface); }
.ppx .pp-go.ppx-go a:hover { color: var(--accent-text); }
.ppx .pp-go.ppx-go svg { width: 13px; height: 13px; flex: none; }
/* легенда над таблицей — 1–2 строки */
.ppx-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s4); margin-bottom: var(--s2); font-size: 13px; color: var(--text-muted); }
.ppx-key__i { display: inline-block; }
.ppx-key .ppx-pill + .ppx-pill { margin-left: 4px; }
.ppx-key b { color: var(--text); font-weight: 600; }
.ppx-key .ppx-pill { padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--surface-2); }
.ppx-key .ppx-pill.pp-pct--red { background: #fbf3ec; color: #a35f28; } .ppx-key .ppx-pill.pp-pct--green { background: #edf6f0; color: #2f6e48; }
.ppx-key .ppx-pill.pp-pct--blue { background: #eef3f8; color: #4a7eaa; }
.ppx-stale { font-weight: 400; font-size: 13px; color: var(--text-muted); }
.ppx tr.is-err td.ppx-s1 { box-shadow: inset 3px 0 0 #b85555, inset -1px 0 0 var(--ppx-gl), 4px 0 6px -4px rgba(0,0,0,.18); }
.ppx-foot { padding: var(--s3) var(--s4); color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--line); }
.ppx-foot p { margin: 4px 0; }
.ppx-sw { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; border-radius: 3px; background: rgba(194,124,62,.17); border: 1px solid #c27c3e; }
.ppx-sw--up { background: rgba(74,158,106,.16); border-color: #4a9e6a; }
.ppx-sw--dn { background: rgba(184,85,85,.15); border-color: #b85555; }
#ppx-pop { position: fixed; z-index: 50; width: 200px; height: 260px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
           background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.18); pointer-events: none; }
@media (max-width: 767px) {
  .ppx-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .ppx-bar__top .search { max-width: none; }
  .ppx-wrap { max-height: calc(100vh - var(--topbar-h) - 12px); }
}

/* ---------- 20. Чип свежести в шапке (редизайн 14.10): одна строка на всех вкладках ---------- */
.topline { display: flex; justify-content: flex-end; min-height: 36px; margin-bottom: var(--s2); }
.fchip { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s2) var(--s3); margin: 0; font-size: var(--fs-label); }
.fchip__more { position: relative; }
.fchip__sum { list-style: none; display: inline-flex; align-items: center; gap: var(--s2); min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); font-size: var(--fs-label); white-space: nowrap; }
.fchip__sum::-webkit-details-marker { display: none; }
.fchip__sum::after { content: "▾"; color: var(--text-faint); }
.fchip__more[open] .fchip__sum::after { content: "▴"; }
.fchip__sum .dot { width: 8px; height: 8px; background: var(--green); }
.fchip--yellow .fchip__sum { color: var(--yellow-text); border-color: rgba(184,147,58,.45); }
.fchip--yellow .fchip__sum .dot { background: var(--yellow); }
.fchip--red .fchip__sum { color: var(--red-text); border-color: rgba(184,85,85,.45); }
.fchip--red .fchip__sum .dot { background: var(--red); }
.fchip__pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(460px, calc(100vw - 32px)); padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow); color: var(--text); overflow-wrap: anywhere; }
.fchip__pop p { margin: 0 0 6px; }
.fchip__pop p:last-child { margin-bottom: 0; }
.fchip__err { color: var(--red-text); font-weight: 600; }
.fchip__btn { min-height: 32px; padding: 0 12px; font-size: var(--fs-label); }
.fchip__btn[disabled] { opacity: .6; cursor: default; }
.wline { align-items: center; padding: 6px var(--s3); font-size: var(--fs-label); }
.wline > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767px) {
  .topline, .fchip { justify-content: flex-start; }
  .fchip__pop { left: 0; right: auto; }
  .fchip__err { order: 3; flex-basis: 100%; }
  .fchip { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .fchip__more { flex: 1 1 0; min-width: 0; }                     /* чип и «Обновить» в одном ряду */
  .fchip__btn { flex: none; }
  .fchip__sum { white-space: normal; padding: 4px 12px; }   /* «… · обновление не прошло» не вылезает за 375 */
  .wline > span { white-space: normal; }
}

/* ---------- 21. Ячейка «товар» и теги решения (редизайн 14.10, общие для сайта; .sku* и голый .tag заняты) ---------- */
.sku2 { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.sku2__img { width: 40px; height: 52px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); flex: none; }
.sku2__img--none { display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); }
.sku2 > .sku2__img--none::after { content: "—"; }    /* без svg в каждой строке: 177 иконок весили 45 КБ */
.sku2__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sku2__name { color: var(--text-strong); font-weight: 600; font-size: var(--fs-label); line-height: 1.3; white-space: normal; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sku2__meta { font-size: var(--fs-label); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sku2__meta .dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; vertical-align: 1px; }
.sku2__nomgr { color: var(--yellow-text); }

.tag--grow, .tag--drop, .tag--stock, .tag--dead, .tag--floor, .tag--promo, .tag--skip, .tag--none {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: var(--fs-label); font-weight: 600; white-space: nowrap; cursor: help; font-variant-numeric: tabular-nums; }
.tag--grow { background: var(--green-bg); color: var(--green-text); border-color: rgba(74,158,106,.3); }
.tag--drop { background: var(--blue-bg); color: var(--blue-text); border-color: rgba(74,126,170,.3); }
.tag--stock { background: var(--yellow-bg); color: var(--yellow-text); border-color: rgba(184,147,58,.35); }
.tag--dead { background: var(--violet-bg); color: var(--violet-text); border-color: rgba(122,103,184,.3); }
.tag--floor { background: var(--red-bg); color: var(--red-text); border-color: rgba(184,85,85,.35); }
.tag--promo { background: transparent; color: var(--violet-text); border: 1px dashed rgba(122,103,184,.6); }
.tag--skip { background: var(--surface-3); color: var(--text-muted); border-color: var(--line-strong); }
.tag--none { background: transparent; color: var(--text-muted); padding: 0; font-weight: 500; }

/* ---------- 22. Репрайсер (редизайн 14.10): статус, сценарий, карточки менеджеров, теги-фильтры, таблица + панель ---------- */
.rp-head { margin-bottom: var(--s3); }
.rp-note { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.statusline { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: var(--fs-label); color: var(--text-muted); margin-bottom: var(--s3); }
.statusline > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); min-height: 44px; padding: 6px var(--s4); cursor: pointer; }
.statusline > summary::-webkit-details-marker { display: none; }
.statusline__item { display: inline-flex; align-items: center; gap: var(--s2); }
.statusline__item .dot { width: 8px; height: 8px; background: var(--line-strong); }
.statusline__item--bad { color: var(--red-text); font-weight: 600; }
.statusline__item--bad .dot { background: var(--red); }
.statusline__more { margin-left: auto; color: var(--blue-text); }
.statusline__more::after { content: " ▾"; }
.statusline[open] .statusline__more::after { content: " ▴"; }
.statusline__body { padding: 0 var(--s4) var(--s3); color: var(--text); overflow-wrap: anywhere; }
.statusline__body p { margin: 0 0 6px; }
.statusline__m { display: none; }
@media (max-width: 767px) { .statusline__m { display: block; } .rp-mhide { display: none; } }
.disclose { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: var(--s4); }
.disclose > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: 48px; padding: 6px var(--s4); color: var(--text-strong); font-size: 15px; cursor: pointer; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::after { content: "▸"; margin-left: auto; color: var(--text-muted); }
.disclose[open] > summary::after { content: "▾"; }
.disclose__title { font-weight: 650; }
.disclose__hint { font-size: var(--fs-label); color: var(--text-muted); }
.disclose__body { padding: 0 var(--s4) var(--s4); }

.mks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.mk { display: flex; flex-direction: column; gap: 2px; padding: 10px var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.mk:hover { border-color: var(--line-strong); text-decoration: none; }
.mk--on { border-color: var(--accent, var(--blue)); background: var(--accent-bg, var(--blue-bg)); }
.mk__name { font-size: var(--fs-label); color: var(--text-muted); font-weight: 600; }
.mk__val { font-size: 26px; font-weight: 650; line-height: 1.1; color: var(--text-strong); }
.mk__sub { font-size: var(--fs-label); color: var(--text-muted); }
.v-up { color: var(--green-text); }
.v-down { color: var(--blue-text); }
.mks-empty { padding: var(--s3) var(--s4); margin-bottom: var(--s3); border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--text-muted); font-size: 15px; }

.rp-fbar { margin-bottom: var(--s3); padding: var(--s2) var(--s3); }
.rp-search { max-width: 260px; flex: 1; min-width: 180px; }
.rp-tabs { margin-bottom: var(--s2); }
.tab[aria-selected="true"] .tab__count { background: var(--accent-bg, var(--blue-bg)); color: var(--accent-text, var(--blue-text)); }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s2); }
.tagf { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: var(--fs-label); color: var(--text); text-decoration: none; }
.tagf:first-child { padding: 0 12px; }
.tagf:hover { border-color: var(--line-strong); text-decoration: none; }
.tagf--on { background: var(--accent-bg, var(--blue-bg)); border-color: var(--accent, var(--blue)); color: var(--accent-text, var(--blue-text)); font-weight: 650; }
.tagf [class^="tag--"] { cursor: pointer; }
.rp-empty { padding: var(--s5); color: var(--text-muted); font-size: 15px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s4); align-items: start; }
@media (max-width: 1439px) { .split { grid-template-columns: minmax(0, 1fr) 280px; } }   /* 1280–1439: товару ≥ 200 px */
.split .table-scroll { max-height: none; }   /* одна прокрутка — страницы; панель sticky рядом */
/* fixed: ширины задают th, товар забирает остаток (≥ 300 px при панели 340 на 1440); строка ≤ 64 px */
.rp-t { table-layout: fixed; font-size: var(--fs-label); }
.rp-t th, .rp-t td { padding: 5px 6px; }
.rp-t thead th { white-space: nowrap; vertical-align: bottom; }
.rp-t th:nth-child(2) { width: 68px; } .rp-t th:nth-child(3) { width: 76px; } .rp-t th:nth-child(4) { width: 112px; }
.rp-t th:nth-child(5) { width: 112px; } .rp-t th.c-go { width: 24px; }
.rp-t .th2 { font-weight: 500; font-size: var(--fs-label); }
.rp-t .c-sku { white-space: normal; }
.rp-t .sku2__name, .rp-t .sku2__meta { line-height: 1.2; }
.rp-t td [class^="tag--"] { display: inline-block; max-width: 100%; line-height: 1.2; padding-top: 2px; padding-bottom: 2px; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }   /* «Решение» 112 px: тег переносится, не обрезается */
@media (min-width: 768px) { .rp-t td [class^="tag--"] { height: auto; min-height: 26px; } }   /* без этого база 26 px держит 2-ю строку тега под кнопкой «Включить» */
.rp-t tbody tr { cursor: pointer; }
.rp-t tbody tr:focus-visible { outline: 2px solid var(--blue-text); outline-offset: -2px; }
.rp-t tbody tr[aria-selected="true"] td { background: var(--surface-2); }
.rp-t tbody tr td:first-child { box-shadow: inset 3px 0 0 transparent; }
.rp-t tr.rc--grow td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.rp-t tr.rc--drop td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.rp-t tr.rc--stock td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.rp-t tr.rc--dead td:first-child, .rp-t tr.rc--promo td:first-child { box-shadow: inset 3px 0 0 var(--violet); }
.rp-t tr.rc--floor td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.rp-t tr.rc--skip td:first-child { box-shadow: inset 3px 0 0 var(--line-strong); }
.rp-t .c-go { padding-left: 0; padding-right: 0; text-align: center; }
.rp-t .c-go a { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 44px; color: var(--text-faint); font-size: 20px; text-decoration: none; }
/* решение + кнопка сценария в одно нажатие (К16 / п.1 spec): тег сверху, маленькая кнопка под ним */
.rp-dec { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.rp-dec .btn { min-height: 26px; padding: 0 10px; font-size: 14px; line-height: 1; }
.pchg { display: inline-flex; align-items: baseline; gap: 6px; }
.pchg__was { color: var(--text-muted); }
.pchg__ar { color: var(--text-faint); }
.pchg__now { color: var(--text-strong); }
.pchg__d { display: none; font-size: var(--fs-label); color: var(--text-muted); }
.pane { position: sticky; top: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s5); }
.pane__body { display: flex; flex-direction: column; gap: var(--s3); }
.pane__close { display: none; }
.pane__top { display: flex; gap: var(--s3); align-items: flex-start; }
.pane__img { width: 84px; height: 112px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); flex: none; }
.pane__sku .sku2__img { display: none; }
.pane__sku .sku2__name { font-size: 15px; -webkit-line-clamp: 3; }
.pane__sku .sku2__meta { white-space: normal; }
.pane__price { display: flex; align-items: flex-end; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pane__lbl { font-size: var(--fs-label); color: var(--text-muted); }
.pane__was { font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--text-muted); }
.pane__now { font-size: 28px; font-weight: 650; line-height: 1.1; color: var(--text-strong); }
.pane__ar { font-size: 20px; color: var(--text-faint); padding-bottom: 4px; }
.pane__d { margin-left: auto; font-size: 15px; color: var(--text-muted); padding-bottom: 4px; }
.pane__why { font-size: var(--fs-label); color: var(--text); margin: 0; overflow-wrap: anywhere; }
.pane__facts { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--s3); margin: 0; font-size: var(--fs-label); }
.pane__facts dt { color: var(--text-muted); }
.pane__facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.pane__acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pane__acts form { margin: 0; }
/* ≤ 1279: таблица во всю ширину, панель — шторка снизу (открывает app.js или ?nm=); справа панель только от 1280 px —
   на 1024 при панели 320 px колонке «Товар» оставалось 0 px (решение директора 14.10) */
@media (max-width: 1279px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .pane { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 86dvh; overflow: auto; border-radius: 16px 16px 0 0; z-index: 50; transform: translateY(110%); transition: transform var(--t) var(--ease); }
  .pane.is-open { transform: none; }
  .pane__close { display: flex; align-items: center; justify-content: center; position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; font-size: 26px; color: var(--text-muted); text-decoration: none; }
  body.sheet::after { content: ""; position: fixed; inset: 0; background: rgba(13,10,20,.45); z-index: 40; }
  .pane__top { padding-right: 40px; }          /* крестик 44 px справа сверху не налезает на название */
  /* статус — одна строка, подробности по раскрытию; «Подробнее ▾» не переносится */
  .statusline > summary { flex-wrap: nowrap; gap: var(--s3); white-space: nowrap; }
  .statusline__item { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .statusline__item .dot { display: inline-block; vertical-align: middle; margin-right: 6px; }
  .statusline__more { flex: none; margin-left: auto; }
  /* карточки менеджеров — лента в один ряд, прокрутка внутри ленты */
  .mks { display: flex; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .mks::-webkit-scrollbar { display: none; }
  .mk { flex: 0 0 auto; min-width: 128px; box-shadow: none; }
  .tagbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .tagbar::-webkit-scrollbar { display: none; }
  .tagf { flex: none; white-space: nowrap; }
}
@media (max-width: 767px) {
  /* кабинет — первым рядом; менеджер, предмет и поиск — одним рядом под ним */
  .rp-fbar { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s2); }
  .rp-fbar .seg { flex: 1 0 100%; display: flex; padding: 2px; }
  .rp-fbar .seg a { flex: 1; justify-content: center; padding: 0 8px; min-height: 36px; }
  .rp-fbar .select { flex: 1 1 0; min-width: 0; }
  .rp-fbar .select select { width: 100%; min-width: 0; }
  .rp-fbar .rp-search { flex: 1.2 1 0; min-width: 0; }
  .disclose__hint, .mk__adv { display: none; }
  .rp-bar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
  .rp-bar > details { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
  .rp-bar > details[open] { flex-basis: 100%; }
  .rp-bar .statusline > summary { padding: 6px var(--s3); }
  .rp-bar .statusline { flex-grow: 2; }
  .rp-bar .statusline__item ~ .statusline__item { display: none; }  /* в строке — главное; остальное в раскрытии */
  .rp-bar .disclose__title::first-letter { text-transform: uppercase; }
  .rp-bar .statusline__more { font-size: 0; }                       /* «Подробнее» — только ▾ */
  .rp-bar .statusline__more::after { font-size: var(--fs-label); }
  .rp-bar .disclose > summary { padding: 6px var(--s3); font-size: var(--fs-label); flex-wrap: nowrap; white-space: nowrap; }
  .rp-bar .disclose > summary .badge { display: none; }             /* «изменён с сайта» — в раскрытии нет места в 165 px */
  /* до первого товара на 375 — меньше 600 px: теги лентой, без подзаголовка и счётчика, плотнее отступы */
  .rp-head .page-head__sub, .rp-fbar .fbar__count { display: none; }
  .rp-head { margin-bottom: var(--s2); }
  .mks, .rp-fbar { margin-bottom: var(--s2); }
  .disclose > summary { min-height: 44px; }
  .mk { padding: 6px var(--s3); }
  .mk__val { font-size: 24px; }

  .rp-search { max-width: none; }
  .rp-t thead, .rp-t td:nth-child(2), .rp-t td:nth-child(3) { display: none; }
  .rp-t, .rp-t tbody { display: block; }
  .rp-t tr { display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 6px 8px; padding: 10px var(--s4); border-bottom: 1px solid var(--line); }
  .rp-t td { display: block; border: 0; padding: 0; }
  .rp-t .col-sticky { position: static; }
  .rp-t .col-sticky::after { display: none; }
  .rp-t .c-sku { grid-column: 1; width: auto; min-width: 0; max-width: none; }
  .rp-t td.r { grid-column: 1; text-align: left; }
  .rp-t td:nth-child(5) { grid-column: 1; }
  .rp-t .c-go { grid-column: 2; grid-row: 1 / 4; align-self: center; width: auto; }
  .rp-t .pchg__d { display: inline; }
  .rp-dec { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s2); }
  .rp-dec .btn { min-height: 36px; }
  .rp-t tbody tr td:first-child, .rp-t tbody tr[class] td:first-child { box-shadow: none; }
  .rp-t tr.rc--grow { box-shadow: inset 3px 0 0 var(--green); }
  .rp-t tr.rc--drop { box-shadow: inset 3px 0 0 var(--blue); }
  .rp-t tr.rc--stock { box-shadow: inset 3px 0 0 var(--yellow); }
  .rp-t tr.rc--dead, .rp-t tr.rc--promo { box-shadow: inset 3px 0 0 var(--violet); }
  .rp-t tr.rc--floor { box-shadow: inset 3px 0 0 var(--red); }
  .rp-t tbody tr[aria-selected="true"] td { background: none; }
}

/* Этап 6: совет «Да/Нет» в панели Репрайсера и метка ↑1/↓1 в ячейке «Решение» */
.adv6 { display: flex; flex-direction: column; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-label); }
.adv6__head { display: flex; align-items: center; gap: var(--s2); color: var(--text-strong); }
.adv6__what .adv6-mark { margin: 0 4px 0 0; }
.adv6__what { margin: 0; color: var(--text-strong); overflow-wrap: anywhere; }
.adv6__facts { margin: 0; padding-left: 18px; line-height: 1.5; }
.adv6__muted { margin: 0; color: var(--text-muted); overflow-wrap: anywhere; }
.adv6__done { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--surface-2); }
.adv6__form { display: flex; flex-direction: column; gap: var(--s2); }
.adv6__why { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.adv6__why legend { padding: 0; margin-bottom: 6px; color: var(--text-muted); }
.adv6-chip { display: inline-flex; cursor: pointer; }
.adv6-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.adv6-chip span { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); }
.adv6-chip input:checked + span { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-text); }
.adv6-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.adv6__text { font-size: 16px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text); min-width: 0; }
.adv6__btn { min-height: 44px; }
.adv6__yes { order: -1; }
.adv6-hyp { font-size: 14px; padding: 1px 8px; border-radius: 999px; background: var(--violet-bg); color: var(--violet-text); }
.adv6-mark { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.adv6-mark--up { background: var(--green-bg); color: var(--green-text); }
.adv6-mark--down { background: var(--blue-bg); color: var(--blue-text); }
.adv6-mark--done { opacity: .55; }
.adv6-dec { margin-top: var(--s4); }
@media (min-width: 1280px) { .adv6-scroll { max-height: calc(100vh - 32px - 2 * var(--s5)); overflow-y: auto; overscroll-behavior: contain; } }

/* ---------- 23. Общие кирпичи этапа 5 (пакет 0): таблица по содержимому, шапка в 2 строки, полоса прокрутки, «?», строка-вопрос ---------- */
/* .table--fit — ширина по содержимому: без width:100% пустые половины колонок («Категория», «Тип») уходят */
.table.table--fit { width: auto; }
@media (min-width: 768px) { .table--fit .sku2 { min-width: 276px; max-width: 336px; } }   /* ячейка «товар» 300–360 px с отступами */
/* вторая строка шапки (единицы, период) под кнопкой сортировки; переносится по словам */
.th2 { display: block; font-weight: 500; font-size: var(--fs-label); line-height: 1.25; white-space: normal; }
/* полоса прокрутки видна всегда (на Mac не overlay), тень у правого края — только когда справа есть что прокрутить:
   белая «крышка» (local) едет с содержимым и закрывает тень (scroll), когда край таблицы дошёл до края карточки */
.table-scroll {
  background-color: var(--surface);
  background-image: linear-gradient(to left, var(--surface) 40%, transparent), linear-gradient(to left, rgba(31,42,55,.14), transparent);
  background-position: right center, right center; background-size: 32px 100%, 12px 100%; background-repeat: no-repeat;
  background-attachment: local, scroll;
}
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: var(--surface-2); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid var(--surface-2); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
@supports not selector(::-webkit-scrollbar) { .table-scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--surface-2); } }
/* «?» у заголовка: <details>, открывается кликом и клавиатурой; панель ≤ 480 px, на телефоне — во всю ширину */
.help { position: relative; display: inline-block; vertical-align: middle; }
.help__btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; box-sizing: border-box; border: 1px solid var(--line-strong);
  border-radius: 50%; color: var(--text-muted); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; list-style: none; user-select: none; }
.help__btn::-webkit-details-marker { display: none; }
.help__btn:hover, .help[open] > .help__btn { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-text); }
.help__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help__pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: max-content; max-width: 480px; padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  color: var(--text); font-size: var(--fs-label); font-weight: 400; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.help__pop p { margin: 0 0 6px; }
.help__pop > :last-child { margin-bottom: 0; }
/* page_q: заголовок + «?» в ряд, вопрос — одна строка с многоточием (полный текст в title) */
.page-head__q { flex: 1 1 320px; min-width: 0; max-width: 100%; }
.page-head__t { display: flex; align-items: center; gap: var(--s2); }
.page-head__q .page-head__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767px) {
  .page-head__t { position: relative; }
  .help { position: static; }
  .help__pop { left: 0; right: 0; width: auto; max-width: none; }
}
