/* ═══════════════════════════════════════════════════════════════════
   Система учёта научных работ - макет
   Дизайн-токены и компоненты взяты из проекта «Чек-листы» (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; }

/* ── 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; } }

/* Загрузка файла */
.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; }

/* 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; } }
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; } }

/* ═══ Научная деятельность: дополнения ═══════════════════════════ */
.kpi.click { cursor: pointer; transition: box-shadow .18s, border-color .18s, transform .18s var(--ease); }
.kpi.click:hover { box-shadow: var(--sh-md); border-color: rgba(0,171,235,.35); transform: translateY(-1px); }
.kpi .value .of { font-size: 18px; font-weight: 400; color: var(--muted-ink); margin-left: 2px; }

/* Виды продукции: квадратик в цвет группы аналитики */
.tag.tg-article, .tag.tg-thesis, .tag.tg-report, .tag.tg-patent, .tag.tg-mono { background: var(--bg-muted); color: var(--dark); font-weight: 700; }
.tag[class*="tg-"]::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.tag.tg-article::before { background: #0098d6; } .tag.tg-thesis::before { background: #2f55c4; } .tag.tg-report::before { background: #d9822b; } .tag.tg-patent::before { background: #8a5cd6; } .tag.tg-mono::before { background: #3a9e57; }
.chip.danger-soft::before { background: var(--danger); }
.chip.sm { font-size: 12.5px; gap: 6px; } .chip.sm::before { width: 6px; height: 6px; }

/* Места в рейтинге */
.place { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--bg-muted); color: var(--dark); font-weight: 700; font-size: 13px; }
tr.me td { background: #f2faff; }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.rank-big { font-size: 38px; font-weight: 700; color: var(--dark); line-height: 1.1; }

/* Мини-график в таблице */
.spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 24px; vertical-align: middle; }
.spark i { display: block; width: 7px; border-radius: 2px 2px 0 0; background: #b9d9ee; }

/* Горизонтальные полосы */
.hbar-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 64px; }
.hb-l { line-height: 1.3; overflow-wrap: anywhere; }
.hbar-row .v small { display: block; font-size: 11px; color: var(--muted-ink); font-weight: 400; }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; }

/* Ошибки полей */
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(219,56,51,.1); }
.ferr { font-size: 12.5px; color: var(--danger); }

/* Меню уведомлений */
.menu .mi.note { align-items: flex-start; }
.menu .mi.note b { display: block; font-size: 14px; }
.menu .mi.note.read { opacity: .62; }
.menu .mi.note .when { margin-top: 3px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }
.menu .mh.row { display: flex; }

/* Блок «Требует вашего ответа» */
.ask { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--hairline-soft); }
.ask:last-child { border-bottom: 0; padding-bottom: 4px; }
.ask:first-child { padding-top: 4px; }
.ask .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-accent); color: var(--primary); flex-shrink: 0; }
.ask .ic.violet { background: #efebfb; color: var(--purple); } .ask .ic.amber { background: #fbf3dc; color: var(--warning-ink); } .ask .ic.red { background: #fdecec; color: var(--danger); } .ask .ic.green { background: #e6f5ea; color: var(--success-ink); }
.ask .body { flex: 1; min-width: 0; }
.ask .kind { font-size: 12px; color: var(--muted-ink); }
.ask .ttl { color: var(--dark); font-weight: 700; font-size: 15px; line-height: 1.35; margin-top: 2px; }
.ask .meta { font-size: 13px; color: var(--fg); margin-top: 3px; }
.ask .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ask.warn .ttl { color: var(--danger); }

/* Календарь */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head h2 { font-size: 20px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal .day { min-height: 92px; border: 1px solid var(--hairline-soft); border-radius: 10px; padding: 6px; background: #fff; display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.cal .day:hover { border-color: rgba(0,171,235,.4); }
.cal .day.out { background: var(--bg); opacity: .55; }
.cal .day.today { border-color: var(--primary); box-shadow: var(--glow); }
.cal .day .n { font-size: 12px; font-weight: 700; color: var(--dark); }
.cal .ev { font-size: 11px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; background: var(--bg-accent); color: #0b5d86; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.amber { background: #fbf3dc; color: var(--warning-ink); } .cal .ev.green { background: #e6f5ea; color: var(--success-ink); } .cal .ev.violet { background: #efebfb; color: var(--purple); }
.cal .more { font-size: 11px; color: var(--muted-ink); }
@media (max-width: 760px) { .cal .day { min-height: 58px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } .cal .more { display: none; } }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--fg); margin-top: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--bg-accent); border: 1px solid #b7def3; }
.cal-legend i.amber { background: #fbf3dc; border-color: #ecd690; } .cal-legend i.green { background: #e6f5ea; border-color: #b9e0c3; } .cal-legend i.violet { background: #efebfb; border-color: #cfc3f2; }
.date-box { width: 50px; height: 54px; border-radius: 10px; background: var(--bg-muted); text-align: center; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; }
.date-box b { font-size: 20px; line-height: 1; color: var(--dark); }
.date-box small { font-size: 11px; color: var(--muted-ink); margin-top: 3px; }
.date-box.violet { background: #efebfb; } .date-box.green { background: #e6f5ea; } .date-box.amber { background: #fbf3dc; }

/* Авторы в форме */
.authors-ed { display: flex; flex-direction: column; gap: 8px; }
.author-row { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.author-row .no { font-size: 13px; color: var(--muted-ink); text-align: center; font-weight: 700; }
.author-row .input, .author-row .select { height: 42px; }
@media (max-width: 640px) { .author-row { grid-template-columns: 22px minmax(0, 1fr) 36px; } .author-row .org { grid-column: 2 / 3; } }
.doi-hint { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.doi-hint button { border: 1px dashed var(--border-strong); background: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; color: var(--fg); }
.doi-hint button:hover { border-color: var(--primary); color: var(--primary); }
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.type-pick button { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: #fff; color: var(--fg); font-size: 13px; transition: border-color .15s, background .15s; }
.type-pick button:hover { border-color: var(--primary); background: var(--bg-accent-soft); }
.type-pick button b { color: var(--dark); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-toggle { width: 42px; height: 46px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: #fff; color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.icon-toggle.on { color: #e0a800; border-color: #f1d98a; background: #fffbea; }
.icon-toggle.on svg { fill: currentColor; }

/* Строка таблицы - ссылка */
.t td a.dark { color: var(--dark); font-weight: 700; }
.t td a.dark:hover { color: var(--primary); }
.t td .lead { color: var(--dark); font-weight: 700; }
.t .num-l { font-weight: 700; color: var(--dark); }
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--primary); }
.t th.sort.on { color: var(--primary); }
.t th .arr { display: inline-block; width: 10px; }

/* План / факт */
.pf-bar { position: relative; height: 8px; border-radius: 4px; background: var(--hairline-soft); min-width: 90px; }
.pf-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--primary); }
.pf-bar > i.lag { background: var(--warning-fill); } .pf-bar > i.done { background: var(--success); }
.pf-bar .exp { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--dark); opacity: .5; }

/* Повестка */
.agenda-item { border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 14px 16px; background: #fff; }
.agenda-item + .agenda-item { margin-top: 10px; }
.agenda-item .no { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-muted); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--dark); flex-shrink: 0; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; }

/* Документ */
.doc p { margin: 8px 0; }
.doc ol { margin: 8px 0; padding-left: 22px; }

/* Сообщения руководителя */
.signal { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--bg-accent); color: #0b5d86; }
.signal.warning { background: #fdecec; color: #a3302c; }
.signal + .signal { margin-top: 10px; }
.signal b { color: inherit; }

.sec-title { font-size: 20px; margin: 30px 0 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-title .sub { font-size: 13px; font-weight: 400; color: var(--muted-ink); }
.split { display: flex; gap: 0; flex-wrap: wrap; }
.mini-stat { padding: 2px 0; }
.mini-stat .v { font-size: 26px; font-weight: 700; color: var(--dark); line-height: 1.15; }
.mini-stat .l { font-size: 13px; color: var(--muted-ink); }
.comp-group h4 { font-size: 13px; color: var(--muted-ink); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.comp-group + .comp-group { margin-top: 18px; }
.portrait { width: 92px; height: 92px; border-radius: 50%; background: var(--bg-accent); color: var(--primary); display: grid; place-items: center; font-size: 30px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 18px; }
.nowrap-cell { white-space: nowrap; }
@media (max-width: 640px) { .hide-sm { display: none; } .page-head .actions { width: 100%; } }
.grow { flex: 1; min-width: 0; }
.steps-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--fg); }
.steps-list b { color: var(--dark); }
.t tbody tr.sent td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.t tbody tr.sent { background: #f3faf5; }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--hairline); }
.dots i.on { background: var(--success); }
.dots i.next { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }
.timeline { display: flex; flex-direction: column; }
.timeline .st { display: flex; gap: 12px; padding: 8px 0; align-items: center; }
.timeline .st .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--hairline-soft); color: var(--muted); flex-shrink: 0; }
.timeline .st.on .mark { background: #e6f5ea; color: var(--success-ink); }
.timeline .st.next .mark { background: var(--bg-accent); color: var(--primary); }
.prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.prog .pf-bar { flex: 1; }
.person-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.person-head .info { flex: 1; min-width: 240px; }
.cal .day { cursor: pointer; }
.cal .ev { cursor: pointer; border: 0; text-align: left; width: 100%; font-family: inherit; display: block; }

.t td .nm { white-space: nowrap; }
.t td.place-c { white-space: nowrap; }
.t.dense th, .t.dense td { padding-left: 8px; padding-right: 8px; }
.t.dense th { letter-spacing: .03em; }
.t.dense th:first-child, .t.dense td:first-child { padding-left: 14px; }

/* Узкий телефон: заголовки карточек, строки «название + метка» и метки
   переносятся, а не распирают страницу вбок */
@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; }
}
