/* ═══════════════════════════════════════════════════════════════════
   Система учёта доноров — макет
   Дизайн-токены взяты из проекта «Чек-листы» (Flat 3.0 · Боткинская)
   ═══════════════════════════════════════════════════════════════════ */

@font-face { font-family: "Intro"; src: url("../fonts/Intro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0000-2115, U+2117-10FFFF; }
@font-face { font-family: "Intro"; src: url("../fonts/Intro-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; unicode-range: U+0000-2115, U+2117-10FFFF; }
@font-face { font-family: "Intro"; src: url("../fonts/Intro-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; unicode-range: U+0000-2115, U+2117-10FFFF; }

:root {
  --font: "Intro", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --primary: #00abeb;
  --primary-hover: #009ad4;
  --dark: #0b2f7c;
  --fg: #435e96;
  --muted: #96a2c7;
  --muted-ink: #7a88b3;

  --bg: #f9fafd;
  --bg-muted: #f2f4fa;
  --bg-accent: #e3f2fd;
  --bg-accent-soft: rgba(0, 185, 255, 0.09);
  --white: #ffffff;

  --border: #eef1f8;
  --border-strong: #e0e6f0;
  --hairline: #e6eaf4;
  --hairline-soft: #eff2f9;

  --success: #41ae59;
  --success-ink: #2f8a45;
  --danger: #db3833;
  --warning: #eeb937;
  --warning-ink: #8a6a10;
  --warning-fill: #c89321;
  --purple: #492eb8;
  --rose: #b95b7a;

  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 20px;

  --sh-xs: 0 1px 2px 0 rgba(11, 47, 124, 0.04);
  --sh-sm: 0 2px 6px -1px rgba(11, 47, 124, 0.06), 0 1px 2px 0 rgba(11, 47, 124, 0.04);
  --sh-md: 0 6px 16px -4px rgba(11, 47, 124, 0.08), 0 2px 6px -2px rgba(11, 47, 124, 0.05);
  --sh-lg: 0 16px 40px -8px rgba(11, 47, 124, 0.12), 0 4px 12px -4px rgba(11, 47, 124, 0.06);
  --sh-xl: 0 24px 56px -12px rgba(11, 47, 124, 0.18);
  --glow: 0 0 0 3px rgba(0, 171, 235, 0.15);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --header-h: 64px;
  --sidebar-w: 256px;
  --gutter: 28px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
/* Без «резинового» оттяга: шапка не отходит от верхнего края на телефоне */
html, body { overscroll-behavior-y: none; }
/* iPhone увеличивает страницу при нажатии на поле мельче 16px - после этого шапка «уезжает» */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
}
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--fg);
  background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { color: var(--dark); margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s14 { width: 14px; height: 14px; } svg.i.s16 { width: 16px; height: 16px; } svg.i.s18 { width: 18px; height: 18px; }
svg.i.s24 { width: 24px; height: 24px; } svg.i.s28 { width: 28px; height: 28px; } svg.i.s32 { width: 32px; height: 32px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .muted-ink { color: var(--muted-ink); } .dark { color: var(--dark); }
.danger-t { color: var(--danger); } .success-t { color: var(--success-ink); } .warning-t { color: var(--warning-ink); } .primary-t { color: var(--primary); }
.b { font-weight: 700; } .nowrap { white-space: nowrap; }
.sm { font-size: 13px; } .xs { font-size: 12px; } .lg { font-size: 17px; }
.hidden { display: none !important; }

/* ── App shell ─────────────────────────────────────────────── */
.app-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50; background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 0 16px; box-shadow: var(--sh-sm);
}
.app-header .burger { display: none; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; min-width: 0; }
.brand-logo { display: flex; align-items: center; gap: 8px; }
.brand-logo svg { height: 36px; width: auto; }
.brand-name { font-weight: 700; font-size: 11px; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; }
.brand-sep { width: 1px; align-self: stretch; margin: 14px 0; background: rgba(255,255,255,.35); }
.brand-title { min-width: 0; }
.brand-title b { display: block; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-title span { display: block; font-size: 12px; opacity: .85; white-space: nowrap; }
.header-spacer { flex: 1; }
.hbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 10px;
  border-radius: var(--r-md); border: 0; background: transparent; color: #fff; transition: background .15s;
}
.hbtn:hover { background: rgba(255,255,255,.14); }
.hbtn .dot-badge {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--primary);
}
.net { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 0 8px; white-space: nowrap; opacity: .92; }
.net .pulse { width: 7px; height: 7px; border-radius: 50%; background: #7cf29a; }
.net.off .pulse { background: #ffd166; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 4px; border-radius: var(--r-md); border: 0; background: transparent; color: #fff; }
.user-chip:hover { background: rgba(255,255,255,.14); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who b { display: block; font-size: 13px; white-space: nowrap; }
.user-chip .who span { display: block; font-size: 11px; opacity: .85; white-space: nowrap; }

.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w); z-index: 30; background: #fff;
  border-right: 1px solid var(--border); box-shadow: var(--sh-sm); overflow-y: auto; padding: 12px 10px 24px; transition: transform .3s var(--ease);
}
.nav-group { margin-top: 14px; padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--r-md);
  color: var(--fg); font-size: 15px; transition: background .15s, color .15s; white-space: nowrap;
}
.nav-link:hover { background: var(--bg-accent-soft); color: var(--primary); }
.nav-link.active { background: var(--bg-accent); color: var(--primary); }
.nav-link.active::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 24px; transform: translateY(-50%); border-radius: 0 4px 4px 0; background: var(--primary); }
.nav-link .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav-badge.red { background: var(--danger); }
.sidebar-foot { margin-top: 18px; padding: 14px 12px 0; border-top: 1px solid var(--hairline-soft); font-size: 12px; color: var(--muted); }

.main { padding-top: var(--header-h); padding-left: var(--sidebar-w); min-height: 100vh; transition: padding .3s var(--ease); }
.page { max-width: 1320px; margin: 0 auto; padding: 28px var(--gutter) 64px; animation: fade-in .25s var(--ease); }
.page.wide { max-width: 1560px; }
.page.narrow { max-width: 980px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.scrim { position: fixed; inset: 0; background: rgba(11,47,124,.28); z-index: 29; opacity: 0; pointer-events: none; transition: opacity .25s; }

/* Rail: планшет в альбомной ориентации с узким экраном */
@media (max-width: 1179px) {
  :root { --sidebar-w: 76px; --gutter: 22px; }
  .sidebar { padding: 12px 10px; }
  .sidebar .nav-link { justify-content: center; padding: 0; height: 48px; }
  .sidebar .nav-link .lbl, .sidebar .nav-group, .sidebar .sidebar-foot { display: none; }
  .sidebar .nav-badge { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: 10px; }
  .brand-title span { display: none; }
}
/* Drawer: планшет в портретной ориентации и уже */
@media (max-width: 899px) {
  :root { --sidebar-w: 0px; --gutter: 16px; }
  .app-header .burger { display: inline-flex; }
  .sidebar { width: 288px; transform: translateX(-100%); padding: 12px 10px 24px; }
  .sidebar .nav-link { justify-content: flex-start; padding: 0 12px; height: 46px; }
  .sidebar .nav-link .lbl, .sidebar .nav-group, .sidebar .sidebar-foot { display: block; }
  .sidebar .nav-link .lbl { display: block; }
  .sidebar .nav-badge { position: static; }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .brand-name, .brand-sep { display: none; }
  .user-chip .who { display: none; }
}
@media (max-width: 560px) {
  .brand-title { display: none; }
  .net .txt { display: none; }
}

/* ── Page head ─────────────────────────────────────────────── */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-ink); margin-bottom: 10px; }
.back:hover { color: var(--primary); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { margin-top: 6px; color: var(--muted-ink); font-size: 14px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 700px) { .page-head h1 { font-size: 26px; } }

/* ── Cards & sections ──────────────────────────────────────── */
.card { background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-sm); border: 1px solid var(--border); padding: 22px 24px; min-width: 0; }
.card.tight { padding: 16px 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { font-size: 19px; }
.card-head .sub { font-size: 13px; color: var(--muted-ink); margin-top: 3px; }
.card + .card, .stack > * + * { margin-top: 18px; }
.grid > .card + .card, .grid > * + * { margin-top: 0; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dark); padding-bottom: 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .g-main { grid-template-columns: minmax(0, 1fr); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--hairline-soft); margin: 16px 0; }

/* Метрики */
.kpi { position: relative; }
.kpi .label { font-size: 14px; color: var(--fg); min-height: 42px; }
.kpi .value { font-size: 38px; font-weight: 700; color: var(--dark); line-height: 1.1; margin-top: 4px; letter-spacing: -.01em; }
.kpi .value small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.kpi .hint { font-size: 13px; color: var(--muted-ink); margin-top: 6px; }
.stat-inline { display: flex; gap: 0; }
.stat-inline > div { flex: 1; padding: 0 18px; border-left: 1px solid var(--hairline); }
.stat-inline > div:first-child { padding-left: 0; border-left: 0; }
.stat-inline .v { font-size: 30px; font-weight: 700; color: var(--dark); line-height: 1.1; }
.stat-inline .l { font-size: 13px; color: var(--muted-ink); margin-top: 4px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent; font-size: 15px; font-weight: 700; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s, color .15s;
  background: var(--primary); color: #fff; box-shadow: var(--sh-sm); user-select: none;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.dark { background: var(--dark); } .btn.dark:hover { background: #0a2766; }
.btn.secondary { background: var(--bg-muted); color: var(--dark); box-shadow: none; } .btn.secondary:hover { background: var(--bg-accent); }
.btn.outline { background: #fff; color: var(--dark); border-color: var(--border-strong); box-shadow: var(--sh-xs); } .btn.outline:hover { background: var(--bg-muted); }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: none; } .btn.ghost:hover { background: var(--bg-muted); color: var(--dark); }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #c22f2a; }
.btn.danger-soft { background: #fdecec; color: var(--danger); box-shadow: none; } .btn.danger-soft:hover { background: #fadada; }
.btn.success { background: var(--success); } .btn.success:hover { background: #379a4e; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: var(--r-lg); }
.btn.icon { width: 42px; padding: 0; } .btn.sm.icon { width: 34px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--primary-hover); }
@media (pointer: coarse) { .btn { height: 46px; } .btn.sm { height: 40px; } .btn.sm.icon { width: 40px; } }

/* ── Статус ────────────────────────────────────────────────────
   Точка и текст, без подложки и рамки (status light: Adobe Spectrum, Linear, Vercel).
   Цвет несёт только точка, текст остаётся тёмным. Красный текст — только для того,
   что требует действия. Цвета точек совпадают с легендой карты. */
.chip { display: inline-flex; align-items: center; gap: 8px; color: var(--dark); font-size: 14px; line-height: 1.4; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.chip.nodot::before { display: none; }
.chip.info::before { background: var(--primary); }
.chip.success::before { background: var(--success); }
.chip.warning::before { background: var(--warning); }
.chip.violet::before { background: var(--purple); }
.chip.dark::before { background: var(--dark); }
.chip.danger { color: var(--danger); font-weight: 700; } .chip.danger::before { background: var(--danger); }
.chip.lg { font-size: 15px; }
.h-count { margin-left: 6px; font-weight: 400; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--bg-accent); color: #0089bd; white-space: nowrap; }
.tag.slate { background: var(--bg-muted); color: var(--fg); } .tag.violet { background: #efebfb; color: var(--purple); } .tag.green { background: #e6f5ea; color: var(--success-ink); } .tag.red { background: #fdecec; color: var(--danger); } .tag.amber { background: #fbf3dc; color: var(--warning-ink); } .tag.dark { background: var(--dark); color: #fff; }

/* ── Tabs (сегменты) ───────────────────────────────────────── */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--bg-muted); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1; min-width: max-content; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted-ink); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.tab:hover { color: var(--dark); }
.tab.active { background: #fff; color: var(--dark); font-weight: 700; box-shadow: var(--sh-sm); }
.tab .cnt { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 9px; background: var(--hairline); color: var(--fg); }
.tab.active .cnt { background: var(--primary); color: #fff; }
.tabs.inline { display: inline-flex; max-width: 100%; } /* без ограничения вкладки распирали страницу на телефоне */
.tabs.inline .tab { flex: 0 0 auto; }

/* ── Forms ─────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .flabel { font-size: 13px; color: var(--fg); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.field > label .req { color: var(--danger); }
.field .help { font-size: 12px; color: var(--muted-ink); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: #fff; color: var(--dark);
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2396a2c7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--glow); }
.input::placeholder, .textarea::placeholder { color: #b3bcd8; }
.input[readonly] { background: var(--bg-soft, #f9fafd); color: var(--fg); }
.input.voice-filled, .textarea.voice-filled { background: #fffbea; border-color: #f1d98a; }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input, .input-group .textarea { padding-right: 52px; }
.input-group .unit { position: absolute; right: 52px; top: 0; height: 46px; display: flex; align-items: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.input-group.no-mic .unit { right: 14px; }
.input-group.no-mic .input { padding-right: 56px; }
.mic { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border-radius: 8px; border: 0; background: var(--bg-muted); color: var(--fg); display: grid; place-items: center; transition: background .15s, color .15s; }
.mic:hover { background: var(--bg-accent); color: var(--primary); }
.mic.on { background: var(--danger); color: #fff; animation: mic-pulse 1.2s infinite; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(219,56,51,.5); } 70% { box-shadow: 0 0 0 10px rgba(219,56,51,0); } 100% { box-shadow: 0 0 0 0 rgba(219,56,51,0); } }
.voice-note { font-size: 12px; color: var(--warning-ink); display: flex; align-items: center; gap: 4px; }
.form-grid { display: grid; gap: 16px 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.form-grid > * { grid-column: span 4; }
.form-grid > .c2 { grid-column: span 2; } .form-grid > .c3 { grid-column: span 3; } .form-grid > .c6 { grid-column: span 6; } .form-grid > .c8 { grid-column: span 8; } .form-grid > .c12 { grid-column: 1 / -1; }
@media (max-width: 1023px) { .form-grid > * { grid-column: span 6; } .form-grid > .c2, .form-grid > .c3 { grid-column: span 3; } .form-grid > .c8 { grid-column: 1 / -1; } }
@media (max-width: 640px) { .form-grid > *, .form-grid > .c2, .form-grid > .c3, .form-grid > .c6 { grid-column: 1 / -1; } }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: #fff; color: var(--fg); font-size: 14px; cursor: pointer; transition: all .15s; user-select: none; }
.seg label:hover { border-color: var(--primary); }
.seg input:checked + label { background: var(--bg-accent); border-color: var(--primary); color: var(--dark); font-weight: 700; }
.seg input:checked + label.danger { background: #fdecec; border-color: var(--danger); color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--dark); user-select: none; min-height: 32px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--border-strong); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .search { flex: 1 1 280px; }
.filters .select { width: auto; min-width: 180px; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dark); padding: 12px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; background: #fff; }
.t td { padding: 13px 14px; border-bottom: 1px solid var(--hairline-soft); color: var(--fg); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: var(--bg-accent-soft); }
.t tbody tr.hl { background: #fffbea; }
.t tbody tr.sel { background: var(--bg-accent); }
.t td.name { color: var(--dark); font-weight: 700; }
.t .r { text-align: right; } .t .c { text-align: center; }
.t td .sub { display: block; font-size: 12px; color: var(--muted-ink); font-weight: 400; margin-top: 1px; }
.card.flush .t th:first-child, .card.flush .t td:first-child { padding-left: 24px; }
.card.flush .t th:last-child, .card.flush .t td:last-child { padding-right: 24px; }
.rail-l:not(tr) { position: relative; }
.rail-l:not(tr)::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--danger); }
tr.rail-l > td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.rail-l.amber::before { background: var(--warning); } .rail-l.blue::before { background: var(--primary); } .rail-l.green::before { background: var(--success); } .rail-l.violet::before { background: var(--purple); }

/* ── Lists ─────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline-soft); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .body { flex: 1; min-width: 0; }
.li .t1 { color: var(--dark); font-weight: 700; font-size: 14px; line-height: 1.35; }
.li .t1.red { color: var(--danger); }
.li .t2 { color: var(--muted-ink); font-size: 12.5px; margin-top: 2px; }
.li .meta { font-size: 12px; color: var(--muted-ink); white-space: nowrap; }
.li.click { cursor: pointer; border-radius: 10px; }
.li.click:hover { background: var(--bg-accent-soft); }
.kv { display: grid; grid-template-columns: minmax(140px, auto) minmax(0, 1fr); gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--muted-ink); } .kv dd { margin: 0; color: var(--dark); font-weight: 700; overflow-wrap: anywhere; }
.kv dd .chip { white-space: normal; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted-ink); }

/* Bars */
.bar { height: 8px; border-radius: 4px; background: var(--hairline-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--primary); transition: width .6s var(--ease); }
.hbar-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 52px; align-items: center; gap: 16px; padding: 9px 0; font-size: 14px; color: var(--dark); }
.hbar-row .v { text-align: right; font-weight: 700; }

/* ── Alerts / banners ──────────────────────────────────────── */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg); background: #fbf3dc; color: var(--warning-ink); font-size: 14px; border: 1px solid rgba(238,185,55,.35); }
.banner.info { background: var(--bg-accent); color: #0b5d86; border-color: rgba(0,171,235,.25); }
.banner.danger { background: #fdecec; color: var(--danger); border-color: rgba(219,56,51,.25); }
.banner.success { background: #e9f6ec; color: var(--success-ink); border-color: rgba(65,174,89,.25); }
.banner .grow { flex: 1; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-ink); }

/* ── Modal / sheet ─────────────────────────────────────────── */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(11,47,124,.32); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(640px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: var(--r-2xl); box-shadow: var(--sh-xl); animation: pop .28s var(--spring); }
.modal.wide { width: min(920px, 100%); } .modal.xwide { width: min(1100px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.modal-head h3 { font-size: 21px; }
.modal-head .sub { font-size: 13px; color: var(--muted-ink); margin-top: 4px; }
.modal-body { padding: 18px 24px 8px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px 22px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-root { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; animation: sheet .3s var(--ease); }
  @keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
  .modal-foot .btn { flex: 1; }
}
.menu { position: fixed; z-index: 120; min-width: 280px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg); border: 1px solid var(--border); padding: 6px; animation: pop .2s var(--ease); color: var(--fg); }
.menu .mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 14px; color: var(--dark); }
.menu .mi:hover { background: var(--bg-accent-soft); }
.menu .mi.active { background: var(--bg-accent); }
.menu .mi small { display: block; font-size: 12px; color: var(--muted-ink); font-weight: 400; }
.menu .mh { padding: 10px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--hairline-soft); margin: 6px 0; }

/* ── Toasts (имитация push) ────────────────────────────────── */
.toasts { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; padding: 14px 16px; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 16px; box-shadow: var(--sh-lg); border: 1px solid var(--border); animation: toast-in .4s var(--spring); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.toast .app { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.toast b { display: block; color: var(--dark); font-size: 14px; line-height: 1.3; }
.toast.danger b { color: var(--danger); }
.toast span { display: block; font-size: 13px; color: var(--fg); margin-top: 2px; }

/* ── Stepper (путь случая) ─────────────────────────────────── */
.stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 2px 2px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: 1 0 104px; position: relative; text-align: center; padding: 0 4px; }
.step::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--hairline); }
.step:first-child::before { display: none; }
.step .n { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--bg-muted); color: var(--muted); border: 2px solid transparent; position: relative; z-index: 1; }
.step .t { font-size: 12px; color: var(--muted-ink); margin-top: 6px; line-height: 1.25; }
.step.done .n { background: var(--primary); color: #fff; }
.step.done::before, .step.cur::before { background: var(--primary); }
.step.cur .n { background: #fff; border-color: var(--primary); color: var(--primary); box-shadow: var(--glow); }
.step.cur .t { color: var(--dark); font-weight: 700; }
.step.fail .n { background: var(--danger); color: #fff; }

/* ── Timeline (дневник наблюдения) ─────────────────────────── */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--hairline); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.tl-item.red::before { border-color: var(--danger); } .tl-item.amber::before { border-color: var(--warning); } .tl-item.violet::before { border-color: var(--purple); } .tl-item.green::before { border-color: var(--success); }
.tl-item .when { font-size: 12px; color: var(--muted-ink); }
.tl-item .what { color: var(--dark); font-weight: 700; font-size: 14px; }

/* ── Map ───────────────────────────────────────────────────── */
.map { position: relative; width: 100%; height: 420px; border-radius: var(--r-lg); overflow: hidden; background: #e8eef6; z-index: 0; }
.map .leaflet-control-attribution { font-size: 9px; background: rgba(255,255,255,.7); }
.map .leaflet-tile-pane { filter: saturate(.42) brightness(1.05) contrast(.9) hue-rotate(-8deg); }
.card.fill { display: flex; flex-direction: column; }
.card.fill .map { flex: 1; min-height: 440px; height: auto !important; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--fg); margin-top: 10px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 18px; height: 3px; border-radius: 2px; background: var(--primary); }
.lg-sq { width: 12px; height: 12px; border-radius: 3px; }
.mk { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 5px; border-radius: 8px; background: #fff; color: var(--dark); font: 700 12px/1.2 var(--font); white-space: nowrap; box-shadow: 0 2px 8px rgba(11,47,124,.25); border: 2px solid var(--primary); transform: translate(-50%, -50%); position: absolute; left: 0; top: 0; }
.mk .i { width: 16px; height: 16px; }
.mk.brig { background: var(--primary); color: #fff; border-color: #fff; }
.mk.brig.onsite { background: var(--purple); transform: translate(-50%, -170%); }
.mk.brig.base { background: var(--success); transform: translate(calc(-50% + var(--dx, 0px)), -170%); }
.mk.brig.ret { background: #5b74b0; }
.mk.hosp { padding: 3px; border-color: var(--dark); color: var(--dark); border-width: 1.5px; }
.mk.hosp.lbl { padding: 3px 7px 3px 4px; }
.mk.base-c { background: var(--dark); color: #fff; border-color: #fff; }
.mk.req { background: var(--danger); color: #fff; border-color: #fff; animation: req-pulse 1.4s infinite; }
@keyframes req-pulse { 0% { box-shadow: 0 0 0 0 rgba(219,56,51,.6); } 70% { box-shadow: 0 0 0 14px rgba(219,56,51,0); } 100% { box-shadow: 0 0 0 0 rgba(219,56,51,0); } }
.mk-wrap { background: none !important; border: 0 !important; }

/* ── Command center blocks ─────────────────────────────────── */
.new-req { position: relative; border-radius: var(--r-xl); padding: 18px 20px; background: #fdecec; border: 2px solid var(--danger); color: var(--danger); overflow: hidden; }
.new-req.flash { animation: flash 1s ease 3; }
@keyframes flash { 50% { background: #f9c9c7; } }
.new-req .ttl { font-size: 24px; font-weight: 900; line-height: 1.15; margin-top: 4px; }
.new-req .h { font-size: 15px; font-weight: 700; color: var(--dark); margin-top: 4px; }
.new-req .s { font-size: 13px; color: var(--fg); }
.brig-card { border-radius: var(--r-lg); border: 1px solid var(--border); background: #fff; padding: 14px 16px; box-shadow: var(--sh-xs); }
.brig-card .top { display: flex; align-items: baseline; gap: 10px; }
.brig-card .nm { font-weight: 700; color: var(--dark); font-size: 16px; flex: 1; }
.brig-card .where { margin-top: 4px; color: var(--fg); font-size: 14px; }
.brig-card .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline-soft); font-size: 12.5px; color: var(--fg); }
.brig-card .foot b { color: var(--dark); }
.prio { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 12px; font-size: 18px; font-weight: 900; color: #fff; background: var(--danger); }
.prio.mid { background: var(--warning-fill); } .prio.low { background: #8fa0c9; }
.log { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: var(--r-md); border-bottom: 1px solid var(--hairline-soft); }
.log-row:last-child { border-bottom: 0; }
.log-row time { font-size: 13px; color: var(--muted-ink); line-height: 1.35; }
.log-row .t1 { color: var(--dark); font-weight: 700; font-size: 14px; line-height: 1.35; }
.log-row .t2 { color: var(--muted-ink); font-size: 12.5px; margin-top: 2px; }
.log-row.alarm time, .log-row.alarm .t1 { color: var(--danger); }
.log-row.click { cursor: pointer; }
.log-row.click:hover { background: var(--bg-accent-soft); }
.factor { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg-muted); color: var(--fg); white-space: nowrap; }
.factor b { color: var(--dark); }
.factor.up { background: #fdecec; color: #a3302c; } .factor.up b { color: var(--danger); }
.factor.down { background: #eef6ee; color: var(--success-ink); }

/* ── TV screen ─────────────────────────────────────────────── */
html.tv-mode { font-size: calc(100vw / 120); scrollbar-gutter: auto; }
html.tv-mode body { overflow: hidden; background: #eef3fa; }
.tv { height: 100vh; display: flex; flex-direction: column; }
.tv-top { height: 4.2rem; background: var(--primary); color: #fff; display: flex; align-items: center; padding: 0 1.6rem; gap: 1.2rem; flex-shrink: 0; }
.tv-top .brand-logo svg { height: 2.6rem; }
.tv-top .brand-name { font-size: .7rem; }
.tv-top .brand-title b { font-size: 1rem; } .tv-top .brand-title span { font-size: .78rem; display: block; }
.tv-top .hbtn { height: 2.5rem; font-size: .85rem; padding: 0 .8rem; border: 1px solid rgba(255,255,255,.35); }
.tv-top .hbtn svg { width: 1.1rem; height: 1.1rem; }
.tv-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 27rem; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1rem 1.2rem; padding: 1.1rem 1.6rem 1rem; min-height: 0; }
.tv-title { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; }
.tv-title h1 { font-size: 2.3rem; font-weight: 900; }
.tv-title .sub { font-size: .9rem; color: var(--fg); margin-top: .2rem; }
.tv-clock { font-size: 3rem; font-weight: 900; color: var(--dark); line-height: 1; display: flex; align-items: baseline; gap: .6rem; }
.tv-clock small { font-size: .9rem; font-weight: 700; padding: .2rem .5rem; border-radius: .4rem; background: var(--bg-muted); color: var(--fg); }
.tv .card { border-radius: 1rem; padding: 1rem 1.2rem; }
.tv .card-head h2 { font-size: 1.25rem; }
.tv-map-card { display: flex; flex-direction: column; min-height: 0; }
.tv-map-card .map { flex: 1; height: auto; min-height: 0; border-radius: .7rem; }
.tv .mk { font-size: .78rem; padding: .25rem .55rem .25rem .35rem; border-radius: .5rem; }
.tv .mk .i { width: 1rem; height: 1rem; }
.tv-side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.tv .new-req { border-radius: 1rem; padding: 1.1rem 1.3rem; }
.tv .new-req .ttl { font-size: 1.9rem; }
.tv .new-req .h { font-size: 1.05rem; } .tv .new-req .s { font-size: .85rem; }
.tv .feed { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tv .log-row { grid-template-columns: 3.2rem minmax(0, 1fr); gap: .8rem; padding: .65rem 0; margin: 0; }
.tv .log-row time { font-size: .9rem; } .tv .log-row .t1 { font-size: .95rem; } .tv .log-row .t2 { font-size: .8rem; }
.tv-brigs { grid-column: 1 / -1; }
.tv-brigs .grid { gap: 1rem; }
.tv .brig-card { border-radius: .8rem; padding: .8rem 1rem; }
.tv .brig-card .nm { font-size: 1.05rem; } .tv .brig-card .where { font-size: .95rem; margin-top: .25rem; } .tv .brig-card .foot { font-size: .8rem; margin-top: .55rem; padding-top: .55rem; }
.tv .chip { font-size: .9rem; }
.tv-foot { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted-ink); padding: 0 1.6rem .7rem; }
.tv-alert { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(219,56,51,.18); animation: fade .2s; pointer-events: none; }
.tv-alert .box { background: #fff; border: .25rem solid var(--danger); border-radius: 1.4rem; padding: 2rem 3rem; text-align: center; box-shadow: var(--sh-xl); animation: pop .4s var(--spring); }
.tv-alert .box b { display: block; font-size: 3rem; color: var(--danger); font-weight: 900; line-height: 1.1; }
.tv-alert .box span { display: block; font-size: 1.4rem; color: var(--dark); margin-top: .6rem; font-weight: 700; }

/* ── Доска органов ─────────────────────────────────────────────
   Колонки — серые дорожки, карточки — белые. Цвет органа — квадратик,
   статус — точка: так они не путаются друг с другом. */
.oc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-bottom: 20px; font-size: 13px; color: var(--fg); }
.oc-route { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.oc-legend-it { display: inline-flex; align-items: center; gap: 7px; color: var(--dark); font-weight: 700; }
.oc-path { color: var(--muted-ink); } .oc-path b { color: var(--dark); }
.oc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: #8fa0c9; }
.oc-sw.red { background: var(--danger); } .oc-sw.violet { background: var(--purple); } .oc-sw.amber { background: var(--warning-fill); } .oc-sw.blue { background: var(--primary); }

.board-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; min-width: 1000px; }
.lane { background: var(--bg-muted); border-radius: var(--r-xl); padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 6px; min-height: 320px; }
.lane-head { display: flex; align-items: baseline; padding: 10px 10px 6px; font-size: 14px; font-weight: 700; color: var(--dark); }
.lane-empty { padding: 22px 8px; text-align: center; font-size: 13px; color: var(--muted); }

.ocard { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-xs); padding: 14px 14px 12px; cursor: pointer; transition: box-shadow .18s, border-color .18s, transform .18s var(--ease); min-width: 0; }
.ocard:hover { box-shadow: var(--sh-md); border-color: rgba(0,171,235,.35); transform: translateY(-1px); }
.oc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.oc-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--dark); line-height: 1.3; min-width: 0; }
.oc-isch { margin-top: 10px; }
.oc-isch-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.oc-time { font-size: 14px; font-weight: 700; color: var(--dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc-isch.warning .oc-time { color: var(--warning-ink); } .oc-isch.danger .oc-time { color: var(--danger); } .oc-isch.done .oc-time { color: var(--fg); font-weight: 400; }
.oc-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--hairline); overflow: hidden; }
.oc-bar i { display: block; height: 100%; border-radius: 2px; background: var(--primary); transition: width .6s var(--ease); }
.oc-isch.warning .oc-bar i { background: var(--warning); } .oc-isch.danger .oc-bar i { background: var(--danger); } .oc-isch.done .oc-bar i { background: #c3cce3; }
.oc-meta { margin-top: 12px; font-size: 12.5px; line-height: 1.45; color: var(--muted-ink); }
.oc-meta b { color: var(--dark); }
.oc-dest { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--hairline-soft); }
.oc-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.oc-val { font-size: 14px; font-weight: 700; color: var(--dark); line-height: 1.35; }
.oc-val.muted { color: var(--fg); font-weight: 400; }
.oc-sub { font-size: 12.5px; color: var(--muted-ink); line-height: 1.4; margin-top: 2px; }
.oc-note { font-size: 12.5px; color: var(--dark); margin-top: 6px; }
.oc-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; }
.oc-foot .chip { font-size: 12.5px; gap: 6px; }
.oc-foot .chip::before { width: 6px; height: 6px; }
.ocard.done { background: rgba(255,255,255,.7); box-shadow: none; }
.ocard.done .oc-title { color: var(--fg); }
.ocard.done:hover { background: #fff; box-shadow: var(--sh-sm); }

/* ── Home (выбор роли) ─────────────────────────────────────── */
.home-hero { background: linear-gradient(135deg, #00abeb 0%, #0b6fc0 60%, #0b2f7c 100%); color: #fff; border-radius: var(--r-2xl); padding: 34px 36px; position: relative; overflow: hidden; }
.home-hero h1 { color: #fff; font-size: 36px; font-weight: 900; }
.home-hero p { max-width: 720px; margin-top: 10px; opacity: .92; font-size: 16px; }
.home-hero .deco { position: absolute; right: -30px; top: -30px; width: 280px; height: 280px; opacity: .12; }
.role-card { display: flex; flex-direction: column; gap: 10px; text-align: left; border: 1px solid var(--border); background: #fff; border-radius: var(--r-xl); padding: 20px; box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; color: var(--fg); min-height: 100%; }
.role-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: rgba(0,171,235,.4); }
.role-card h3 { font-size: 17px; }
.role-card p { font-size: 13px; color: var(--muted-ink); flex: 1; }
.role-card .go { font-size: 13px; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }

/* ── Документ (паспорт органа / акт) ───────────────────────── */
.doc { background: #fff; border: 1px solid var(--hairline); border-radius: 6px; padding: 34px 40px; color: #1b2a4a; font-size: 13.5px; line-height: 1.5; box-shadow: var(--sh-md); max-width: 820px; margin: 0 auto; }
.doc h2 { text-align: center; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; color: #1b2a4a; }
.doc .doc-sub { text-align: center; font-size: 12px; color: #5a6789; margin-top: 4px; }
.doc .doc-org { display: flex; justify-content: space-between; font-size: 11px; color: #5a6789; border-bottom: 1px solid #c9d2e6; padding-bottom: 10px; margin-bottom: 16px; gap: 20px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc td, .doc th { border: 1px solid #c9d2e6; padding: 6px 9px; vertical-align: top; text-align: left; font-size: 12.5px; }
.doc th { background: #f2f5fb; width: 38%; font-weight: 700; color: #33436b; }
.doc .sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 30px; margin-top: 22px; }
.doc .sig { border-top: 1px solid #1b2a4a; padding-top: 4px; font-size: 11px; color: #5a6789; min-height: 54px; position: relative; }
.doc .sig img { position: absolute; bottom: 18px; left: 10px; height: 46px; }
.doc .doc-sec { font-weight: 700; margin-top: 18px; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; color: #33436b; }
@media (max-width: 640px) { .doc { padding: 20px 16px; } }

/* Подпись */
.sigpad { border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: #fbfcff; position: relative; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 160px; cursor: crosshair; }
.sigpad .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #b3bcd8; font-size: 14px; pointer-events: none; }
.sigpad.has .ph { display: none; }

/* Загрузка файла */
.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); padding: 22px; text-align: center; color: var(--muted-ink); background: #fbfcff; cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.drop:hover { border-color: var(--primary); background: var(--bg-accent-soft); }
.drop input { display: none; }
.thumb { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--bg-muted); }
.thumb img { width: 56px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--hairline); background: #fff; }

/* Пайплайн (лаборатория / архив) */
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pipe .p { position: relative; }
.pipe .p .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--bg-muted); color: var(--muted); transition: all .3s; }
.pipe .p.done .n { background: var(--primary); color: #fff; }
.pipe .p.run .n { background: #fff; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary), var(--glow); }
.pipe .p::after { content: ""; position: absolute; top: 15px; left: 44px; right: 8px; height: 2px; background: var(--hairline); }
.pipe .p:last-child::after { display: none; }
.pipe .p.done::after { background: var(--primary); }
.pipe .p b { display: block; margin-top: 10px; color: var(--dark); font-size: 15px; }
.pipe .p span { display: block; font-size: 12.5px; color: var(--muted-ink); }
@media (max-width: 760px) { .pipe { grid-template-columns: 1fr 1fr; } .pipe .p::after { display: none; } }

/* Голосовая диктовка */
.dict { border-radius: var(--r-xl); background: linear-gradient(180deg, #f5fbff, #fff); border: 1px solid var(--border); padding: 18px; }
.dict-mic { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(0,171,235,.6); transition: transform .15s; }
.dict-mic:active { transform: scale(.96); }
.dict-mic.on { background: var(--danger); animation: mic-pulse 1.2s infinite; }
.dict-mic svg { width: 34px; height: 34px; }
.transcript { min-height: 84px; padding: 14px 16px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--hairline); font-size: 15px; color: var(--dark); line-height: 1.6; }
.transcript .noise { color: #b3bcd8; text-decoration: line-through; }
.transcript .caret { display: inline-block; width: 2px; height: 1em; background: var(--primary); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.wave { display: flex; align-items: center; gap: 3px; height: 28px; }
.wave i { width: 4px; border-radius: 2px; background: var(--danger); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .4s; } .wave i:nth-child(6) { animation-delay: .5s; } .wave i:nth-child(7) { animation-delay: .6s; }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 26px; } }
.fill-anim { animation: fill-flash 1.2s ease; }
@keyframes fill-flash { 0% { background: #fff3c4; } 100% { background: #fff; } }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid #dce4f1; box-shadow: 0 4px 14px rgba(11,47,124,.1); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--fg); white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 5; }
.chart .tip b { color: var(--dark); }
.chart .tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--fg); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .ln { width: 16px; height: 2px; background: var(--dark); position: relative; }
.legend .ln::after { content: ""; position: absolute; left: 5px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--dark); }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut-legend .it { padding: 10px 0; border-bottom: 1px solid var(--hairline-soft); }
.donut-legend .it:last-child { border-bottom: 0; }
.donut-legend .it .n { font-size: 13px; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.donut-legend .it .v { font-size: 22px; font-weight: 700; color: var(--dark); margin-top: 2px; }
.donut-legend .it .v small { font-size: 13px; color: var(--muted-ink); font-weight: 400; margin-left: 6px; }
.gauge-line { position: relative; height: 14px; border-radius: 7px; background: var(--hairline-soft); overflow: visible; }
.gauge-line > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--primary); }
.gauge-line .mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--dark); }
.gauge-line .mark span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--dark); white-space: nowrap; }

/* Демо-полоса */
.demo-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-ink); margin-top: 26px; }

/* Печать */
@media print {
  body { background: #fff; }
  .app-header, .sidebar, .toasts, .no-print, .scrim, .modal-root .modal-head, .modal-root .modal-foot { display: none !important; }
  .main { padding: 0; }
  .modal-root { position: static; background: none; padding: 0; display: block; }
  .modal { box-shadow: none; max-height: none; width: 100%; overflow: visible; }
  body.printing-doc .main { display: none; }
  .doc { box-shadow: none; border: 0; max-width: none; padding: 0; }
}

/* Вспомогательное */
@media (max-width: 640px) { .hide-sm { display: none; } }
@media (max-width: 1023px) { #matchGrid { grid-template-columns: minmax(0, 1fr) !important; } }
fieldset[disabled] .mic { display: none; }
fieldset[disabled] .input, fieldset[disabled] .select, fieldset[disabled] .textarea { background: #f9fafd; color: var(--fg); }
@media (max-width: 1365px) { .tabs .tab > svg { display: none; } .tabs .tab { padding: 0 12px; } }
html.tv-mode .toasts { display: none; }

/* Узкий телефон: заголовки карточек, строки «название + метка» и метки
   переносятся, а не распирают страницу вбок */
@media (max-width: 480px) {
  .card-head, .row.between { flex-wrap: wrap; }
  .tag, .factor { white-space: normal; }
  .stat-inline > div { min-width: 0; padding: 0 10px; }
}
