/* BI Orion — веб-портал. Токены и цвета — по dataviz skill (references/palette.md). */

:root {
  color-scheme: light;
  --page:        #f9f9f7;
  --surface:     #fcfcfb;
  --surface-2:   #ffffff;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:    #e1e0d9;
  --border:      rgba(11,11,11,0.10);
  --baseline:    #c3c2b7;

  --accent:      #2a78d6;
  --accent-2:    #6da7ec;   /* лёгкий след акцента (track меры) */
  --accent-wash: #cde2fb;

  --good:        #0ca30c;
  --warning:     #fab219;
  --serious:     #ec835a;
  --critical:    #d03b3b;

  --series-2: #eb6834; /* orange — второй ряд, если понадобится */
  --series-3: #1baf7a; /* aqua */

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11,11,11,0.04), 0 8px 24px rgba(11,11,11,0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page:        #0d0d0d;
    --surface:     #1a1a19;
    --surface-2:   #202020;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:    #2c2c2a;
    --border:      rgba(255,255,255,0.10);
    --baseline:    #383835;

    --accent:      #3987e5;
    --accent-2:    #184f95;
    --accent-wash: #16294a;

    --good:        #0ca30c;
    --warning:     #fab219;
    --serious:     #ec835a;
    --critical:    #e66767;

    --series-2: #d95926;
    --series-3: #199e70;

    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---------------- Layout ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 10px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar .brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2489FF, #0F5FDC);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}

.topbar .user {
  display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px 14px;
  color: var(--text-secondary);
  font-size: 14px;
}

.topbar .user a.logout {
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.topbar .user a.logout:hover { color: var(--text-primary); border-color: var(--text-muted); }

.nav-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 28px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.nav-pill.home { font-weight: 600; }

/* Выпадающий список раздела — на <details>/<summary>, без JS. name="navgroup"
   на всех <details> (см. base.html) даёт "радио"-поведение нативно: открытие
   одного раздела закрывает остальные. */
.nav-dropdown {
  position: relative;
}

.nav-group-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.nav-group-chip::-webkit-details-marker { display: none; }
.nav-group-chip:hover { border-color: var(--tint-strong, var(--accent)); }
.nav-dropdown[open] .nav-group-chip { border-color: var(--tint-strong, var(--accent)); }
/* Раздел, где лежит текущая страница, — подсветка чипа БЕЗ раскрытия
   списка (запрос 17.08.2026: после перехода на отчёт список должен
   сворачиваться, а не оставаться висеть открытым). */
.nav-group-chip.current {
  border-color: var(--tint-strong, var(--accent));
  background: color-mix(in srgb, var(--tint-strong, var(--accent)) 18%, var(--surface));
}

.nav-group-chip-icon {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--tint-strong, var(--accent-wash));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.nav-chevron {
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 0.15s;
}
.nav-dropdown[open] .nav-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 240px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-dropdown-menu .nav-pill {
  border-radius: var(--radius-sm);
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
}
.nav-dropdown-menu .nav-pill:hover { background: var(--page); }
.nav-dropdown-menu .nav-pill.active { background: var(--accent); color: white; }
.nav-subgroup { margin: 0; }
.nav-subgroup-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 8px 6px;
  cursor: pointer;
  list-style: none;
}
.nav-subgroup-label::-webkit-details-marker { display: none; }
.nav-subgroup:first-child .nav-subgroup-label { padding-top: 2px; }
.nav-subgroup-chevron {
  font-size: 9px;
  transition: transform 0.15s;
}
.nav-subgroup[open] .nav-subgroup-chevron { transform: rotate(180deg); }

.nav-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-pill:hover { color: var(--text-primary); border-color: var(--text-muted); }
.nav-pill.active { background: var(--accent); color: white; border-color: var(--accent); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 64px;
}

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 18px 20px 28px;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 24px 0 12px; color: var(--text-secondary); font-weight: 600; }
.subtitle { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

/* ---------------- Иконка-бейдж в заголовке страницы отчёта ---------------- */

.page-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 4px;
}
.page-head .badge {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent-wash);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.page-head h1 { margin: 0; }

/* ---------------- Home: разделы-аккордеон + карточки-кнопки ---------------- */

.group-details {
  margin-bottom: 14px;
}
.group-details + .group-details { margin-top: 4px; }

.group-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--tint-bg, var(--surface));
  box-shadow: var(--shadow);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color 0.15s, transform 0.1s;
}
.group-button::-webkit-details-marker { display: none; }
.group-button:hover { border-color: var(--tint-strong, var(--accent)); }
.group-button:active { transform: translateY(1px); }

.group-icon {
  font-size: 22px;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--tint-strong, var(--accent-wash));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.group-name { font-weight: 700; font-size: 16px; flex-shrink: 0; }
.group-count {
  color: var(--text-muted);
  font-size: 12.5px;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}
.group-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.group-details[open] .group-chevron { transform: rotate(180deg); }

/* Лёгкий цветной акцент на кнопку каждого раздела — только оттенок фона
   иконки/рамки при hover, не влияет на данные/графики (см. dataviz skill —
   категориальная палитра там, где кодирует данные; здесь чистая навигация). */
.tint-day       { --tint-strong: color-mix(in srgb, var(--warning) 55%, var(--surface)); }
.tint-periods   { --tint-strong: var(--accent-wash); }
.tint-purchases { --tint-strong: color-mix(in srgb, var(--good) 35%, var(--surface)); }
.tint-finance   { --tint-strong: color-mix(in srgb, var(--series-2) 35%, var(--surface)); }
.tint-sales     { --tint-strong: color-mix(in srgb, var(--series-3) 35%, var(--surface)); }
.tint-admin     { --tint-strong: color-mix(in srgb, var(--critical) 30%, var(--surface)); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.card-subgroup { margin: 0; }
.card-subgroup-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 22px;
  cursor: pointer;
  list-style: none;
}
.card-subgroup-label::-webkit-details-marker { display: none; }
.card-subgroup:first-of-type .card-subgroup-label { margin-top: 14px; }
.card-subgroup-chevron {
  font-size: 10px;
  transition: transform 0.15s;
}
.card-subgroup[open] .card-subgroup-chevron { transform: rotate(180deg); }

.report-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.report-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.report-card .icon { font-size: 30px; margin-bottom: 12px; display: block; }
.report-card .title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.report-card .desc { color: var(--text-muted); font-size: 13.5px; }

/* ---------------- Stat tiles ---------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-tile .label { color: var(--text-muted); font-size: 13px; margin-bottom: 6px; }
.stat-tile .value { font-size: 26px; font-weight: 700; }
.stat-tile .delta { font-size: 13px; margin-top: 6px; }
.stat-tile .delta.good { color: var(--good); }
.stat-tile .delta.warning { color: var(--warning); }
.stat-tile .delta.bad { color: var(--critical); }
a.stat-tile { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat-tile:hover { border-color: var(--accent); box-shadow: var(--shadow); }

/* Запрос 22.08.2026 — цвет для роста/падения в таблицах (не только на
   плитках, см. .delta выше) и для ABC-групп (A зелёный/B жёлтый/C красный). */
.text-good    { color: var(--good); }
.text-warning { color: var(--warning); }
.text-bad     { color: var(--critical); }

.abc-badge {
  display: inline-block;
  min-width: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.abc-badge.abc-a { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.abc-badge.abc-b { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning); }
.abc-badge.abc-c { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); }

/* Строка "изменилась ABC-группа" — фон подсказывает, ушла группа вверх
   (клиент стал важнее, зелёный) или вниз (просел, красный). */
tr.abc-row-up   { background: color-mix(in srgb, var(--good) 7%, transparent); }
tr.abc-row-down { background: color-mix(in srgb, var(--critical) 7%, transparent); }

a.client-link { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
a.client-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------------- Tables ---------------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gridline);
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text-primary); }
thead th.sortable[data-asc="1"]::after { content: " \25B2"; }
thead th.sortable[data-asc="0"]::after { content: " \25BC"; }
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gridline);
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { padding: 10px 12px; border-top: 2px solid var(--border); font-variant-numeric: tabular-nums; }
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
/* Дублирующий горизонтальный скролл сверху широкой таблицы (запрос
   19.08.2026) — на длинных таблицах (много строк) настоящий скролл внизу
   контейнера не виден без прокрутки страницы до конца; JS в base.html
   синхронизирует эту полосу с прокруткой самой .table-wrap. */
.table-wrap-topscroll {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-bottom: 4px;
}
.table-wrap-topscroll > div { height: 1px; }
/* Прилипающая шапка таблицы (запрос 19.08.2026, "и шапку закрепи") — УБРАНО
   20.08.2026 ("поправь таблицу по городам"): position:sticky на thead
   внутри .table-wrap конфликтует с overflow-x:auto на том же контейнере —
   по спецификации CSS overflow-x:auto без явного overflow-y заставляет
   браузер считать элемент скролл-контейнером и по вертикали тоже, а sticky
   внутри такого контейнера ведёт себя непредсказуемо (визуальный баг —
   первая строка таблицы налезала на шапку). Половинчато работающая фича
   хуже отсутствующей — убрали, а не чинили косметически. Верхний
   дублирующий скроллбар (ниже) эту проблему не имеет, его оставляем. */
td.num, th.num { text-align: right; }
/* Обрезанное наименование под артикулом в узкой ячейке таблицы (не .subtitle
   — тот класс держит margin-bottom:24px для подзаголовков страниц) */
.cell-note {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------------- Форма выбора (месяц/год/дата) ---------------- */

.filter-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-row select, .filter-row input[type=date], .filter-row input[type=text] {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
}
.filter-row button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.filter-row button:hover { opacity: 0.9; }

.field-group { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.field-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.field-group input[type=number], .field-group input[type=file] {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
}
.field-group-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
}
.field-group-btn:hover { opacity: 0.9; }

.btn-secondary {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-excel {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--good);
  background: var(--good);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn-excel:hover { opacity: 0.88; }

/* ---------------- Рекомендации ("Управление закупками") ---------------- */

.reco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.reco-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.reco-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.reco-card-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.reco-card-head h2 { margin: 0; font-size: 15.5px; color: var(--text-primary); font-weight: 700; }

.reco-general {
  margin-bottom: 16px;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.reco-general .reco-card-icon { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }

.reco-list { list-style: none; margin: 0; padding: 0; }
.reco-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--gridline);
  font-size: 13.5px;
  line-height: 1.5;
}
.reco-item:first-child { border-top: none; padding-top: 0; }
.reco-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--text-muted);
}
.reco-item.sev-critical .reco-dot { background: var(--critical); }
.reco-item.sev-warning .reco-dot { background: var(--warning); }
.reco-item.sev-good .reco-dot { background: var(--good); }
.reco-item.sev-info .reco-dot { background: var(--accent); }
.reco-item.sev-critical .reco-text { color: var(--text-primary); font-weight: 600; }

/* ---------------- Segmented control (переключатель РФ/AM-KG и т.п.) ---------------- */

.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 20px;
}
.segmented-btn {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.segmented-btn:hover { color: var(--text-primary); }
.segmented-btn.active { background: var(--accent); color: white; }

/* ---------------- Meter (план/факт) ---------------- */

.meter-row { margin-bottom: 16px; }
.meter-row .meter-label {
  display: flex; justify-content: space-between;
  font-size: 13.5px; margin-bottom: 6px;
}
.meter-row .meter-label .name { color: var(--text-primary); font-weight: 600; }
.meter-row .meter-label .pct { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.meter-track {
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.meter-fill.good { background: var(--good); }
.meter-fill.warning { background: var(--warning); }
.meter-fill.critical { background: var(--critical); }
.meter-note { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }

/* ---------------- Login ---------------- */

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--page);
}
.login-card {
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}
.login-card .mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, #2489FF, #0F5FDC);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 22px;
  margin: 0 auto 16px;
}
.login-card h1 { font-size: 18px; margin-bottom: 4px; }
.login-card .subtitle { margin-bottom: 24px; }
.login-card input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--page);
  color: var(--text-primary);
  font-size: 14px;
}
.login-card button {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
}
.login-error {
  background: color-mix(in srgb, var(--critical) 12%, transparent);
  color: var(--critical);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------------- Инфо / инструкции (запрос 22.08.2026) ---------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s, box-shadow .15s;
}
.info-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.info-card .info-card-icon { font-size: 26px; margin-bottom: 10px; }
.info-card .info-card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.info-card .info-card-desc { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.info-steps { counter-reset: infostep; margin: 14px 0; padding: 0; list-style: none; }
.info-steps li {
  counter-increment: infostep; position: relative; padding-left: 38px; margin-bottom: 14px; font-size: 14px;
}
.info-steps li::before {
  content: counter(infostep); position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center;
}

.info-tip {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--good);
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 14px 0; font-size: 13.5px;
}
.info-tip.warn { border-left-color: var(--warning); }
.info-tip .info-tip-label { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--good); }
.info-tip.warn .info-tip-label { color: var(--warning); }

.info-pdf-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-primary); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.info-pdf-link:hover { border-color: var(--accent); color: var(--accent); }

.info-abc-a { color: var(--good); font-weight: 700; }
.info-abc-b { color: var(--warning); font-weight: 700; }
.info-abc-c { color: var(--critical); font-weight: 700; }

.about-dev {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-top: 8px; display: flex; gap: 18px; align-items: flex-start;
}
.about-dev .about-dev-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.about-dev h3 { margin: 0 0 4px; font-size: 15.5px; }
.about-dev p { margin: 0 0 6px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.about-dev a { color: var(--accent); text-decoration: none; }
.about-dev a:hover { text-decoration: underline; }

/* ---------------- Chart (простой SVG bar) ---------------- */

.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.chart-bar-rect { fill: var(--accent); }
.chart-bar-rect:hover { fill: var(--accent-2); }
.chart-axis-text { fill: var(--text-muted); font-size: 11px; }
.chart-gridline { stroke: var(--gridline); stroke-width: 1; }
.chart-value-text { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }

/* Донат-диаграммы (запрос 20.08.2026, "добавь круговых диаграмм") — только
   для доли ОТ ОДНОГО ЦЕЛОГО (включено/отключено, склад/кросс), см.
   charts.donut_chart docstring. */
.donut-center-text { fill: var(--text-primary); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.donut-row {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch;
  padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px;
}
.donut-card { display: flex; align-items: center; gap: 12px; }
.donut-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.donut-legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.donut-legend-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.donut-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
}

/* Индикатор загрузки для долгих отчётов (запрос 19.08.2026, см. base.html) */
.loading-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in srgb, var(--page) 80%, transparent);
  display: flex; align-items: center; justify-content: center;
}
/* Реальная причина бага "оверлей висит на каждой странице" (запрос
   20.08.2026) — НЕ кэш браузера, а CSS: атрибут [hidden] и класс имеют
   одинаковую специфичность, и .loading-overlay{display:flex} побеждал
   встроенное правило браузера [hidden]{display:none} по порядку каскада.
   Оверлей был виден на КАЖДОЙ странице с первого дня, а не только после
   формы. Явный override с [hidden] чинит это раз и навсегда. */
.loading-overlay[hidden] { display: none; }
.loading-box {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 40px; max-width: 320px; text-align: center;
  color: var(--text-secondary); font-size: 14px;
}
.loading-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
