/* Выставил.рф — дизайн-система «Бланк и печать» (07.2026).
   Мир продукта: бумага, чернила, круглая печать. Плоско, светло, без глассморфизма.
   Шрифты самохостятся в assets/fonts: Bitter (заголовки), Golos Text (интерфейс), JetBrains Mono (цифры). */

@font-face { font-family: 'Bitter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/bitter-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Bitter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/bitter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Bitter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/bitter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/jbmono-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/jbmono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/jbmono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F7F6F2; --bg2: #F1EFE8; --surface: #FFFFFF; --border: #E3E0D6;
  --text: #1B1F2C; --muted: #646A7C;
  --primary: #2C46C7; --primary-soft: rgba(44,70,199,.09);
  --seal: #C7392B; /* сургуч — только фирменные метки, не кнопки */
  --success: #177A4C; --success-soft: rgba(23,122,76,.11);
  --warning: #A16207; --warning-soft: rgba(161,98,7,.12);
  --danger: #C2333F;  --danger-soft: rgba(194,51,63,.10);
  --info: #0E7490;    --info-soft: rgba(14,116,144,.10);
  --shadow: 0 1px 2px rgba(27,31,44,.05), 0 6px 20px rgba(27,31,44,.06);
  --r-card: 14px; --r-btn: 10px; --r-modal: 18px;
  --font-ui: "Golos Text", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: Bitter, Georgia, "Times New Roman", serif;
  /* алиасы: бенч-стили (.bx-*) исторически ссылаются на --accent/--card */
  --accent: var(--primary); --card: var(--surface);
}
html[data-theme="dark"] {
  --bg: #14161F; --bg2: #0F1118; --surface: #1B1E2A; --border: #2C303F;
  --text: #E9E7E0; --muted: #9AA0B0;
  --primary: #5F79EA; --primary-soft: rgba(125,145,255,.13);
  --seal: #E0584A;
  --success: #3FBF82; --success-soft: rgba(63,191,130,.14);
  --warning: #E0A93E; --warning-soft: rgba(224,169,62,.14);
  --danger: #EF6A75; --danger-soft: rgba(239,106,117,.13);
  --info: #4FB3CE; --info-soft: rgba(79,179,206,.13);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-ui);
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
h1 { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.mono, .num { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* ---- каркас ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.logo { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.01em; margin: 2px 8px 18px; display: flex; align-items: center; gap: 9px; }
.logo .dot { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--seal); background: transparent; flex: none; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-btn);
  color: var(--muted); font-weight: 500; border-left: 3px solid transparent; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); border-left-color: var(--primary); font-weight: 600; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sub { color: var(--muted); font-size: 14px; }

/* ---- карточки: плоский «лист» с тонкой линией ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 20px;
  transition: transform .25s, box-shadow .25s;
}
/* «прыгающие» карточки — только на лендинге, в рабочем UI это шум */
body.landing .card.lift:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(27,31,44,.12); }
.grid { display: grid; gap: 24px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.two-col { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .main { padding: 16px 16px 84px; } /* снизу место под таббар */
  /* сайдбар превращается в выезжающее меню по кнопке «Ещё» */
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; top: 0; left: 0; bottom: 0; width: 268px; max-width: 84vw; z-index: 300; background: var(--surface); box-shadow: 0 0 60px rgba(27,31,44,.4); }
}

/* ---- таблицы ---- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(27,31,44,.03); }
html[data-theme="dark"] tbody tr:hover { background: rgba(255,255,255,.045); }

/* ---- статусы ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; transition: all .3s; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.draft { color: var(--muted); background: rgba(100,106,124,.13); }
.badge.sent { color: var(--info); background: var(--info-soft); }
.badge.paid { color: var(--success); background: var(--success-soft); }
.badge.overdue { color: var(--danger); background: var(--danger-soft); }
.badge.cancelled { color: var(--muted); background: rgba(100,106,124,.11); text-decoration: line-through; }

/* ---- формы и кнопки ---- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r-btn); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: var(--r-btn); border: 1px solid var(--border); cursor: pointer;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; transition: all .15s;
}
.btn:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(44,70,199,.3); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn.danger { color: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- чипы номенклатуры ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px; border-radius: 999px; border: 1px dashed var(--primary); background: var(--primary-soft);
  color: var(--text); font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.chip:hover { background: var(--primary); color: #fff; }
.chip .price { font-weight: 700; }

/* ---- toast и пустые состояния ---- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 14px 18px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-weight: 600; animation: toast-in .3s ease; max-width: 360px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { font-size: 40px; margin-bottom: 10px; }

/* ---- страницы входа / лендинг ---- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; }
.hero { max-width: 860px; margin: 0 auto; text-align: center; padding: 90px 20px 40px; }
.hero h1 { font-size: clamp(32px, 6vw, 54px); line-height: 1.08; letter-spacing: -.02em; }
.hero .accent { color: var(--primary); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 980px; margin: 30px auto; padding: 0 20px; text-align: left; }

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

/* ---------- Онбординг на дашборде ---------- */
.onboard { display: flex; gap: 12px; flex-wrap: wrap; }
.ob-step {
  display: flex; gap: 12px; align-items: flex-start; flex: 1 1 210px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-btn);
  text-decoration: none; color: var(--text); transition: border-color .15s;
}
.ob-step:hover { border-color: var(--primary); }
.ob-step.done { opacity: .55; }
.ob-step.done .ob-mark { background: var(--success-soft); color: var(--success); }
.ob-mark {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ---------- «Северная звезда» на дашборде: главная цифра ---------- */
.northstar { padding: 26px 28px; border-left: 4px solid var(--primary); }
.northstar .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.northstar .ns-value { font-family: var(--font-display); font-size: clamp(34px, 5vw, 46px); font-weight: 800; letter-spacing: -.01em; line-height: 1.1; margin-top: 4px; }
.northstar .ns-sub { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ---------- Модуль «Тендеры» ---------- */
.tender-card { display: flex; gap: 20px; margin-bottom: 14px; padding: 18px 20px; }
.tender-card .t-main { flex: 1; min-width: 0; }
.tender-card .t-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; font-size: 13px; }
.tender-card .t-title { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.35; margin-bottom: 6px; color: var(--text); }
.tender-card .t-title:hover { color: var(--primary); }
.tender-card .t-cust { font-size: 13.5px; margin-bottom: 4px; }
.tender-card .t-meta { font-size: 12.5px; }
.tender-card .t-side { flex: 0 0 170px; text-align: right; }
.tender-card .t-price { font-size: 19px; font-weight: 700; }
.tender-card .t-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.tender-card .t-statusform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 720px) {
  .tender-card { flex-direction: column; }
  .tender-card .t-side { text-align: left; flex-basis: auto; }
}

/* ---------- Команда: рейтинг сотрудников ---------- */
.team-table { font-size: 13.5px; min-width: 900px; }
.team-table td, .team-table th { white-space: nowrap; }
.team-table td:first-child { white-space: normal; min-width: 160px; }
.team-table .num { font-variant-numeric: tabular-nums; }
.lag-flag { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--danger); background: var(--danger-soft); padding: 2px 8px; border-radius: 99px; }
.plan-cell { display: flex; align-items: center; gap: 8px; }
.plan-bar { width: 64px; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.plan-bar i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.plan-cell.ok  .plan-bar i { background: var(--success); }
.plan-cell.mid .plan-bar i { background: var(--warning); }
.plan-cell.bad .plan-bar i { background: var(--danger); }
.plan-cell.ok  span { color: var(--success); }
.plan-cell.mid span { color: var(--warning); }
.plan-cell.bad span { color: var(--danger); }

/* дедлайн-чипы */
.dl-chip { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: rgba(100,106,124,.11); color: var(--muted); }
.dl-chip.warn { background: var(--warning-soft); color: var(--warning); }
.dl-chip.hot  { background: var(--danger-soft); color: var(--danger); }

/* фильтры поиска тендеров  */
.t-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; font-size: 14px; }
.t-filters > label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.t-filters input, .t-filters select { min-height: auto; padding: 7px 10px; font-weight: 400; font-size: 14px; }
.t-filters select[multiple] { min-height: 96px; }

/* ===== Карточка тендера ===== */
.tv-grid { display:grid; grid-template-columns: 1fr 340px; gap:18px; align-items:start; }
@media (max-width: 980px) { .tv-grid { grid-template-columns: 1fr; } }
.tv-task { display:flex; gap:10px; align-items:flex-start; padding:8px 0; border-bottom:1px solid var(--border); }
.tv-task:last-of-type { border-bottom:none; }
.tv-task.done .tv-task-title { text-decoration:line-through; opacity:.55; }
.tv-check { width:24px; height:24px; min-height:24px; border:2px solid var(--border); border-radius:6px;
  background:transparent; cursor:pointer; font-size:14px; line-height:1; color:var(--success, #16a34a);
  display:flex; align-items:center; justify-content:center; padding:0; }
.tv-task.done .tv-check { border-color:var(--success, #16a34a); background:color-mix(in srgb, var(--success, #16a34a) 12%, transparent); }
.tv-comment { padding:10px 12px; border:1px solid var(--border); border-radius:10px; margin-bottom:10px; font-size:14px; }
.tv-comment.mine { background:color-mix(in srgb, var(--primary) 6%, transparent); border-color:color-mix(in srgb, var(--primary) 30%, var(--border)); }
.tv-comment-head { display:flex; gap:8px; align-items:baseline; margin-bottom:4px; }
.tv-event { display:flex; gap:10px; padding:6px 0; }
.tv-event-dot { width:8px; height:8px; border-radius:50%; background:var(--primary); margin-top:6px; flex:none; }
.tv-flag { padding:8px 12px; border-radius:8px; font-size:13px; margin-bottom:10px; }
.tv-flag.danger { background:color-mix(in srgb, var(--danger) 10%, transparent); color:var(--danger); border:1px solid color-mix(in srgb, var(--danger) 35%, transparent); font-weight:600; }

/* ===== Канбан-доска тендеров ===== */
.kb-board { display:flex; gap:12px; align-items:flex-start; overflow-x:auto; padding-bottom:14px; }
.kb-col { flex:0 0 250px; min-width:250px; background:var(--bg); border:1px solid var(--border); border-radius:12px; }
.kb-col-head { padding:10px 12px; font-weight:700; font-size:13.5px; border-radius:12px 12px 0 0;
  display:flex; align-items:center; gap:8px; }
.kb-count { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:1px 8px; font-size:12px; font-weight:600; }
.kb-cards { padding:8px; min-height:60px; display:flex; flex-direction:column; gap:8px; border-radius:0 0 12px 12px; }
.kb-cards.over { background:color-mix(in srgb, var(--primary) 8%, transparent); outline:2px dashed var(--primary); outline-offset:-4px; }
.kb-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px 12px;
  cursor:grab; box-shadow:var(--shadow); }
.kb-card.dragging { opacity:.5; cursor:grabbing; }
.kb-card-title { font-size:13.5px; line-height:1.35; margin-bottom:4px; }
.kb-card-meta { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin:4px 0; font-size:13px; }

/* ===== Аналитика: диаграммы и точки роста ===== */
.an-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.an-label { flex:0 0 140px; font-size:13px; }
.an-track { flex:1; height:18px; background:var(--bg); border-radius:9px; overflow:hidden; }
.an-track i { display:block; height:100%; border-radius:9px; min-width:3px; transition:width .3s; }
.an-val { flex:0 0 36px; text-align:right; font-weight:600; font-size:13.5px; }
.an-chart { display:flex; gap:10px; align-items:flex-end; height:140px; padding-top:6px; }
.an-group { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; height:100%; }
.an-bars { flex:1; display:flex; gap:3px; align-items:flex-end; width:100%; justify-content:center; }
.an-bars i { display:block; width:16px; border-radius:4px 4px 0 0; }
.an-month { font-size:11px; color:var(--muted); }
.an-dot { display:inline-block; width:10px; height:10px; border-radius:3px; vertical-align:-1px; }
.an-tip { padding:8px 12px; border-radius:8px; background:var(--primary-soft); font-size:13px; margin-bottom:8px; }
.gng-item { font-size:13px; margin-bottom:4px; }

/* Аналитика тендеров (anx-) */
.anx-d { font-size: 12.5px; font-weight: 600; }
.anx-d.good { color: var(--success); }
.anx-d.bad { color: var(--danger); }
.anx-d.mut { color: var(--muted); font-weight: 500; }
.anx-insight { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--primary-soft); flex-wrap: wrap; }
.anx-ico { font-size: 22px; }
.anx-money { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: var(--success-soft); color: var(--success); font-size: 12px; font-weight: 700; white-space: nowrap; }
.anx-rel { position: relative; overflow: visible; }
.anx-rel i { border-radius: 9px; }
.anx-bench { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .55; border-radius: 2px; }
.anx-heat { border-collapse: separate; border-spacing: 4px; min-width: 640px; }
.anx-heat th { font-size: 11px; padding: 4px 6px; border: none; text-transform: none; letter-spacing: 0; max-width: 110px; white-space: normal; color: var(--muted); }
.anx-heat td { padding: 0; border: none; }
.anx-heat tbody tr:hover { background: transparent; }
.anx-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; min-height: 44px; border-radius: 8px; color: var(--text); font-size: 12px; }
.anx-cell b { font-size: 13px; }
.anx-cell span { color: var(--muted); font-size: 11px; }
.anx-cell.empty { background: var(--bg); color: var(--muted); }

/* Печатная версия аналитики — «отчёт руководителю» без ручной работы */
@media print {
  .sidebar, .topbar form, .toast, .btn, form.actions { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* ===== Диаграммы аналитики (палитра валидирована на CVD, тёмная тема — свои ступени) ===== */
:root {
  --viz1: #2a78d6; --viz2: #008300; --viz3: #e87ba4; --viz4: #eda100; --viz5: #1baf7a;
  --viz-oth: #94A3B8; --surface-solid: #ffffff;
}
html[data-theme="dark"] {
  --viz1: #3987e5; --viz2: #2e9e2e; --viz3: #d55181; --viz4: #c98500; --viz5: #199e70;
  --viz-oth: #64748B; --surface-solid: #1B1E2A;
}
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.viz-key { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); margin-right: 14px; }
.viz-key i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.viz-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.viz-donut-leg { display: flex; flex-direction: column; gap: 7px; min-width: 180px; flex: 1; }
.viz-donut-leg .viz-key { display: flex; }
.viz-donut-leg .viz-key span:first-of-type { flex: 1; }
.viz-donut-leg .viz-key b { margin-left: auto; }
.viz-donut-leg .viz-key .sub { width: 38px; text-align: right; font-size: 11.5px; }

/* Полный отчёт в новом окне */
.report-body { max-width: 1040px; margin: 0 auto; padding: 28px 22px 48px; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap;
  border-bottom: 2px solid var(--primary); padding-bottom: 12px; margin-bottom: 22px; }
.report-head h1 { font-size: 24px; }
.report-body .card { margin-bottom: 18px; }
@media print { .report-noprint { display: none !important; } }

/* ===== Бенчмарк ИИ-моделей (.bx-*) ===== */
.bx-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.bx-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
.bx-table th.bx-sorted { color: var(--accent); }
.bx-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bx-table tbody tr:last-child td { border-bottom: none; }
.bx-table td.num, .bx-table th.num { text-align: right; }
.bx-items td { white-space: normal; }
.bx-bad { color: var(--danger, #c53030); font-weight: 600; }
.bx-mark { color: var(--muted); }
.bx-cellbar { position: relative; min-width: 90px; height: 18px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bx-cellbar span { position: absolute; inset: 0 auto 0 0; background: var(--viz1); opacity: .35; border-radius: 4px; }
.bx-cellbar.teal span { background: var(--viz5); }
.bx-cellbar b { position: relative; display: block; text-align: right; padding: 0 6px; line-height: 18px; }
.bx-scatterwrap { overflow-x: auto; }
.bx-tip { position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 6px 24px rgba(0,0,0,.14); pointer-events: none; max-width: 240px; }
.bx-dumb, .bx-hbar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.bx-dlabel { flex: 0 0 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-dval { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.bx-dtrack { position: relative; flex: 1; height: 18px; background: var(--bg); border-radius: 9px; }
.bx-dline { position: absolute; top: 8px; height: 2px; background: var(--border); }
.bx-dot { position: absolute; top: 4px; width: 10px; height: 10px; border-radius: 50%; margin-left: -5px; }
.bx-dot.grey { background: var(--viz-oth); }
.bx-dot.up { background: var(--viz2); }
.bx-dot.down { background: var(--viz4); }
.bx-htrack { position: relative; flex: 1; height: 16px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bx-hfill { position: absolute; inset: 0 auto 0 0; background: var(--viz1); border-radius: 4px; }
.bx-hfill.red { background: var(--viz3); }
.bx-stack { display: flex; }
.bx-stack .seg { height: 100%; }
.bx-stack .seg + .seg { margin-left: 2px; }
.bx-stack .seg.go { background: var(--viz2); }
.bx-stack .seg.maybe { background: var(--viz4); }
.bx-stack .seg.no { background: var(--viz3); }
.bx-cons { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.bx-cons:last-child { border-bottom: none; }
.bx-consn { flex: 0 0 64px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.bx-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.bx-search { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); min-width: 220px; font-size: 13.5px; }
.btn.bx-f { padding: 6px 12px; font-size: 12.5px; }
.btn.bx-f.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bx-item { border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; background: var(--card); }
.bx-item summary { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.bx-item summary::-webkit-details-marker { display: none; }
.bx-item[open] summary { border-bottom: 1px solid var(--border); }
.bx-round { flex: 0 0 auto; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.bx-ttl { flex: 1 1 320px; font-weight: 600; font-size: 13.5px; }
.bx-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.bx-badge { border: 1px solid var(--border); border-radius: 20px; padding: 1px 9px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bx-badge.green { color: var(--viz2); border-color: var(--viz2); }
.bx-badge.red { color: var(--viz3); border-color: var(--viz3); }
.bx-badge.grey { opacity: .7; }
.bx-badge.v-go { color: var(--viz2); border-color: currentColor; }
.bx-badge.v-maybe { color: var(--viz4); border-color: currentColor; }
.bx-badge.v-no { color: var(--viz3); border-color: currentColor; }
.bx-body { padding: 12px 14px; }
@media (max-width: 720px) { .bx-dlabel { flex-basis: 90px; font-size: 11.5px; } }

/* ==== быстрые победы дизайна (20.07.2026) ==== */
/* бейдж-счётчик в меню («Просрочено: N») */
.nav-badge { margin-left: auto; background: var(--danger-soft); color: var(--danger); border-radius: 99px; font-size: 11px; font-weight: 800; padding: 2px 8px; line-height: 1.4; }

/* обёртка широких таблиц: прокрутка внутри, а не слом страницы */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* нижняя навигация на мобильном */
.bottombar { display: none; }
@media (max-width: 900px) {
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 290;
    background: var(--surface); border-top: 1px solid var(--border); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .bottombar a, .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; color: var(--muted); font-size: 11px; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .bottombar .bb-ic { font-size: 19px; line-height: 1; }
  .bottombar a.active { color: var(--primary); }
  #botw-btn { bottom: 74px; }
  #botw { bottom: 136px; }
}
.scrim { display: none; }
.scrim.on { display: block; position: fixed; inset: 0; z-index: 295; background: rgba(27,31,44,.5); }

/* состояния ошибок в формах */
.field.error input, .field.error select, .field.error textarea, input.error, select.error, textarea.error { border-color: var(--danger); }
.field .err-text { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* кнопка в состоянии загрузки: не даём нажать дважды */
.btn.loading { pointer-events: none; opacity: .7; position: relative; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-left: 8px; animation: btnspin .7s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }

/* фокус — только с клавиатуры */
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==== фирменная круглая печать (сигнатура бренда) ==== */
.seal-badge { display: inline-grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--primary); color: var(--primary); font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em; opacity: .92; user-select: none; }
