/* Ассортимент — отличия по точкам и деньги в запасе */

.as-loading { padding: 24px; color: var(--text-muted, #6b7280); }
.as-snap { margin-left: 12px; font-size: 12px; color: var(--text-muted, #6b7280); }

.as-tiles { display: flex; gap: 10px; margin: 2px 0 10px; flex-wrap: wrap; }
.as-tile {
  flex: 1 1 140px; min-width: 130px;
  padding: 8px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  background: var(--surface, #fff);
}
.as-tile--warn { border-color: #f59e0b; }
.as-tile__v { font-size: 18px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.as-tile__l { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 2px; }

.as-body { display: flex; flex-direction: column; min-height: 0; }

.as-bar { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; flex-shrink: 0; }
.as-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.as-chip {
  border: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.as-chip span { font-variant-numeric: tabular-nums; color: var(--text-muted, #6b7280); font-size: 12px; }
.as-chip:hover { border-color: #9ca3af; }
.as-chip--on { background: #111827; color: #fff; border-color: #111827; }
.as-chip--on span { color: #d1d5db; }
.as-chip--warn:not(.as-chip--on) { border-color: #fcd34d; }
.as-chip--bad:not(.as-chip--on)  { border-color: #fca5a5; }

.as-sel, .as-search {
  height: 28px; font-size: 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px;
  padding: 0 10px; font-size: 13px; background: var(--surface, #fff);
}
.as-search { flex: 1; min-width: 180px; max-width: 320px; margin-left: auto; }

/* Высота от окна, а не от содержимого, и не в зависимости от того, флексовый
   ли предок: на большом экране таблица занимает экран, на маленьком не
   выпихивает страницу за край. */
.as-scroll {
  overflow: auto;
  max-height: calc(100vh - 300px);
  min-height: 280px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
}

/* Плотность рассчитана на 13": сеть из пяти точек плюс итоги должна
   помещаться по ширине без горизонтальной прокрутки. */
.as-tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; background: var(--surface, #fff); }
.as-tbl th, .as-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--border, #eef0f3); }
.as-tbl tbody td { vertical-align: top; }

/* Шапка держится сверху, первая колонка — слева. Иначе при прокрутке вбок
   видно столбцы цифр и не видно, чья это строка. */
/* Шапка выше и в две строки: подписи переносятся, колонки от этого узкие. */
.as-tbl thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f8fafc; text-align: left; font-weight: 600; font-size: 11px;
  color: #374151; white-space: normal; line-height: 1.25;
  height: 42px; vertical-align: bottom; padding-bottom: 7px;
  border-bottom: 1px solid #d1d5db;
}
/* Двести пятьдесят точек не хватало: названия позиций в 1С длинные, и хвост
   с заводом — как раз то, чем позиции внутри наименования отличаются, — уходил
   в многоточие. Особенно там, где в одно наименование свели разные заводы. */
.as-tbl .as-th-name, .as-tbl .as-name {
  position: sticky; left: var(--note-w, 0px); z-index: 2; background: var(--surface, #fff);
  width: 340px; min-width: 340px; max-width: 340px;
  box-shadow: 1px 0 0 var(--border, #e5e7eb);
}
.as-tbl thead .as-th-name { z-index: 4; background: #f8fafc; }
/* Правило шапки (.as-tbl thead th) специфичнее одиночного класса, поэтому
   выравнивание числовых колонок задаём с тем же весом — иначе подпись стоит
   слева, а число под ней справа. */
.as-tbl thead th.as-th-num,
.as-tbl thead th.as-th-store { text-align: right; }
.as-tbl th.as-th-num { width: 78px; min-width: 78px; }
.as-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* В разрезе одного магазина колонок вдвое меньше, и ширина таблицы
   растаскивала их по экрану. Прижимаем содержимое влево пустым добором
   справа: колонки остаются своей ширины, а не тянутся. */
.as-tbl { width: auto; min-width: 100%; }
.as-tbl .as-th-fill, .as-tbl .as-fill { width: auto; padding: 0; border-bottom: 0; }

/* Строку ведут глазами через всю ширину экрана, и бледная подсветка на этом
   пути теряется. Липкая колонка названия красится отдельно: у неё свой фон,
   иначе она осталась бы белой полосой посреди подсвеченной строки. */
.as-tbl tbody tr:hover > td { background: #e8f0fe; }
.as-tbl tbody tr:hover .as-name { background: #dfe9fc; }
.as-tbl tbody tr:hover > td.as-cell--empty { background: #e8f0fe; }

/* Название переносится на вторую строку, а не обрывается: длинные имена
   различаются как раз концом — «... (Кайман)» против «... (Калачинск)». Третью
   строку не даём, иначе строки таблицы скачут по высоте. */
.as-name__t {
  font-weight: 500; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Вторая строка под наименованием — отличие. Отдельной колонкой оно съедало
   больше двухсот точек ширины ради текста, который читают глазами один раз. */
.as-name__g {
  font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.as-poz { color: #9ca3af; }
/* «Отличие» стоит первой колонкой и липнет к левому краю вместе с
   наименованием: между названием и цифрами она разрывала строку, а по краю
   читается как пометка на полях. Фраза бывает длинной («нет в: Канск,
   Назарово, Ачинск Кирова»), поэтому ширина жёсткая, две строки мелким,
   остальное — в подсказке. Колонку можно выключить галочкой в фильтрах. */
.as-tbl .as-th-note, .as-tbl .as-note {
  position: sticky; left: 0; z-index: 2; background: var(--surface, #fff);
  width: 104px; min-width: 104px; max-width: 104px;
  padding-right: 6px;
}
.as-tbl thead .as-th-note { z-index: 4; background: #f8fafc; }
/* Обрезка висит на внутреннем блоке, а НЕ на ячейке. Клэмп превращает элемент
   в -webkit-box, и ячейка перестаёт быть ячейкой: высота и выравнивание едут,
   строки разъезжаются по вертикали — это и были «разрывы». */
.as-note { vertical-align: top; cursor: help; }
.as-note__t {
  font-size: 10.5px; line-height: 1.15; color: var(--text-muted, #6b7280);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Наименование липнет следом за «Отличием», а без него — к самому краю.
   Сдвиг задаётся переменной, чтобы не держать два одинаковых числа. */
.as-tbl { --note-w: 104px; }
.as-tbl.as-tbl--nonote { --note-w: 0px; }

/* В разрезе одного филиала «Отличие» несёт главный ответ — есть ли позиция у
   соседей, — и мельчить его незачем: колонок по точкам там нет, место есть. */
.as-tbl--store { --note-w: 210px; }
.as-tbl--store .as-th-note, .as-tbl--store .as-note {
  width: 210px; min-width: 210px; max-width: 210px;
}
.as-tbl--store .as-note__t {
  font-size: 12px; line-height: 1.3; color: var(--text-primary, #0f1117);
  -webkit-line-clamp: 3;
}
.as-num--zero { color: #d1d5db; }
.as-num--rev { color: var(--text-muted, #6b7280); }
.as-num--money { font-weight: 600; }

/* Две крайности запаса красим одинаково во всех режимах: «кончится на днях» и
   «лежит третий месяц» — оба повод действовать, просто в разные стороны.
   В разрезе точки подсветка была только у общего вида, и риск там не читался. */
.as-days--crit { color: #b91c1c; font-weight: 600; }
.as-days--low  { color: #b45309; }
.as-days--slow { color: #b45309; }
.as-days--dead { color: #b91c1c; font-weight: 600; }
/* Строка целиком подсвечивается по краям шкалы: ряд цифр по всей ширине
   читается быстрее, чем одна крашеная ячейка в середине. */
.as-tbl--store tr.as-row:has(.as-days--crit) > td,
.as-tbl--store tr.as-row:has(.as-days--dead) > td { background: #fff6f5; }
.as-tbl--store tr.as-row:has(.as-days--crit):hover > td,
.as-tbl--store tr.as-row:has(.as-days--dead):hover > td { background: #e8f0fe; }

.as-empty { padding: 28px; text-align: center; color: var(--text-muted, #6b7280); }

/* ── Фильтры, сортировка, раскрытие ───────────────────────────────────────── */
.as-bar--filters { padding-top: 0; }
.as-count { font-size: 12px; color: var(--text-muted, #6b7280); font-variant-numeric: tabular-nums; }

.as-sortable { cursor: pointer; user-select: none; }
.as-sortable:hover { color: #111827; background: #eef2f7; }
.as-sorted { color: #111827; }
.as-arrow { margin-left: 4px; font-size: 11px; }

.as-tbl tbody .as-row { cursor: pointer; }
.as-caret { display: inline-block; width: 12px; color: #9ca3af; font-size: 10px; }
.as-caret--none { visibility: hidden; }

.as-kid td { background: #fbfcfd; font-size: 11px; }
.as-kid .as-name--kid { padding-left: 26px; background: #fbfcfd; }
.as-kid__load { color: var(--text-muted, #6b7280); padding: 10px 26px; }

.as-num--opt { color: #2563eb; }
/* Не сопоставлено со справочником опта — не «пусто», а «не знаем»: тот же
   янтарный, что у остальных поводов проверить руками, не синий факта. */
.as-num--opt-unknown { color: #b45309; font-style: italic; }
.as-num--opt-stale   { text-decoration: underline dotted #b45309; text-underline-offset: 3px; }

/* Отличие подсвечивается по смыслу: дыра — то, с чем идут работать. */
.as-note--gap, .as-note--missing_one { color: #b45309; }
.as-note--nowhere, .as-note--none    { color: #b91c1c; }
.as-note--unique, .as-note--only_one { color: #1d4ed8; }
.as-note--all, .as-note--common      { color: var(--text-muted, #6b7280); }
.as-sel--store { font-weight: 600; }

/* ── Сниппет филиала: остаток · хватит · скорость ──────────────────────────── */
.as-th-store {
  text-align: right; cursor: pointer; user-select: none;
  width: 86px; min-width: 86px;
}
.as-cell {
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
  line-height: 1.2; padding: 4px 8px;
}
.as-cell__q { font-weight: 600; font-size: 12px; }
.as-cell__d { font-size: 11px; }
.as-cell__s { font-size: 10px; color: #9ca3af; }
/* Средняя скорость одной торгующей точки — под суммарной по сети. Мельче:
   это уточнение к строке, а не вторая главная цифра. */
.as-cell__avg {
  font-size: 10px;
  color: var(--text-muted, #9ca3af);
  margin-top: 1px;
  white-space: nowrap;
}

/* Метка «скорость занижена»: товара не было на полке часть окна, и деление
   на все шесть недель дало цифру меньше настоящей. Спорную цифру помечаем
   у самой цифры — сноска внизу таблицы до неё не доносится. */
.as-shelf { color: #d97706; font-size: 10px; cursor: help; }
.as-cell--empty { color: #d1d5db; }

/* Сетевой сниппет — последний в ряду, отделяем чертой. */
.as-tbl tr > .as-cell:last-of-type,
.as-tbl thead th.as-th-store:last-of-type { border-left: 1px solid var(--border, #e5e7eb); }

/* Отличие вернулось колонкой, но узкой и с переносом строки. */
.as-th-note { width: 150px; min-width: 150px; }
.as-note {
  white-space: normal; line-height: 1.25; font-size: 11px;
  overflow-wrap: anywhere;
}

.as-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 3px; vertical-align: 1px;
  background: #f3f4f6; color: #6b7280; font-weight: 500;
}
.as-tag--paused { background: #fef3c7; color: #92400e; }
.as-tag--arch   { background: #e5e7eb; color: #4b5563; }
/* Пустое торговое поле — наша недоделка, а не состояние товара. Цвет тот же,
   что у предупреждающих фильтров, чтобы метка и кнопка читались как одно. */
.as-tag--gap    { background: #fef3c7; color: #92400e; cursor: help; }

/* Выведенный код внутри живого наименования: гасим строку, но не прячем —
   решение видно там же, где его принимали, и его можно отменить. */
.as-kid--off td { opacity: .55; }
.as-kid--off .as-name__t { text-decoration: line-through; text-decoration-thickness: 1px; }

/* Кнопка «вывести код» стоит под самим кодом, мелко: это точечное действие,
   ради него не заводят колонку на шесть сотен строк. */
.as-skumark {
  border: 0; background: none; padding: 0 0 0 8px;
  font-size: 10px; color: #6b7280; cursor: pointer; text-decoration: underline dotted;
}
.as-skumark:hover { color: #b45309; }

.as-kid--act td { padding: 6px 10px 6px 26px; background: #f8fafc; }
.as-mark-l { font-size: 11px; color: var(--text-muted, #6b7280); margin-right: 6px; }
.as-mark {
  border: 1px solid var(--border, #e5e7eb); background: #fff; cursor: pointer;
  border-radius: 999px; padding: 2px 10px; font-size: 11px; margin-right: 4px;
}
.as-mark:hover { border-color: #9ca3af; }
.as-mark--on { background: #111827; color: #fff; border-color: #111827; }

/* ── Режимы, нормы, заявка ────────────────────────────────────────────────── */
.as-modes { display: inline-flex; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; overflow: hidden; }
.as-mode {
  border: 0; background: #fff; cursor: pointer; padding: 5px 14px; font-size: 12px;
  border-right: 1px solid var(--border, #e5e7eb);
}
.as-mode:last-child { border-right: 0; }
.as-mode--on { background: #111827; color: #fff; }
.as-chip--ghost { border-style: dashed; }
.as-chip--w { padding: 4px 8px; }
.as-mark-l--sep { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--border, #e5e7eb); }

/* Шапка филиала и его ячейка выровнены одинаково — иначе числа съезжают
   относительно подписи. */
.as-tbl th.as-th-store, .as-tbl td.as-cell { text-align: right; padding-right: 10px; }

.as-cell--need { background: #fffbeb; }
.as-cell__need { font-size: 12px; font-weight: 600; color: #b45309; }
.as-num--need { font-weight: 600; color: #b45309; }

.as-norms { display: inline-flex; align-items: center; gap: 10px; margin-left: 18px; flex-wrap: wrap; }
.as-norm { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #6b7280; }
.as-norm input {
  width: 62px; height: 24px; font-size: 11px; text-align: right;
  border: 1px solid var(--border, #e5e7eb); border-radius: 4px; padding: 0 6px;
}

/* ── Лист заявки ──────────────────────────────────────────────────────────── */
.as-ord-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.as-ord { background: #fff; border-radius: 10px; width: min(900px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.as-ord-bar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb); font-size: 13px;
}
.as-ord-bar div { margin-right: auto; font-weight: 600; }
.as-ord-bar button { border: 1px solid var(--border, #e5e7eb); background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.as-ord-sheet { overflow: auto; padding: 18px 22px 26px; }
.as-ord-block { margin-bottom: 22px; }
.as-ord-block h3 { font-size: 14px; margin: 0 0 8px; }
.as-ord-block h3 span { font-weight: 400; color: #6b7280; font-size: 12px; }
.as-ord-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.as-ord-tbl th, .as-ord-tbl td { border-bottom: 1px solid #eef0f3; padding: 4px 8px; text-align: right; }
.as-ord-tbl th:first-child, .as-ord-tbl td:first-child { text-align: left; }
.as-ord-need { font-weight: 600; }

@media print {
  body.printing-sheet .as-ord-overlay { display: none !important; }
}

/* Хвост учёта — не наличие: показываем, но не считаем присутствием. */
.as-cell--trace .as-cell__q { color: #b45309; font-weight: 500; }
.as-cell--trace .as-cell__d { color: #9ca3af; }

/* ── Правки ОС поверх номенклатуры 1С ─────────────────────────────────────── */
.as-tag--ovr { background: #dbeafe; color: #1d4ed8; }
/* Наименование разбито по двум полкам: не ошибка разметки, а незаконченная
   разметка — совпало имя, не совпал подраздел. */
.as-tag--split { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
@media (prefers-color-scheme: dark) {
  .as-tag--split { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.35); color: #fbbf24; }
}
.as-mark--go { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
/* Разметку ведут в «Номенклатуре» — отсюда только ссылка туда, и выглядеть она
   должна подсказкой, а не ещё одной кнопкой действия. */
.as-mark--link {
  border-style: dashed;
  color: #2563eb;
  text-decoration: none;
  line-height: 1.6;
}
.as-mark--link:hover { border-color: #2563eb; background: #eff6ff; }
.as-edit {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border, #e5e7eb);
}
.as-edit label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #6b7280; }
.as-edit input {
  height: 26px; font-size: 12px; padding: 0 8px; min-width: 220px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 4px;
}
.as-edit-hint { font-size: 11px; color: #9ca3af; }
.as-kid-edit { display: flex; gap: 4px; margin-top: 4px; }
.as-kid-edit input {
  height: 22px; font-size: 11px; padding: 0 6px; width: 132px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 4px;
}

/* Сигнал, а не курьёз: позиция продаётся, а везти уже нечего. */
.as-cell--out { background: #fef2f2; }
.as-cell--out .as-cell__q { color: #b91c1c; font-weight: 600; }
.as-cell--crit { background: #fff7ed; }
.as-days--crit { color: #b91c1c; font-weight: 600; }
.as-days--low  { color: #b45309; }

/* Скорость, пересчитанная по дням в продаже: та же метка, но говорит об
   исправлении, а не о поломке. */
.as-shelf--fixed { color: #15803d; }

/* Выбор причины вывода. Причина спрашивается сразу: без неё пометка не говорит,
   что делать со средним по позиции. */
.as-ask__h { margin: 0 0 12px; font-size: 13px; line-height: 1.45; }
.as-ask__r {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.as-ask__r:hover { background: #f3f4f6; }
.as-ask__d {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  color: #b45309; background: #fef3c7; border-radius: 3px; padding: 1px 6px;
}
/* Подсказка под причиной: что произойдёт дальше, если выбрать эту. */
.as-ask__hint {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-muted, #6b7280);
  margin-top: 1px;
}

/* Точка, на которой позицию сознательно не держат. Пустая полка здесь — не
   дыра, а решение: приглушаем, а не красим красным. */
.as-cell--off { opacity: .5; }
/* Товар вернулся, а пометка осталась: не ошибка и не дыра — отработавшее
   решение, которое пора снять. Зелёным, потому что новость хорошая. */
.as-cell--back { background: #f0fdf4; }
.as-cell__d--back { color: #15803d; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .as-cell--back { background: rgba(34,197,94,.10); }
  .as-cell__d--back { color: #4ade80; }
}
.as-cell--off .as-cell__q { font-weight: 500; font-style: italic; }

/* Ячейка филиала в составе кликается: здесь ставится решение «не возим». */
.as-cell--pick { cursor: pointer; }
.as-cell--pick:hover { outline: 1px solid #93c5fd; outline-offset: -1px; }

.as-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--text-secondary, #4b5161); white-space: nowrap; }

/* Поиск: найденное в названии и коде, строка «нашлось по коду» под именем */
.as-hl { background: #ffe58a; color: inherit; border-radius: 2px; padding: 0 1px; }
.as-name__hit { font-size: 11px; color: var(--text-secondary, #555); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Установленная цена рядом с названием ТН (как на борде). */
.as-price { margin-left: 6px; font-weight: 600; font-size: 12.5px; color: var(--text-primary, #111827);
            font-variant-numeric: tabular-nums; white-space: nowrap; }
.as-price em { font-style: normal; font-size: 10px; color: var(--text-muted, #6b7280); font-weight: 400; }
.as-rub { font-size: 10.5px; color: var(--text-muted, #6b7280); margin-left: 1px; }

/* ── Модель статусов (23.10) ─────────────────────────────────────────────────
   Красный — нет, и никто не отметил почему. Жёлтый — нет, но ждём: причина
   записана. Фиолетовый — лежит без цены. Серый — не торгуем здесь. */
.as-cell--wait { background: #fefce8; }
.as-cell--wait .as-cell__q { color: #a16207; font-weight: 600; }
.as-cell--wait .as-cell__d { color: #a16207; }
.as-cell--noprice { background: #f5f3ff; }
.as-cell--noprice .as-cell__d { color: #6d28d9; font-weight: 600; }
.as-cell--tail { background: #f8fafc; }
.as-cell--tail .as-cell__q { color: #475569; font-weight: 600; }
.as-cell--sellout .as-cell__d { color: #0369a1; }
.as-cell__p { font-size: 10px; color: var(--text-secondary, #6b7280); margin-top: 1px; white-space: nowrap; }
.as-cell__p s { color: #9ca3af; }
.as-cell__p--promo { color: #b91c1c; }
.as-cell__p--none { color: #6d28d9; font-weight: 600; }
.as-chips--sig { flex-wrap: wrap; }
.as-chip--sig span { font-weight: 600; }
.as-sig--out span { color: #b91c1c; }
.as-sig--noprice span { color: #6d28d9; }
.as-sig--low span { color: #b45309; }
.as-sig--wait span { color: #a16207; }
.as-legend { font-size: 11px; color: var(--text-muted, #9ca3af); margin-left: 6px; }
.as-ask__grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #6b7280); margin: 12px 0 4px; }
.as-watch { font-size: 10.5px; padding: 0 7px; margin-left: 6px; border-radius: 9px; border: 1px dashed var(--border, #d1d5db); background: transparent; color: var(--text-muted, #9ca3af); cursor: pointer; opacity: 0; }
.as-row:hover .as-watch, .as-watch--on { opacity: 1; }
.as-watch--on { border: 1px solid #f59e0b; background: #fffbeb; color: #92400e; }
.as-ask__r { align-items: flex-start; }
.as-ask__season { margin: 10px 0 0 26px; padding: 8px 10px; background: #f8fafc; border-radius: 6px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.as-ask__season[hidden] { display: none; }
.as-ask__season select { margin-left: 6px; }
.as-ask__all { font-size: 12px; color: var(--text-secondary, #4b5563); }
.as-price--none { font-weight: 400; font-size: 11px; color: var(--danger, #b91c1c); }

/* Подпись в ячейке не раздвигает колонку: длинное — в подсказке */
.as-cell__d, .as-cell__s { max-width: 110px; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }

/* Строки-суммы: итог отбора и подразделы раздела */
.as-sum > td { background: #f8fafc; border-bottom: 1px solid var(--border, #e5e7eb); }
.as-sum .as-name__t { font-weight: 700; }
.as-sum--sub { cursor: pointer; }
.as-sum--sub > td { background: #f1f5f9; }
.as-sum--sub:hover > td { background: #e2e8f0; }
.as-sum__out { font-size: 10px; color: #b91c1c; font-weight: 600; }

/* Раскрытое наименование и его коды — различимы с одного взгляда
   (24.10): строка ТН плотно подсвечена с чертой сверху, коды под ней —
   с отступом и синей полосой слева, как вложенный список. */
.as-tbl tr.as-row--open > td { background: #dbeafe; border-top: 2px solid #2563eb; }
.as-tbl tr.as-row--open .as-name__t { font-weight: 800; }
.as-tbl tr.as-row--open .as-caret { color: #2563eb; transform: rotate(90deg); display: inline-block; }
.as-kid > td { background: #f8fbff; }
.as-kid .as-name--kid { padding-left: 34px; background: #f8fbff; box-shadow: inset 5px 0 0 #93c5fd; }
.as-kid--act > td { background: #eff6ff; box-shadow: inset 5px 0 0 #93c5fd; }
.as-kid--act > td ~ td { box-shadow: none; }

/* Лежит, а за 7 дней ни одной продажи */
.as-cell--stuck { background: #fdf4ff; }
.as-cell--stuck .as-cell__q { color: #a21caf; font-weight: 600; }
.as-cell--stuck .as-cell__d { color: #a21caf; font-weight: 600; }
.as-sig--stuck.as-chip--on { background: #a21caf; border-color: #a21caf; }
.as-sig--stuck span { color: #a21caf; }
/* ТН внутри подраздела — со сдвигом, коды — ещё глубже */
.as-tbl tr.as-row--insub > td.as-name { padding-left: 22px; box-shadow: inset 3px 0 0 #cbd5e1; }
.as-tbl tr.as-row--insub.as-row--open > td.as-name { box-shadow: inset 3px 0 0 #2563eb; }

/* ── 26.10: панель, действия, хвосты, контроль ─────────────────────────── */

/* Панель над таблицей: одна строка на виду, остальное — «Ещё настройки» */
.as-more {
  height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); white-space: nowrap;
}
.as-more b { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: #111827; color: #fff; font-size: 11px; }
.as-more--on { background: #f1f5f9; }
.as-bar--more {
  background: #f8fafc; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 8px 10px; margin-bottom: 4px;
}
.as-bar--more[hidden] { display: none; }
.as-count { font-size: 12px; color: var(--text-muted, #6b7280); white-space: nowrap; }
.as-chips--sig .as-count { margin-left: auto; align-self: center; }
.as-search { margin-left: 0; }
/* Таблицу прокрутили — панель сжимается до первой строки */
.as-body--compact .as-bar--more,
.as-body--compact .as-chips--sig { display: none; }

/* Действия строки — значок справа в ячейке названия, вне обрезаемого текста:
   длинное имя поставщика больше не выталкивает кнопку за край */
.as-tbl td.as-name { padding-right: 26px; }
.as-act {
  position: absolute; top: 4px; right: 3px; width: 20px; height: 20px; padding: 0;
  border: 1px solid #e5e7eb; border-radius: 5px; background: #fff;
  color: #4b5563; font-size: 14px; line-height: 16px; cursor: pointer;
}
.as-tbl tr:hover .as-act { border-color: #cbd5e1; background: #fff; color: #374151; }
.as-act:hover { border-color: #2563eb !important; color: #2563eb !important; }
.as-actmenu { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 280px; }
.as-actmenu__h { margin: -2px 0 8px; font-size: 12px; color: var(--text-muted, #6b7280); max-width: 340px; }

/* Вторая строка названия: метки и цена первыми — их не обрезать */
.as-name__g .as-price { font-size: 11px; margin: 0 2px 0 0; }
.as-name__g .as-tag { font-size: 10px; padding: 0 5px; margin-left: 0; }
.as-tag--ctl   { background: #fee2e2; color: #991b1b; font-weight: 600; }
.as-tag--watch { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Похоже на хвост: в 1С есть, не менялся две недели, продаж нет */
.as-cell--trace { background: repeating-linear-gradient(135deg, #f8fafc 0 6px, #f1f5f9 6px 12px); }
.as-cell--trace .as-cell__q { color: #64748b; font-weight: 600; }
.as-cell--trace .as-cell__d { color: #94a3b8; }
.as-sig--tail span { color: #475569; }

/* Блок «на контроле у руководства» — над таблицей */
.as-ctl-h > td {
  position: sticky; left: 0; background: #fef2f2 !important; color: #991b1b;
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid #fecaca;
}
.as-ctl-h span { font-weight: 400; color: #b91c1c; }
.as-ctl-end > td { height: 6px; padding: 0; background: #fef2f2; border-bottom: 2px solid #fecaca; }
.as-sig--control { border-color: #fca5a5; }
.as-sig--control span { color: #b91c1c; }
.as-sig--control.as-chip--on { background: #b91c1c; border-color: #b91c1c; }

/* Ноутбук: липкие колонки слева уже — под цифры остаётся больше места */
@media (max-width: 1500px) {
  .as-tbl .as-th-name, .as-tbl .as-name { width: 250px; min-width: 250px; max-width: 250px; }
  .as-tbl { --note-w: 92px; }
  .as-tbl.as-tbl--nonote { --note-w: 0px; }
  .as-tbl .as-th-note, .as-tbl .as-note { width: 92px; min-width: 92px; max-width: 92px; }
  .as-tbl--store { --note-w: 160px; }
  .as-tbl.as-tbl--store .as-th-note, .as-tbl.as-tbl--store .as-note { width: 160px; min-width: 160px; max-width: 160px; }
}

/* ── 26.10, второй заход: во всю высоту, крупнее, плотнее, опт по городам ── */

/* Экран — ровно в окно; прокручивается только таблица */
.as-page {
  height: calc(100vh - 36px); margin-bottom: -28px;
  display: flex; flex-direction: column; min-height: 0;
}
.as-page > .page-header { margin-bottom: 6px; flex-shrink: 0; }
.as-page .as-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.as-panel { flex-shrink: 0; }
.as-page .as-scroll { flex: 1; min-height: 0; max-height: none; }

/* Крупнее и плотнее: таблица не растягивается на всю ширину — на большом
   мониторе цифры стоят рядом с названием, глазу не надо гулять */
.as-tbl { font-size: 13px; width: auto; min-width: 0; }
.as-tbl th, .as-tbl td { padding: 4px 7px; }
.as-cell { padding: 4px 7px; line-height: 1.25; }
.as-cell__q { font-size: 13.5px; }
.as-cell__d { font-size: 12px; }
.as-cell__s { font-size: 11px; color: #7b8494; }
.as-name__t { font-size: 13px; }
.as-name__g { font-size: 11.5px; }
/* Обычная ячейка — две строки: дни и остаток, под ними скорость */
.as-cell__row { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; }
.as-cell__row .as-cell__d { max-width: none; margin-left: 0; }

/* Раскрытие не двигает строки: без жирного и без черты сверху */
.as-tbl tr.as-row--open > td { border-top: 0; box-shadow: inset 0 2px 0 #2563eb; }
.as-tbl tr.as-row--open .as-name__t { font-weight: 500; }
.as-tbl tr.as-row--open td.as-name { box-shadow: inset 0 2px 0 #2563eb, inset 4px 0 0 #2563eb; }

/* Группы «точки + их склад» разделены чертой; склад — подкрашен */
.as-tbl .as-grp-start { border-left: 2px solid #dbe3ee !important; }
.as-tbl th.as-th-opt { background: #eef4fb; color: #1e3a8a; width: 74px; min-width: 74px; }
.as-tbl td.as-num--opt { background: #f5f9fe; }
.as-opt__q { font-size: 13px; color: #1e40af; }
.as-opt__t { font-size: 10.5px; color: #94a3b8; white-space: nowrap; }
.as-th-mine { color: #1d4ed8 !important; box-shadow: inset 0 -3px 0 #2563eb; }
.as-ord-note { font-size: 12px; margin: 0 0 10px; }
/* Ширина под 13 дюймов: пять точек, три склада, сеть и Красноярск */
.as-page { margin-left: -12px; margin-right: -14px; }
.as-tbl .as-th-store { width: 80px; min-width: 80px; }
@media (max-width: 1500px) {
  .as-tbl .as-th-name, .as-tbl .as-name { width: 220px; min-width: 220px; max-width: 220px; }
  .as-tbl .as-th-store { width: 74px; min-width: 74px; }
  .as-tbl th.as-th-opt { width: 62px; min-width: 62px; }
  .as-tbl th, .as-tbl td, .as-cell { padding-left: 5px; padding-right: 5px; }
}
.as-th-unit { display: block; font-size: 10.5px; font-weight: 400; color: #94a3b8; margin-top: 2px; }
/* Слова состояния («нет дольше 6 нед») переносятся, а не раздвигают колонку */
.as-tbl td.as-cell:not(.as-cell--norm) .as-cell__d,
.as-tbl td.as-cell:not(.as-cell--norm) .as-cell__q { white-space: normal; max-width: 78px; margin-left: auto; }
@media (max-width: 1500px) {
  .as-tbl .as-th-name, .as-tbl .as-name { width: 205px; min-width: 205px; max-width: 205px; }
}
/* Лист на списание: название слева, цифры в строку, графа под ручку */
.as-tail-tbl th, .as-tail-tbl td { text-align: left; }
.as-tail-tbl td:nth-child(1), .as-tail-tbl td:nth-child(3), .as-tail-tbl td:nth-child(4) { white-space: nowrap; }
.as-tail-tbl td:nth-child(3), .as-tail-tbl td:nth-child(4) { text-align: right; }
.as-tail-tbl td:nth-child(5) { width: 90px; border-bottom: 1px solid #000; }

/* ── 26.10, третий заход: группы в шапке, три строки, чередование ─────── */
.as-cell__q { font-size: 14px; }
.as-cell__d { font-size: 12px; }
.as-cell__s { font-size: 11px; }
.as-tbl tbody td { padding-top: 5px; padding-bottom: 5px; }

/* Строка групп: склад и его точки — один блок */
.as-tbl--grp thead tr.as-grp-h th {
  top: 0; height: 26px; padding: 4px 8px; text-align: left; vertical-align: middle;
  font-size: 12.5px; font-weight: 700; color: #0f172a; background: #eef2f7;
  border-bottom: 1px solid #dbe3ee;
}
.as-tbl--grp thead tr.as-grp-h th span { font-weight: 400; color: #64748b; font-size: 11px; margin-left: 6px; }
.as-tbl--grp thead tr:nth-child(2) th { top: 26px; }
.as-tbl--grp thead tr.as-grp-h th.as-th-name,
.as-tbl--grp thead tr.as-grp-h th.as-th-note { z-index: 5; }

/* Чередование строк наименований — глазу легче вести строку через ширину */
.as-tbl tbody tr.as-row:nth-child(even) > td { background: #fafbfd; }
.as-tbl tbody tr.as-row:nth-child(even) > td.as-name { background: #fafbfd; }
.as-tbl tbody tr.as-row:nth-child(even) > td.as-num--opt { background: #f1f6fd; }

/* Нет данных для запаса — приглушённо, курсивом */
.as-cell--unsure .as-cell__d, .as-days--unsure { color: #94a3b8 !important; font-style: italic; }
@media (max-width: 1500px) {
  .as-tbl .as-th-name, .as-tbl .as-name { width: 192px; min-width: 192px; max-width: 192px; }
}
.as-tbl td.as-cell--ord .as-cell__d, .as-tbl td.as-cell--ord .as-cell__q { white-space: nowrap; max-width: none; }
.as-tbl td.as-cell--ord { min-width: 96px; }
.as-opt__d { font-size: 12px; color: #334155; }
.as-opt__s { font-size: 11px; color: #7b8494; }
@media (max-width: 1500px) {
  .as-tbl .as-th-name, .as-tbl .as-name { width: 186px; min-width: 186px; max-width: 186px; }
}

/* «Почти не берут» (12.11): остаток лежит, уходит меньше 1 кг в неделю */
.as-cell--slow { background: #fff7ed; }
.as-cell--slow .as-cell__d, .as-days--slow { color: #c2410c !important; font-weight: 600; font-style: normal; }
.as-cell--slow .as-cell__s { color: #c2410c; }
@media (prefers-color-scheme: dark) {
  .as-cell--slow { background: rgba(194, 65, 12, .14); }
  .as-cell--slow .as-cell__d, .as-days--slow, .as-cell--slow .as-cell__s { color: #fb923c !important; }
}

/* Меню «⋯» у наименования (12.11): решения по наименованию разделом сверху */
.as-actmenu__sec { margin: 8px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted, #6b7280); }
.as-actmenu__sec:first-child { margin-top: 0; }
.as-actmenu__on { border-color: #15803d !important; color: #15803d !important; font-weight: 600; }
.as-out__to { margin: -2px 0 8px 26px; }
.as-out__to .as-inp { width: 100%; max-width: 360px; padding: 6px 8px; font: inherit; font-size: 13px;
  border: 1px solid var(--border, #d1d5db); border-radius: 6px; background: var(--bg, #fff); color: inherit; }

/* Неделя против среднего (13.11): в режиме «последние 7 дней» — стрелка с процентом */
.as-dev { font-weight: 700; font-size: 10.5px; white-space: nowrap; }
.as-dev--up { color: #15803d; }
.as-dev--down { color: #b91c1c; }
/* Резкая смена за 7 дней (18.11): только строка текста, без заливки ячейки */
.as-cell__shift { font-size: 10.5px; font-weight: 600; white-space: nowrap; color: var(--text-muted, #6b7280); }
.as-cell__shift--down { color: #b91c1c; }
.as-cell__shift--up { color: #15803d; }
.as-sel--speed { font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .as-dev--up { color: #4ade80; }
  .as-dev--down { color: #f87171; }
  .as-cell__shift--down { color: #f87171; }
  .as-cell__shift--up { color: #4ade80; }
}

/* «В запросы опта» из листа пополнения (20.11) */
.as-rp-block { margin-bottom: 14px; }
.as-rp-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.as-rp-h span { color: var(--text-muted, #6b7280); font-size: 12px; }
.as-rp-note { font-size: 12px; color: var(--text-muted, #6b7280); margin-right: auto; max-width: 460px; }
