/* TruDrive — дизайн-система. Редизайн 09.11.2026 (макет партнёра 0.19.1-demo-ui): светлая по умолчанию, белый фон, тонкие
   рамки, спокойные цифры, чёрные основные кнопки, фиолетовый акцент продукта; цвет школы — на её карточке (знак, иконки, печать).
   Правила:
   - цвета только через токены ниже; новых литералов в компонентах не вписывать;
   - акцент — одна переменная --accent, производные считаются из неё (color-mix);
   - блок :root — тёмная пара токенов, светлая — <html data-theme="light">; какая тема по умолчанию, решает web/theme.js
     (с 09.11.2026 — светлая), по настройке устройства тема не выбирается;
   - текст не мельче 11 px, поля ввода на телефоне — 16 px (иначе iPhone увеличивает страницу при вводе);
   - запреты по ролям — в логике и на сервере, никогда не в CSS;
   - inline-стилей нет (CSP style-src 'self'): всё — классами отсюда. */

/* ---------- токены: тёмная пара ----------
   html:root — акцент продукта сильнее цвета кнопок школы из /brand.css (решение Павла 09.11.2026: «как в демо партнёра» —
   интерфейс в цветах TruDrive, школа — на своей карточке через --brand). Вернуть акцент школы — убрать «html» у селектора. */
html:root {
  color-scheme: dark;
  --accent: #6b5fe7;
  --on-accent: #fff;
  /* знак школы и иконка — основной цвет школы (P04, /brand.css); не задан — как акцент */
  --brand: var(--accent);
  --on-brand: var(--on-accent);
  --logo-bg: #fff;        /* подложка логотипа: логотипы рисуют под белый фон */
  --accent-ink: color-mix(in oklab, var(--accent) 55%, #fff);     /* акцентный ТЕКСТ на тёмном фоне */
  --accent-hover: color-mix(in oklab, var(--accent) 86%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 50%, var(--border));
  --accent-dot: color-mix(in srgb, var(--accent) 45%, var(--surface));
  --accent-title: color-mix(in oklab, var(--accent) 80%, #fff);  /* вторая строка крупных заголовков */
  --accent-glow: transparent;

  /* основная кнопка — «чернилами»: на тёмной — светлая */
  --action: #eeeef5;
  --action-hover: #fff;
  --on-action: #1b1d24;

  --bg: #0b0b0d;          /* фон страницы */
  --side-bg: #0b0b0d;     /* боковое меню */
  --surface: #151518;     /* карточка */
  --surface-2: #1c1c20;   /* плашка внутри карточки, шапка таблицы */
  --surface-3: #26262c;   /* наведение, полоса прогресса */
  --border: #33333a;
  --border-soft: #24242a;
  --text: #f2f2f3;
  --muted: #b4b4bc;
  --hint: #8e8e98;
  --scrim: rgba(0, 0, 0, .62);
  --glass: rgba(11, 11, 13, .86);
  --tabbar: rgba(28, 28, 32, .94);

  --ok: #34d399;  --ok-bg: rgba(52, 211, 153, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --bad: #ff6b7a; --bad-bg: rgba(255, 107, 122, .12); --bad-fill: #dc2626;
  --test: #c4b5fd; --test-bg: rgba(167, 139, 250, .14);
  --white: #fff;          /* текст на красной кнопке */

  --shadow-pop: 0 24px 64px rgba(0, 0, 0, .55);
  --shadow-card: none;
  --shadow-float: 0 8px 40px rgba(0, 0, 0, .4);

  --r-sm: 8px; --r: 10px; --r-lg: 12px; --r-xl: 16px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 58px;
  --sidebar-w: 236px;
}

/* ---------- светлая (по умолчанию, ставит web/theme.js) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --accent-ink: color-mix(in oklab, var(--accent) 82%, #000);
  --accent-hover: color-mix(in oklab, var(--accent) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 42%, var(--surface));
  --accent-dot: color-mix(in srgb, var(--accent) 32%, var(--surface));
  --accent-title: color-mix(in oklab, var(--accent) 88%, #fff);

  --action: #1c1e25;
  --action-hover: #353741;
  --on-action: #fff;

  --bg: #fff;
  --side-bg: #fafafd;
  --surface: #fff;
  --surface-2: #f7f8fa;
  --surface-3: #f0f0f5;
  --border: #dcdde5;
  --border-soft: #e7e8ec;
  --text: #1b1d24;
  --muted: #505762;
  --hint: #69707d;
  --scrim: rgba(20, 22, 32, .36);
  --glass: rgba(255, 255, 255, .94);
  --tabbar: rgba(255, 255, 255, .96);

  --ok: #31834a;  --ok-bg: #edf7f0;
  --warn: #8a6416; --warn-bg: #faf4e8;
  --bad: #ad3244; --bad-bg: #fceff1; --bad-fill: #c81e1e;
  --test: #6d28d9; --test-bg: rgba(109, 40, 217, .09);

  --shadow-pop: 0 16px 46px rgba(23, 29, 49, .12);
  --shadow-card: 0 1px 2px rgba(23, 29, 49, .03), 0 4px 20px rgba(23, 29, 49, .025);
  --shadow-float: 0 8px 40px rgba(23, 29, 49, .08);
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); }
* { scrollbar-color: var(--surface-3) transparent; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code { font-family: var(--mono); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.hint { color: var(--hint); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.ico-sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- кнопки: основная — чёрная, остальные — белые с рамкой ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--action); border-radius: var(--r-sm); font: 500 13.5px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  background: var(--action); color: var(--on-action); text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost, .btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover, .btn-outline:hover { background: var(--surface-2); border-color: var(--border); }
.btn-danger { background: var(--bad-fill); border-color: var(--bad-fill); color: var(--white); }
.btn-danger:hover { background: var(--bad-fill); border-color: var(--bad-fill); opacity: .9; }
.btn-text { background: none; border-color: transparent; color: var(--accent-ink); padding: 6px 6px; min-height: 0; }
.btn-text:hover { background: var(--accent-soft); border-color: transparent; text-decoration: none; }
.btn-text.danger { color: var(--bad); }
.btn-text.danger:hover { background: var(--bad-bg); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; background: var(--surface); color: var(--hint); border-color: var(--border-soft); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--hint); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; font: 14px/1.3 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 88px; resize: vertical; }
/* K03: редактор шаблона договора */
.field textarea.pr-editor { min-height: 420px; font: 13px/1.55 var(--mono); }
.tbl td.c, .tbl th.c { text-align: center; }
.input::placeholder, .field input::placeholder { color: var(--hint); opacity: .85; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:disabled, .field select:disabled { opacity: .7; cursor: default; background: var(--surface-2); }
.field select, select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%),
  linear-gradient(135deg, var(--hint) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.field.wide { grid-column: 1 / -1; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.form-grid > .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.form-inline { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.form-msg { font-size: 12.5px; color: var(--hint); }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--bad); }
.search { position: relative; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--hint); pointer-events: none; }
.search .input { padding-left: 42px; min-height: 44px; font-size: 14px; }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 20px 22px;
  box-shadow: var(--shadow-card); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head > b { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.card-note { color: var(--hint); font-size: 12.5px; line-height: 1.6; margin: -6px 0 16px; }
.plate { background: var(--surface-2); border-radius: var(--r); padding: 14px 16px; }
.stack > * + * { margin-top: 16px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 13.5px;
  background: var(--surface-2); color: var(--muted); }
.callout .ico { margin-top: 1px; }
.callout.warn { background: var(--warn-bg); color: var(--warn); }
.callout.bad { background: var(--bad-bg); color: var(--bad); }
.callout.ok { background: var(--ok-bg); color: var(--ok); }
.callout.info { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- крупные цифры (KPI): спокойные, без «неона» ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 116px;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-card); transition: border-color .15s, background .15s; }
.kpi::after { content: ""; position: absolute; top: 18px; right: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-dot); }
a.kpi:hover { border-color: var(--accent-line); text-decoration: none; }
.kpi-label { padding-right: 14px; font-size: 12px; font-weight: 400; color: var(--hint); }
.kpi-val { font: 600 29px/1.15 var(--font-num); letter-spacing: -.045em; }
.kpi-val small { font: 500 13px var(--font); letter-spacing: 0; color: var(--hint); margin-left: 5px; }
.kpi-sub { font-size: 12px; line-height: 1.5; color: var(--hint); }
.kpi-val.ok { color: var(--ok); } .kpi-val.warn { color: var(--warn); } .kpi-val.bad { color: var(--bad); }
.kpi-hero { grid-column: span 2; grid-row: span 2; overflow: hidden; padding: 22px 24px; border-radius: var(--r-lg); gap: 16px; }
.kpi-hero::before, .kpi-hero::after { content: none; }
.kpi-hero > * { position: relative; }
.kpi-hero .kpi-label { font-size: 13px; font-weight: 500; color: var(--text); }
.kpi-big { font: 600 52px/1.05 var(--font-num); letter-spacing: -.055em; }
.kpi-big small { font-size: 20px; font-weight: 500; color: var(--hint); margin-left: 4px; letter-spacing: -.02em; }
.kpi-main { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 22px; }
.kpi-note { max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.segbar { display: flex; gap: 3px; height: 6px; }
.segbar > span { border-radius: 3px; min-width: 6px; }
.seg-ok { background: var(--ok); } .seg-warn { background: var(--warn); } .seg-bad { background: var(--bad); } .seg-empty { background: var(--surface-3); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend > a, .legend > span { padding: 6px 10px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-decoration: none; }
.legend > a:hover { background: var(--surface-3); text-decoration: none; }
.legend b { margin-right: 4px; font-weight: 600; }
.legend b.ok { color: var(--ok); } .legend b.warn { color: var(--warn); } .legend b.bad { color: var(--bad); }

/* ---------- бейджи статусов ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  line-height: 1.5; white-space: nowrap; background: var(--surface-2); color: var(--hint); border: 1px solid var(--border-soft); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.test { background: var(--test-bg); color: var(--test); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; font-size: 11px; font-weight: 500; background: var(--surface-3); color: var(--muted); }
.count.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- аватар (инициалы) ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.avatar.lg { width: 60px; height: 60px; border-radius: 16px; font-size: 20px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }

/* ---------- вкладки: подчёркивание ---------- */
.tabs { display: flex; gap: 22px; padding: 0; margin: 0 0 22px; background: transparent; border-bottom: 1px solid var(--border-soft);
  overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 44px; padding: 10px 2px 11px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--hint); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab.active .count { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- фильтры-чипы ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border-radius: 7px;
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; text-decoration: none; }
.chip:hover { color: var(--text); border-color: var(--border); text-decoration: none; }
.chip.active { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* ---------- список (строки-карточки) ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border-soft);
  color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; }
a.item:hover { text-decoration: none; }
a.item:hover .item-title { color: var(--accent-ink); }
.item-body { flex: 1 1 auto; min-width: 0; }
.item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; font-weight: 500; }
.item-sub { margin-top: 3px; color: var(--hint); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.item-sub .sep { margin: 0 6px; opacity: .6; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; text-align: right; font-size: 13px; }
.item .chev { color: var(--hint); }

/* ---------- таблица; на телефоне — карточками ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--hint); background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.tbl th:first-child { border-top-left-radius: var(--r-sm); } .tbl th:last-child { border-top-right-radius: var(--r-sm); }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .cell-main { font-weight: 500; }
.tbl .cell-person { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.tbl .num { text-align: right; }

/* ---------- пустые состояния и скелетоны ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--hint); }
.empty .empty-ico { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 6px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--hint); }
.empty .empty-ico .ico { width: 24px; height: 24px; }
.empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.empty .btn { margin-top: 10px; }
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
.skel-line { height: 12px; margin: 8px 0; }
.skel-line.w40 { width: 40%; } .skel-line.w60 { width: 60%; } .skel-line.w80 { width: 80%; }
.skel-ava { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; }
.skel-kpi { height: 116px; border-radius: var(--r-lg); }
.skel-block { height: 220px; border-radius: var(--r-lg); }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- окна (модалки); прокрутка — здесь, у всех одинаково ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .15s ease; }
.modal { display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(88vh, 920px); background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); animation: pop .18s ease; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head h2 { flex: 1 1 auto; font-size: 19px; font-weight: 600; letter-spacing: -.035em; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 22px 8px; }
.modal-body > p + p { margin-top: 10px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px;
  border-top: 1px solid var(--border-soft); }
.modal-foot:empty { display: none; }
.modal-foot .spacer { flex: 1 1 auto; }
body.modal-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* пароль, показанный один раз */
.secret { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px; margin: 6px 0 14px;
  border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed var(--border); }
.secret code { font: 600 32px/1 var(--mono); letter-spacing: .14em; color: var(--text); }

/* ---------- тосты ---------- */
.toasts { position: fixed; z-index: 400; right: 20px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--r);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 13.5px;
  pointer-events: auto; animation: pop .2s ease; }
.toast.ok .ico { color: var(--ok); }
.toast.err .ico { color: var(--bad); }
.toast.warn .ico { color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

/* ---------- спотлайт-поиск ---------- */
.spot-overlay { align-items: flex-start; padding-top: 11vh; }
.spot { width: min(640px, 100%); max-height: 70vh; }
.spot-head { position: relative; padding: 14px; border-bottom: 1px solid var(--border-soft); }
.spot-head .ico { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); color: var(--hint); pointer-events: none; }
.spot-head input { width: 100%; min-height: 48px; padding: 0 16px 0 44px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  color: var(--text); font: 500 16px var(--font); outline: none; }
.spot-head input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.spot-res { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; }
.spot-group { padding: 12px 12px 6px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--hint); }
.spot-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; cursor: pointer; }
.spot-item:hover { text-decoration: none; }
.spot-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.spot-item.active .item-sub, .spot-item.active .spot-kind { color: var(--accent-ink); opacity: .85; }
.spot-item .spot-ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--muted); }
.spot-item.active .spot-ico { background: var(--surface); color: var(--accent-ink); }
.spot-kind { margin-left: auto; font-size: 12px; color: var(--hint); }
.spot-empty { padding: 26px 16px; text-align: center; color: var(--hint); font-size: 13.5px; }
.spot-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border-soft); color: var(--hint); font-size: 12px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-soft);
  color: var(--hint); font: 500 11px var(--font); text-align: center; }

/* ---------- всплывающее меню (пользователь) ---------- */
.pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 150; min-width: 260px; padding: 8px; background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); animation: pop .15s ease; }
.pop-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.pop-head b { display: block; font-weight: 600; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text); font: 500 13.5px var(--font); text-align: left; cursor: pointer; }
.pop-item:hover { background: var(--surface-2); }
.pop-item.danger { color: var(--bad); }

/* =================== оболочка =================== */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: var(--r-sm); background: var(--brand); color: var(--on-brand); overflow: hidden; }
.brand-mark .ico { width: 20px; height: 20px; }
.brand-mark.has-logo { background: var(--logo-bg); padding: 3px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-name { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--hint); }

/* знак продукта TruDrive: под светлую и тёмную тему — свой файл */
.td-logo { display: inline-flex; align-items: center; min-height: 40px; flex: 0 0 auto; }
.td-logo img { display: block; width: 112px; height: auto; }
.td-logo .on-dark { display: none; }
:root:not([data-theme="light"]) .td-logo .on-light { display: none; }
:root:not([data-theme="light"]) .td-logo .on-dark { display: block; }

/* боковое меню (компьютер): школа — карточкой сверху, TruDrive — внизу */
.sidebar { display: none; background: var(--side-bg); border-right: 1px solid var(--border-soft); }
.sidebar-in { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px; overflow-y: auto; }
.sidebar .brand { padding: 11px 12px; margin-bottom: 18px; border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-card); }
.sidebar .brand:hover { border-color: var(--border); }
.nav-group { padding: 16px 12px 6px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--hint); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 400; font-size: 13.5px; text-decoration: none; }
.nav-item .ico { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.sidebar-foot .td-logo { margin: 0 12px 6px; }

/* шапка: где я — слева, поиск, демо, тема и я — справа */
.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 14px; height: var(--topbar-h);
  padding: 0 24px; padding-top: env(safe-area-inset-top); background: var(--glass); border-bottom: 1px solid var(--border-soft);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); }
.topbar .brand { flex: 0 0 auto; }
.crumbs { display: none; align-items: center; gap: 10px; min-width: 0; color: var(--hint); font-size: 12.5px; white-space: nowrap; }
.crumbs b { overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 500; }
.spot-btn { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; max-width: 340px; height: 40px; margin: 0 0 0 auto; padding: 0 12px;
  border: 1px solid var(--border-soft); border-radius: var(--r-sm); background: var(--surface); color: var(--hint); font: 13px var(--font);
  cursor: pointer; text-align: left; }
.spot-btn:hover { background: var(--surface-2); border-color: var(--border); }
.spot-btn span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--hint); font-size: 11.5px; white-space: nowrap; }
.demo-chip i, .eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.top-actions > .btn-icon { border-color: transparent; background: transparent; }
.top-actions > .btn-icon:hover { background: var(--surface-2); }
.user-wrap { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font: 500 13px var(--font); cursor: pointer; }
.user-btn:hover { background: var(--surface-2); }
.user-btn .avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; }
.user-btn .user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* страница */
.page { max-width: 1260px; margin: 0 auto; padding: 28px 30px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.page-hello { font-size: 12.5px; color: var(--hint); margin-bottom: 8px; }
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -.045em; line-height: 1.15; }
.page-title .dim { color: var(--hint); font-weight: 500; }
.page-title .title-accent { color: var(--hint); font-weight: 500; }
.sec-title { margin: 32px 0 16px; font-size: 18px; font-weight: 600; letter-spacing: -.035em; }
.sec-title a { color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--hint); font-size: 13px; font-weight: 500; }
.back:hover { color: var(--text); text-decoration: none; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.quick a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-card); }
.quick a:hover { border-color: var(--accent-line); text-decoration: none; }
.quick .q-ico { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--accent); }
.quick small { display: block; margin-top: 2px; font-weight: 400; color: var(--hint); font-size: 12px; }

/* нижние вкладки (телефон): плавающая панель */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 120; display: none;
  grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 6px; border-radius: var(--r-xl); background: var(--tabbar);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-float); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 54px; border-radius: var(--r-lg);
  color: var(--hint); font-size: 11px; font-weight: 500; text-decoration: none; }
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar a.active { background: var(--accent-soft); color: var(--accent-ink); }
body.modal-open .tabbar { display: none !important; }

/* =================== вход =================== */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px;
  background: var(--bg); }
.login-theme { position: fixed; right: 16px; top: calc(16px + env(safe-area-inset-top)); z-index: 2; }
.login-box { width: min(420px, 100%); padding: 30px 28px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-xl); box-shadow: var(--shadow-float); }
.login-box > .brand { margin-bottom: 24px; }
.login-box h1, .login-box h2 { font-size: 22px; font-weight: 600; letter-spacing: -.04em; margin-bottom: 6px; }
.login-box .lead { color: var(--hint); font-size: 13.5px; margin-bottom: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box .btn { min-height: 46px; font-size: 14px; }
.code-input { text-align: center; font: 600 26px/1 var(--font-num) !important; letter-spacing: .3em; }
.login-switch { display: flex; justify-content: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.login-err { min-height: 1.2em; color: var(--bad); font-size: 13.5px; text-align: center; }
.login-err:empty { min-height: 0; }
.login-foot { margin-top: 18px; color: var(--hint); font-size: 12px; text-align: center; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--hint); }

/* =================== демо-школа (P05): вход как на лендинге — герой и карточки ролей =================== */
.login-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100%, 1192px); min-height: 72px;
  border-bottom: 1px solid var(--border-soft); }
.login-nav .td-logo img { width: 140px; }
.login-site { padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.login-site:hover { background: var(--surface-2); text-decoration: none; }
.login-hero { max-width: 800px; padding: 60px 0 38px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--border-soft); border-radius: 999px;
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.login-hero h1 { margin: 22px 0; font-size: clamp(38px, 4.6vw, 62px); line-height: 1.06; letter-spacing: -.06em; font-weight: 600; }
.login-hero h1 span { color: var(--accent-title); }
.login-hero p { max-width: 570px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.7; }
.login.is-demo { justify-content: flex-start; padding: 0 30px 60px; }
.login.is-demo .login-theme { position: absolute; top: 86px; right: 24px; }
.login.is-demo .login-box { width: min(100%, 1000px); padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.login.is-demo .login-box > .brand { display: none; }
.demo-box { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.demo-head { margin-top: 2px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--hint); }
.demo-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-pick { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border-soft); box-shadow: var(--shadow-card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.demo-pick:hover, .demo-pick:focus-visible { border-color: var(--accent-line); box-shadow: var(--shadow-float); }
.demo-pick-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--border-soft);
  border-radius: var(--r); background: var(--surface); color: var(--accent); }
.demo-pick-ico .ico { width: 19px; height: 19px; }
.demo-pick-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 14px; }
.demo-pick b { font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.demo-pick small { color: var(--hint); font-size: 12px; line-height: 1.45; }
.demo-pick-go { position: absolute; top: 14px; right: 14px; color: var(--hint); font-size: 13px; }
.demo-pick.is-start { border-color: var(--accent-line); background: var(--accent-soft); }
.demo-pick-start { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 600; letter-spacing: 0; vertical-align: 1px; }
.demo-or { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--hint); font-size: 12px; }
.demo-or::before, .demo-or::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.login.is-demo .demo-box { gap: 0; margin: 0; }
.login.is-demo .demo-head { margin-bottom: 16px; text-align: center; }
.login.is-demo .demo-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.login.is-demo .demo-pick { min-height: 88px; padding: 18px 20px; }
.login.is-demo .demo-box > .callout { order: 3; justify-content: center; padding: 22px 0 0; background: transparent; color: var(--hint); font-size: 12px; }
.login.is-demo .demo-or { display: none; }
.login-more { max-width: 420px; margin: 26px auto 0; }
.login-more > summary { min-height: 44px; padding: 12px; color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.login-more[open] > summary { margin-bottom: 14px; }
.login-more .login-forms { padding: 24px; border: 1px solid var(--border-soft); border-radius: var(--r-lg); background: var(--surface); }
.login.is-demo .login-foot { margin-top: 24px; }
/* полоса «Демо» внутри приложения — тихой строкой */
.demo-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 22px; padding: 0 0 16px;
  border-bottom: 1px solid var(--border-soft); color: var(--hint); font-size: 12px; }
.demo-bar > span { flex: 1 1 0; min-width: 0; }
.demo-bar .btn { margin-left: auto; font-size: 12px; }

/* =================== вождение на главной (P05) =================== */
.sec-gap { height: 16px; }
.day-title { margin: 6px 0 2px; font-size: 13px; font-weight: 600; color: var(--hint); }
.day-title:not(:first-child) { margin-top: 18px; }
.lesson-time { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 58px; white-space: nowrap; font: 600 15px/1.2 var(--font-num); }
.lesson-time small { color: var(--hint); font: 500 12px/1.3 var(--font); }
.item-side .num { font: 600 17px/1.1 var(--font-num); }

/* =================== курсанты =================== */
.st-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; position: relative; overflow: hidden;
  padding: 24px 26px; border-radius: var(--r-xl); }
.st-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(380px 260px at 100% 0%, var(--accent-glow), transparent 70%); }
.st-hero > * { position: relative; }
.st-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.st-name { font-size: 26px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.st-meta { margin-top: 6px; color: var(--hint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.st-meta a { color: var(--muted); }
.st-kpis { display: flex; gap: 10px; }
.st-kpi { min-width: 108px; padding: 12px 16px; border-radius: 16px; background: var(--surface-2); }
.st-kpi .kpi-label { font-size: 11.5px; }
.st-kpi .kpi-val { font-size: 24px; margin-top: 6px; }
.st-alerts { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }

.contract { padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); }
.contract + .contract { margin-top: 12px; }
.contract-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.contract-num { font: 600 17px var(--font-num); letter-spacing: -.02em; }
.contract-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; margin: 14px 0; }
.fact span { display: block; font-size: 12px; font-weight: 400; color: var(--hint); }
.fact b { font-weight: 600; font-size: 14px; }
.hours { display: flex; flex-wrap: wrap; gap: 8px; }
.hours .h { padding: 8px 12px; border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--muted); }
.hours .h b { font: 600 16px var(--font-num); color: var(--text); margin-right: 6px; letter-spacing: -.02em; }
.contract-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

.checklist { display: flex; flex-direction: column; }
.check-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 2px;
  border-bottom: 1px solid var(--border-soft); }
.check-row:last-child { border-bottom: 0; }
.mark { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; }
.mark.ok { background: var(--ok-bg); color: var(--ok); }
.mark.bad { background: var(--bad-bg); color: var(--bad); }
.mark.none { background: var(--surface-2); color: var(--hint); }
.check-name { font-weight: 600; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 10px; background: var(--surface-2);
  font-size: 12.5px; color: var(--muted); }
.file a { color: var(--text); font-weight: 600; }
.file button { display: inline-flex; padding: 3px; border: 0; border-radius: 6px; background: none; color: var(--hint); cursor: pointer; }
.file button:hover { background: var(--bad-bg); color: var(--bad); }

.consent-state { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); }
.consent-state .mark { width: 44px; height: 44px; border-radius: 14px; }

/* =================== адаптив =================== */
@media (min-width: 1100px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
  .sidebar { display: block; grid-column: 1; grid-row: 1 / span 2; }
  .topbar, .shell > .page { grid-column: 2; }
  .shell > .page { width: 100%; }
  .topbar .brand { display: none; }
  .crumbs { display: flex; }
}
@media (max-width: 1099px) {
  .tabbar { display: grid; }
  .shell .page { padding-bottom: 120px; }
  .toasts { left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); align-items: center; }
}
@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-hero { grid-row: auto; }
  .st-hero { grid-template-columns: 1fr; }
  .st-kpis { overflow-x: auto; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  /* iPhone увеличивает страницу при вводе в поле мельче 16 px */
  .input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea,
  .spot-head input { font-size: 16px; }
  .topbar { padding: 0 16px; gap: 8px; padding-top: env(safe-area-inset-top); }
  .demo-chip { display: none; }
  .demo-bar > .ico { display: none; }
  .demo-bar { flex-wrap: nowrap; padding-bottom: 12px; margin-bottom: 18px; }
  .topbar .brand-text, .user-btn .user-name, .spot-btn kbd { display: none; }
  .user-btn { padding: 0 4px; }
  .page { padding: 22px 16px 48px; }
  .page-title { font-size: 26px; }
  .card { padding: 18px 16px; }
  .kpi { min-height: 108px; padding: 16px; }
  .kpi-val { font-size: 25px; }
  .kpi-hero { padding: 20px; }
  .kpi-big { font-size: 42px; }
  .kpi-big small { font-size: 18px; }
  .st-hero { padding: 18px; }
  .st-name { font-size: 21px; }
  .avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }
  .st-kpi { min-width: 96px; padding: 10px 12px; }
  .st-kpi .kpi-val { font-size: 20px; }
  .item-side { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .login-box { padding: 26px 20px; }

  /* таблица — карточками: подписи из data-label */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { padding: 3px 0; border: 0; }
  .tbl td[data-label]:not(.cell-main)::before { content: attr(data-label) ": "; color: var(--hint); font-size: 12.5px; }
  .tbl td.cell-main { padding-bottom: 6px; }
  .tbl td.cell-act { padding-top: 10px; }
  .tbl td.cell-act .btn { width: 100%; }

  /* окно — лист снизу */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); animation: sheet .22s ease; }
  .modal-foot .btn { flex: 1 1 auto; }
  .spot-overlay { align-items: flex-start; padding: 10px; }
  .spot { border-radius: var(--r-xl); border-bottom: 1px solid var(--border-soft); max-height: 80vh; }
  .spot-foot { display: none; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* кнопка, выглядящая как пункт меню */
.btn-reset { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
/* страница никогда не шире экрана: длинные слова и строки без пробелов переносим */
html, body { overflow-x: clip; }
.page { min-width: 0; overflow-wrap: break-word; }
/* подписи и бейджи не рвём посреди слова (общий перенос «anywhere» — только для длинных значений) */
.kpi-label, .badge, .tab, .chip, .btn { overflow-wrap: normal; }
@media (max-width: 700px) {
  .st-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; }
  .st-kpi { min-width: 0; }
  .st-kpi .kpi-label { font-size: 11px; }
}

/* =================== настройки школы и бренд (P04) =================== */
.color-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 44px; }
.color-row code { font: 13px var(--mono); color: var(--muted); }
.color-input { width: 52px; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); cursor: pointer; }
.color-input:disabled { opacity: .45; cursor: default; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.brand-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-2); }
.logo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-tile { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; padding: 8px; flex: 0 0 auto;
  border-radius: var(--r-lg); background: var(--logo-bg); }
.logo-tile.empty { background: var(--surface-2); color: var(--hint); }
.logo-tile.empty .ico { width: 34px; height: 34px; }
.logo-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 auto; }
.set-hist { margin-top: 6px; font-size: 13px; }
.set-hist summary { cursor: pointer; color: var(--accent-ink); }
.set-hist ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.set-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; text-align: right; }
@media (max-width: 700px) {   /* телефон: значение и кнопка — под описанием, а не сбоку */
  .set-pay { flex-direction: column; align-items: stretch; }
  .set-side { flex-direction: row; align-items: center; flex-wrap: wrap; text-align: left; }
  .set-side .btn { margin-left: auto; }
}
.login-foot { display: flex; flex-direction: column; gap: 4px; }
.login-contacts { color: var(--muted); font-size: 13px; }
.login-contacts a { color: var(--muted); }

/* ---------- зарплата мастеров (P06) ---------- */
.mv-month { display: flex; align-items: center; gap: 8px; }
.mv-month .input { width: auto; min-width: 150px; }
.mv-bar { height: 4px; margin-top: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; max-width: 360px; }
.mv-bar-fill { display: block; height: 100%; border-radius: inherit; }
.mv-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mv-facts > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--r); }
.mv-facts b { font: 600 18px/1.15 var(--font-num); }
.mv-amt { white-space: nowrap; }
.mv-amt.ok { color: var(--ok); } .mv-amt.bad { color: var(--bad); }
.mv-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 14px 4px 0; border-top: 1px solid var(--border); }
.mv-total b { font: 600 26px/1 var(--font-num); }
.mv-step { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-ink); font-weight: 700; font-size: 13px; }
.mv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.field textarea.mv-json { min-height: 360px; font: 12.5px/1.45 var(--mono); white-space: pre; tab-size: 2; }
@media (max-width: 720px) {
  .mv-facts { grid-template-columns: 1fr; }
  .mv-month .input { min-width: 0; }
  .list .mv-item { align-items: flex-start; }
  .list .mv-item .item-side { display: flex; }      /* сумма нужна и на телефоне */
  .mv-item .item-side .chev { display: none; }
  .mv-item .item-side .num { font-size: 15px; }
}

/* ---------- кабинет мастера, табель, отметки месяца (P07) ---------- */
.pay-hero .kpi-main { align-items: baseline; }
.pay-bar { max-width: none; height: 6px; margin-top: 0; }
.pay-norm { max-width: none; }
.pay-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pay-facts > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border: 1px solid var(--border-soft); border-radius: var(--r); }
.pay-facts span { font-size: 12.5px; color: var(--hint); }
.pay-facts b { font-weight: 600; }
.pay-sec { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--hint); }
.form-grid > .pay-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pay-flags { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.pay-abs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.stack-sm > * + * { margin-top: 10px; }
.pay-tbl .cell-person span { display: flex; flex-direction: column; gap: 2px; }
.pay-sub { font-size: 12.5px; font-weight: 400; color: var(--hint); }
.pay-tbl td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-row { cursor: pointer; }
.pay-row:hover td { background: var(--surface-2); }
.pay-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pay-out { font-weight: 700; }
.pay-total td { padding-top: 16px; border-top: 1px solid var(--border); border-bottom: 0; font-weight: 700; }
@media (max-width: 720px) {
  .pay-abs { grid-template-columns: 1fr 1fr; }
  .pay-abs > :first-child { grid-column: 1 / -1; }
  .pay-total { padding-top: 14px; }
  .pay-total td { border-top: 0; padding-top: 3px; }
}
.pay-only-phone { display: none; }
@media (max-width: 720px) { .pay-only-phone { display: inline; } }

/* =================== приложение курсанта и PWA (T07) =================== */
.seg-accent { background: var(--accent); }
.hours-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hours-grid .kpi-hero { grid-column: 1 / -1; grid-row: auto; }
.hours-free { color: var(--accent-ink); font-weight: 600; }
.master-card { display: flex; align-items: center; gap: 16px; }
.master-card .grow { min-width: 0; }
.master-name { font-size: 18px; font-weight: 700; }
.master-car { margin-top: 4px; color: var(--hint); font-size: 13.5px; }
.master-car .sep, .card-note .sep { margin: 0 6px; opacity: .6; }
.spot-btn[hidden] + .top-actions { margin-left: auto; }   /* у курсанта поиска нет — кнопки остаются справа */
.master-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.st-lesson-place { color: var(--muted); }
.ledger-plus { color: var(--ok); } .ledger-minus { color: var(--text); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two-col > .card + .card { margin-top: 0; }
.install-steps { margin: 10px 0 0 18px; color: var(--muted); font-size: 14px; }
.install-steps li + li { margin-top: 4px; }
.letter { white-space: pre-wrap; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); color: var(--text);
  font-size: 14px; line-height: 1.5; }
.letter-head { margin-bottom: 10px; color: var(--hint); font-size: 13px; }
/* новая версия приложения — плашка внизу, над вкладками телефона */
.update-bar { position: fixed; z-index: 390; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 14px; animation: pop .2s ease-out; }
/* офлайн-заглушка */
.offline { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.offline-box { width: min(420px, 100%); padding: 32px 30px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 28px; text-align: center; }
.offline-box h1 { font-size: 22px; margin: 18px 0 8px; }
.offline-box .lead { color: var(--hint); font-size: 14px; margin-bottom: 22px; }
.offline-mark { margin: 0 auto; width: 52px; height: 52px; }
@media (max-width: 960px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .hours-grid { grid-template-columns: minmax(0, 1fr); }
  .master-card { flex-wrap: wrap; }
  .master-actions { width: 100%; }
  .master-actions .btn { flex: 1 1 auto; }
  .update-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* =================== окна мастера и запись (T08) =================== */
.week-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.week-range { font: 600 15px var(--font-num); text-align: center; }
.slot { align-items: flex-start; }
.slot-closed { opacity: .55; }
.slot-empty { padding: 8px 4px 4px; }
.slot-person { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.slot-name { font-weight: 600; }
.slot-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.item > .slot-acts { margin-top: 0; flex: 0 0 auto; justify-content: flex-end; }
.booking-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.booking-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.top-actions select.input { width: auto; min-width: 200px; }
.modal-foot select.input { width: auto; }
@media (max-width: 640px) {
  .week-range { order: -1; flex-basis: 100%; }
  .top-actions { flex-wrap: wrap; }
  .top-actions select.input { min-width: 0; width: 100%; }
}
.tpl-day { align-items: flex-start; }
.tpl-wd { flex: 0 0 28px; padding-top: 6px; text-transform: uppercase; font-size: 12.5px; color: var(--hint); }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.tpl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border-soft); font: 600 13px var(--font-num); }
.tpl-chip small { color: var(--hint); font: 500 11.5px var(--font); }
.tpl-x { display: inline-flex; padding: 3px; border: 0; border-radius: 50%; background: transparent; color: var(--hint); cursor: pointer; }
.tpl-x:hover { background: var(--surface-3); color: var(--text); }

/* =================== разделы школы (03.11.2026): автопарк, лиды, бухгалтерия, обращения, объявления =================== */
.sec-gap-sm { height: 12px; }
.sub-title { margin: 22px 0 10px; font-size: 15px; font-weight: 700; }
.title-accent { color: var(--accent-ink); }
.kpi-of { font: 600 32px var(--font-num); color: var(--hint); letter-spacing: -.02em; }
b.ok, span.ok, .item-sub.ok { color: var(--ok); } b.warn, span.warn, .item-sub.warn { color: var(--warn); } b.bad, span.bad, .item-sub.bad { color: var(--bad); }
.item-sub .ico-sm { vertical-align: -3px; margin-right: 4px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip-n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.chip.active .chip-n { background: var(--surface); color: var(--accent-ink); }
.check-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check-chip input { accent-color: var(--accent); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; margin: 16px 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.strike { text-decoration: line-through; opacity: .6; }
.muted-row { opacity: .6; }
.span-all { grid-column: 1 / -1; }
.input-sm { min-height: 38px; padding: 6px 10px; width: auto; }
.nav-item .count { margin-left: auto; }
.nav-item.active .count { background: var(--surface); color: var(--accent-ink); }

/* автопарк: плитки машин */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.car-grid.one { grid-template-columns: minmax(0, 520px); margin-bottom: 16px; }
.car-tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); cursor: pointer; overflow: hidden;
  transition: border-color .15s, transform .15s, background .15s; }
.car-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ok); }
.car-tile.lvl-warn::before { background: var(--warn); } .car-tile.lvl-bad::before { background: var(--bad); }
.car-tile:hover { border-color: var(--border); background: var(--surface-2); transform: translateY(-2px); }
.car-tile.inactive { opacity: .55; }
.car-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.car-plate { font: 600 22px/1 var(--font-num); letter-spacing: -.02em; }
.car-make { color: var(--muted); font-size: 13.5px; }
.car-masters { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.car-masters .ico { color: var(--hint); }
.car-issues { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.car-issues li { padding-left: 14px; position: relative; }
.car-issues li::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.car-issues li.bad { color: var(--bad); } .car-issues li.warn { color: var(--warn); } .car-issues li.hint { color: var(--hint); }
.car-ok { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; }
.car-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 13px; font-weight: 600; }
.car-foot small { display: block; font-size: 11px; font-weight: 400; color: var(--hint); margin-bottom: 2px; }
.ev-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); }
.ev-ico.work { background: var(--accent-soft); color: var(--accent-ink); }
.ev-ico.cost { background: var(--warn-bg); color: var(--warn); }
.ev-ico.lvl-bad { background: var(--bad-bg); color: var(--bad); } .ev-ico.lvl-warn { background: var(--warn-bg); color: var(--warn); }
.ev-ico.lvl-ok { background: var(--ok-bg); color: var(--ok); } .ev-ico.lvl-accent { background: var(--accent-soft); color: var(--accent-ink); }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.step { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--hint); font: 600 12px var(--font); }
button.step { cursor: pointer; } button.step:hover:not([disabled]) { border-color: var(--border); color: var(--text); }
.step.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.step.cur { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.work-item { align-items: flex-start; }

/* лиды и мероприятия */
.lead-item { cursor: pointer; border-radius: 12px; }
.lead-item:hover .item-title { color: var(--accent-ink); }
.lead-item.overdue { box-shadow: inset 3px 0 0 var(--bad); padding-left: 12px; }
.lead-check { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.assign-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.assign-bar .input { flex: 1 1 220px; width: auto; }
.lead-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lead-acts .btn.active { outline: 2px solid var(--accent); }
.lead-call { margin: 14px 0 4px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.ev-tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; text-align: left; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--r-lg); cursor: pointer; transition: border-color .15s, background .15s; }
.ev-tile:hover { border-color: var(--border); background: var(--surface-2); }
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; width: 54px; height: 58px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-ink); }
.ev-date b { font: 600 22px/1 var(--font-num); } .ev-date small { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.ev-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--hint); }
.ev-nums b { color: var(--text); font-weight: 700; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: 13.5px; }
.tl-when { color: var(--hint); font-size: 12.5px; padding-top: 1px; }

/* обращения и объявления */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.msg.answer { align-self: flex-end; background: var(--accent-soft); }
.msg-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.msg-text { white-space: pre-wrap; line-height: 1.45; }
.reply { display: flex; flex-direction: column; gap: 10px; }
.reply .badges { align-items: center; }
.take { display: inline-flex; gap: 8px; align-items: center; }
.notice { position: relative; }
.notice.unread { border-color: var(--accent); }
.notice.pinned .pin { color: var(--accent-ink); margin-right: 6px; vertical-align: -2px; }
.notice-text { white-space: pre-wrap; line-height: 1.5; margin: 6px 0 12px; }
.notice-strip { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-soft);
  color: var(--text); text-decoration: none; font-size: 14px; }
.notice-strip.unread { border-color: var(--accent); background: var(--accent-soft); }
.notice-strip .ico { color: var(--accent-ink); flex: 0 0 auto; }
.notice-strip:hover { text-decoration: none; border-color: var(--border); }
.urgent { border-left: 3px solid var(--bad); }
.urgent .card-head b { display: inline-flex; align-items: center; gap: 8px; }
.urgent-item { padding: 10px 4px; }
.urgent-item > .ico { color: var(--hint); }
.count.bad { background: var(--bad-bg); color: var(--bad); }
.count.ok { background: var(--ok-bg); color: var(--ok); }
.count.accent { background: var(--accent-soft); color: var(--accent-ink); }

/* филиалы на главной */
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.branch-tile { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); }
.branch-tile .card-head { margin: 0; align-items: flex-start; }
.branch-name { font-size: 19px; letter-spacing: -.01em; }
.branch-big { font: 600 40px/1 var(--font-num); letter-spacing: -.04em; }
.branch-big small { font: 600 16px var(--font); color: var(--hint); }
.branch-tile .mv-bar { max-width: none; margin: 0; }
.branch-tile .mv-bar-fill { background: var(--accent); }
.branch-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.branch-stats span { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); }
.branch-stats b { font: 600 17px var(--font-num); } .branch-stats small { color: var(--hint); font-size: 11px; }

/* телефон: «Ещё» и точки на вкладках */
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 54px; border-radius: 16px;
  color: var(--muted); font: 600 11px var(--font); cursor: pointer; }
.tab-ico { position: relative; display: inline-flex; }
.tab-dot { position: absolute; top: -2px; right: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.tab-dot.bad { background: var(--bad); } .tab-dot.accent { background: var(--accent); } .tab-dot.ok { background: var(--ok); }
.more-menu { display: flex; flex-direction: column; }
.more-menu .nav-item { color: var(--text); }
@media (max-width: 700px) {
  .modal.sheet { align-self: flex-end; width: 100%; max-height: 86vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .car-plate { font-size: 20px; }
  .car-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-grid { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 100%; }
  .tl-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .branch-big { font-size: 34px; }
}
.item-sub:has(> .ico-sm) { display: flex; align-items: center; gap: 4px; }
.item-sub > .ico-sm { margin-right: 0; flex: 0 0 auto; }
@media (max-width: 700px) {
  .notice-strip { flex-wrap: wrap; row-gap: 4px; }
  .notice-strip b { flex: 1 1 auto; min-width: 0; }
  .notice-strip .clamp1 { order: 3; flex: 1 0 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .kpi-big.nowrap { font-size: 52px; }
  .kpi-big.nowrap .kpi-of { font-size: 22px; }
}

/* =================== менеджерская и зарплата менеджеров (P08) =================== */
.sl-bar { position: relative; height: 6px; margin-top: 8px; border-radius: 999px; background: var(--surface-3); overflow: visible; }
.sl-bar .mv-bar-fill { border-radius: 999px; }
.sl-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: .55; }
.sl-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sl-strip-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
.sl-strip-item:hover { border-color: var(--border); }
.sl-strip-item b { font: 600 24px/1.05 var(--font-num); letter-spacing: -.02em; }
.sl-strip-item small { color: var(--hint); font-size: 12px; }
.sl-strip-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13.5px; }
.sl-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; margin: 16px 0; }
.sl-plan-grid > .card + .card { margin-top: 0; }
.sl-plan .card-head { justify-content: flex-start; flex-wrap: wrap; }
.sl-plan .card-head .btn { margin-left: auto; }
.sl-row + .sl-row { margin-top: 18px; }
.sl-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sl-row-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sl-row-val { font: 600 18px/1 var(--font-num); }
.sl-row-sub { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; margin-top: 7px; color: var(--hint); font-size: 12.5px; }
.sl-row-sub b { color: var(--text); font-weight: 600; }
.sl-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--surface-3); flex: 0 0 auto; }
.sl-dot.ok { background: var(--ok); } .sl-dot.warn { background: var(--warn); } .sl-dot.bad { background: var(--bad); }
.sl-up { color: var(--ok); } .sl-down { color: var(--bad); }
.sl-people { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.sl-person { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto 3.2em; align-items: center; gap: 10px; font-size: 13.5px; }
.sl-person .sl-bar { margin-top: 0; }
.sl-person b { font-variant-numeric: tabular-nums; }
.sl-person small { color: var(--hint); font-size: 12px; text-align: right; }
.sl-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-me { background: var(--accent-soft); border-radius: var(--r); }
.item.sl-me { padding-left: 10px; padding-right: 10px; }
.sl-person.sl-me { padding: 4px 6px; margin: 0 -6px; }
.sl-tbl tfoot .sl-prev td { padding-top: 4px; border-bottom: 0; }
/* график менеджеров: таблица прокручивается внутри карточки, страница — нет */
.sl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 12px; color: var(--hint); font-size: 12.5px; }
.sl-legend > span { display: inline-flex; }
.sl-grid-wrap { margin: 0 -8px; padding: 0 8px; }
.sl-grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.sl-grid th, .sl-grid td { padding: 3px 2px; border-bottom: 1px solid var(--border-soft); text-align: center; }
.sl-grid thead th { font-weight: 600; color: var(--hint); }
.sl-day { min-width: 30px; }
.sl-day span { display: block; font-variant-numeric: tabular-nums; color: var(--text); }
.sl-day small { display: block; font-size: 10.5px; font-weight: 400; }
.sl-grid .is-weekend { background: var(--surface-2); }
.sl-grid th.is-today span { color: var(--accent-ink); font-weight: 700; }
.sl-name-col { position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 190px; padding-right: 10px !important; text-align: left !important;
  background: var(--surface); }
.sl-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.sl-name b { font-size: 13.5px; }
.sl-name small { color: var(--hint); font-size: 11.5px; line-height: 1.3; }
.sl-name .btn { margin-left: -6px; }
.sl-sum-col { min-width: 120px; padding-left: 10px !important; text-align: right !important; white-space: nowrap; }
.sl-sum-col small { display: block; }
.sl-day-cell.is-edit { cursor: pointer; }
.sl-day-cell.is-edit:hover .sl-cell, .sl-day-cell.is-edit:focus-visible .sl-cell { outline: 2px solid var(--accent); outline-offset: -2px; }
.sl-day-cell:focus-visible { outline: none; }
.sl-cell { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 600;
  font-variant-numeric: tabular-nums; font-size: 12px; }
.sl-cell.k-none { color: var(--hint); }
.sl-cell.k-shift { background: var(--accent-soft); color: var(--accent-ink); }
.sl-cell.k-shift.is-sub { background: var(--warn-bg); color: var(--warn); }
.sl-cell.k-vacation { background: var(--ok-bg); color: var(--ok); font-size: 10.5px; }
.sl-cell.k-sick { background: var(--surface-3); color: var(--muted); font-size: 10.5px; }
.sl-cell.k-absent { background: var(--bad-bg); color: var(--bad); font-size: 10.5px; }
.sl-cell.is-future { opacity: .55; }
.sl-cell.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.sl-cell sup { position: absolute; top: -2px; right: 1px; font-size: 10px; }
/* мой график — календарь месяца */
.sl-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.sl-cal-head { color: var(--hint); font-size: 11.5px; font-weight: 600; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.sl-cal-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: var(--r); }
.sl-cal-day small { color: var(--hint); font-size: 11px; }
.sl-cal-day.is-today { background: var(--surface-2); }
.sl-cal-day .sl-cell { width: 32px; height: 26px; }
@media (max-width: 700px) {
  .sl-person { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; }
  .sl-person small { display: none; }
  .sl-name-col { min-width: 112px; max-width: 120px; }
  .sl-name small { display: none; }
}

/* ---------- касса (T13): деньги договора, график, журнал, учебный СБП ---------- */
.cash-box .segbar { margin: 4px 0 2px; }
.cash-box .contract-facts { margin: 12px 0; }
.cash-plan { display: grid; gap: 6px; margin: 8px 0 12px; }
.cash-plan-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 12px; background: var(--surface); font-size: 13.5px; }
.cash-plan-row.is-paid { opacity: .7; }
.cash-plan-row.is-overdue { box-shadow: inset 3px 0 0 var(--bad); }
.cash-plan-row.is-today { box-shadow: inset 3px 0 0 var(--warn); }
.cash-plan-date { font-variant-numeric: tabular-nums; color: var(--muted); }
.cash-plan-what { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-pays { margin-top: 10px; }
.cash-pays .item-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cash-day { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 4px 6px; }
.cash-day:first-child { margin-top: 4px; }
.plan-rows { display: grid; gap: 8px; }
.plan-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hint.ok { color: var(--ok); } .hint.warn { color: var(--warn); }
/* демо (12.11.2026): «В демо это выключено — в вашей школе работает» под неактивной кнопкой */
.demo-off { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.sbp-qr { display: grid; place-items: center; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); }
.qr { display: grid; grid-template-columns: repeat(25, 1fr); width: min(220px, 64vw); aspect-ratio: 1; padding: 12px; border-radius: 12px; background: var(--surface); }
.qr span.on { background: var(--text); border-radius: 1px; }
.sbp-sum { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sbp-sum b { font: 600 28px var(--font-num); letter-spacing: -.02em; }
@media (max-width: 560px) {
  .cash-plan-row { grid-template-columns: 82px minmax(0, 1fr) auto; }
  .cash-plan-row .badge { grid-column: 2 / -1; justify-self: start; }
  .plan-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
}

/* ---------- теория (T15): группы, журнал занятия, предметы, прогресс ---------- */
.item-btn { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.item-btn:hover { background: var(--surface-2); }
.th-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.th-progress .segbar { flex: 1 1 auto; max-width: 320px; }
.th-marks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.th-mark { cursor: pointer; font: inherit; font-size: 13px; }
.th-mark.on-present { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.th-mark.on-absent { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.th-mark.on-excused { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.th-subj { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.th-subj:last-child { border-bottom: 0; }
.th-subj-name { font-size: 14px; min-width: 0; }
.th-subj-bar { grid-column: 1 / -1; }
.th-subj .badge { grid-column: 1 / -1; justify-self: start; }
.th-hero { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.th-home { display: block; color: inherit; }
.th-home:hover { text-decoration: none; }
.th-home .segbar { margin: 6px 0 8px; }
.th-box .segbar { margin: 4px 0 2px; }
.th-box .contract-facts { margin: 12px 0; }
.th-pick { max-height: min(56vh, 520px); overflow-y: auto; }
.th-pick .check-row { cursor: pointer; }
.th-pick input { accent-color: var(--accent); width: 18px; height: 18px; flex: 0 0 auto; }
@media (max-width: 560px) {
  .th-marks { justify-content: flex-start; }
  .item:has(.th-marks) { flex-wrap: wrap; }
}

/* выпуск (T16a) */
.gr-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; flex: 0 0 auto; }
.gr-box .steps { margin: 2px 0 10px; }
.gr-box .step.done { font-weight: 600; }
.gr-ready { margin: 4px 0 6px; }
.gr-ready .check-row { padding: 9px 2px; grid-template-columns: 32px minmax(0, 1fr) auto; }
.gr-ready .mark { width: 28px; height: 28px; border-radius: 8px; }
.gr-box > .item { padding: 10px 2px; }
@media (max-width: 700px) {
  .item:has(> .gr-acts) { flex-wrap: wrap; }
  .gr-acts { width: 100%; justify-content: flex-start; }
}

/* экзамены в ГИБДД (T16b): результаты дня — этап, три кнопки, лист и баллы */
.gb-row .item-body { display: grid; gap: 6px; }
.gb-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gb-stage { min-width: 88px; font-size: 13px; color: var(--muted); }
.gb-line .th-marks { justify-content: flex-start; }
.gb-mark.on-passed { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.gb-mark.on-failed { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.gb-mark.on-absent { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.gb-sheet { width: 120px; }
.gb-pen { width: 80px; }

/* график от мастера (T08b): дни недели кнопками, время, предпросмотр дат; у курсанта — недели и строка графика */
.plan-form { display: grid; gap: 14px; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.plan-grid .field { min-width: 0; }
.plan-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.plan-wd { min-width: 0; padding: 7px 0; justify-content: center; text-align: center; }
.plan-custom { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.plan-custom .input { min-width: 0; flex: 1 1 0; }
.plan-sum { padding: 4px 0 6px; }
.plan-preview .list { max-height: 46vh; overflow-y: auto; }
@media (max-width: 700px) { .plan-preview .list { max-height: none; overflow: visible; } }
.lp-row .item-title .badge { font-weight: 500; }
.plan-ahead { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.plan-ahead > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 4px 0; }
.plan-ahead > .btn { margin-top: 8px; }
.st-plan { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px;
  background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.st-plan b { color: var(--text); font-weight: 600; }
.st-week { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 0 2px; padding-top: 10px;
  border-top: 1px solid var(--border-soft); font-size: 14px; }
.st-week:first-child, .st-plan + .st-week, .card-head + .st-week { margin-top: 4px; padding-top: 0; border-top: 0; }
.st-week + .day-title { margin-top: 6px; }
@media (max-width: 700px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .plan-grid > :first-child { grid-column: 1 / -1; }
  .my-phone { display: none; }
  .my-row { flex-wrap: wrap; }
  .my-row > .item-body { flex: 1 1 calc(100% - 70px); }
  .my-row > .slot-acts { width: 100%; justify-content: flex-start; padding-left: 54px; margin-top: 0; }
}

/* вход демо на телефоне и планшете */
@media (max-width: 860px) {
  .login.is-demo .demo-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .login.is-demo { padding: 0 16px 48px; }
  .login-nav { min-height: 64px; }
  .login-nav .td-logo img { width: 112px; }
  .login.is-demo .login-theme { top: 76px; right: 12px; }
  .login-hero { padding: 54px 0 30px; }
  .login-hero h1 { font-size: clamp(34px, 10vw, 46px); }
  .login-hero p { font-size: 14px; }
  .login.is-demo .demo-picks { gap: 10px; }
  .login.is-demo .demo-pick { flex-direction: column; align-items: flex-start; min-height: 128px; padding: 16px; gap: 10px; }
  .demo-pick-ico { width: 32px; height: 32px; }
  .login.is-demo .demo-box > .callout { justify-content: flex-start; text-align: left; }
  .tabs { gap: 18px; }
}
@media (max-width: 360px) {
  .login.is-demo .demo-picks { grid-template-columns: minmax(0, 1fr); }
  .login.is-demo .demo-pick { min-height: 0; flex-direction: row; align-items: center; }
}

/* =================== «что сегодня» на главной (UX, 09.11.2026) ===================
   Компьютер: слева дела дня, справа срочное и объявления (композиция партнёра «Обзор школы»), цифры — ниже слева.
   Телефон: дела дня → срочное → цифры. */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.home-today, .home-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-today > .card + .card, .home-aside > .card + .card { margin-top: 0; }
.home-rest { min-width: 0; }
.home-rest > .sec-title:first-child { margin-top: 8px; }
.home-today .sec-title { margin-top: 8px; }
@media (min-width: 1200px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr; gap: 20px 24px; align-items: start; }
  .home-today { grid-column: 1; grid-row: 1; }
  .home-aside { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--topbar-h) + 16px); }
  .home-rest { grid-column: 1; grid-row: 2; }
  .home-grid:has(> .home-aside[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .home-aside .urgent-item .item-title { font-size: 13px; font-weight: 400; line-height: 1.5; }
}
.td-card { padding-top: 18px; padding-bottom: 8px; }
.td-card > .card-head { margin-bottom: 4px; }
.td-sec + .td-sec { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.td-sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 8px 4px 2px; }
.td-sec-head b { font-size: 13.5px; font-weight: 600; }
.td-sec .card { padding: 0; border: 0; box-shadow: none; background: transparent; }
.td-row { padding: 12px 4px; }
.td-row .item-title a { color: var(--text); }
.td-row > .slot-acts { margin-top: 0; flex: 0 0 auto; justify-content: flex-end; }
a.td-row:hover .btn { border-color: var(--accent-line); }
.td-more { justify-content: space-between; color: var(--accent-ink); font-size: 13px; }
.td-money { gap: 6px; min-height: 0; }
.td-money .kpi-val { font-size: 34px; }
.td-money .mv-bar { max-width: none; margin: 6px 0 2px; }
.home-notices .card-head a { font-size: 12px; }
.notice-row { padding: 12px 2px; }
.notice-row .item-title { font-size: 13px; }
.notice-row .item-title .ico { color: var(--accent-ink); }
.notice-row.unread .item-title { color: var(--accent-ink); }
@media (max-width: 700px) {
  .td-row { flex-wrap: wrap; }
  .td-row > .item-body { flex: 1 1 calc(100% - 80px); }
  .td-row > .slot-acts { width: 100%; justify-content: flex-start; }
  .td-row > .lesson-time + .item-body + .slot-acts { padding-left: 70px; }
  .td-money .kpi-val { font-size: 30px; }
}
.td-sec .sec-title { display: none; }
.home-today > .urgent { border-left-width: 3px; }

/* учебные группы (G01) */
.card-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.warn-text { color: var(--warn); }
.gp-alert { display: flex; align-items: center; gap: 6px; }
.gp-alert.lvl-warn { color: var(--warn); } .gp-alert.lvl-bad { color: var(--bad); } .gp-alert.lvl-accent { color: var(--accent-ink); }
.gp-callout { align-items: center; }
.gp-callout > .btn { flex: 0 0 auto; }
.gp-steps .step small { font-weight: 500; opacity: .85; }
.step.wait { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.step.late { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.step.none { opacity: .65; }
.gp-funnel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; margin: 2px 0 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft); }
.gp-fun { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gp-fun-l { font-size: 12px; color: var(--hint); }
.gp-fun b { font-size: 17px; }
.gp-fun b small { font-weight: 400; color: var(--hint); font-size: 12px; }
.gp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gp-tag { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.gp-tag small { font-weight: 400; color: var(--hint); font-size: 11.5px; }
.gp-tag.ok { background: var(--ok-bg); color: var(--ok); } .gp-tag.warn { background: var(--warn-bg); color: var(--warn); } .gp-tag.bad { background: var(--bad-bg); color: var(--bad); }
.gp-tag.ok small, .gp-tag.warn small, .gp-tag.bad small { color: inherit; opacity: .75; }
@media (max-width: 560px) {
  .gp-callout { flex-wrap: wrap; }
  .gp-callout > .btn { margin-left: 30px; }
  .gp-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* P10: переход из АШК — карточка-ссылка в настройках */
a.card.st-ashk { display: block; color: inherit; text-decoration: none; margin-bottom: 16px; }
a.card.st-ashk:hover { border-color: var(--accent); }
a.card.st-ashk .card-head { display: flex; align-items: center; justify-content: space-between; }

/* K01: филиалы, площадки, юрлица */
.br-lines { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.br-line { display: flex; align-items: flex-start; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.br-line .ico { flex: 0 0 auto; margin-top: 2px; color: var(--hint); }
.branch-tile .card-acts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.br-checks { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.br-sec { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.br-sec summary { cursor: pointer; padding: 4px 0; }
.br-move select { flex: 0 0 auto; width: auto; max-width: 46%; }
section.card.inactive { opacity: .7; }
@media (max-width: 560px) { .br-move { flex-wrap: wrap; } .br-move select { max-width: none; width: 100%; } }

/* ---------- контакты (K04) ---------- */
.ct-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card > .ct-acts { margin-top: 14px; }
.ct-item > .ct-acts { flex: 0 1 auto; justify-content: flex-end; max-width: 55%; }
@media (max-width: 700px) {   /* телефон: кнопки связи — под именем, во всю ширину */
  .ct-item { flex-wrap: wrap; }
  .ct-item > .item-body { flex: 1 1 0; }
  .ct-item > .ct-acts { flex: 1 1 100%; max-width: none; justify-content: flex-start; padding-left: 48px; }
}
.master-card.ct-person { flex-wrap: nowrap; }   /* кнопки связи — отдельной строкой, имя не уезжает под аватар */
.master-card.ct-person .grow { flex: 1 1 0; }
.card > .ct-acts + .card-note { margin-top: 10px; }
.ct-personal { white-space: nowrap; }

/* проведение занятия, карта наката, срез (T09) */
.lm-form { display: grid; gap: 8px; }
.lm-block { border: 1px solid var(--border-soft); border-radius: 10px; padding: 4px 12px; background: var(--surface); }
.lm-block > summary { cursor: pointer; padding: 10px 0; list-style-position: inside; }
.lm-block[open] > summary { border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.lm-topic { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.lm-topic:last-child { border-bottom: 0; }
.lm-topic-name { flex: 1 1 200px; min-width: 0; font-size: 14px; }
.lm-scores { flex: 0 0 auto; gap: 6px; }
.lm-sc { min-width: 38px; justify-content: center; font-size: 14px; font-weight: 600; }
.lm-note { margin-top: 6px; }
.lm-score { min-width: 28px; text-align: center; font-size: 16px; }
.lm-score.dim { color: var(--muted); font-weight: 400; }
.lm-block-title { margin-top: 14px; }
.lm-tags { margin-top: 6px; gap: 6px; }
.lm-note-text { white-space: pre-wrap; }
.lm-errs { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.lm-errs b { color: var(--text); }
.lm-add { margin-bottom: 10px; }
.lm-add textarea { width: 100%; min-height: 64px; resize: vertical; }
.lm-sheet { display: grid; gap: 6px; margin-top: 10px; }
.lm-sheet-group .sec-title { margin-top: 10px; }
.lm-sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.lm-sheet-name { flex: 1 1 220px; min-width: 0; font-size: 13.5px; }
.lm-sheet-hd { margin-top: 6px; font-weight: 600; }
.lm-cells { gap: 4px; flex-wrap: wrap; overflow: visible; }
.lm-cell { min-width: 30px; min-height: 30px; padding: 0 8px; justify-content: center; font-weight: 700; }
.lm-total { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0; }
.lm-link { color: var(--accent-ink); text-align: left; font-weight: 600; cursor: pointer; }
.lm-tpl-block { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.lm-tpl-block .form-inline { align-items: center; }
.lm-tpl-block .form-inline .input { flex: 1 1 200px; min-width: 0; }
.lm-tpl-row { flex-wrap: nowrap; gap: 6px; }
.form-inline .input-sm { width: 84px; }

/* ---------- K05: экзамены по мастерам ---------- */
.ex-master { margin: 10px 0 6px; }
.ex-form { padding: 12px 0 4px; border-top: 1px solid var(--border-soft); margin-top: 10px; }
.ex-form .form-inline .input-sm { width: 96px; }
.ex-form .form-inline .ex-date { width: 150px; }
.ex-form .form-inline .ex-who { width: 210px; }
.ex-form .form-inline select.input-sm { width: auto; min-width: 120px; }
.ex-stage { align-self: center; font-weight: 600; }
.ex-events { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 13px; }
.ex-tbl th.ex-group { text-align: center; border-bottom: 1px solid var(--border-soft); }
.ex-tbl td, .ex-tbl th { white-space: nowrap; }
.ex-tbl td:first-child { white-space: normal; min-width: 160px; }
.ex-choice { margin-top: 8px; }
.ex-choice .chip { white-space: normal; text-align: left; }
@media (max-width: 700px) {
  .ex-form .form-inline .ex-date, .ex-form .form-inline .ex-who { width: 100%; }
}
