/* ==========================================================================
   Дизайн-система «Кварц» — компоненты
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--ink-900); }
h1 { font-size: var(--fs-28); line-height: 1.2; }
h2 { font-size: var(--fs-22); line-height: 1.25; }
h3 { font-size: var(--fs-18); line-height: 1.3; }
h4 { font-size: var(--fs-16); line-height: 1.35; }
p { margin: 0 0 var(--s-12); }
p:last-child { margin-bottom: 0; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-6); }

.num { font-variant-numeric: tabular-nums; }

/* --- Утилиты --- */
.muted { color: var(--ink-500); }
.dim { color: var(--ink-400); }
.tiny { font-size: var(--fs-12); }
.small { font-size: var(--fs-13); }
.big { font-size: var(--fs-18); }
.strong { font-weight: 600; }
.upper { text-transform: uppercase; letter-spacing: .07em; font-size: var(--fs-11); font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: var(--s-8); }
.row-t { display: flex; gap: var(--s-8); }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.col { display: flex; flex-direction: column; gap: var(--s-8); }
.stack-12 > * + * { margin-top: var(--s-12); }
.stack-16 > * + * { margin-top: var(--s-16); }
.stack-24 > * + * { margin-top: var(--s-24); }
.hide { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; }

.grid { display: grid; gap: var(--s-16); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: minmax(0, 1fr); } }

svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 15px; height: 15px; }
svg.i.l { width: 22px; height: 22px; }

/* ==========================================================================
   Каркас приложения
   ========================================================================== */

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ink-900);
  color: var(--ink-300);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #000;
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--s-10, 10px);
  padding: var(--s-16) var(--s-20);
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--gold-500); color: var(--ink-900);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  letter-spacing: -.02em;
}
.sidebar__title { color: #fff; font-weight: 600; font-size: var(--fs-14); line-height: 1.1; }
.sidebar__sub { font-size: var(--fs-11); color: var(--ink-400); }

.sidebar__nav { padding: var(--s-12) var(--s-12) var(--s-24); overflow-y: auto; flex: 1; }
.sidebar__group { margin: var(--s-16) 0 var(--s-6); padding: 0 var(--s-12); color: #66727f; }
.sidebar__group:first-child { margin-top: var(--s-4); }
.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--s-12); border-radius: var(--r-6);
  color: var(--ink-300); font-size: var(--fs-14); cursor: pointer;
  border-left: 2px solid transparent; margin-bottom: 1px;
  text-decoration: none;
}
.navlink:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.navlink.on { background: rgba(200,150,47,.13); color: #fff; border-left-color: var(--gold-500); }
.navlink .cnt {
  margin-left: auto; font-size: var(--fs-11); font-weight: 600;
  background: rgba(255,255,255,.12); color: #fff;
  border-radius: var(--r-pill); padding: 1px 7px; font-variant-numeric: tabular-nums;
}
.navlink.on .cnt { background: var(--gold-500); color: var(--ink-900); }

.sidebar__foot { padding: var(--s-12); border-top: 1px solid rgba(255,255,255,.08); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-12); padding: 0 var(--s-24);
  position: sticky; top: 0; z-index: 30;
}
.topbar__ctx { font-size: var(--fs-13); color: var(--ink-500); }
.topbar__ctx b { color: var(--ink-900); font-weight: 600; }

.content { padding: var(--s-24); max-width: var(--content-max); width: 100%; }

.page-head { margin-bottom: var(--s-20); }
.page-head h1 { margin-bottom: 4px; }
.crumb { font-size: var(--fs-12); color: var(--ink-400); margin-bottom: 6px; }
.crumb a { color: var(--ink-500); }

/* Мобильный каркас */
.burger { display: none; }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .18s ease; }
  .app.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10,14,18,.5); z-index: 55; }
  .burger { display: inline-flex; }
  .content { padding: var(--s-16); }
  .topbar { padding: 0 var(--s-12); gap: var(--s-8); }
  .topbar .demo-flag, .topbar .right { display: none; }
  .topbar [data-action="reset"] span, .topbar [data-action="reset"] { font-size: var(--fs-12); }
  .row, .card__head { flex-wrap: wrap; }
  .topbar { flex-wrap: nowrap; }
  .dl { grid-template-columns: 1fr; }
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="position:sticky"] { position: static !important; }
  .field[style*="width:calc(50%"] { width: 100% !important; margin-right: 0 !important; }
  .sticky-actions { flex-wrap: wrap; }
}

/* ==========================================================================
   Кнопки
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-6);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-800);
  font: 500 var(--fs-14)/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--bg-sunken); }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn--primary:hover { background: var(--brand-800); border-color: var(--brand-800); }
.btn--gold { background: var(--gold-500); border-color: var(--gold-500); color: var(--ink-900); font-weight: 600; }
.btn--gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.btn--danger { color: var(--err-600); border-color: #eccbc7; background: #fff; }
.btn--danger:hover { background: var(--err-100); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--bg-sunken); }
.btn--sm { height: 30px; padding: 0 10px; font-size: var(--fs-13); }
.btn--xs { height: 26px; padding: 0 8px; font-size: var(--fs-12); border-radius: var(--r-4); }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-6) 0 0 var(--r-6); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-6) var(--r-6) 0; }
.btn-group .btn.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; z-index: 1; }

/* ==========================================================================
   Карточки и панели
   ========================================================================== */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-10); }
.card__head {
  padding: var(--s-16) var(--s-20); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-12);
}
.card__head h3, .card__head h4 { margin: 0; }
.card__body { padding: var(--s-20); }
.card__body--tight { padding: var(--s-12) var(--s-16); }
.card__foot { padding: var(--s-12) var(--s-20); border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--r-10) var(--r-10); }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-10); padding: var(--s-16); }
.kpi__label { font-size: var(--fs-12); color: var(--ink-500); margin-bottom: 6px; }
.kpi__value { font-size: var(--fs-28); font-weight: 600; letter-spacing: -.02em; color: var(--ink-900); font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.kpi__value--text { font-size: var(--fs-16); line-height: 1.3; letter-spacing: 0; }
.kpi__hint { font-size: var(--fs-12); color: var(--ink-400); margin-top: 4px; }
.kpi--accent { border-left: 3px solid var(--gold-500); }

.panel { background: var(--brand-050); border: 1px solid var(--brand-100); border-radius: var(--r-10); padding: var(--s-16); }

.note {
  display: flex; gap: 10px; padding: var(--s-12) var(--s-16);
  border-radius: var(--r-6); font-size: var(--fs-13); border: 1px solid;
  background: var(--info-100); border-color: #c9d9f2; color: #23477d;
}
.note svg { flex: none; margin-top: 1px; }
.note--warn { background: var(--warn-100); border-color: #efd9a8; color: var(--warn-700); }
.note--err { background: var(--err-100); border-color: #f0cbc7; color: var(--err-700); }
.note--ok { background: var(--ok-100); border-color: #c6e2d1; color: var(--ok-700); }
.note--muted { background: var(--bg-sunken); border-color: var(--line); color: var(--ink-600); }

/* ==========================================================================
   Бейджи, чипы, метки
   ========================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-12); font-weight: 500; line-height: 1.6;
  background: var(--bg-sunken); color: var(--ink-600); border: 1px solid transparent;
  white-space: nowrap;
}
.badge--ok { background: var(--ok-100); color: var(--ok-700); }
.badge--warn { background: var(--warn-100); color: var(--warn-700); }
.badge--err { background: var(--err-100); color: var(--err-700); }
.badge--info { background: var(--info-100); color: var(--info-600); }
.badge--brand { background: var(--brand-100); color: var(--brand-700); }
.badge--gold { background: var(--gold-100); color: var(--gold-700); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface); font-size: var(--fs-13); cursor: pointer; color: var(--ink-600);
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); }
.chip.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.chip button { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; display: flex; }

.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-4); background: var(--bg-sunken); color: var(--ink-600); font-size: var(--fs-12); }

/* ==========================================================================
   Таблицы
   ========================================================================== */

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-500);
  font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .05em;
  padding: 10px var(--s-12); border-bottom: 1px solid var(--line);
  background: var(--bg); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--brand-700); }
table.tbl td { padding: 11px var(--s-12); border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tbody tr:hover { background: var(--brand-050); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tr.sub td { background: var(--bg); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .rank { font-weight: 600; color: var(--ink-400); font-variant-numeric: tabular-nums; }
table.tbl tfoot td { padding: 11px var(--s-12); border-top: 2px solid var(--line-strong); font-weight: 600; background: var(--bg); }
.tbl--fixed { table-layout: fixed; }

.empty { padding: var(--s-40) var(--s-20); text-align: center; color: var(--ink-400); }
.empty svg { width: 34px; height: 34px; stroke-width: 1.2; margin-bottom: var(--s-8); }

/* ==========================================================================
   Формы
   ========================================================================== */

.field { margin-bottom: var(--s-16); }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; font-size: var(--fs-13); font-weight: 500; color: var(--ink-800); margin-bottom: 5px; }
.field__label .req { color: var(--err-600); margin-left: 2px; }
.field__hint { font-size: var(--fs-12); color: var(--ink-500); margin-top: 5px; line-height: 1.45; }
.field__hint--pre { white-space: pre-line; }
.field__err { font-size: var(--fs-12); color: var(--err-600); margin-top: 5px; display: flex; gap: 5px; align-items: flex-start; }

.inp, .sel, .txt {
  width: 100%; font: 400 var(--fs-14)/1.45 var(--font); color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-6);
  padding: 8px 11px; transition: border-color .12s, box-shadow .12s;
}
.inp { height: 38px; }
.txt { min-height: 96px; resize: vertical; }
.sel { height: 38px; appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6675' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.inp:focus, .sel:focus, .txt:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.inp[disabled], .txt[disabled], .sel[disabled] { background: var(--bg-sunken); color: var(--ink-500); }
.inp.err, .sel.err, .txt.err { border-color: var(--err-600); }
.inp::placeholder, .txt::placeholder { color: var(--ink-300); }

.inp--num { text-align: right; font-variant-numeric: tabular-nums; }

.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: var(--fs-14); }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand-700); flex: none; cursor: pointer; }
.check + .check { margin-top: 9px; }

.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px var(--s-12);
  border: 1px solid var(--line-strong); border-radius: var(--r-6); cursor: pointer; background: var(--surface);
}
.radio-card:hover { border-color: var(--brand-300); }
.radio-card.on { border-color: var(--brand-600); background: var(--brand-050); box-shadow: inset 0 0 0 1px var(--brand-600); }
.radio-card input { margin: 3px 0 0; accent-color: var(--brand-700); flex: none; }
.radio-card__t { font-weight: 500; }
.radio-card__d { font-size: var(--fs-12); color: var(--ink-500); margin-top: 2px; }

.counter { font-size: var(--fs-12); color: var(--ink-400); text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--err-600); }

.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.search .inp { padding-left: 34px; }

/* Загрузка файлов */
.uploader { border: 1px dashed var(--line-strong); border-radius: var(--r-6); padding: var(--s-12); background: var(--bg); }
.uploader__row { display: flex; align-items: center; gap: 10px; }
.uploader__t { font-size: var(--fs-13); font-weight: 500; }
.uploader__d { font-size: var(--fs-12); color: var(--ink-500); }
.file {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-6); background: var(--surface); font-size: var(--fs-13);
}
.file + .file { margin-top: 6px; }
.file__ico { color: var(--err-600); }
.file__name { font-weight: 500; }
.file__meta { font-size: var(--fs-12); color: var(--ink-400); }

/* ==========================================================================
   Степпер мастера заявки
   ========================================================================== */

.stepper { display: flex; flex-direction: column; gap: 2px; }
.step {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px var(--s-12);
  border-radius: var(--r-6); cursor: pointer; border-left: 2px solid transparent;
}
.step:hover { background: var(--bg-sunken); }
.step.on { background: var(--brand-050); border-left-color: var(--brand-600); }
.step__n {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: var(--fs-12); font-weight: 600; background: var(--bg-sunken); color: var(--ink-500);
  border: 1px solid var(--line-strong);
}
.step.on .step__n { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.step.done .step__n { background: var(--ok-600); border-color: var(--ok-600); color: #fff; }
.step.err .step__n { background: var(--err-100); border-color: var(--err-600); color: var(--err-600); }
.step__t { font-size: var(--fs-13); font-weight: 500; line-height: 1.3; }
.step__d { font-size: var(--fs-11); color: var(--ink-400); }

.progress { height: 6px; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand-600); border-radius: var(--r-pill); transition: width .25s; }
.progress__bar--gold { background: var(--gold-500); }
.progress__bar--ok { background: var(--ok-600); }
.progress__bar--err { background: var(--err-600); }
.progress--lg { height: 10px; }

/* ==========================================================================
   Вкладки
   ========================================================================== */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 9px var(--s-12); font-size: var(--fs-14); color: var(--ink-500); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500;
  background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font);
}
.tab:hover { color: var(--ink-900); }
.tab.on { color: var(--brand-700); border-bottom-color: var(--brand-700); }
.tab .cnt { font-size: var(--fs-11); background: var(--bg-sunken); border-radius: var(--r-pill); padding: 1px 6px; margin-left: 5px; }
.tab.on .cnt { background: var(--brand-100); color: var(--brand-700); }

/* ==========================================================================
   Определения (пары «поле — значение»)
   ========================================================================== */

.dl { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; }
.dl > dt { padding: 10px var(--s-16) 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-500); font-size: var(--fs-13); }
.dl > dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.dl > dt:last-of-type, .dl > dd:last-of-type { border-bottom: 0; }
@media (max-width: 700px) {
  .dl { grid-template-columns: 1fr; }
  .dl > dt { border-bottom: 0; padding-bottom: 0; }
  .dl > dd { padding-top: 2px; }
}

/* ==========================================================================
   Модальные окна и панель-выдвижка
   ========================================================================== */

.modal-bg { position: fixed; inset: 0; background: rgba(12,18,22,.48); z-index: 100; display: grid; place-items: center; padding: var(--s-24); }
.modal {
  background: var(--surface); border-radius: var(--r-14); box-shadow: var(--sh-3);
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
}
.modal--wide { max-width: 900px; }
.modal--xl { max-width: 1120px; }
.modal__head { padding: var(--s-20); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: var(--s-12); }
.modal__body { padding: var(--s-20); overflow-y: auto; }
.modal__foot { padding: var(--s-16) var(--s-20); border-top: 1px solid var(--line); display: flex; gap: var(--s-8); justify-content: flex-end; background: var(--bg); border-radius: 0 0 var(--r-14) var(--r-14); }

.toasts { position: fixed; right: var(--s-20); bottom: var(--s-20); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink-900); color: #fff; border-radius: var(--r-6); padding: 11px var(--s-16);
  font-size: var(--fs-13); box-shadow: var(--sh-2); max-width: 380px; display: flex; gap: 9px; align-items: flex-start;
  animation: toast-in .18s ease;
}
.toast--ok { background: var(--ok-700); }
.toast--err { background: var(--err-700); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   Специальные блоки
   ========================================================================== */

/* Шкала оценки эксперта */
.scale { display: flex; gap: 4px; flex-wrap: wrap; }
.scale button {
  width: 36px; height: 36px; border-radius: var(--r-6); border: 1px solid var(--line-strong);
  background: var(--surface); font: 600 var(--fs-14)/1 var(--font); color: var(--ink-600); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.scale button:hover { border-color: var(--brand-500); color: var(--brand-700); }
.scale button.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.scale button.on.lo { background: var(--err-600); border-color: var(--err-600); }
.scale button.on.mid { background: var(--warn-600); border-color: var(--warn-600); }
.scale button.on.hi { background: var(--ok-600); border-color: var(--ok-600); }

.crit { border: 1px solid var(--line); border-radius: var(--r-10); padding: var(--s-16); background: var(--surface); }
.crit + .crit { margin-top: var(--s-12); }
.crit__head { display: flex; gap: var(--s-12); align-items: flex-start; margin-bottom: var(--s-12); }
.crit__n { width: 26px; height: 26px; border-radius: var(--r-6); background: var(--bg-sunken); color: var(--ink-500); display: grid; place-items: center; font-size: var(--fs-12); font-weight: 600; flex: none; }
.crit__k { font-size: var(--fs-12); color: var(--ink-500); }
.crit__k b { color: var(--gold-700); font-variant-numeric: tabular-nums; }
.crit__score { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }

/* Полоса в таблице рейтинга */
.bar { height: 6px; background: var(--bg-sunken); border-radius: var(--r-pill); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--brand-500); border-radius: var(--r-pill); }
.bar > i.gold { background: var(--gold-500); }
.bar > i.ok { background: var(--ok-600); }

/* Линия отсечки бюджета */
tr.cutoff td { border-bottom: 2px dashed var(--gold-500) !important; }
tr.below td { opacity: .62; }
.cutoff-label { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-700); font-size: var(--fs-12); font-weight: 600; }

/* Лента статусов заявки */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding-bottom: var(--s-16); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
}
.tl-item.done::before { background: var(--ok-600); border-color: var(--ok-600); }
.tl-item.cur::before { background: var(--gold-500); border-color: var(--gold-500); box-shadow: 0 0 0 3px var(--gold-100); }
.tl-item__t { font-size: var(--fs-13); font-weight: 500; }
.tl-item__d { font-size: var(--fs-12); color: var(--ink-400); }

/* Аккордеон */
.acc { border: 1px solid var(--line); border-radius: var(--r-10); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: var(--s-8); }
.acc__head { padding: var(--s-12) var(--s-16); display: flex; align-items: center; gap: 10px; cursor: pointer; background: var(--surface); }
.acc__head:hover { background: var(--bg); }
.acc__body { padding: 0 var(--s-16) var(--s-16); border-top: 1px solid var(--line); padding-top: var(--s-16); }
.acc__chev { margin-left: auto; color: var(--ink-400); transition: transform .15s; }
.acc.open .acc__chev { transform: rotate(180deg); }

/* Строка динамического списка (члены команды, партнёры, статьи бюджета) */
.dyn { border: 1px solid var(--line); border-radius: var(--r-10); padding: var(--s-16); background: var(--surface); position: relative; }
.dyn + .dyn { margin-top: var(--s-12); }
.dyn__head { display: flex; align-items: center; gap: var(--s-8); margin-bottom: var(--s-12); }
.dyn__n { font-size: var(--fs-12); font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .05em; }

/* Роль-переключатель */
.rolepick { display: grid; gap: 10px; }
.rolecard {
  display: flex; gap: var(--s-12); align-items: flex-start; padding: var(--s-16);
  border: 1px solid var(--line-strong); border-radius: var(--r-10); background: var(--surface);
  cursor: pointer; text-align: left; font-family: var(--font); width: 100%;
}
.rolecard:hover { border-color: var(--brand-500); box-shadow: var(--sh-1); }
.rolecard__ic { width: 38px; height: 38px; border-radius: var(--r-6); display: grid; place-items: center; flex: none; background: var(--brand-100); color: var(--brand-700); }
.rolecard__ic--gold { background: var(--gold-100); color: var(--gold-700); }
.rolecard__t { display: block; font-weight: 600; font-size: var(--fs-14); color: var(--ink-900); }
.rolecard__d { display: block; font-size: var(--fs-12); color: var(--ink-500); margin-top: 2px; line-height: 1.45; }
.radio-card__t { display: block; }
.radio-card__d { display: block; }

/* Экран входа */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__hero { display: none; } }
.auth__hero { background: var(--ink-900); color: #fff; padding: var(--s-56); display: flex; flex-direction: column; justify-content: space-between; }
.auth__form { padding: var(--s-40); display: flex; align-items: center; justify-content: center; overflow-y: auto; }
.auth__inner { width: 100%; max-width: 460px; }
.hero-mark { display: flex; align-items: center; gap: var(--s-12); }
.hero-mark__sq { width: 42px; height: 42px; border-radius: 10px; background: var(--gold-500); color: var(--ink-900); display: grid; place-items: center; font-weight: 700; }
.hero-list { display: grid; gap: var(--s-16); margin-top: var(--s-32); }
.hero-list__i { display: flex; gap: var(--s-12); align-items: flex-start; }
.hero-list__i svg { color: var(--gold-500); margin-top: 2px; }
.hero-list__t { font-weight: 600; font-size: var(--fs-14); }
.hero-list__d { font-size: var(--fs-13); color: var(--ink-300); }

/* Печатная форма заявки */
.printable { background: #fff; }
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; }
  body { background: #fff; font-size: 11pt; }
  .print-only { display: block !important; }
  table.tbl th { position: static; }
}
.print-only { display: none; }

/* Диадок — имитация статуса ЭДО */
.edo { display: flex; gap: var(--s-12); align-items: center; padding: var(--s-12) var(--s-16); border: 1px solid var(--line); border-radius: var(--r-10); background: var(--surface); }
.edo__ic { width: 34px; height: 34px; border-radius: var(--r-6); background: var(--ink-900); color: var(--gold-500); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 11px; }

.demo-flag {
  background: var(--gold-100); color: var(--gold-700); border: 1px solid var(--gold-300);
  border-radius: var(--r-pill); padding: 2px 10px; font-size: var(--fs-11); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}

.hr { height: 1px; background: var(--line); border: 0; margin: var(--s-20) 0; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-600); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--brand-800); }

.sticky-actions {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: var(--s-12) var(--s-20); display: flex; gap: var(--s-8); align-items: center;
  margin: var(--s-20) calc(-1 * var(--s-20)) calc(-1 * var(--s-20));
  border-radius: 0 0 var(--r-10) var(--r-10); z-index: 10;
}
