/* Пульт воронок — дизайн-язык CRM ИстСайд (crm_frontend/design.md):
   плоская светлая админка, Manrope, один синий акцент, карточки без теней,
   глубина бордером и заливкой. Рецепты повторены один в один, чтобы два
   инструмента команды читались как один продукт. Кода CRM тут нет. */

@font-face { font-family: 'Manrope'; src: url('fonts/Manrope.ttf') format('truetype');
  font-weight: 100 900; font-display: swap; }

:root {
  --app: #FFFFFF; --main: #F6F7F9; --card: #FFFFFF;
  --ink: #11151F; --ink-2: #697086; --ink-3: #A6ABB8;
  --line: #EDEEF2; --line-2: #E3E5EB; --fill: #F5F6F9;
  --blue: #2F6BFF; --blue-d: #1E50E6; --navy: #1C2B4A; --blue-tint: #EAF0FF;
  --black: #15161C;
  --green: #18A957; --green-ink: #0E7C3F; --green-soft: #E4F6EC;
  --red: #E5484D; --red-ink: #C42A2F; --red-soft: #FCEBEC;
  --amber: #E0922F; --amber-ink: #9A5B12; --amber-soft: #FBF0DD;
  --r-xl: 20px; --r-lg: 14px; --r-pill: 999px;
  --ease: cubic-bezier(.22,1,.36,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #E5E7EC; color: var(--ink);
  font-family: 'Manrope', 'Inter', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: 'tnum';
}
::selection { background: var(--blue); color: #fff; }
svg { display: block; flex: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
.num { font-feature-settings: 'tnum'; letter-spacing: -.02em; }

/* ════ КАРКАС ════ */
.app { display: flex; height: 100vh; overflow: hidden; padding: 10px; gap: 10px; }
.side { flex: 0 0 248px; overflow-y: auto; background: var(--app);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 22px 18px; display: flex; flex-direction: column; }
.side::-webkit-scrollbar { width: 0; }
.main { flex: 1; min-width: 0; background: var(--main); display: flex; flex-direction: column;
  overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-xl); }
.main::-webkit-scrollbar { width: 0; }/* Отдельной шапки у пульта нет: вкладок и профиля в ней не будет, а пустая
   белая полоса сверху только съедала бы высоту. Заголовок страницы и есть шапка. */
.content { padding: 30px 32px 48px; }
.chead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 0 2px 26px; flex-wrap: wrap; }
.chead > div:first-child { flex: 1; min-width: 0; }
.chead h2 { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
/* строка подписи не растягивается во всю ширину: иначе она отжимает выбор
   района на свою строку, и шапка страницы распухает вдвое */
.chead .sub { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; max-width: 84ch; }

.logo { display: flex; align-items: center; gap: 11px; padding: 0 6px 24px; }
.logo .mk { width: 32px; height: 32px; border-radius: 9px; background: var(--blue);
  display: grid; place-items: center; color: #fff; }
.logo .nm { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.logo .nm small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); margin-top: 1px; }
.side-sub { padding: 0 6px 18px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.navi { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: .15s;
  width: 100%; text-align: left; }
.navi svg { color: var(--ink-3); }
.navi:hover { background: var(--fill); color: var(--ink); }
.navi.on { background: var(--blue); color: #fff; }
.navi:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47,107,255,.35); }
.seg button:focus-visible, .bp:focus-visible { outline: none;
  box-shadow: 0 0 0 3px rgba(47,107,255,.25); }
.navi.on svg { color: #fff; }
.navi .soon { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); }
.side-foot { margin-top: auto; padding-top: 18px; }
.side-note { font-size: 11.5px; line-height: 1.5; color: var(--ink-2); padding: 12px;
  background: var(--fill); border-radius: 12px; }

/* ════ КАРТОЧКИ И СЕТКА ════ */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: stretch; }
.grid > .card { display: flex; flex-direction: column; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); }
.sp4 { grid-column: span 4; } .sp6 { grid-column: span 6; }
.sp8 { grid-column: span 8; } .sp12 { grid-column: 1 / span 12; }
.pad { padding: 22px 26px; }
.sec-head { display: flex; align-items: center; gap: 11px; }
.sec-head .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--blue-tint);
  display: grid; place-items: center; color: var(--blue); flex: none; }
.sec-head .ic.warn { background: var(--red-soft); color: var(--red); }
.sec-head .ic.gold { background: var(--amber-soft); color: var(--amber-ink); }
.sec-head .t { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.sec-head .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.sec-head .cnt { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--fill); border-radius: var(--r-pill); padding: 8px 14px; white-space: nowrap; }

/* ════ МЕТРИКА-ПОЛОСА ════ */
.statbar { display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; margin-bottom: 20px; }
.stat { min-width: 0; text-align: left; padding: 16px 18px; position: relative; border-radius: 14px; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px;
  width: 1px; background: var(--line); }
.stat .sl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .sv { font-size: 38px; font-weight: 700; letter-spacing: -.04em; margin-top: 14px;
  line-height: 1; font-variant-numeric: tabular-nums; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; }
.stat .sd { margin-top: 13px; min-height: 24px; font-size: 12.5px; color: var(--ink-3); }

/* ════ ЛЕСТНИЦА ПУТИ ════
   Строка: ступень · шкала · число · потеря справа. Шкала считается от первой
   ступени, поэтому обрыв виден глазом, без чтения цифр. */
.lad-row { display: grid; grid-template-columns: 178px 1fr 58px 136px; gap: 16px;
  align-items: center; padding: 0 26px; height: 60px; border-bottom: 1px solid var(--line);
  position: relative; transition: .14s; }
.lad-row:last-child { border-bottom: none; }
.lad-row:hover { background: #FBFBFC; }
.lad-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  opacity: 0; transition: .14s; }
.lad-row.worst::before { background: var(--red); opacity: 1; }
.lad-nm { font-size: 14px; font-weight: 600; }
.lad-nm small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.lad-track { height: 10px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.lad-fill { height: 100%; border-radius: 6px; background: var(--blue); min-width: 6px;
  transition: width .9s var(--ease); }
.lad-row.worst .lad-fill { background: var(--red); }
.lad-n { font-size: 15px; font-weight: 600; text-align: right; }
.lad-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.lad-conv { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
/* Потеря на ступени — спокойный чип: таких строк на экране семь, и если
   красить красным каждую, сигнал «вот тут обрыв» пропадает. Красный остается
   только у худшей ступени (§3.4 design.md CRM: большое красное — одно). */
.lad-drop { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  font-weight: 600; color: var(--ink-2); background: var(--fill);
  border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap; }
.lad-row.worst .lad-drop { color: var(--red-ink); background: var(--red-soft); font-weight: 700; }
.lad-drop.zero { color: var(--ink-2); }

/* Список действий — та же анатомия, что у лестницы, но без правой колонки и с
   ограниченной шкалой: во всю ширину она перетягивает внимание с лестниц, а
   якорь на экране один. */
.act-row { grid-template-columns: 210px minmax(90px, 420px) 64px 1fr; }
.act-who { justify-self: start; }

/* «Где теряем» — единственное большое красное число на экране. Карточка
   растет по содержимому: вытянутая до высоты соседнего списка, она давала
   полэкрана пустоты под заголовком. */
.card.lose { align-self: start; }
.lose-body { display: flex; align-items: center; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.lose-big { display: flex; align-items: baseline; gap: 12px; flex: none; }
.lose-big b { font-size: 46px; font-weight: 700; letter-spacing: -.045em; color: var(--red); line-height: 1; }
.lose-big span { font-size: 14.5px; font-weight: 600; }
.lose-sub { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; max-width: 72ch; }

/* ════ СПИСКИ ════ */
.listcard { overflow: hidden; }
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 26px; border-bottom: 1px solid var(--line); }
.list-count { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  white-space: nowrap; padding-right: 2px; }
.list-count b { color: var(--ink-2); font-weight: 700; }
.trow { display: grid; align-items: center; gap: 16px; padding: 0 26px; height: 58px;
  border-bottom: 1px solid var(--line); transition: .14s; position: relative; }
.trow:last-child { border-bottom: none; }
.trow:hover { background: #FBFBFC; }
.trow.thead { height: 38px; background: #FBFBFC; }
.trow.thead:hover { background: #FBFBFC; }
.th { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); }
.th.r { text-align: right; }
.sch-grid { grid-template-columns: minmax(0, 1fr) 186px 92px 78px 78px 104px; }
.sch-nm { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.sch-nm small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.cell { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.cell.r { text-align: right; font-weight: 600; color: var(--ink); }
.cell.mute { color: var(--ink-2); font-weight: 500; }

/* ════ ЧИПЫ И КОНТРОЛЫ ════ */
.sev { display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px;
  font-weight: 600; line-height: 1; padding: 6px 11px; border-radius: 8px; white-space: nowrap;
  color: var(--ink-2); background: var(--fill); }
.sev.ok { color: var(--green-ink); background: var(--green-soft); }
.sev.wait { color: var(--amber-ink); background: var(--amber-soft); }
.sev.none { color: var(--ink-3); background: var(--fill); }
.bp { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; background: var(--blue); color: #fff;
  font-size: 13.5px; font-weight: 600; transition: .15s; }
.bp:hover { background: var(--blue-d); }
.bp.ghost { background: var(--card); border: 1px solid var(--line-2); color: var(--ink); }
.bp.ghost:hover { background: var(--fill); }
.bp.sm { padding: 9px 14px; font-size: 12.5px; }
.seg { display: inline-flex; gap: 3px; background: var(--fill); border-radius: var(--r-pill); padding: 4px; }
.seg button { padding: 7px 14px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); transition: .15s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--blue); }
.al-in { width: 100%; padding: 11px 14px; border-radius: 11px; background: var(--fill);
  border: 0; box-shadow: inset 0 0 0 1px var(--line-2); font: 500 13.5px 'Manrope', sans-serif;
  color: var(--ink); transition: .15s; }
.al-in::placeholder { color: var(--ink-3); font-weight: 500; }
.al-in:focus { outline: none; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 3px rgba(47,107,255,.1); }
.searchwrap { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 200px;
  max-width: 340px; padding: 0 12px; border-radius: 11px; background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line-2); transition: .15s; }
.searchwrap:focus-within { background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 3px rgba(47,107,255,.1); }
.searchwrap svg { color: var(--ink-3); }
.searchwrap:focus-within svg { color: var(--blue); }
.searchwrap input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: none;
  font: 500 13.5px 'Manrope', sans-serif; color: var(--ink); }
.searchwrap input:focus { outline: none; }
.searchwrap input::placeholder { color: var(--ink-3); font-weight: 500; }
.s-clear { width: 22px; height: 22px; border-radius: 50%; flex: none; display: none;
  place-items: center; color: var(--ink-2); transition: .15s; }
.s-clear svg { width: 12px; height: 12px; color: currentColor; }
.searchwrap.has-val .s-clear { display: grid; }
.s-clear:hover { color: var(--ink); background: #E7E9EE; }
select.al-in { max-width: 230px; cursor: pointer; }

/* ════ ЛЮДИ ════
   Фильтры — те же .al-in и капс-микролейбл CRM. Список — .trow, строка целиком
   кнопка: карточка семьи открывается по клику в любом месте строки. */
.flt { margin-bottom: 20px; }
.flt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px;
  padding: 20px 26px 18px; }
.flt-f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.flt-l { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); }
.flt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.flt-pair .flt-f { gap: 0; }
.flt .al-in, .flt select.al-in { max-width: none; padding: 10px 12px; font-size: 13px; }
.flt-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 62px;
  padding: 12px 26px; border-top: 1px solid var(--line); }
.flt-foot .list-count { margin-left: 0; margin-right: auto; }
.flt-foot .err { font-size: 12.5px; color: var(--red-ink); }
.al-in.sm { padding: 9px 12px; font-size: 13px; }
.flt-name { flex: 1; min-width: 200px; max-width: 420px; }
.flt-help { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 12.5px;
  font-weight: 600; color: var(--amber-ink); background: var(--amber-soft); border-radius: 10px;
  padding: 9px 12px; }
.fc-help { align-self: flex-start; margin-top: 6px; }
.flt-done { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 13px;
  font-weight: 600; color: var(--green-ink); }

.fam-grid { grid-template-columns: minmax(0, 1.4fr) 104px 160px 140px minmax(0, 1fr) 96px 104px; }
.fam-row { width: 100%; text-align: left; cursor: pointer; }
.fam-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--blue); opacity: 0; transition: .14s; }
.fam-row:hover::before { opacity: 1; }
.fam-row:focus-visible { outline: none; background: #FBFBFC; box-shadow: inset 0 0 0 2px rgba(47,107,255,.35); }
.fam-nm { min-width: 0; }
.fam-id { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.fam-nm small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fam-kids { display: flex; gap: 4px; flex-wrap: wrap; }
.gr { font-size: 11.5px; font-weight: 700; color: var(--navy); background: var(--blue-tint);
  border-radius: 7px; padding: 4px 7px; white-space: nowrap; }
.fam-last { text-align: right; }
.fam-last .cell { font-weight: 500; color: var(--ink-2); }

/* ════ СЕГМЕНТЫ ════ */
.seg-grid { grid-template-columns: minmax(0, 1fr) 120px 150px auto; height: auto; min-height: 72px;
  padding-top: 12px; padding-bottom: 12px; }
.seg-grid .fc-tags { margin-top: 7px; }
.seg-n { text-align: right; }
.seg-n b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.seg-n small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.seg-act { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.seg-ready { margin-top: 20px; }
.ready-row { width: 100%; text-align: left; grid-template-columns: minmax(0, 1fr) auto; }
.seg-go { color: var(--ink-3); transition: .15s; }
.ready-row:hover .seg-go { color: var(--blue); transform: translateX(2px); }
.icobtn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 10px; color: var(--ink-2); transition: .15s; white-space: nowrap; }
.icobtn:hover { background: var(--fill); color: var(--ink); }
.icobtn.arm { font-size: 12px; font-weight: 700; color: var(--red-ink); background: var(--red-soft); }
.icobtn:focus-visible, .fc-copy:focus-visible, .ready-row:focus-visible { outline: none;
  box-shadow: 0 0 0 3px rgba(47,107,255,.25); }

/* ════ КАРТОЧКА СЕМЬИ ════
   Большая модалка CRM (design.md §5): единственное место пульта с тенью,
   потому что она плавает над экраном. Слева путь и история, справа факты. */
.mbg { position: fixed; inset: 0; z-index: 50; background: rgba(17,21,31,.38);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px;
  animation: viewFade .18s var(--ease) both; }
.modal { width: 100%; max-width: 1020px; height: min(86vh, 860px); background: var(--card);
  border-radius: 24px; box-shadow: 0 44px 130px -30px rgba(15,19,32,.5);
  display: flex; flex-direction: column; overflow: hidden; animation: riseIn .26s var(--ease) both; }
.m-load { padding: 18px 0; }
.m-head { display: flex; align-items: center; gap: 14px; padding: 22px 26px;
  border-bottom: 1px solid var(--line); }
.fc-av { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); }
.m-ttl { flex: 1; min-width: 0; }
.m-ttl h3 { font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.m-sub { font-size: 13px; color: var(--ink-2); margin-top: 3px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.m-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px;
  overflow-y: auto; }
.m-main { padding: 22px 26px 30px; min-width: 0; }
.m-side { padding: 22px 24px 30px; background: #FBFBFC; border-left: 1px solid var(--line); min-width: 0; }
.m-sec + .m-sec { margin-top: 24px; }
.m-sec > .flt-l { display: block; margin-bottom: 10px; }

.fc-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.fc-path { background: var(--fill); border-radius: 14px; padding: 15px 16px 16px; }
.fc-path-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fc-path-h .flt-l { width: 100%; margin-bottom: 4px; }
.fc-path-h b { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.fc-path-h b.mute { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.fc-path-h small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.fc-steps { display: flex; gap: 4px; margin-top: 12px; }
.fc-st { flex: 1; height: 6px; border-radius: 4px; background: #E3E6EC; }
.fc-st.done { background: #A9C0FF; }
.fc-st.now { background: var(--blue); }
.fc-warn { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--amber-ink); background: var(--amber-soft); border-radius: 12px; padding: 10px 13px;
  margin: -10px 0 24px; }

.fc-hist { position: relative; }
.fc-h { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0;
  position: relative; }
.fc-h::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.fc-h:first-child::before { top: 16px; }
.fc-h:last-child::before { bottom: calc(100% - 16px); }
.fc-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; margin: 4px 0 0 2px;
  box-shadow: inset 0 0 0 2px var(--ink-3); position: relative; }
.fc-h.ours .fc-dot { box-shadow: inset 0 0 0 5px var(--blue); }
.fc-h-t { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.fc-h-t .sev { padding: 3px 7px; font-size: 11px; }
.sev.ours { color: var(--blue-d); background: var(--blue-tint); }
.fc-h-w { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.fc-h time { font-size: 12px; color: var(--ink-3); white-space: nowrap; padding-top: 1px; }

.ab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0;
  font-size: 13px; }
.ab > span:first-child { color: var(--ink-2); }
.ab b { font-weight: 600; text-align: right; }
.fc-copy { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink);
  padding: 4px 8px; margin-right: -8px; border-radius: 8px; transition: .15s; }
.fc-copy svg { color: var(--ink-3); }
.fc-copy:hover { background: var(--fill); }
.fc-copy:hover svg { color: var(--blue); }
.fc-copy.done svg { color: var(--green); }
.fc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.fc-kid-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.fc-kid-h b { font-size: 15px; font-weight: 700; }
.fc-kid-h span { font-size: 12.5px; color: var(--ink-2); }
.fc-claims { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fc-cl { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; }
.fc-cl .sev { padding: 3px 7px; font-size: 11px; }
.fc-psy { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px;
  margin-top: 8px; }
.fc-psy-h { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.fc-psy-h small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.fc-sc { display: grid; grid-template-columns: minmax(0, 1fr) 60px 22px; gap: 8px; align-items: center;
  font-size: 12px; color: var(--ink-2); padding: 3px 0; }
.fc-sc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-sc .lad-track { height: 6px; }
.fc-sc b { text-align: right; color: var(--ink); font-weight: 600; }

/* ════ ПУСТО И ЗАГРУЗКА ════ */
.empty { display: flex; align-items: flex-start; gap: 13px; padding: 24px 26px;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.empty .eic { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-tint);
  color: var(--blue); display: grid; place-items: center; flex: none; }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.shim { position: relative; overflow: hidden; background: var(--fill); border-radius: 8px; }
.shim::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85) 50%, transparent);
  animation: shimmer 1.5s var(--ease) infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-stat { padding: 18px 22px; }
.sk-stat .shim { height: 12px; } .sk-stat .shim.b { height: 34px; width: 52%; margin-top: 16px; border-radius: 10px; }
.sk-line { display: flex; align-items: center; gap: 14px; padding: 15px 26px; border-top: 1px solid var(--line); }
.sk-line:first-child { border-top: 0; }
.sk-line .shim.a { height: 12px; flex: 1; } .sk-line .shim.c { height: 12px; width: 44px; }

/* ════ ВХОД ════
   Единственная темная поверхность пульта — как gate логина в CRM. */
.gate { height: 100vh; display: grid; place-items: center; background: var(--black); padding: 20px; }
.gate-box { width: 100%; max-width: 380px; }
.gate-mk { width: 44px; height: 44px; border-radius: 13px; background: var(--blue);
  display: grid; place-items: center; color: #fff; margin-bottom: 22px; }
.gate h1 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; color: #fff; }
.gate p { font-size: 13.5px; color: #8A90A0; margin-top: 9px; line-height: 1.5; }
.gate form { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.gate .al-in { background: rgba(255,255,255,.06); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); padding: 13px 15px; }
.gate .al-in::placeholder { color: #6B7180; }
.gate .al-in:focus { background: rgba(255,255,255,.1);
  box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 3px rgba(47,107,255,.16); }
.gate .bp { padding: 13px 18px; }
.gate .err { font-size: 12.5px; color: #FF8A8F; min-height: 18px; }

/* ════ ДВИЖЕНИЕ ════ */
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.view-anim { animation: viewFade .2s var(--ease) both; }
.grid > * { animation: riseIn .34s var(--ease) both; }
.grid > *:nth-child(1) { animation-delay: .02s; }
.grid > *:nth-child(2) { animation-delay: .06s; }
.grid > *:nth-child(3) { animation-delay: .10s; }
.grid > *:nth-child(n+4) { animation-delay: .14s; }
@media (prefers-reduced-motion: reduce) {
  .shim::after, .grid > *, .view-anim { animation: none; }
  .lad-fill { transition: none; }
}

/* ════ УЗКИЙ ЭКРАН ════
   Пульт открывают с ноутбука, но раз в неделю его смотрят с телефона на ходу. */
@media (max-width: 1100px) {
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n+1)::before { display: none; }
  .sp4, .sp6, .sp8 { grid-column: 1 / span 12; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; padding: 8px; }
  .side { flex: none; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto;
    padding: 10px 12px; }
  .side .logo { padding: 0 8px 0 0; flex: none; }
  .side .logo .nm small, .side-sub, .side-foot { display: none; }
  .side nav { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { height: 0; }
  .navi { width: auto; white-space: nowrap; padding: 9px 12px; }
  .navi .soon { display: none; }
  .content { padding: 18px 14px 40px; }
  /* на телефоне заголовок, подпись и выбор района идут друг под другом:
     в строку они ужимают текст до колонки в два слова */
  .chead { flex-direction: column; align-items: stretch; gap: 14px; }
  .chead select.al-in { max-width: none; }
  .stat .sv { font-size: 32px; }
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .stat::before { display: none; }
  .lad-row { grid-template-columns: 1fr auto auto; gap: 8px 10px; padding: 11px 14px; height: auto; }
  .lad-row .lad-nm { grid-column: 1; grid-row: 1; }
  .lad-row .lad-n { grid-column: 2; grid-row: 1; }
  .lad-row .lad-right { grid-column: 3; grid-row: 1; }
  .lad-row .lad-track { grid-column: 1 / -1; grid-row: 2; }
  .sch-grid { grid-template-columns: minmax(0, 1fr) 70px 70px; height: auto; padding: 12px 16px; }
  .sch-grid > .hide-sm { display: none; }
  .sch-nm { white-space: normal; }   /* на 390px имя школы лучше перенести, чем обрезать */
  .sch-nm small { display: none; }
  .act-row { grid-template-columns: 1fr auto; }
  .act-row .lad-track { grid-column: 1 / -1; }
  .act-row .act-who { grid-row: 1; grid-column: 1; justify-self: end; }
}

@media (max-width: 1100px) {
  .flt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fam-grid { grid-template-columns: minmax(0, 1.4fr) 96px 150px 90px 96px; }
  .fam-grid > .hide-sm { display: none; }
}
@media (max-width: 860px) {
  .flt-grid { grid-template-columns: 1fr; padding: 16px; }
  .flt-foot { padding: 12px 16px; }
  .fam-grid { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'nm last' 'kids st' 'kids off';
    height: auto; padding: 12px 16px; gap: 8px 12px; }
  .fam-grid.thead { display: none; }
  .fam-grid > .fam-nm { grid-area: nm; }
  .fam-grid > .fam-kids { grid-area: kids; }
  .fam-grid > .fam-st { grid-area: st; justify-self: end; }
  .fam-grid > .fam-off { grid-area: off; justify-self: end; }
  .fam-grid > .fam-off .cell.mute { display: none; }
  .fam-grid > .fam-last { grid-area: last; }
  .seg-grid { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .seg-grid > .hide-sm { display: none; }
  .seg-grid .seg-n { grid-column: 2; grid-row: 1; }
  .seg-grid .seg-act { grid-column: 1 / -1; justify-content: flex-start; }
  .mbg { padding: 0; place-items: stretch; }
  .modal { max-width: none; height: 100%; border-radius: 0; }
  .m-head { padding: 16px; }
  .m-body { grid-template-columns: 1fr; }
  .m-main { padding: 18px 16px 8px; }
  .m-side { border-left: 0; border-top: 1px solid var(--line); padding: 18px 16px 30px; }
  .fc-paths { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .mbg, .modal { animation: none; }
}
