/* CSS админки v7 одним файлом: каркас, главная, платформа, доступы, обучение, потоки, отчёты, остаточные знания. Подключается после base.css. */
/* Каркас и компоненты админки v7. Цвета только через токены из tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 1.5;
  background: var(--background); color: var(--foreground);
}
h1, h2, h3, p { margin: 0; }
button, select, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* ---------- Каркас ---------- */
.app { display: flex; min-height: 100vh; }
/* Фон сайдбара тянется на всю высоту страницы (колонка растягивается), содержимое липнет к экрану. */
.sidebar { width: 256px; flex: none; background: var(--sidebar); color: var(--sidebar-foreground); border-right: 1px solid var(--border); }
.sidebar-inner { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.brand-mark { position: relative; width: 28px; height: 28px; flex: none; display: inline-block; }
.brand-mark img { width: 28px; height: 28px; display: block; }
.brand-mark .bm-dark { display: none; }
:root[data-theme="dark"] .brand-mark .bm-light { display: none; }
:root[data-theme="dark"] .brand-mark .bm-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-mark .bm-light { display: none; }
  :root:not([data-theme="light"]) .brand-mark .bm-dark { display: block; }
}
.brand-name { font-size: 16px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-bottom { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.nav-group-title { padding: 4px 12px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.nav-group a { margin-left: 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  font-weight: 500; color: var(--muted-foreground);
}
.nav a:hover { background: var(--accent); color: var(--foreground); }
.nav a[aria-current="page"] { background: var(--primary-tint); color: var(--foreground); }
.nav a[aria-current="page"] .icon { color: var(--primary); }
.nav .icon { width: 18px; height: 18px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.sidebar-collapse { display: none; padding: 8px 12px 12px; justify-content: flex-end; }
.role-switch { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.role-switch label { font-size: 12px; color: var(--muted-foreground); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--muted); color: var(--muted-foreground);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none;
}
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; height: 64px; background: var(--background);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.topbar .brand-inline { display: none; align-items: center; gap: 8px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted-foreground); min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.crumbs a:hover { color: var(--foreground); }
.crumbs b { color: var(--foreground); font-weight: 500; white-space: nowrap; }
.crumbs .icon { width: 14px; height: 14px; }
.spacer { flex: 1; }
.org-btn { max-width: 260px; }
.org-name { overflow: hidden; text-overflow: ellipsis; }
.user-btn { padding: 0 4px; }
.viewer-badge { display: none; }
[data-role="viewer"] .viewer-badge { display: inline-flex; }

.page { width: 100%; max-width: 80rem; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 40px; }
@media (min-width: 640px) { .page { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) { .page { padding-left: 32px; padding-right: 32px; } }

.overlay { display: none; }
@media (max-width: 1023px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; height: 100vh; transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: var(--shadow-lg); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .overlay { display: block; position: fixed; inset: 0; z-index: 50; background: var(--overlay); }
  .topbar .brand-inline { display: flex; }
  .crumbs { display: none; }
}
/* Свёрнутый сайдбар: только десктоп, на узком экране остаётся выезжающая панель с подписями. */
@media (min-width: 1024px) {
  .sidebar { transition: width .2s ease-out; }
  .topbar .menu-btn { display: none; }
  .sidebar-collapse { display: flex; }
  html[data-sidebar="collapsed"] .sidebar-collapse { justify-content: center; padding: 8px 0 12px; }
  html[data-sidebar="collapsed"] .sidebar { width: 64px; overflow: hidden; }
  html[data-sidebar="collapsed"] .brand { justify-content: center; padding: 0; }
  html[data-sidebar="collapsed"] .brand-name,
  html[data-sidebar="collapsed"] .nav-group-title,
  html[data-sidebar="collapsed"] .nav .nav-disabled > .icon:last-child,
  html[data-sidebar="collapsed"] .sidebar-foot { display: none; }
  /* Подпись остаётся в DOM как доступное имя ссылки, глазу не видна. */
  html[data-sidebar="collapsed"] .nav a > span,
  html[data-sidebar="collapsed"] .nav .nav-disabled > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  html[data-sidebar="collapsed"] .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
  html[data-sidebar="collapsed"] .nav-group a,
  html[data-sidebar="collapsed"] .nav-group .nav-disabled { margin-left: 0; width: 40px; }
  html[data-sidebar="collapsed"] .nav a,
  html[data-sidebar="collapsed"] .nav .nav-disabled { width: 40px; height: 40px; padding: 0; justify-content: center; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
@media (max-width: 639px) {
  .org-name, .org-btn > .icon:last-child, .topbar .brand-name { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .inbox-label { display: none; }
  .inbox-btn { padding: 0 10px; }
  .topbar .org-btn, .topbar .user-btn { padding: 0 10px; }
  .topbar .user-btn { padding: 0 4px; }
  .topbar .menu-btn { flex-shrink: 0; }
  .topbar:has(.viewer-badge) .brand-inline { display: none; }
}

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { background: var(--destructive-hover); }
.btn-outline { border-color: var(--input); background: var(--background); }
.btn-outline:hover, .btn-ghost:hover { background: var(--accent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 36px; padding: 0; }
.select-wrap { position: relative; display: block; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 36px; padding: 0 32px 0 12px;
  border: 1px solid var(--input); border-radius: 8px; background: var(--background); font-size: 14px;
  cursor: pointer; text-overflow: ellipsis;
}
.select-wrap select:hover { background: var(--accent); }
.select-wrap select:focus-visible { border-color: var(--primary); }
.select-wrap .icon { position: absolute; right: 10px; top: 10px; pointer-events: none; color: var(--muted-foreground); }
.select-wrap.compact select { height: 32px; font-size: 13px; padding-right: 28px; }
.select-wrap.compact .icon { top: 8px; right: 8px; }
.segmented { display: inline-flex; padding: 3px; background: var(--muted); border-radius: 8px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--background); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }

/* ---------- Карточки, бейджи ---------- */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius-card); }
.card-pad { padding: 24px; }
.card-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }
/* base.css грузится раньше admin.css: без этой строки .card-head (колонка) перебивает .card-head-row из base.css. */
.card-head.card-head-row { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.2; }
.card-desc { font-size: 14px; color: var(--muted-foreground); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.5;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-done { background: var(--info-tint); color: var(--info-ink); }
.badge-ok { background: var(--success-tint); color: var(--success-ink); }
.badge-late { background: var(--warning-tint); color: var(--warning-ink); }
.badge-risk { background: var(--destructive-tint); color: var(--destructive-ink); }
.badge-none { background: var(--secondary); color: var(--muted-foreground); border-color: var(--border); }
.badge-view::before { display: none; }
.badge-view { background: var(--secondary); color: var(--secondary-foreground); border-color: var(--border); gap: 4px; }
.badge-view .icon { width: 12px; height: 12px; }
.badge-archived { background: var(--muted); color: var(--muted-foreground); border-color: var(--border); }
.badge-archived::before { background: transparent; border: 1.5px solid currentColor; }

/* ---------- Заглушки разделов ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 4px; }
.h1 { font-size: 20px; font-weight: 600; line-height: 1.2; }
.lead { color: var(--muted-foreground); margin-top: 8px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted-foreground); }
.stub { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.stub-ico { color: var(--muted-foreground); display: inline-grid; place-items: center; }
.stub ul { margin: 0; padding-left: 18px; color: var(--muted-foreground); display: grid; gap: 4px; }
.alert, .notice { display: flex; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.alert { gap: 10px; padding: 12px 16px; }
.alert .icon { margin-top: 2px; color: var(--muted-foreground); }
.alert-warn .icon { color: var(--warning-ink); }
.link-action { color: var(--foreground); font-weight: 500; text-decoration: none; }
.link-action:hover { text-decoration: underline; }
.nav .nav-disabled { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 500; text-align: left; color: var(--muted-foreground); opacity: .7; cursor: help; }
.nav .nav-disabled:hover { background: var(--accent); }
.nav-group .nav-disabled { margin-left: 8px; width: calc(100% - 8px); }
.nav .nav-disabled > .icon:last-child { margin-left: auto; width: 14px; height: 14px; }

/* Подсказка у закрытого пункта меню */
.nav-pop { position: fixed; z-index: 50; width: 288px; max-width: calc(100vw - 16px); padding: 16px; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.nav-pop p { color: var(--muted-foreground); }
.nav-pop b { color: var(--foreground); font-weight: 600; }

/* ---------- Движение: спокойно, только переходы ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Плашка: подтверждение и следующий шаг ---------- */
.notice { gap: 16px; align-items: flex-start; padding: 16px 20px; color: var(--card-foreground); }
.notice-sm { padding: 16px; gap: 12px; }
.notice-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.notice-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.notice-text { font-size: 14px; color: var(--muted-foreground); max-width: 60ch; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Экран «Участник»: вместо админки одна плашка-подсказка */
.learner-page { min-height: 100vh; justify-content: center; align-items: center; }
.learner-box { display: flex; flex-direction: column; gap: 16px; max-width: 36rem; width: 100%; }

/* Главная (D-V7-5): три блока по порядку: когорты, внимание, модули. Расстояние между блоками задаёт
   только .home-dash gap, у блоков своих отступов, рамок и подложек нет. */
.home-dash { display: flex; flex-direction: column; gap: 48px; }
.home-dash > .notice { max-width: 720px; }

.home-filter { display: flex; align-items: center; gap: 12px; margin-bottom: -16px; }
.home-filter label { font-size: 13px; color: var(--muted-foreground); }
.home-filter .select-wrap { min-width: 220px; }
.home-filter [hidden] { display: none; }

/* Показатели: три плитки, на узком экране одна колонка */
.kpis { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 32px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { border-radius: var(--radius-card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.stat-value { font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 0.6em; font-weight: 500; color: var(--muted-foreground); margin-left: 2px; }
.stat-sub { font-size: 13px; color: var(--muted-foreground); line-height: 1.4; }

/* Главный блок */
.home-attn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.home-h2 { font-size: 16px; font-weight: 600; line-height: 1.2; }
.home-sub { font-size: 14px; color: var(--muted-foreground); margin-top: 4px; max-width: 80ch; }
.home-attn .home-sub { margin-bottom: 16px; }
.attn-count { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted-foreground); }
.attn-count .icon { width: 16px; height: 16px; }
.attn-count.has { color: var(--destructive-ink); }
.attn-count[hidden] { display: none; }
.home-quiet { color: var(--muted-foreground); padding: 16px 0; }
.days small { display: block; font-weight: 400; font-size: 12px; color: var(--muted-foreground); }
.days { font-weight: 600; }
.next-step { font-size: 14px; }

/* Ритм заголовков блоков главной: расстояние до содержимого задаёт заголовок, а не блок. .home-h3 нужен заголовку графика в «Отчётах». */
.home-block > .home-h2, .home-attn-head { margin-bottom: 12px; }
.home-attn-head .home-h2 { margin: 0; }
.home-h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.home-block .home-sub { margin-bottom: 16px; }
.chart { width: 100%; min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-sans); font-size: 12px; fill: var(--muted-foreground); }
.chart .val, .chart .seg-val { fill: var(--foreground); font-weight: 600; font-size: 12px; }
.chart .seg-val { fill: var(--background); }
.chart .seg-name { font-weight: 500; }
.chart .seg-m1-t { fill: var(--module-1); } .chart .seg-m2-t { fill: var(--module-2); }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.seg-m1 { fill: var(--module-1); } .seg-m2 { fill: var(--module-2); }
.chart-note { font-size: 12px; color: var(--muted-foreground); margin-top: 8px; }

.days, .home-dash .table .num { white-space: nowrap; }

/* Воронка */
/* Модули сеткой: при развёрнутом меню на 1024 px влезают две колонки, при свёрнутом и на широком экране три.
   min(100%, …) не даёт колонке вылезти за экран телефона. */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px 32px; align-items: start; }
.fmod-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.fmod-title i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.fmod-title span { font-weight: 400; color: var(--muted-foreground); }
.frow { display: grid; grid-template-columns: minmax(96px, 170px) 1fr auto; gap: 12px; align-items: center; padding: 4px 0; font-size: 13px; }
.bar { height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.bar b { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.frow .v { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.frow .v em { font-style: normal; color: var(--muted-foreground); }
.fnote { padding: 8px 0; color: var(--muted-foreground); font-size: 13px; }
@media (max-width: 479px) { .frow { grid-template-columns: 1fr auto; } .frow .bar { grid-column: 1 / -1; order: 3; } }
.fmod-pick { cursor: pointer; border-radius: 8px; padding: 8px; margin: -8px; border: 1px solid transparent; transition: background-color .2s, border-color .2s; }
.fmod-pick:hover { background: var(--accent); }
.fmod-pick:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.fmod-pick.is-picked { border-color: var(--border); background: var(--primary-tint); }
.fmod-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.fmod-chip-row[hidden] { display: none; }
.fmod-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--secondary); color: var(--foreground); font-size: 13px; font-weight: 500; cursor: pointer; }
.fmod-chip .icon { width: 14px; height: 14px; }
.fmod-chip:hover { background: var(--accent); }
.fmod-chip-note { font-size: 12px; color: var(--muted-foreground); }

/* Статусы: число внутри сегмента, имя в подписях ниже */
.cohort-bar { display: flex; gap: 2px; height: 28px; border-radius: 6px; overflow: hidden; margin: 24px 0 12px; background: var(--muted); }
.cohort-bar span { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-done { background: var(--info-tint); color: var(--info-ink); }
.c-ok { background: var(--success-tint); color: var(--success-ink); }
.c-late { background: var(--warning-tint); color: var(--warning-ink); }
.c-risk { background: var(--destructive-tint); color: var(--destructive-ink); }
.c-none { background: var(--secondary); color: var(--muted-foreground); }
.cohort-legend { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 12px; color: var(--muted-foreground); margin: 0; }
.cohort-item { white-space: nowrap; }

/* Плашка-подсказка «Как читать показатели»: свёрнута */
details.help { border-top: 1px solid var(--border); padding-top: 8px; }
details.help summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 8px 0; }
details.help summary::-webkit-details-marker { display: none; }
details.help .help-title { font-size: 14px; font-weight: 500; flex: 1; }
details.help summary .icon { color: var(--muted-foreground); transition: transform .2s; }
details.help[open] summary .icon { transform: rotate(180deg); }
.help-body { padding: 8px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 24px; }
@media (min-width: 720px) { .help-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .help-body { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.help-body dt { font-weight: 600; margin-bottom: 2px; }
.help-body dd { margin: 0; color: var(--muted-foreground); font-size: 13px; }

/* Таблица внутри главной: плотнее, без горизонтального скролла */
.home-dash .table { min-width: 0; }
.home-dash .table thead th, .home-dash .table tbody td { padding-left: 6px; padding-right: 6px; }
.home-dash .table-scroll { max-height: 520px; }
.home-dash .table td:first-child { max-width: 220px; }
.home-dash .person > div { min-width: 0; }

/* Главная платформы (Р-12) и наблюдателя платформы. Только токены, без теней и без рамок у блоков: группы держит воздух. */
.home-dash.pstack { gap: 56px; }
.psection { display: flex; flex-direction: column; gap: 24px; }
.psection-head { display: flex; flex-direction: column; gap: 4px; }
.psection-title { font-size: 16px; font-weight: 600; line-height: 1.25; margin: 0; }
.psection-desc { margin: 0; font-size: 14px; color: var(--muted-foreground); max-width: 64ch; }
.muted { color: var(--muted-foreground); }

/* Вариант A: список того, что требует внимания */
.pprob { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.pprob-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; }
.pprob-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 4px; }
.pprob-main p { margin: 0; font-size: 16px; line-height: 1.45; max-width: 64ch; }
.pprob-main small { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: 13px; }
.pprob-side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; justify-content: flex-end; padding-top: 2px; }
.pprob-link { white-space: nowrap; font-size: 14px; }
@media (max-width: 559px) { .pprob-row { grid-template-columns: minmax(0, 1fr); } .pprob-side { justify-content: flex-start; } }

/* Цифры платформы: крупно, без карточек, вторичный блок */
.pfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; margin: 0; }
@media (min-width: 720px) { .pfacts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pfacts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pfact { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.pfact dt { order: 2; font-size: 13px; color: var(--muted-foreground); line-height: 1.35; }
.pfact dd { order: 1; margin: 0; font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pfact-sub { order: 3; font-size: 12px; color: var(--muted-foreground); line-height: 1.4; }
.pquick { display: flex; flex-wrap: wrap; gap: 8px; }

/* Вариант B: клиенты */
.psummary { margin: 0; font-size: 14px; color: var(--muted-foreground); }
.ptable { font-size: 15px; }
.ptable td small.cell-sub { display: block; color: var(--muted-foreground); font-size: 12px; }
.ptable tbody tr:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.ptable tbody td { padding-top: 16px; padding-bottom: 16px; }
.ptable .th-sort { white-space: normal; }
.ptable-wrap { border: 0; max-height: none; }
.ptable-wrap .table thead th { background: var(--background); }
.ptable .risk-high { color: var(--destructive-ink); font-weight: 500; }

/* Наблюдатель: поиск */
.psearch { display: flex; flex-direction: column; gap: 12px; }
.psearch-label { font-size: 16px; font-weight: 600; }
.psearch-box { position: relative; }
.psearch-box > .icon { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; color: var(--muted-foreground); pointer-events: none; }
.psearch-input { height: 50px; font-size: 16px; padding-left: 44px; }
.psearch-out { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.psearch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.psearch-row { display: flex; align-items: center; gap: 12px; }
.psearch-row .avatar { flex: none; width: 32px; height: 32px; }
.psearch-main { min-width: 0; flex: 1; }
.psearch-main a { font-weight: 500; display: block; }
.psearch-main a:hover { text-decoration: underline; }
.psearch-main small { display: block; color: var(--muted-foreground); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psearch-more { margin: 4px 0 0; font-size: 12px; color: var(--muted-foreground); }

/* Раздел «Доступы»: сотрудники, карточка сотрудника, организации, учётные записи. Только токены, без градиентов и теней. */
.acc-muted { color: var(--muted-foreground); }
.acc-stack { display: flex; flex-direction: column; gap: 32px; }
.acc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 1100px) { .acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.acc-note { font-size: 12px; color: var(--muted-foreground); max-width: 80ch; }
.acc-inline { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.acc-wrap { white-space: normal; }

/* Роли: подпись текстом, без плашек */
.acc-role { font-size: 14px; }
.acc-role-admin { font-weight: 600; color: var(--foreground); }
.acc-role-observer { color: var(--foreground); }
.acc-role-member { color: var(--muted-foreground); }

/* Карточка сотрудника: шапка и цифры, группировка воздухом */
.acc-hero { display: flex; flex-direction: column; gap: 16px; }
.acc-hero-line { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted-foreground); font-size: 14px; }
.acc-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
@media (min-width: 720px) { .acc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .acc-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.acc-kpi { padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.acc-kpi-label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); line-height: 1.3; }
.acc-kpi-value { font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.acc-kpi-value small { font-size: 16px; font-weight: 500; color: var(--muted-foreground); margin-left: 2px; }
.acc-kpi-sub { font-size: 12px; color: var(--muted-foreground); line-height: 1.4; }
.acc-kpi.is-bad .acc-kpi-value, .acc-kpi.is-bad .acc-kpi-sub { color: var(--destructive-ink); }
.acc-kpi.is-warn .acc-kpi-value, .acc-kpi.is-warn .acc-kpi-sub { color: var(--warning-ink); }
.acc-kpi .btn { margin-left: -8px; }

/* Прогресс по модулям */
.acc-mod + .acc-mod { margin-top: 20px; }
.acc-mod-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.acc-mod-title { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.acc-mod-title i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.acc-mod-val { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted-foreground); }
.acc-bar { height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.acc-bar b { display: block; height: 100%; border-radius: 999px; }
.acc-closed { color: var(--muted-foreground); font-size: 14px; }

/* Хронология */
.acc-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.acc-timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; font-size: 14px; }
.acc-timeline time { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.acc-timeline small { display: block; color: var(--muted-foreground); font-size: 12px; }

/* Организация: цифры */
.acc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
@media (min-width: 720px) { .acc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.acc-stats .acc-kpi-value { font-size: 20px; }

/* Диалоги: членства, импорт */
.acc-mem { width: 100%; border-collapse: collapse; font-size: 14px; }
.acc-mem th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-foreground); padding: 4px 8px 6px 0; }
.acc-mem td { padding: 6px 8px 6px 0; vertical-align: middle; }
.acc-mem .select-wrap { min-width: 150px; }
.acc-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.acc-add-row .field { flex: 1 1 160px; }
.acc-drop { position: relative; border: 1px dashed var(--input); border-radius: var(--radius); padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; color: var(--muted-foreground); transition: background-color .2s, border-color .2s; }
.acc-drop:hover, .acc-drop.is-over, .acc-drop:focus-within { background: var(--primary-tint); border-color: var(--primary); }
.acc-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.acc-drop b { color: var(--foreground); font-weight: 500; }
.acc-result { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.acc-result .acc-kpi-value { font-size: 20px; }
.acc-code { font-family: var(--font-mono); font-size: 12px; background: var(--muted); border-radius: 6px; padding: 2px 6px; }
.acc-errors { max-height: 240px; }
.acc-count { font-size: 12px; color: var(--muted-foreground); text-align: right; }
.acc-orgs-cell { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.acc-more { font-size: 12px; color: var(--muted-foreground); }

/* Раздел «Обучение»: курсы, страница курса, библиотека, редактор.
   Только токены, без теней и градиентов. Группы отделяет воздух, а не рамки. */

/* ---------- Таблицы: ячейка названия, пометка изменений ---------- */
.lt-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lt-title a { font-weight: 500; }
.lt-title a:hover { text-decoration: underline; }
.lt-title small, .lt-sub { display: block; color: var(--muted-foreground); font-size: 12px; font-weight: 400; }
.lt-dirty { color: var(--warning-ink); }
.lt-type { display: flex; flex-direction: column; gap: 2px; }
.lt-muted { color: var(--muted-foreground); }
.lt-note { margin-bottom: 24px; }

/* ---------- Страница курса ---------- */
.lc-info { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.lc-info dt { color: var(--muted-foreground); font-size: 12px; }
.lc-info dd { margin: 4px 0 0; font-weight: 500; }
.lc-info a { color: var(--action); }
.lc-about { display: flex; flex-direction: column; gap: 24px; }
.lc-section-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.lc-section-head h2 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.lc-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.lc-lead { color: var(--muted-foreground); font-size: 14px; margin-top: 4px; }
.lc-modules { display: flex; flex-direction: column; gap: 32px; }
.lc-module-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.lc-module-title { flex: 1; min-width: 0; }
.lc-module-title h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.lc-hint { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.lc-items { list-style: none; margin: 0; padding: 0; }
.lc-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.lc-item:last-child { border-bottom: 0; }
.lc-item.is-drag { opacity: .5; }
.lc-item.is-over { box-shadow: inset 0 2px 0 var(--primary); }
.lc-handle { cursor: grab; color: var(--muted-foreground); display: grid; place-items: center; width: 24px; height: 28px; background: transparent; border: 0; padding: 0; flex: none; }
.lc-handle:disabled { cursor: default; opacity: .4; }
.lc-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-item-title { font-weight: 500; overflow-wrap: anywhere; }
.lc-item-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-empty-mod { padding: 16px 0; color: var(--muted-foreground); font-size: 14px; }
@media (max-width: 639px) { .lc-item { flex-wrap: wrap; } .lc-item-badges { order: 3; flex-basis: 100%; padding-left: 36px; } }

/* ---------- Диалоги: списки, импорт, экспорт ---------- */
.lx-list { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.lx-list-plain { list-style: none; margin: 8px 0 0; padding: 0; }
.lx-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.lx-row:last-child { border-bottom: 0; }
.lx-row:hover { background: var(--muted); }
.lx-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lx-row-main small { color: var(--muted-foreground); font-size: 12px; }
.lx-row .select-wrap { width: 170px; flex: none; }
.lx-row-wrap { flex-wrap: wrap; cursor: default; }
.lx-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.lx-bar .dt-search { flex: 1 1 200px; max-width: none; }
.lx-banner { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-banner .input { flex: 1 1 200px; }
.li-drop { border: 1px dashed var(--input); border-radius: var(--radius); padding: 32px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 16px; }
.li-drop.is-over { border-color: var(--primary); background: var(--primary-tint); }
.li-drop p { color: var(--muted-foreground); }
.li-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }

/* ---------- Редактор: шапка, плашка, разделы ---------- */
.le-save { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.le-save[data-state="saved"] { color: var(--success-ink); }
.le-save[data-state="unsaved"] { color: var(--warning-ink); }
.le-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.le-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--muted); font-size: 14px; }
.le-banner .spacer { flex: 1; }
.le-stack { display: flex; flex-direction: column; gap: 32px; }
.le-sec { display: flex; flex-direction: column; gap: 16px; }
.le-sec + .le-sec { padding-top: 32px; border-top: 1px solid var(--border); }
.le-sec-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.le-tabpanel { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; }
.le-list { display: flex; flex-direction: column; }
.le-item { padding: 24px 0; border-top: 1px solid var(--border); display: grid; gap: 16px; }
.le-item:first-child { border-top: 0; padding-top: 0; }
.le-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.le-item-head .select-wrap { flex: 1 1 180px; max-width: 260px; }
.le-item-head .spacer { flex: 1; }
.le-num { min-width: 24px; color: var(--muted-foreground); font-size: 14px; font-weight: 600; flex: none; }
.le-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.le-sum { font-size: 14px; color: var(--muted-foreground); }
.le-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 12px; }
@media (max-width: 639px) { .le-row3 { grid-template-columns: 1fr 1fr; } }
.le-ro { display: grid; gap: 16px; }
.le-ro-note { font-size: 14px; color: var(--muted-foreground); }

/* ---------- Пробное прохождение ---------- */
.le-chat { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--muted); border-radius: var(--radius); max-height: 420px; overflow: auto; }
.le-msg { max-width: 85%; padding: 12px; border-radius: 10px; background: var(--card); overflow-wrap: anywhere; }
.le-msg-me { align-self: flex-end; background: var(--primary-tint); }
.le-msg small { display: block; color: var(--muted-foreground); font-size: 12px; margin-bottom: 2px; }
.le-send { display: flex; gap: 8px; }
.le-send .input { flex: 1; }
.le-result { display: grid; gap: 16px; }
.le-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.le-score b { font-size: 24px; font-weight: 600; }

/* ---------- Блочный редактор ---------- */
.lb-wrap { display: flex; flex-direction: column; gap: 8px; }
.lb { display: flex; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 8px; align-items: flex-start; }
.lb:hover, .lb:focus-within { border-color: var(--border); }
.lb-tools { display: flex; flex-direction: column; gap: 2px; opacity: .35; }
.lb:hover .lb-tools, .lb:focus-within .lb-tools { opacity: 1; }
.lb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lb-chip { align-self: flex-start; font-size: 12px; color: var(--muted-foreground); }
.lb-edit { outline: none; min-height: 1.5em; overflow-wrap: anywhere; border-radius: 4px; }
.lb-edit:empty::before { content: attr(data-ph); color: var(--muted-foreground); }
.lb-h1 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.lb-h2 { font-size: 16px; font-weight: 600; }
.lb-quote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted-foreground); }
.lb-callout { border-radius: 8px; padding: 12px; background: var(--muted); }
.lb-callout.is-warn { background: var(--warning-tint); color: var(--warning-ink); }
.lb-prompt { font-family: var(--font-mono); font-size: 13px; background: var(--muted); padding: 12px; border-radius: 8px; }
.lb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 639px) { .lb-cols { grid-template-columns: 1fr; } }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table td { border: 1px solid var(--border); padding: 8px; }
.lb-hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; width: 100%; }
.lb-drop { border: 1px dashed var(--input); border-radius: 8px; padding: 16px; text-align: center; color: var(--muted-foreground); }
.lb-step { display: flex; gap: 12px; align-items: flex-start; }
.lb-add { align-self: flex-start; }
.lb-add-row { margin-top: 16px; }

/* Палитра блоков: список прокручивается внутри, поле поиска остаётся на месте */
.le-palette { position: fixed; z-index: 50; width: min(92vw, 360px); max-height: min(60vh, 420px); overflow: hidden; background: var(--popover); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.le-palette [data-opts] { overflow: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.le-palette .menu-item { padding: 8px 12px; }
.le-palette small { color: var(--muted-foreground); margin-left: auto; font-size: 12px; }

/* ---------- Описание элемента ---------- */
.le-meta { display: grid; gap: 16px; }

/* Раздел «Доступ к курсам»: только токены, без градиентов. Локальные компоненты, кандидаты в общие. */
.st-stack { display: grid; gap: 16px; min-width: 0; }
.st-stack-sm { display: grid; gap: 12px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.st-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 900px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Разделитель секций: только воздух, без линии */
.st-hr { border: 0; height: 0; margin: 32px 0 0; }
.st-subhead { margin: 0 0 12px; }
.form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.st-wizard { max-width: 52rem; }
.st-wz-actions { justify-content: space-between; }
.st-sums { display: grid; gap: 32px; }
.st-sum-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.st-sum-head .sub-title { margin: 0; }

.st-advs { display: grid; gap: 24px; }
.st-adv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.st-adv-head .sub-title { margin: 0 0 4px; }
.st-adv-sum { margin: 0; color: var(--muted-foreground); }
.st-adv-body { margin-top: 16px; padding-top: 4px; }
.st-adv-body[hidden] { display: none; }

.st-code-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.st-linkbtn { margin-top: 28px; padding: 6px 0; border: 0; background: none; color: var(--action); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.st-linkbtn:hover { text-decoration-thickness: 2px; }
.st-linkbtn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.st-h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.st-lead { margin: 0; color: var(--muted-foreground); }
.st-code-row .field { flex: 1 1 200px; }
.st-list-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.st-list-row .textarea, .st-grow { flex: 1 1 auto; min-width: 0; }
.st-num { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 8px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.st-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.st-next { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--primary-tint); }
.st-subtabs { margin-bottom: 12px; }
.st-card-foot { margin-top: 16px; }

.st-sched-wrap { max-height: none; }
.st-sched { min-width: 560px; }
.st-sched .input { min-width: 150px; }
.st-sched[data-mode="immediate"] .sm-link, .st-sched[data-mode="immediate"] .sm-qr,
.st-sched[data-mode="date"] .sm-link, .st-sched[data-mode="date"] .sm-qr { display: none; }
.st-sched-note { margin: 0; }

.st-sub { display: block; color: var(--muted-foreground); font-size: 12px; font-weight: 400; }
.st-muted { color: var(--muted-foreground); }
.st-risk { color: var(--destructive-ink); }
.st-nowrap { white-space: nowrap; }
.st-expired, .st-expired-note { color: var(--destructive-ink); }
.st-code { font-family: var(--font-mono); font-size: 13px; word-break: break-all; }
.st-btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-qr-box { display: flex; justify-content: center; padding: 12px; }
.st-qr { width: 180px; height: 180px; color: var(--foreground); background: var(--card); }
.st-banner { margin-bottom: 16px; }

.st-progress { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.st-bar { flex: 0 0 80px; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--success); }
.st-name { font-weight: 500; display: block; }
.st-picker { max-height: 240px; overflow: auto; display: grid; gap: 4px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.st-pick-row { padding: 4px; }

.st-danger { display: grid; gap: 12px; justify-items: start; }
.st-danger .card-title { color: var(--destructive-ink); }
#t-overview, #t-participants, #t-access, #t-comms, #t-settings { padding-top: 16px; }
#t-comms > .st-stack > #cm-table { min-width: 0; }
@media (max-width: 639px) { .st-wz-actions { justify-content: stretch; } .st-wz-actions .btn { flex: 1 1 auto; } }

/* План прохождения */
.st-plan-table { min-width: 720px; }
.st-plan-table .pl-date .input { min-width: 150px; }
.st-plan-table .pl-dur .input { width: 88px; min-width: 88px; }
.st-plan-table td small { display: block; margin-top: 4px; }
.st-plan-table td small:empty { display: none; }
.st-plan-table .field-error { margin: 4px 0 0; max-width: 28ch; white-space: normal; }
.st-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-btnrow-top { margin-top: 0; }
.st-plan-warn { align-items: flex-start; }
.st-plan-warn p { margin: 4px 0 12px; }
.st-sched-wrap:has(.st-links-only[data-mode="immediate"]), .st-sched-wrap:has(.st-links-only[data-mode="date"]) { display: none; }

/* Карточка со шире-экрана таблицей не раздувает колонку: таблица скроллится внутри */
.st-stack > *, .st-stack > .card { min-width: 0; }

/* Отчёты: рамка Metabase. Только токены, без теней. */
.rep-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.rep-note { margin: 16px 0 0; font-size: 13px; color: var(--muted-foreground); max-width: 64ch; }
.rep-frame { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); min-height: 520px; display: grid; place-items: center; }
.rep-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 32px 24px; color: var(--muted-foreground); }
.rep-placeholder b { color: var(--foreground); font-size: 16px; font-weight: 600; }
.rep-placeholder p { margin: 0; max-width: 44ch; font-size: 14px; }
.rep-frame.rep-full { position: fixed; inset: 0; z-index: 50; margin: 0; border-radius: 0; min-height: 0; }
.rep-frame.rep-ov { display: flex; place-items: initial; padding: 32px; }
.rep-frame.rep-full.rep-ov { overflow: auto; }

/* Остаточные знания в админке: плитка, расписание, колонка, раздел человека. Только токены. */
.rk-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 900px) { .rk-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.rk-tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); color: var(--card-foreground); height: 100%; box-sizing: border-box; }
.rk-label { font-size: 13px; color: var(--muted-foreground); }
.rk-value { font-size: 32px; font-weight: 600; line-height: 1.1; }
.rk-value small { font-size: 16px; margin-left: 2px; color: var(--muted-foreground); }
.rk-none { font-size: 18px; font-weight: 500; color: var(--muted-foreground); }
.rk-sub { font-size: 13px; color: var(--muted-foreground); }
.rk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.rk-chip { padding: 4px 12px; border-radius: 999px; background: var(--primary-tint); color: var(--primary-ink); font-size: 13px; }
.rk-sub-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.rk-topics { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rk-topic { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.rk-topic-name { min-width: 0; flex: 1 1 220px; }
.rk-topic-val { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rk-bar { flex: 0 0 80px; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: var(--success); }
.rk-when { display: block; margin-top: 2px; color: var(--muted-foreground); }
.rk-when span { margin-right: 6px; color: var(--foreground); }
.rk-sum { margin: 0 0 8px; }
.rk-note { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--warning-tint); color: var(--warning-ink); font-size: 13px; }

/* ---------- Итоговые проверки: список, редактор, превью чата. Только токены, без градиентов и теней. ---------- */
.ck-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ck-know { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: center; font-size: 14px; }
.ck-count { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); white-space: nowrap; }
.ck-count[data-state="empty"] { background: var(--warning-tint); color: var(--warning-ink); }
.ck-opt { display: flex; align-items: center; gap: 8px; }
.ck-opt .input { flex: 1; min-width: 0; }
.ck-errs { display: grid; gap: 4px; }
.ck-errs:empty { display: none; }
.ck-alert { padding: 12px 16px; border-radius: var(--radius); background: var(--destructive-tint); color: var(--destructive-ink); font-size: 14px; }
.ck-alert ul { margin: 4px 0 0; padding-left: 20px; }
.ck-lock { display: grid; place-items: center; width: 24px; flex: none; color: var(--muted-foreground); }
@media (max-width: 639px) {
  .ck-know { grid-template-columns: minmax(0, 1fr) auto; }
  .ck-know .check-row { grid-column: 1 / -1; }
}

.ck-main { min-width: 0; }

/* ---------- Знания курса: блок на странице курса и список в проверке ---------- */
.kn-chips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kn-chip { padding: 2px 10px; border-radius: 999px; background: var(--muted); font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.kn-open { all: unset; box-sizing: border-box; cursor: pointer; text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.kn-open:hover { text-decoration: underline; }
.kn-open:focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; border-radius: 4px; }
.kn-chip-x { display: inline-flex; align-items: center; gap: 4px; padding-right: 2px; }
.kn-chip-del { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; }
.kn-chip-del:hover { background: var(--border); }
.kn-chip-del:focus-visible { outline: 2px solid var(--ring, currentColor); }
.kn-chip-del:disabled { cursor: default; opacity: .5; }
.kn-chip-del svg { width: 14px; height: 14px; }
.ck-group { display: grid; gap: 8px; }
.ck-point { display: grid; gap: 4px; align-content: start; }

.imp-group { margin-bottom: 16px; }
.imp-group .sub-title { margin: 0 0 6px; }
.imp-list li { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; overflow-wrap: anywhere; }
.imp-list li:last-child { border-bottom: 0; }
.imp-list .imp-err { color: var(--destructive); }

/* Переписка тренера с сотрудником (trainer-chat.js): панель справа поверх страницы, на телефоне во всю ширину. */
.tchat-root { position: fixed; inset: 0; z-index: 55; }
.tchat-scrim { position: absolute; inset: 0; background: var(--scrim); }
.tchat { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); display: flex; flex-direction: column; background: var(--background); color: var(--foreground); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.tchat-head { flex: none; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
.tchat-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tchat-who b { font-size: 14px; font-weight: 600; line-height: 1.2; }
.tchat-who span { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tchat-empty { margin: auto; font-size: 14px; color: var(--muted-foreground); }
.tchat-msg { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.tchat-out { align-self: flex-end; align-items: flex-end; }
.tchat-in { align-self: flex-start; align-items: flex-start; }
.tchat-bub { padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; background: var(--muted); }
.tchat-out .tchat-bub { background: var(--primary); color: var(--primary-foreground); }
.tchat-msg time { font-size: 11px; color: var(--muted-foreground); }
.tchat-compose { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.tchat-actions { display: flex; justify-content: flex-end; }
.chat-count { margin-left: 8px; padding: 0 8px; }
.inbox-btn .chat-count { margin-left: 6px; }
.tchat-search { flex: none; position: relative; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tchat-search > .icon { position: absolute; left: 28px; top: 24px; width: 16px; height: 16px; color: var(--muted-foreground); pointer-events: none; }
.tchat-search .input { padding-left: 36px; }
.tchat-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 8px; }
.tchat-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tchat-row:hover { background: var(--muted); }
.tchat-row:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tchat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tchat-row-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchat-row-last { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchat-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--muted-foreground); }
.tchat-row-side .chat-count { margin-left: 0; }
.tchat-ai { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--primary); color: var(--primary-foreground); }
.tchat-bub a { color: inherit; font-weight: 600; text-decoration: underline; }
.tchat-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tchat-chip { padding: 6px 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--card-foreground); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tchat-chip:hover { background: var(--accent); }
.tchat-chip:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tchat-typing .tchat-bub { color: var(--muted-foreground); }
.tchat-none { padding: 24px 8px; text-align: center; font-size: 14px; color: var(--muted-foreground); }
@media (max-width: 639px) {
  .tchat { left: 0; width: auto; border-left: 0; }
  .tchat-compose .textarea { font-size: 16px; }
}
