/* Учебный центр — общая визуальная система.
 * Токены → базовые элементы → оболочка → компоненты → страницы → утилиты.
 * Шрифт Golos Text подключён локально (OFL, fonts/OFL.txt), без внешних CDN.
 */

@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400;
  src: url("fonts/golos-text-cyrillic-400-normal.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-display: swap; font-weight: 500;
  src: url("fonts/golos-text-cyrillic-500-normal.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-display: swap; font-weight: 600;
  src: url("fonts/golos-text-cyrillic-600-normal.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-display: swap; font-weight: 700;
  src: url("fonts/golos-text-cyrillic-700-normal.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-display: swap; font-weight: 400;
  src: url("fonts/golos-text-latin-400-normal.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-display: swap; font-weight: 500;
  src: url("fonts/golos-text-latin-500-normal.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-display: swap; font-weight: 600;
  src: url("fonts/golos-text-latin-600-normal.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-display: swap; font-weight: 700;
  src: url("fonts/golos-text-latin-700-normal.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: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --text: #17212F;
  --text-2: #64748B;
  --text-3: #8391A5;          /* только для плейсхолдеров и неактивных элементов */
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #EAF1FF;
  --border: #E4E9F0;
  --border-strong: #CBD5E1;
  --selected: #EAF1FF;

  --success: #15803D;  --success-soft: #E7F6EC;
  --warning: #B45309;  --warning-soft: #FEF3E2;
  --danger: #B91C1C;   --danger-soft: #FDECEC;
  --info: #1D4ED8;     --info-soft: #EAF1FF;
  --neutral: #475569;  --neutral-soft: #EEF2F6;

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 22px; --fs-h1: 27px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --radius-sm: 6px; --radius: 8px; --radius-lg: 10px; --radius-pill: 999px;
  --control-h: 40px; --control-h-sm: 32px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-pop: 0 8px 24px rgba(15, 23, 42, .12), 0 1px 3px rgba(15, 23, 42, .08);
  --focus: 0 0 0 3px rgba(37, 99, 235, .35);
  --nav-h: 56px;
  --page-max: 1440px;
  --form-max: 760px;
}

/* ------------------------------------------------------------------ база */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/1.5 var(--font); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img, svg { vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.icon-fill { fill: currentColor; stroke: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: 100; background: var(--surface);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.skip-link:focus { top: var(--sp-2); }
code { font-family: var(--mono); font-size: .92em; }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-4) 0; }

/* ------------------------------------------------------------------ оболочка */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: var(--sp-6); height: var(--nav-h); padding: 0 var(--sp-6);
  max-width: var(--page-max); margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text); font-weight: 700;
  font-size: var(--fs-md); white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand .icon { width: 26px; height: 26px; color: var(--accent); }
.mainnav { display: flex; align-items: stretch; gap: var(--sp-1); height: 100%; }
.mainnav a { display: inline-flex; align-items: center; padding: 0 var(--sp-3); color: var(--text); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mainnav a:hover { color: var(--accent); text-decoration: none; }
.mainnav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.mainnav a:focus-visible { box-shadow: inset var(--focus); border-radius: 0; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--fs-sm); }
.btn.nav-toggle { display: none; }
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-10); }
.page-narrow { max-width: var(--form-max); }

@media (max-width: 860px) {
  .topbar-inner { padding: 0 var(--sp-4); gap: var(--sp-3); }
  .btn.nav-toggle { display: inline-flex; margin-left: auto; }
  .topbar-end { margin-left: 0; }
  .topbar-end .user-name { display: none; }
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: var(--nav-h); height: auto; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--sp-2) var(--sp-4) var(--sp-3);
    box-shadow: var(--shadow-pop); }
  .mainnav.open { display: flex; }
  .mainnav a { padding: var(--sp-3); border-bottom: 0; border-left: 3px solid transparent; border-radius: 0; }
  .mainnav a[aria-current="page"] { border-left-color: var(--accent); background: var(--selected); }
  .page { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
}

/* ------------------------------------------------------------------ заголовок страницы */
.back-link { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 500; margin-bottom: var(--sp-3); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); }
.page-head-main { flex: 1 1 320px; min-width: 0; }
.page-title { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.01em; display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-2) var(--sp-3); }
.page-sub { color: var(--text-2); font-size: var(--fs-md); margin: var(--sp-1) 0 0; }
.page-meta { color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3);
  margin-top: var(--sp-2); font-size: var(--fs-md); }
.page-meta .sep { width: 1px; height: 16px; background: var(--border-strong); }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
@media (max-width: 600px) { .page-title { font-size: 23px; } .page-actions { width: 100%; } }

/* ------------------------------------------------------------------ кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--control-h);
  padding: 0 var(--sp-4); border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--surface-2); border-color: #B6C2D2; color: var(--text); text-decoration: none; }
.btn:focus-visible { border-radius: var(--radius); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--neutral-soft); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #F2B8B8; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #991B1B; border-color: #991B1B; color: #fff; }
.btn-sm { height: var(--control-h-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); gap: 6px; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); }
.btn-link { border: 0; background: none; padding: 0; height: auto; color: var(--accent); font-weight: 500; cursor: pointer; }
.btn-link:hover { text-decoration: underline; color: var(--accent-hover); }
.btn[disabled], .btn.disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-block { width: 100%; }
.btn .count { background: var(--accent); color: #fff; border-radius: var(--radius-pill); font-size: var(--fs-xs);
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } * { transition: none !important; } }

/* ------------------------------------------------------------------ поля */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 500; font-size: var(--fs-sm); color: var(--text); }
.label-opt { color: var(--text-2); font-weight: 400; }
.input, .select, .textarea, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; height: var(--control-h); padding: 0 var(--sp-3); border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: var(--fs); }
.textarea, .field textarea { height: auto; min-height: 72px; padding: var(--sp-2) var(--sp-3); resize: vertical; line-height: 1.45; }
.select, .field select { appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: var(--focus); border-radius: var(--radius); }
.input[disabled], .select[disabled], .field input[disabled], .field select[disabled], .field textarea[disabled] {
  background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
.input-sm, .select-sm { height: var(--control-h-sm); font-size: var(--fs-sm); padding: 0 var(--sp-2); }
.select-sm { padding-right: 28px; background-position: right 8px center; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .input.is-invalid, .select.is-invalid {
  border-color: var(--danger); }
.hint { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.error-text { color: var(--danger); font-size: var(--fs-sm); display: flex; gap: 6px; align-items: flex-start; }
.error-text .icon { width: 16px; height: 16px; margin-top: 2px; }
.check { display: inline-flex; align-items: flex-start; gap: var(--sp-2); cursor: pointer; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid > * { grid-column: span 12; }
@media (min-width: 720px) {
  .form-grid .span-3 { grid-column: span 3; } .form-grid .span-4 { grid-column: span 4; }
  .form-grid .span-6 { grid-column: span 6; } .form-grid .span-8 { grid-column: span 8; }
}
.form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-5); }
.fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-6); }
.fieldset > legend, .section-title { font-size: var(--fs-md); font-weight: 600; padding: 0; margin-bottom: var(--sp-3); }

/* ------------------------------------------------------------------ поверхности */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--sp-4); }
.layout-2 > .card, .layout-split > .card, .commission-grid > .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.card-head.flush { border-bottom: 0; padding-bottom: var(--sp-2); }
.card-title { font-size: var(--fs-md); font-weight: 600; margin-right: auto; }
.card-body { padding: var(--sp-5); }
.card-foot { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm); }
.stack > * + * { margin-top: var(--sp-4); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; }
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 960px) { .layout-2, .layout-split { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ таблицы */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.table th { text-align: left; font-weight: 600; font-size: var(--fs-sm); color: var(--text); padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child > td { border-bottom: 0; }
.table-hover tbody tr:hover > td { background: #FAFBFD; }
.table tr.is-current > td { background: var(--selected); }
.table-compact th, .table-compact td { padding: var(--sp-2) var(--sp-3); }
.table .c { text-align: center; } .table .r { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table .w-1 { width: 1%; }
.cell-sub { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.4; margin-top: 2px; }
.cell-strong { font-weight: 600; }
.row-link { font-weight: 500; }
/* Вся строка кликабельна: ссылка растягивается на строку, ctrl/средний клик работают как обычно */
.table-rows tbody tr { position: relative; cursor: pointer; }
.table-rows .row-link::after { content: ""; position: absolute; inset: 0; }
.table-rows .row-link:focus-visible { outline: none; }
.table-rows tbody tr:has(.row-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.table td.row-problem { background: var(--danger-soft); }
.table td.row-warn { background: var(--warning-soft); }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); justify-content: space-between;
  padding: var(--sp-3) var(--sp-1); color: var(--text-2); }

/* ------------------------------------------------------------------ статусы */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral); }
.badge .icon { width: 14px; height: 14px; stroke-width: 2; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--neutral-soft); color: var(--text-2); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.badge-sm { height: 22px; padding: 0 8px; font-size: var(--fs-xs); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-line { display: inline-flex; align-items: center; gap: var(--sp-2); }
.text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); }
.text-muted { color: var(--text-2); } .text-accent { color: var(--accent); }

/* ------------------------------------------------------------------ сводка */
.summary { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: var(--sp-5); }
.summary-item { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); flex: 1 1 auto;
  border-left: 1px solid var(--border); min-height: 52px; }
.summary-item:first-child { border-left: 0; }
.summary-item .icon { color: var(--text-2); }
.summary-item b { font-weight: 600; }
.summary-item .ok { color: var(--success); } .summary-item .warn { color: var(--warning); } .summary-item .bad { color: var(--danger); }
@media (max-width: 760px) {
  .summary-item { flex: 1 1 50%; border-left: 0; border-top: 1px solid var(--border); padding: var(--sp-2) var(--sp-4); }
  .summary-item:nth-child(-n+2) { border-top: 0; }
}

/* ------------------------------------------------------------------ вкладки и сегменты */
.tabs { position: relative; display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4);
  overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) 10px; border: 0;
  background: none; color: var(--text); font-weight: 500; font-size: var(--fs-md); border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--accent); text-decoration: none; }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab:focus-visible { box-shadow: inset var(--focus); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab .badge { height: 22px; font-size: var(--fs-xs); padding: 0 8px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
.segmented a { display: inline-flex; align-items: center; height: var(--control-h); padding: 0 var(--sp-5);
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius); color: var(--text); font-weight: 500; }
.segmented a:hover { text-decoration: none; background: var(--surface-2); }
.segmented a[aria-current="page"] { background: var(--selected); border-color: #9DBBF5; color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------------ поиск и фильтры */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-4); }
.search { position: relative; flex: 1 1 320px; min-width: 0; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.search .input { padding-left: 40px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--info); font-size: var(--fs-sm); font-weight: 500; }
.chip a { display: inline-flex; color: inherit; border-radius: 50%; padding: 2px; }
.chip a:hover { background: rgba(37, 99, 235, .12); }

/* ------------------------------------------------------------------ меню и всплывающие панели */
.menu { position: relative; display: inline-flex; }
.menu-panel { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 220px; max-width: min(360px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  padding: 6px; }
.menu-panel.left { right: auto; left: 0; }
.menu-panel.up { top: auto; bottom: calc(100% + 6px); }
.menu-panel.floating { position: fixed; right: auto; bottom: auto; z-index: 60; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 36px; padding: 6px 10px;
  border: 0; background: none; border-radius: var(--radius-sm); color: var(--text); text-align: left; cursor: pointer;
  font-weight: 400; white-space: nowrap; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); color: var(--text); text-decoration: none; box-shadow: none; }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-item .icon { color: var(--text-2); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-item[aria-disabled="true"] { color: var(--text-3); cursor: not-allowed; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-label { padding: 6px 10px 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.menu-note { padding: 2px 10px 6px; font-size: var(--fs-sm); color: var(--text-2); white-space: normal; line-height: 1.4; }
.menu-note.warn { color: var(--warning); }
.menu-doc { padding: 4px 4px 6px; }
.menu-doc + .menu-doc { border-top: 1px solid var(--border); }
.menu-doc-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 6px 6px 4px; font-weight: 600; }
.menu-doc-links { display: flex; gap: 4px; padding: 0 2px; }
.menu-doc-links .btn { flex: 1; }
.pop-form { padding: var(--sp-3); min-width: 280px; }
.pop-form .field + .field { margin-top: var(--sp-3); }
.pop-actions { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ------------------------------------------------------------------ уведомления */
.alert { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface); margin-bottom: var(--sp-4); line-height: 1.45; }
.alert > .icon { margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body > :last-child { margin-bottom: 0; }
.alert-title { font-weight: 600; }
.alert-success { background: var(--success-soft); border-color: #BFE3CB; } .alert-success > .icon { color: var(--success); }
.alert-warning { background: #FFF8EC; border-color: #F6DDB4; } .alert-warning > .icon { color: var(--warning); }
.alert-error { background: var(--danger-soft); border-color: #F4C7C7; } .alert-error > .icon { color: var(--danger); }
.alert-info { background: var(--info-soft); border-color: #C9DAFB; } .alert-info > .icon { color: var(--info); }
.alert-close { margin: -6px -8px -6px 0; }
.alert-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.messages { margin-bottom: var(--sp-2); }
.toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 60; display: flex; flex-direction: column;
  gap: var(--sp-2); width: min(420px, calc(100vw - 32px)); }
.toasts .alert { box-shadow: var(--shadow-pop); margin: 0; }

/* ------------------------------------------------------------------ пустые состояния */
.empty { text-align: center; padding: var(--sp-10) var(--sp-5); color: var(--text-2); }
.empty .icon { width: 32px; height: 32px; color: var(--text-3); margin-bottom: var(--sp-3); }
.empty-title { color: var(--text); font-weight: 600; font-size: var(--fs-md); margin-bottom: var(--sp-1); }
.empty p { max-width: 460px; margin: 0 auto var(--sp-4); }
.empty .btn { margin-top: var(--sp-1); }

/* ------------------------------------------------------------------ диалоги */
dialog.dialog { border: 0; padding: 0; border-radius: 12px; box-shadow: var(--shadow-pop); width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); color: var(--text); background: var(--surface); }
dialog.dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-head { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.dialog-title { font-size: var(--fs-lg); font-weight: 600; flex: 1; }
.dialog-body { padding: 0 var(--sp-5) var(--sp-4); overflow-y: auto; }
.dialog-body ul { margin: var(--sp-1) 0 var(--sp-3); padding-left: 20px; }
.dialog-body li + li { margin-top: 2px; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border); }
.dialog-section + .dialog-section { margin-top: var(--sp-4); }
.dialog-section h3 { font-size: var(--fs); font-weight: 600; margin-bottom: var(--sp-1); }

/* ------------------------------------------------------------------ пагинация */
.pager { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
  padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.pager a:hover { text-decoration: none; background: var(--surface-2); }
.pager [aria-current="page"] { background: var(--selected); border-color: #9DBBF5; color: var(--accent); font-weight: 600; }
.pager .gap { border: 0; background: none; min-width: 20px; }
.pager .disabled { color: var(--text-3); }

/* ------------------------------------------------------------------ шаги и загрузка */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); list-style: none; padding: 0;
  margin: 0 0 var(--sp-5); }
.step { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); font-weight: 500; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--neutral-soft); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.step[aria-current="step"] { color: var(--text); font-weight: 600; }
.step[aria-current="step"] .step-n { background: var(--accent); color: #fff; }
.step.done .step-n { background: var(--success-soft); color: var(--success); }
.step-line { width: 44px; height: 1px; background: var(--border-strong); }
.step.done + .step-line { background: var(--accent); }
.dropzone { position: relative; display: flex; align-items: center; gap: var(--sp-4); border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg); background: var(--surface-2); padding: var(--sp-5); cursor: pointer;
  transition: background-color .12s, border-color .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #F3F7FF; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.dropzone-icon { width: 44px; height: 44px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); flex: none; }
.dropzone-icon.file { background: #E7F6EC; color: #15803D; }
.dropzone-text { flex: 1; min-width: 0; }
.dropzone-name { font-weight: 600; font-size: var(--fs-md); overflow-wrap: anywhere; }
.dropzone-meta { color: var(--text-2); font-size: var(--fs-sm); }
.dropzone.has-error { border-color: var(--danger); background: var(--danger-soft); }
details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); color: var(--accent); font-weight: 500; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { transition: transform .15s; }
details.disclosure[open] > summary .icon { transform: rotate(180deg); }
details.disclosure > .disclosure-body { padding: 0 var(--sp-4) var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); }
details.disclosure > .disclosure-body ul { margin: 0; padding-left: 18px; }

/* ------------------------------------------------------------------ сохранение на лету */
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); min-height: 20px; }
.save-state.ok { color: var(--success); }
.save-state.err { color: var(--danger); }
.save-state .btn-link { font-size: var(--fs-sm); }
.quick { display: flex; align-items: center; gap: 6px; }
.quick .input, .quick .select { min-width: 0; }
.quick-date { width: 150px; }
.quick-comm { width: 240px; }
.field-state { width: 16px; height: 16px; flex: none; display: inline-flex; }
.field-state .icon { width: 16px; height: 16px; }
.field-state.ok { color: var(--success); } .field-state.err { color: var(--danger); } .field-state.busy { color: var(--text-2); }

/* ------------------------------------------------------------------ страницы */
/* карточка заявки */
.group-prog { min-width: 300px; max-width: 460px; }
.group-code { font-weight: 600; }
.group-title { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.4; margin-top: 2px; }
.group-note { font-size: var(--fs-sm); margin-top: 4px; display: flex; gap: 4px; align-items: flex-start; line-height: 1.4; }
.group-note .icon { width: 14px; height: 14px; margin-top: 2px; }
.group-note.warn { color: var(--warning); } .group-note.bad { color: var(--danger); }
.end-date { white-space: nowrap; }
.data-block { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); }
.data-block-title { font-weight: 600; font-size: var(--fs-md); min-width: 140px; }
.data-items { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); flex: 1; min-width: 0; }
.data-item { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text); }
.data-item .icon { color: var(--text-2); }
.data-item .k { color: var(--text-2); }
.complete-bar { display: flex; justify-content: flex-end; margin-top: var(--sp-5); }
.doc-matrix td { vertical-align: top; }
.doc-cell-links { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.doc-cell-reason { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.4; max-width: 260px; }
.zip-list { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.zip-list li { display: flex; gap: var(--sp-2); align-items: flex-start; padding: 4px 0; line-height: 1.45; }
.zip-list .icon { width: 16px; height: 16px; margin-top: 2px; }
.export-list { list-style: none; margin: 0; padding: 0; }
.export-list li { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border); }
.export-list li:first-child { border-top: 0; }
.check-list { display: flex; flex-direction: column; gap: var(--sp-2); }
/* слушатели */
.history-toggle { display: inline-flex; align-items: center; gap: 6px; }
.history-toggle .icon { transition: transform .15s; }
.history-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.history-row > td { padding: 0 var(--sp-4) var(--sp-4); background: var(--surface); }
.history { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); overflow: hidden; }
.history-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); font-weight: 600; }
.history .table th, .history .table td { background: transparent; }
/* справочник */
.commission-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-5); align-items: start; }
@media (max-width: 1000px) { .commission-grid { grid-template-columns: minmax(0, 1fr); } }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; gap: var(--sp-2); padding: 4px 0; }
.member-role { color: var(--text-2); min-width: 110px; }
.staff-list { list-style: none; margin: 0; padding: 0; }
.staff-list li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); }
.staff-list li:first-child { border-top: 0; }
.formset-table td { vertical-align: top; }
.formset-table .field input, .formset-table .field select { height: var(--control-h-sm); font-size: var(--fs-sm); }
/* вход */
.auth { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: var(--sp-6) var(--sp-4); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .card-body { padding: var(--sp-8); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; font-size: var(--fs-lg); margin-bottom: var(--sp-5); }
.auth-brand .icon { width: 30px; height: 30px; color: var(--accent); }

/* ------------------------------------------------------------------ утилиты */
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 600; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.ml-auto { margin-left: auto; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.inline-form { display: inline; }
.w-full { width: 100%; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.prewrap { white-space: pre-line; }
details.section-card > summary::-webkit-details-marker { display: none; }
details.section-card > summary .icon { transition: transform .15s; color: var(--text-2); }
details.section-card[open] > summary .icon { transform: rotate(180deg); }
details.section-card:not([open]) > summary { border-bottom: 0; }
.year-switch { display: inline-flex; gap: 4px; }
.year-switch a { display: inline-flex; align-items: center; height: var(--control-h-sm); padding: 0 var(--sp-3); border-radius: var(--radius);
  border: 1px solid var(--border-strong); color: var(--text); font-size: var(--fs-sm); font-weight: 500; }
.year-switch a:hover { text-decoration: none; background: var(--surface-2); }
.year-switch a[aria-current="page"] { background: var(--selected); border-color: #9DBBF5; color: var(--accent); font-weight: 600; }
.readonly-value { min-height: var(--control-h); display: flex; align-items: center; color: var(--text); }
.alert { flex-wrap: wrap; }
.alert-body { flex: 1 1 220px; }
@media (max-width: 760px) {
  .data-block { flex-direction: column; align-items: flex-start; }
  .data-items { flex-direction: column; }
  .tab { padding-left: var(--sp-2); padding-right: var(--sp-2); font-size: var(--fs); }
  .page-meta .sep { display: none; }
  .card-head { padding: var(--sp-3) var(--sp-4); }
  .card-body { padding: var(--sp-4); }
}

/* Полоса тестовой копии (SITE_BANNER) */
.site-banner {
  background: #b45309;
  color: #fff;
  text-align: center;
  font-weight: 600;
  padding: 6px 16px;
  font-size: 14px;
}

/* Нумерация в настройках: группы программ */
.counter-groups { margin-top: var(--sp-3); border-top: 1px solid var(--border); }
details.counter-group { border-bottom: 1px solid var(--border); }
details.counter-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5); min-height: 44px; }
details.counter-group > summary::-webkit-details-marker { display: none; }
details.counter-group > summary:hover { background: var(--surface-2); }
details.counter-group > summary .icon { transition: transform .15s; color: var(--text-2); flex: none; transform: rotate(-90deg); }
details.counter-group[open] > summary .icon { transform: rotate(0deg); }
.counter-group-title { font-weight: 600; white-space: nowrap; }
.counter-group-codes { color: var(--text-2); font-size: var(--fs-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.counter-group[open] .counter-group-codes { visibility: hidden; }
.counter-search { padding: var(--sp-3) var(--sp-5) 0; }
.counter-search .input { max-width: 22rem; width: 100%; }
