/* План поставки, Сгоревший товар. Только классы с префиксом раздела; токены цвета — из app.css. */

/* ── общие ─────────────────────────────────────────────── */
.sup-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sup-bar .aside { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.sup-count { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 4px; }
.tab.is-active .sup-count { opacity: .85; }

/* плитки: подпись-пояснение под числом переносится, число — одной строкой */
.sup-tiles .tile__value { white-space: nowrap; }
.sup-tiles .tile--warn .tile__value { color: var(--warn); }
.sup-tiles .tile--bad .tile__value { color: var(--bad); }
.sup-tiles .tile__value.is-na { font-size: 18px; color: var(--ink-3); font-weight: 600; }

/* ── округа ─────────────────────────────────────────────── */
.sup-districts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sup-d {
  padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px;
}
.sup-d__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sup-d__name { font-size: 14px; font-weight: 650; }
.sup-d__share { font-size: 12.5px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.sup-d__qty { font-size: 24px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sup-d__qty small { font-size: .55em; font-weight: 500; color: var(--ink-2); }
.sup-d__qty.is-zero { color: var(--ink-3); }
.sup-d__sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.sup-d .select { padding: 6px 9px; font-size: 13px; }
/* Склад «куда везти». Текст закрытого select не переносится: «Екатеринбург -
   Испытателей 14г — 708 шт» обрезался до «— 708 ш». Видимую подпись рисуем
   сами, с переносом, а настоящий select лежит поверх прозрачным — список,
   клавиатура и экранный диктор работают как у обычного. */
.sup-pick { position: relative; }
.sup-pick__val {
  display: block; padding: 6px 30px 6px 9px; min-height: 34px; font-size: 13px; line-height: 1.4;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-s); overflow-wrap: anywhere; transition: border-color .12s, box-shadow .12s;
}
.sup-pick__val::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px;
  border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg);
}
.sup-d .sup-pick__sel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sup-pick:hover .sup-pick__val { border-color: var(--ink-3); }
.sup-pick:focus-within .sup-pick__val { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sup-d.is-off { background: var(--surface-2); }
.sup-d.is-off .sup-d__qty { color: var(--ink-3); }
.sup-d__lbl { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ── таблица ────────────────────────────────────────────── */
.sup-tbl tbody tr.sup-row { cursor: pointer; }
.sup-tbl tbody tr.sup-row:hover th, .sup-tbl tbody tr.sup-row:hover td { background: var(--surface-2); }
.sup-tbl tbody tr.sup-row.is-open th, .sup-tbl tbody tr.sup-row.is-open td { background: var(--surface-2); border-bottom-color: transparent; }
.sup-tbl tbody tr.sup-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sup-tbl td.sup-ship { font-weight: 650; }
.sup-tbl td.sup-dcol { color: var(--ink-2); padding-left: 4px; padding-right: 4px; }
.sup-tbl td.sup-dcol.is-zero { color: var(--line-2); }
.sup-tbl thead th.sup-dcol { min-width: 40px; padding-left: 4px; padding-right: 4px; }
.sup-tbl .sup-caret { display: inline-block; width: 12px; color: var(--ink-3); transition: transform .15s; }
.sup-tbl tr.is-open .sup-caret { transform: rotate(90deg); }
.sup-tbl tbody th .sup-code { display: flex; align-items: baseline; gap: 6px; }

.sup-abc {
  display: inline-block; min-width: 18px; text-align: center; font-size: 11px; font-weight: 700;
  padding: 0 5px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2);
  line-height: 17px;
}
.sup-abc--A { background: var(--brand); color: var(--brand-ink); }
.sup-abc--B { background: var(--line-2); color: var(--ink); }

.sup-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.sup-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.sup-st--ship::before { background: var(--s1); }
.sup-st--urgent::before { background: var(--st-crit); }
.sup-st--soon::before { background: var(--st-warn); }
.sup-st--enough::before { background: var(--st-good); }
.sup-st--no_ship { color: var(--ink-3); }
.sup-st--urgent { color: var(--bad); }

/* раскрытая строка: ячейка на всю ширину таблицы, а текст держится в видимой
   части прокрутки — на телефоне таблица шире экрана */
.sup-detail > td { background: var(--surface-2); padding: 4px 14px 16px 20px !important; white-space: normal !important;
  text-align: left !important; }
.data--sticky tr.sup-detail > td:first-child { position: static; box-shadow: none; background: var(--surface-2); }
.sup-detail__in { position: sticky; left: 20px; max-width: min(1040px, calc(100vw - 72px)); }
.sup-detail__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px 28px; }
.sup-detail p { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); line-height: 1.45; max-width: 90ch; }
.sup-detail p b { color: var(--ink); font-weight: 600; }
.sup-detail h4 { margin: 4px 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .04em; }
.sup-whs { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-wh { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font-size: 12px; white-space: nowrap; }
.sup-wh b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sup-wh small { color: var(--ink-3); font-size: 11px; }
.sup-wh.is-burned { border-style: dashed; color: var(--ink-3); text-decoration: line-through;
  text-decoration-color: var(--ink-3); }
.sup-wh.is-burned b { text-decoration: none; }
.sup-sizes { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 2px; }
/* таблица размеров вложена в .data — общие правила .data (липкая первая колонка,
   отступы) ей не нужны */
.data .sup-sizes th, .data .sup-sizes td { padding: 4px 12px 4px 0; text-align: right; border-bottom: 1px solid var(--line);
  white-space: nowrap; font-size: 12.5px; position: static; box-shadow: none; background: transparent;
  min-width: 0; }
.data .sup-sizes th:first-child, .data .sup-sizes td:first-child { text-align: left; }
.data .sup-sizes thead th { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }

/* ── настройки ─────────────────────────────────────────── */
.sup-set > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap; padding: 16px 20px; }
.sup-set > summary::-webkit-details-marker { display: none; }
.sup-set > summary h2 { margin: 0; font-size: 17px; font-weight: 650; }
.sup-set > summary .sub { color: var(--ink-3); font-size: 13px; }
.sup-set > summary::after { content: "▸"; margin-left: auto; color: var(--ink-3); transition: transform .15s; }
.sup-set[open] > summary::after { transform: rotate(90deg); }
.sup-set > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sup-form { display: flex; flex-direction: column; gap: 14px; padding: 4px 20px 18px; }
.sup-form__nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sup-form .field { margin: 0; }
.sup-form .field > span small { color: var(--ink-3); font-weight: 400; }
.sup-form__group > .lbl { font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.sup-form__group > .hint { margin: 0 0 6px; }
.sup-form__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.sup-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 18px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit;
  font-size: 12.5px; cursor: pointer; max-width: 100%; flex-wrap: wrap; text-align: left;
}
.sup-chip small { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sup-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.sup-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sup-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.sup-chip[aria-pressed="true"] small { color: var(--brand-ink); opacity: .75; }
.sup-chip[disabled] { cursor: default; opacity: .7; }
.sup-chip .q { color: var(--warn); font-weight: 700; }
.sup-chip[aria-pressed="true"] .q { color: var(--brand-ink); }
.sup-add { display: flex; gap: 6px; max-width: 420px; margin-top: 8px; }
.sup-add .input { padding: 6px 10px; font-size: 13px; }

/* ── Сгоревший товар ───────────────────────────────────── */
.brn-chipbar { display: flex; flex-direction: column; gap: 10px; }
.brn-chipbar .sup-form__foot { margin-top: 2px; }
.brn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 18px; }
.brn-grid > * { min-width: 0; }
.brn-link { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 12px 16px;
  border-radius: var(--r-s); background: var(--accent-soft); color: var(--ink); font-size: 13.5px; }
.brn-link a { font-weight: 600; }
.brn-tbl td.brn-wh { color: var(--ink-2); }
.brn-tbl td.brn-wh.is-zero { color: var(--line-2); }

/* ── узкие экраны ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .sup-districts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sup-form__nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brn-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sup-detail__grid { grid-template-columns: minmax(0, 1fr); }
  .sup-bar .aside { margin-left: 0; }
}
@media (max-width: 520px) {
  .sup-districts { grid-template-columns: minmax(0, 1fr); }
  .sup-d { padding: 12px 16px 14px; }
  .sup-form, .sup-set > summary { padding-left: 16px; padding-right: 16px; }
  .sup-form__nums { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sup-detail > td { padding-left: 16px !important; }
}
