/* «Сцепление» — дизайн-система (P04b): тёмная тема по умолчанию, крупные цифры, карточки; цвета школы — только через акцент.
   Правила:
   - цвета только через токены ниже; новых литералов в компонентах не вписывать;
   - акцент — одна переменная --accent (P04 подставит цвет школы), производные считаются из неё (color-mix);
   - тёмная тема по умолчанию, светлая — <html data-theme="light"> (выбор пользователя, web/theme.js);
   - запреты по ролям — в логике и на сервере, никогда не в CSS;
   - inline-стилей нет (CSP style-src 'self'): всё — классами отсюда. */

/* ---------- шрифты (OFL): Onest — текст, Unbounded 700 — крупные цифры; подмножества кириллица + латиница ---------- */
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/onest-cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/onest-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(/fonts/unbounded-cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(/fonts/unbounded-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- токены: тёмная тема (по умолчанию) ---------- */
:root {
  color-scheme: dark;
  /* акцент школы: одна переменная; умолчание нейтральное (индиго), не цвет какой-либо школы */
  --accent: #5b5bd6;
  --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) 18%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 30%, transparent);

  --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, .82);
  --tabbar: rgba(28, 28, 32, .92);

  --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);

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

  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 24px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-num: "Unbounded", "Onest", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 64px;
  --sidebar-w: 256px;
}

/* ---------- светлая тема — выбор пользователя ---------- */
: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%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 18%, transparent);

  --bg: #f3f3f5;
  --surface: #fff;
  --surface-2: #f0f0f3;
  --surface-3: #e6e6eb;
  --border: #d4d4db;
  --border-soft: #e4e4e9;
  --text: #141418;
  --muted: #4e4e58;
  --hint: #66666f;
  --scrim: rgba(20, 20, 28, .38);
  --glass: rgba(255, 255, 255, .84);
  --tabbar: rgba(255, 255, 255, .92);

  --ok: #15803d;  --ok-bg: rgba(21, 128, 61, .10);
  --warn: #a16207; --warn-bg: rgba(217, 119, 6, .12);
  --bad: #c81e1e; --bad-bg: rgba(200, 30, 30, .08); --bad-fill: #c81e1e;
  --test: #6d28d9; --test-bg: rgba(109, 40, 217, .09);

  --shadow-pop: 0 24px 64px rgba(16, 16, 24, .18);
  --shadow-card: 0 1px 3px rgba(16, 16, 24, .05), 0 4px 14px rgba(16, 16, 24, .04);
}

/* ---------- основа ---------- */
*, *::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: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-glow); }
* { 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: -.02em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.hint { color: var(--hint); font-size: 13px; }
.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 18px;
  border: 1px solid transparent; border-radius: 12px; font: 600 14px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  background: var(--accent); color: var(--on-accent); text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad-fill); color: #fff; }
.btn-danger:hover { background: var(--bad-fill); opacity: .9; }
.btn-text { background: none; color: var(--accent-ink); padding: 6px 4px; min-height: 0; }
.btn-text:hover { background: none; text-decoration: underline; }
.btn-text.danger { color: var(--bad); }
.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 10px; font-size: 13px; }
.btn-icon { width: 42px; padding: 0; background: var(--surface); color: var(--muted); border-color: var(--border-soft); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; 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: 44px; padding: 10px 14px; font: 15px/1.3 var(--font); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 88px; resize: vertical; }
.input::placeholder, .field input::placeholder { color: var(--hint); opacity: .8; }
.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; }
.field select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%),
  linear-gradient(135deg, var(--hint) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 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: 13px; color: var(--hint); }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--bad); }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hint); pointer-events: none; }
.search .input { padding-left: 44px; min-height: 48px; border-radius: 14px; font-size: 15.5px; }

/* ---------- карточки ---------- */
.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: 14px; }
.card-head h2 { font-size: 17px; }
.card-note { color: var(--hint); font-size: 13px; margin: -6px 0 14px; }
.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: 14px;
  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: 16px; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 124px;
  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, transform .15s, background .15s; }
a.kpi:hover { border-color: var(--border); background: var(--surface-2); transform: translateY(-2px); text-decoration: none; }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hint); }
.kpi-val { font: 700 32px/1 var(--font-num); letter-spacing: -.03em; }
.kpi-val small { font: 600 14px var(--font); letter-spacing: 0; color: var(--hint); margin-left: 6px; }
.kpi-sub { font-size: 12.5px; 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: 26px 28px; border-radius: var(--r-xl); gap: 18px; }
.kpi-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(420px 320px at 92% -8%, var(--accent-glow), transparent 70%); }
.kpi-hero > * { position: relative; }
.kpi-hero .kpi-label { font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.kpi-big { font: 700 84px/.9 var(--font-num); letter-spacing: -.05em; }
.kpi-big small { font-size: 32px; 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: 280px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.segbar { display: flex; gap: 4px; height: 10px; }
.segbar > span { border-radius: 5px; 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: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; text-decoration: none; }
.legend > a:hover { background: var(--surface-3); text-decoration: none; }
.legend b { margin-right: 4px; font-weight: 700; }
.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: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  line-height: 1.35; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.test { background: var(--test-bg); color: var(--test); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.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: 11.5px; font-weight: 700; 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: 40px; height: 40px;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 16px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tab.active { background: var(--accent); color: var(--on-accent); }
.tab.active .count { background: rgba(255, 255, 255, .22); color: var(--on-accent); }

/* ---------- фильтры-чипы ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface);
  color: var(--muted); font: 600 13px var(--font); cursor: pointer; text-decoration: none; }
.chip:hover { color: var(--text); border-color: var(--border); text-decoration: none; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- список (строки-карточки) ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 14px; 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-weight: 600; }
.item-sub { margin-top: 3px; color: var(--hint); font-size: 13px; 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; }
.item .chev { color: var(--hint); }

/* ---------- таблица; на телефоне — карточками ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--hint); border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .cell-person { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.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: 56px; height: 56px; margin-bottom: 6px;
  border-radius: 18px; background: var(--surface-2); color: var(--hint); }
.empty .empty-ico .ico { width: 26px; height: 26px; }
.empty b { color: var(--text); font-size: 16px; }
.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: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; }
.skel-kpi { height: 124px; 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(6px); backdrop-filter: blur(6px); 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; }
.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: 700 34px/1 var(--font-num); 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: 14px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 14px;
  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: 30px; top: 50%; transform: translateY(-50%); color: var(--hint); pointer-events: none; }
.spot-head input { width: 100%; min-height: 50px; padding: 0 16px 0 48px; border: 0; border-radius: 14px; background: var(--surface-2);
  color: var(--text); font: 500 17px var(--font); outline: none; }
.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: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--hint); }
.spot-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; cursor: pointer; }
.spot-item:hover { text-decoration: none; }
.spot-item.active { background: var(--accent); color: var(--on-accent); }
.spot-item.active .item-sub, .spot-item.active .spot-kind { color: var(--on-accent); opacity: .85; }
.spot-item .spot-ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.spot-item.active .spot-ico { background: rgba(255, 255, 255, .18); color: var(--on-accent); }
.spot-kind { margin-left: auto; font-size: 12px; color: var(--hint); }
.spot-empty { padding: 26px 16px; text-align: center; color: var(--hint); font-size: 14px; }
.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-3); color: var(--muted);
  font: 600 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); border-radius: 16px; 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; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: 500 14px 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: 12px; 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: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 12px; background: var(--brand); color: var(--on-brand); overflow: hidden; }
.brand-mark .ico { width: 24px; height: 24px; }
.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: 700; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { display: block; font-size: 11.5px; color: var(--hint); }

/* боковое меню (компьютер) */
.sidebar { display: none; background: var(--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: 4px 8px 22px; }
.nav-group { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--hint); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; font-size: 14px; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent); color: var(--on-accent); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 12px; height: var(--topbar-h);
  padding: 0 28px; 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; }
.spot-btn { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; max-width: 520px; height: 42px; margin: 0 auto; padding: 0 14px;
  border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); color: var(--hint); font: 14px 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; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.user-wrap { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 4px; border: 1px solid var(--border-soft);
  border-radius: 14px; background: var(--surface); color: var(--text); font: 600 13.5px var(--font); cursor: pointer; }
.user-btn:hover { background: var(--surface-2); }
.user-btn .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.user-btn .user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* страница */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 28px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.page-hello { font-size: 13px; color: var(--hint); margin-bottom: 4px; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -.025em; }
.page-title .dim { color: var(--hint); font-weight: 600; }
.sec-title { margin: 32px 0 14px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--hint); font-size: 14px; 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-weight: 600; box-shadow: var(--shadow-card); }
.quick a:hover { border-color: var(--border); background: var(--surface-2); text-decoration: none; }
.quick .q-ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink); }
.quick small { display: block; font-weight: 400; color: var(--hint); font-size: 12.5px; }

/* нижние вкладки (телефон) */
.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: 22px; background: var(--tabbar);
  border: 1px solid var(--border); -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: 16px;
  color: var(--hint); font-size: 11px; font-weight: 600; text-decoration: none; }
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar a.active { background: var(--accent); color: var(--on-accent); }
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: radial-gradient(640px 420px at 50% 42%, var(--accent-glow), transparent 70%), var(--bg); }
.login-theme { position: fixed; right: 16px; top: calc(16px + env(safe-area-inset-top)); }
.login-box { width: min(420px, 100%); padding: 32px 30px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 28px; box-shadow: var(--shadow-pop); }
.login-box .brand { margin-bottom: 26px; }
.login-box h1 { font-size: 24px; margin-bottom: 6px; }
.login-box .lead { color: var(--hint); font-size: 14px; margin-bottom: 22px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box .btn { min-height: 48px; font-size: 15px; }
.code-input { text-align: center; font: 700 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: 14px; text-align: center; }
.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) =================== */
.demo-box { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.demo-head { margin-top: 2px; font-size: 11px; font-weight: 600; 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 { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.demo-pick:hover, .demo-pick:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.demo-pick b { font-size: 15px; }
.demo-pick small { color: var(--hint); font-size: 12px; line-height: 1.3; }
.demo-pick:last-child:nth-child(odd) { grid-column: 1 / -1; }
.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); }
.demo-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 16px; padding: 6px 8px 6px 14px;
  border-radius: var(--r); background: var(--accent-soft); color: var(--muted); font-size: 13px; }
.demo-bar .btn { margin-left: auto; }

/* =================== вождение на главной (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: 700 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: 10.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: 700 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: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; 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: 700 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; }
}
@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; }
  .topbar { padding: 0 14px; gap: 10px; padding-top: env(safe-area-inset-top); }
  .topbar .brand-text, .user-btn .user-name, .spot-btn kbd { display: none; }
  .user-btn { padding: 0 4px; }
  .page { padding: 20px 14px 48px; }
  .page-title { font-size: 26px; }
  .card { padding: 16px; border-radius: 18px; }
  .kpi { min-height: 108px; padding: 16px; }
  .kpi-val { font-size: 26px; }
  .kpi-hero { padding: 20px; }
  .kpi-big { font-size: 60px; }
  .kpi-big small { font-size: 24px; }
  .st-hero { padding: 18px; }
  .st-name { font-size: 21px; }
  .avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 16px; }
  .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; border-radius: 24px; }

  /* таблица — карточками: подписи из 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: 24px 24px 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: 20px; 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: 9.5px; letter-spacing: .05em; }
}

/* =================== настройки школы и бренд (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: 700 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: 700 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: 700 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: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
.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: rgba(255, 255, 255, .22); color: var(--on-accent); }

/* автопарк: плитки машин */
.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: 700 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: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; 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: 700 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: 700 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: 700 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: 22px 22px 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; }
}
