/* Комплаенс-ассистент — дизайн-система приложения (app-оболочка).
   Визуальная ДНК «Дух+доверие»: тёмный премиум, ОДИН teal-акцент,
   чистый sans + моноширинный ТОЛЬКО для ссылок на закон (.law-ref).
   Самодостаточный файл: токены + раскладка + все компоненты + экран входа.
   Подключается в <head> как /assets/ds.css. Раскладку сайдбар/топбар
   рисует /assets/shell.js (страница верстает только <main class="content">). */

/* ===================================================================
   1. ТОКЕНЫ ТЕМЫ
   =================================================================== */
:root{
  /* Цвет — ровно по визуальной ДНК «Дух+доверие» */
  --bg:#161a20;
  --panel:#11151b;
  --panel2:#1b2029;
  --border:#2a3742;
  --fg:#e6edf3;
  --muted:#8a97a6;
  --accent:#2ba6c4;
  --accent2:#4cc6df;
  --on-accent:#062029;
  --ok:#34d399;
  --warn:#f0ad4e;
  --risk:#e06c75;
  --radius:10px;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sans:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;

  /* Служебные размеры оболочки */
  --sidebar-w:248px;
  --topbar-h:60px;

  /* Производные «мягкие» оттенки акцента (для подложек/рамок/фокуса) */
  --accent-soft:rgba(43,166,196,.12);
  --accent-line:rgba(43,166,196,.55);
  --focus-ring:0 0 0 3px rgba(76,198,223,.45);
  --shadow-card:0 1px 0 rgba(255,255,255,.03) inset, 0 18px 44px -28px rgba(0,0,0,.7);
  --content-pad:clamp(18px,3vw,32px);
}

*,*::before,*::after{ box-sizing:border-box; }

html,body{ height:100%; }

/* ===================================================================
   2. БАЗА + ГЛОБАЛЬНЫЙ ФОН (спокойнее, чем у лендинга — это рабочее ПО)
   =================================================================== */
body{
  margin:0;
  min-height:100%;
  font-family:var(--sans);
  color:var(--fg);
  background-color:var(--bg);
  /* Деликатная точечная сетка — глуше, чем на визитке */
  background-image:
    radial-gradient(circle at 50% -6%, rgba(76,198,223,.020) 0, transparent 60%),
    radial-gradient(rgba(230,237,243,.028) 1px, transparent 1px);
  background-size:auto, 24px 24px;
  background-position:center, center;
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  line-height:1.5;
}
/* Мягкое верхнее teal-свечение — приглушённое, рабочее */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background:radial-gradient(900px 320px at 18% -8%, rgba(43,166,196,.085), transparent 70%);
}

h1,h2,h3,h4{ margin:0; font-weight:650; letter-spacing:-.01em; color:var(--fg); }
a{ color:var(--accent2); }
:where(a):focus-visible{ outline:none; box-shadow:var(--focus-ring); border-radius:4px; }

/* Универсальное правило фокуса (доступность WCAG) */
:where(button,a,input,textarea,select,[tabindex]):focus-visible{
  outline:none;
  box-shadow:var(--focus-ring);
}

.visually-hidden{
  position:absolute !important; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* ===================================================================
   3. РАСКЛАДКА ОБОЛОЧКИ (CSS grid: сайдбар | [топбар / контент])
   shell.js препендит .sidebar и .topbar; body — grid-контейнер.
   =================================================================== */
body{
  display:grid;
  grid-template-columns:var(--sidebar-w) 1fr;
  grid-template-rows:var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height:100svh;
}
/* На экране входа (login.html) оболочки нет — обычный поток */
body.auth-screen{
  display:block;
  min-height:100svh;
}

.sidebar{ grid-area:sidebar; }
.topbar{  grid-area:topbar; }
.content{ grid-area:content; }

/* ─── Сайдбар ─────────────────────────────────────────────────────── */
.sidebar{
  position:sticky;
  top:0;
  align-self:start;
  height:100svh;
  display:flex;
  flex-direction:column;
  background:var(--panel);
  border-right:1px solid var(--border);
  z-index:40;
}
.sidebar__brand{
  display:flex;
  align-items:center;
  gap:10px;
  height:var(--topbar-h);
  padding:0 18px;
  border-bottom:1px solid var(--border);
  text-decoration:none;
  color:var(--fg);
  flex:0 0 auto;
}
.sidebar__mark{
  flex:0 0 auto;
  width:28px; height:28px;
  color:var(--accent);
  filter:drop-shadow(0 2px 8px rgba(43,166,196,.4));
}
.sidebar__word{
  font-size:15px;
  font-weight:650;
  letter-spacing:.2px;
  white-space:nowrap;
}

/* Навигация */
.nav{
  flex:1 1 auto;
  overflow-y:auto;
  padding:14px 12px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.nav__item{
  display:flex;
  align-items:center;
  gap:11px;
  padding:9px 12px;
  border-radius:var(--radius);
  color:var(--muted);
  text-decoration:none;
  font-size:14px;
  font-weight:500;
  border:1px solid transparent;
  transition:background-color .18s ease, color .18s ease, border-color .18s ease;
}
.nav__item svg{ flex:0 0 auto; width:18px; height:18px; }
.nav__item:hover{
  background:var(--panel2);
  color:var(--fg);
}
.nav__item:focus-visible{ outline:none; box-shadow:var(--focus-ring); }
.nav__item.is-active{
  background:var(--accent-soft);
  color:var(--accent2);
  border-color:var(--accent-line);
  font-weight:600;
}
.nav__item.is-active svg{ color:var(--accent2); }

/* Блок пользователя внизу сайдбара */
.sidebar__user{
  flex:0 0 auto;
  border-top:1px solid var(--border);
  padding:12px;
  display:flex;
  align-items:center;
  gap:10px;
}
.user-avatar{
  flex:0 0 auto;
  width:34px; height:34px;
  border-radius:50%;
  display:grid; place-items:center;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  color:var(--on-accent);
  font-weight:700;
  font-size:13px;
}
.sidebar__user-info{ min-width:0; flex:1 1 auto; }
.sidebar__user-name{
  font-size:13px; font-weight:600; color:var(--fg);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sidebar__user-mail{
  font-size:11.5px; color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sidebar__logout{
  flex:0 0 auto;
  display:grid; place-items:center;
  width:32px; height:32px;
  border-radius:8px;
  background:transparent;
  border:1px solid var(--border);
  color:var(--muted);
  cursor:pointer;
  transition:color .18s ease, border-color .18s ease, background-color .18s ease;
}
.sidebar__logout:hover{ color:var(--risk); border-color:var(--risk); }
.sidebar__logout svg{ width:16px; height:16px; }

/* ─── Топбар ──────────────────────────────────────────────────────── */
.topbar{
  position:sticky;
  top:0;
  z-index:30;
  height:var(--topbar-h);
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 var(--content-pad);
  background:rgba(17,21,27,.86);
  backdrop-filter:saturate(140%) blur(8px);
  border-bottom:1px solid var(--border);
}
.topbar__burger{
  display:none; /* виден только на узких экранах */
  flex:0 0 auto;
  width:38px; height:38px;
  border-radius:8px;
  background:var(--panel2);
  border:1px solid var(--border);
  color:var(--fg);
  cursor:pointer;
  place-items:center;
}
.topbar__burger svg{ width:18px; height:18px; }
.topbar__title{
  font-size:16px;
  font-weight:650;
  letter-spacing:-.01em;
  margin-right:auto;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Поиск-заглушка */
.topbar__search{
  position:relative;
  flex:0 1 320px;
  display:flex;
  align-items:center;
}
.topbar__search svg{
  position:absolute; left:11px;
  width:16px; height:16px;
  color:var(--muted);
  pointer-events:none;
}
.topbar__search input{
  width:100%;
  height:38px;
  padding:0 12px 0 34px;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--fg);
  font:inherit; font-size:13.5px;
}
.topbar__search input::placeholder{ color:var(--muted); }
.topbar__search input:focus-visible{ outline:none; border-color:var(--accent); box-shadow:var(--focus-ring); }

/* Иконка-кнопка в топбаре (колокольчик/пользователь) */
.icon-btn{
  position:relative;
  flex:0 0 auto;
  display:grid; place-items:center;
  width:38px; height:38px;
  border-radius:8px;
  background:transparent;
  border:1px solid var(--border);
  color:var(--muted);
  cursor:pointer;
  transition:color .18s ease, border-color .18s ease, background-color .18s ease;
}
.icon-btn:hover{ color:var(--fg); border-color:var(--accent); }
.icon-btn svg{ width:18px; height:18px; }
/* Точка-бейдж непрочитанных на колокольчике */
.icon-btn__count{
  position:absolute; top:-5px; right:-5px;
  min-width:17px; height:17px; padding:0 4px;
  display:grid; place-items:center;
  background:var(--risk); color:#fff;
  font-size:10.5px; font-weight:700; line-height:1;
  border-radius:999px;
  border:2px solid var(--panel);
}

/* Дропдаун уведомлений (рисует shell.js) */
.dropdown{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:320px; max-width:88vw;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:0 20px 50px -20px rgba(0,0,0,.75);
  z-index:50;
  overflow:hidden;
}
.dropdown[hidden]{ display:none; }
.dropdown__head{
  display:flex; align-items:center; justify-content:space-between;
  padding:11px 14px;
  border-bottom:1px solid var(--border);
  font-size:13px; font-weight:650;
}
.dropdown__head a{ font-size:12px; font-weight:500; text-decoration:none; }
.dropdown__item{
  display:block;
  padding:11px 14px;
  border-bottom:1px solid var(--border);
  text-decoration:none;
  color:var(--fg);
}
.dropdown__item:last-child{ border-bottom:0; }
.dropdown__item:hover{ background:var(--panel); }
.dropdown__item-title{ font-size:13px; font-weight:550; margin-bottom:2px; }
.dropdown__item-meta{ font-size:11.5px; color:var(--muted); }

/* Обёртка позиционирования для топбар-элементов с дропдауном */
.topbar__notify{ position:relative; flex:0 0 auto; }

/* ─── Контентная зона ─────────────────────────────────────────────── */
.content{
  position:relative;
  z-index:1;
  min-width:0;
  padding:var(--content-pad);
  padding-bottom:48px;
}

/* ===================================================================
   4. ШАПКА СТРАНИЦЫ + СЕТКИ
   =================================================================== */
.page-head{
  display:flex;
  align-items:flex-end;
  flex-wrap:wrap;
  gap:14px 20px;
  margin-bottom:22px;
}
.page-head__text{ flex:1 1 auto; min-width:240px; }
.page-head__title{ font-size:clamp(20px,3vw,26px); font-weight:700; }
.page-head__subtitle{ margin-top:5px; color:var(--muted); font-size:14px; max-width:70ch; }
.page-head__actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* Сетки-помощники */
.grid{ display:grid; gap:16px; }
.grid--stats{ grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); }
.grid--2{ grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); }
.grid--cards{ grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); }
.section{ margin-top:26px; }
.section__head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:12px; margin-bottom:12px;
}
.section__title{ font-size:16px; font-weight:650; }
.section__link{ font-size:13px; text-decoration:none; }

/* ===================================================================
   5. КАРТОЧКИ / ПАНЕЛИ
   =================================================================== */
.card,.panel{
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-card);
}
.card{ padding:18px; }
.panel{ overflow:hidden; }
.panel__head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 18px; border-bottom:1px solid var(--border);
}
.panel__title{ font-size:15px; font-weight:650; }
.panel__body{ padding:18px; }
.panel__body--flush{ padding:0; }
.card__title{ font-size:15px; font-weight:650; margin-bottom:8px; }

/* ─── Карточка-метрика .stat ──────────────────────────────────────── */
.stat{
  position:relative;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px 18px;
  box-shadow:var(--shadow-card);
  display:flex;
  flex-direction:column;
  gap:6px;
  overflow:hidden;
}
.stat::before{ /* тонкая teal-полоса слева */
  content:""; position:absolute; left:0; top:14px; bottom:14px;
  width:3px; border-radius:3px;
  background:linear-gradient(var(--accent),var(--accent2));
  opacity:.85;
}
.stat__head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.stat__label{ font-size:12.5px; color:var(--muted); font-weight:500; }
.stat__icon{
  display:grid; place-items:center;
  width:32px; height:32px; border-radius:8px;
  background:var(--accent-soft); color:var(--accent2);
  flex:0 0 auto;
}
.stat__icon svg{ width:17px; height:17px; }
.stat__value{ font-size:30px; font-weight:700; line-height:1.05; letter-spacing:-.02em; }
.stat__delta{ font-size:12px; color:var(--muted); display:inline-flex; align-items:center; gap:5px; }
.stat__delta--up{ color:var(--ok); }
.stat__delta--down{ color:var(--risk); }
.stat__delta--warn{ color:var(--warn); }

/* ===================================================================
   6. ТАБЛИЦА (плотная, деловая)
   =================================================================== */
.table-wrap{ width:100%; overflow-x:auto; }
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13.5px;
}
.table th,.table td{
  text-align:left;
  padding:11px 16px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
  white-space:nowrap;
}
.table th{
  font-size:11.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--muted);
  background:var(--panel);
  position:sticky; top:0;
}
.table tbody tr{ transition:background-color .12s ease; }
.table tbody tr:nth-child(even){ background:rgba(255,255,255,.012); }
.table tbody tr:hover{ background:var(--accent-soft); }
.table td.is-wrap{ white-space:normal; }
.table td.is-num{ text-align:right; font-variant-numeric:tabular-nums; }
.table .cell-strong{ font-weight:600; color:var(--fg); }
.table .cell-muted{ color:var(--muted); }
.table tbody tr:last-child td{ border-bottom:0; }

/* Группа-разделитель строк (напр. разбивка по комплаенс-рискам) */
.table tbody tr.table__group td{
  padding:9px 16px;
  background:var(--panel);
  font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.6px;
  color:var(--accent2);
}
.table tbody tr.table__group:hover td{ background:var(--panel); }
.table tbody tr.table__group .table__group-count{
  margin-left:8px; color:var(--muted); font-weight:600; letter-spacing:0; text-transform:none;
}

/* ===================================================================
   7. БЕЙДЖИ / ЧИПЫ / ТЕГИ
   =================================================================== */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 9px;
  font-size:12px; font-weight:600; line-height:1.4;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--muted);
  white-space:nowrap;
}
.badge::before{
  content:""; width:6px; height:6px; border-radius:50%;
  background:currentColor; flex:0 0 auto;
}
.badge--ok{   color:var(--ok);     background:rgba(52,211,153,.10);  border-color:rgba(52,211,153,.4); }
.badge--warn{ color:var(--warn);   background:rgba(240,173,78,.10);  border-color:rgba(240,173,78,.4); }
.badge--risk{ color:var(--risk);   background:rgba(224,108,117,.10); border-color:rgba(224,108,117,.45); }
.badge--info{ color:var(--accent2);background:var(--accent-soft);    border-color:var(--accent-line); }
.badge--muted{ color:var(--muted); }
.badge--muted::before{ background:var(--muted); }
/* без точки — для нейтральных «бесточечных» бейджей при необходимости */
.badge--plain::before{ display:none; }

/* Чип/тег: метки типов и партнёрства */
.chip,.tag{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 10px;
  font-size:12px; font-weight:500;
  border-radius:999px;
  background:var(--panel);
  border:1px solid var(--border);
  color:var(--muted);
  white-space:nowrap;
}
.tag--type{ color:var(--fg); }
.tag--accent{ color:var(--accent2); border-color:var(--accent-line); background:var(--accent-soft); }
/* Деликатная коммерческая метка (Партнёрское/Спонсор) */
.tag--promo{
  color:var(--accent2);
  border-color:var(--accent-line);
  background:var(--accent-soft);
  font-size:11px;
}

/* Релевантность изменения закона */
.rel{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; }
.rel::before{ content:""; width:7px; height:7px; border-radius:50%; flex:0 0 auto; }
.rel--high::before{ background:var(--risk); box-shadow:0 0 5px rgba(224,108,117,.55); }
.rel--mid::before{  background:var(--warn); }
.rel--low::before{  background:var(--muted); }

/* ===================================================================
   8. КНОПКИ
   =================================================================== */
.btn{
  appearance:none;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:40px;
  padding:0 16px;
  font-family:inherit; font-size:14px; font-weight:600;
  border-radius:var(--radius);
  border:1px solid transparent;
  cursor:pointer; text-decoration:none;
  white-space:nowrap;
  transition:transform .14s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn svg{ width:16px; height:16px; flex:0 0 auto; }
.btn:focus-visible{ outline:none; box-shadow:var(--focus-ring); }
.btn:disabled,.btn.is-disabled{ opacity:.5; cursor:not-allowed; }

.btn--primary{
  color:var(--on-accent);
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 8px 20px -12px rgba(43,166,196,.85);
}
.btn--primary:hover{ transform:translateY(-1px); box-shadow:0 12px 24px -12px rgba(43,166,196,.95); }
.btn--ghost{ color:var(--fg); background:var(--panel2); border-color:var(--border); }
.btn--ghost:hover{ border-color:var(--accent); }
.btn--subtle{ color:var(--muted); background:transparent; border-color:transparent; }
.btn--subtle:hover{ color:var(--fg); background:var(--panel2); }
.btn--danger{ color:var(--risk); background:transparent; border-color:rgba(224,108,117,.45); }
.btn--danger:hover{ background:rgba(224,108,117,.10); border-color:var(--risk); }
.btn--sm{ min-height:32px; padding:0 12px; font-size:13px; border-radius:8px; }
.btn--block{ width:100%; }

/* ===================================================================
   9. ФОРМЫ
   =================================================================== */
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.field--row{ flex-direction:row; align-items:center; gap:10px; }
.label{ font-size:13px; font-weight:550; color:var(--fg); }
.label .req{ color:var(--risk); }
.hint{ font-size:12px; color:var(--muted); }
.error-text{ font-size:12.5px; color:var(--risk); }

.input,.textarea,.select{
  width:100%;
  min-height:42px;
  padding:10px 12px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  color:var(--fg);
  font:inherit; font-size:14px;
  transition:border-color .18s ease, box-shadow .18s ease;
}
.textarea{ min-height:120px; resize:vertical; line-height:1.5; }
.select{ appearance:none; padding-right:36px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a97a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center;
}
.input::placeholder,.textarea::placeholder{ color:var(--muted); }
.input:focus-visible,.textarea:focus-visible,.select:focus-visible{
  outline:none; border-color:var(--accent); box-shadow:var(--focus-ring);
}
.input.is-invalid,.textarea.is-invalid{ border-color:var(--risk); }

/* Чекбокс / переключатель */
.checkbox{ display:inline-flex; align-items:flex-start; gap:9px; cursor:pointer; font-size:13.5px; }
.checkbox input{
  appearance:none;
  flex:0 0 auto;
  width:18px; height:18px; margin-top:1px;
  border:1px solid var(--border); border-radius:5px;
  background:var(--panel); cursor:pointer;
  display:grid; place-items:center;
  transition:background-color .15s ease, border-color .15s ease;
}
.checkbox input:checked{ background:var(--accent); border-color:var(--accent); }
.checkbox input:checked::after{
  content:""; width:5px; height:9px; margin-top:-2px;
  border:solid var(--on-accent); border-width:0 2px 2px 0; transform:rotate(45deg);
}
.checkbox input:focus-visible{ outline:none; box-shadow:var(--focus-ring); }

/* ─── Зона загрузки файла .dropzone ───────────────────────────────── */
.dropzone{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px;
  padding:36px 24px;
  text-align:center;
  border:1.5px dashed var(--border);
  border-radius:var(--radius);
  background:var(--panel);
  color:var(--muted);
  cursor:pointer;
  transition:border-color .18s ease, background-color .18s ease, color .18s ease;
}
.dropzone:hover,.dropzone.is-drag{
  border-color:var(--accent);
  background:var(--accent-soft);
  color:var(--fg);
}
.dropzone:focus-visible{ outline:none; box-shadow:var(--focus-ring); }
.dropzone__icon{
  display:grid; place-items:center;
  width:48px; height:48px; border-radius:50%;
  background:var(--accent-soft); color:var(--accent2);
}
.dropzone__icon svg{ width:24px; height:24px; }
.dropzone__title{ font-size:15px; font-weight:600; color:var(--fg); }
.dropzone__hint{ font-size:12.5px; color:var(--muted); }

/* ===================================================================
   10. ССЫЛКА НА ЗАКОН .law-ref (ЕДИНСТВЕННЫЙ моноширинный)
   =================================================================== */
.law-ref{
  display:inline-flex; align-items:center; gap:5px;
  padding:1px 7px;
  font-family:var(--mono);
  font-size:12.5px; letter-spacing:.2px;
  color:var(--accent2);
  background:var(--accent-soft);
  border:1px solid var(--accent-line);
  border-radius:6px;
  text-decoration:none;
  white-space:nowrap;
}
a.law-ref:hover{ background:rgba(43,166,196,.2); border-color:var(--accent2); }

/* ===================================================================
   11. ПУСТОЕ СОСТОЯНИЕ
   =================================================================== */
.empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; padding:48px 24px; text-align:center; color:var(--muted);
}
.empty__icon{
  display:grid; place-items:center;
  width:52px; height:52px; border-radius:50%;
  background:var(--panel); border:1px solid var(--border); color:var(--muted);
}
.empty__icon svg{ width:24px; height:24px; }
.empty__title{ font-size:15px; font-weight:600; color:var(--fg); }
.empty__text{ font-size:13px; max-width:42ch; }

/* ===================================================================
   12. КАРТОЧКА МЕРОПРИЯТИЯ .event-card
   =================================================================== */
.event-card{
  display:flex; gap:14px;
  padding:16px;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-card);
}
.event-date{
  flex:0 0 auto;
  width:58px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:8px 0;
  border-radius:8px;
  background:var(--accent-soft);
  border:1px solid var(--accent-line);
  color:var(--accent2);
  text-align:center;
}
.event-date__day{ font-size:20px; font-weight:700; line-height:1; }
.event-date__mon{ font-size:11px; text-transform:uppercase; letter-spacing:.4px; margin-top:3px; }
.event-card__body{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:8px; }
.event-card__row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.event-card__topic{ font-size:14.5px; font-weight:600; color:var(--fg); line-height:1.35; }
.event-card__foot{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:2px; }

/* ===================================================================
   13. ЛЕНТА / TIMELINE (законодательство)
   =================================================================== */
.feed{ display:flex; flex-direction:column; }
.feed__item{
  position:relative;
  display:flex; gap:14px;
  padding:16px 18px;
  border-bottom:1px solid var(--border);
}
.feed__item:last-child{ border-bottom:0; }
.feed__item:hover{ background:rgba(255,255,255,.012); }
.feed__marker{
  flex:0 0 auto; position:relative;
  width:10px; height:10px; margin-top:5px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 0 4px var(--accent-soft);
}
.feed__marker--high{ background:var(--risk); box-shadow:0 0 0 4px rgba(224,108,117,.14); }
.feed__marker--mid{ background:var(--warn); box-shadow:0 0 0 4px rgba(240,173,78,.14); }
/* вертикальная линия таймлайна */
.feed--line .feed__item::before{
  content:""; position:absolute; left:22px; top:26px; bottom:-1px;
  width:1px; background:var(--border);
}
.feed--line .feed__item:last-child::before{ display:none; }
.feed__body{ flex:1 1 auto; min-width:0; }
.feed__meta{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin-bottom:5px; }
.feed__title{ font-size:14px; font-weight:550; color:var(--fg); line-height:1.4; }
.feed__source{ font-weight:600; color:var(--fg); }
.feed__time{ color:var(--muted); }

/* ===================================================================
   14. ВКЛАДКИ .tabs
   =================================================================== */
.tabs{
  display:flex; gap:4px;
  border-bottom:1px solid var(--border);
  margin-bottom:18px;
}
.tab{
  appearance:none;
  background:transparent; border:0;
  padding:10px 14px;
  font:inherit; font-size:14px; font-weight:550;
  color:var(--muted); cursor:pointer;
  border-bottom:2px solid transparent;
  margin-bottom:-1px;
  transition:color .18s ease, border-color .18s ease;
}
.tab:hover{ color:var(--fg); }
.tab:focus-visible{ outline:none; box-shadow:var(--focus-ring); border-radius:6px 6px 0 0; }
.tab.is-active{ color:var(--accent2); border-bottom-color:var(--accent); }

/* ===================================================================
   15. МОДАЛКА .modal (заявка на доступ / подтверждения)
   =================================================================== */
.modal{
  position:fixed; inset:0; z-index:100;
  display:grid; place-items:center;
  padding:24px;
  background:rgba(8,11,15,.66);
  backdrop-filter:blur(3px);
}
.modal[hidden]{ display:none; }
.modal__card{
  width:100%; max-width:460px;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:calc(var(--radius) + 4px);
  box-shadow:0 28px 70px -28px rgba(0,0,0,.8);
  overflow:hidden;
}
.modal__head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 20px; border-bottom:1px solid var(--border);
}
.modal__title{ font-size:16px; font-weight:650; }
.modal__close{
  display:grid; place-items:center;
  width:32px; height:32px; border-radius:8px;
  background:transparent; border:1px solid var(--border); color:var(--muted);
  cursor:pointer;
}
.modal__close:hover{ color:var(--fg); border-color:var(--accent); }
.modal__close svg{ width:16px; height:16px; }
.modal__body{ padding:20px; }
.modal__foot{
  display:flex; justify-content:flex-end; gap:10px;
  padding:14px 20px; border-top:1px solid var(--border);
}

/* ===================================================================
   16. ЭКРАН ВХОДА .auth-* (login.html — без оболочки)
   =================================================================== */
.auth{
  min-height:100svh;
  display:grid; place-items:center;
  padding:clamp(20px,5vw,48px);
  position:relative; z-index:1;
}
.auth__card{
  width:100%; max-width:400px;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:calc(var(--radius) + 6px);
  padding:clamp(26px,5vw,38px);
  box-shadow:0 24px 60px -24px rgba(0,0,0,.7);
  position:relative;
}
.auth__card::before{
  content:""; position:absolute; left:28px; right:28px; top:0; height:2px;
  border-radius:2px;
  background:linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
  opacity:.75;
}
.auth__brand{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  text-align:center; margin-bottom:24px;
}
.auth__mark{ width:40px; height:40px; color:var(--accent); filter:drop-shadow(0 2px 10px rgba(43,166,196,.45)); }
.auth__word{ font-size:17px; font-weight:650; letter-spacing:.2px; }
.auth__sub{ font-size:13px; color:var(--muted); }
.auth__error{
  display:flex; align-items:center; gap:8px;
  margin-bottom:16px; padding:10px 12px;
  font-size:13px; color:var(--risk);
  background:rgba(224,108,117,.10); border:1px solid rgba(224,108,117,.4);
  border-radius:var(--radius);
}
.auth__error[hidden]{ display:none; }
.auth__error svg{ width:16px; height:16px; flex:0 0 auto; }
.auth__foot{
  margin-top:18px; padding-top:16px; border-top:1px solid var(--border);
  text-align:center; font-size:12.5px; color:var(--muted);
}
.auth__foot a{ text-decoration:none; font-weight:550; }

/* ===================================================================
   17. УТИЛИТЫ
   =================================================================== */
.u-mt-0{ margin-top:0; } .u-mb-0{ margin-bottom:0; }
.u-muted{ color:var(--muted); }
.u-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.u-spread{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.u-grow{ flex:1 1 auto; min-width:0; }
.u-nowrap{ white-space:nowrap; }
.u-divider{ height:1px; background:var(--border); border:0; margin:18px 0; }

/* ===================================================================
   18. АДАПТИВ — сайдбар off-canvas ≤ 900px
   =================================================================== */
/* Backdrop под off-canvas сайдбаром (рисует shell.js) */
.nav-backdrop{
  position:fixed; inset:0; z-index:35;
  background:rgba(8,11,15,.55);
  opacity:0; pointer-events:none;
  transition:opacity .22s ease;
}

@media (max-width:900px){
  body{
    grid-template-columns:1fr;
    grid-template-areas:
      "topbar"
      "content";
  }
  .sidebar{
    position:fixed;
    top:0; left:0; bottom:0;
    width:min(82vw, var(--sidebar-w));
    transform:translateX(-100%);
    transition:transform .24s ease;
    box-shadow:0 0 40px rgba(0,0,0,.5);
  }
  body.nav-open .sidebar{ transform:translateX(0); }
  body.nav-open .nav-backdrop{ opacity:1; pointer-events:auto; }
  .topbar__burger{ display:grid; }
  .topbar__search{ display:none; } /* поиск убираем в дропдаун/прячем на узких */
}
@media (max-width:560px){
  :root{ --content-pad:16px; }
  .stat__value{ font-size:26px; }
  .page-head{ align-items:flex-start; }
}

/* ===================================================================
   19. PREFERS-REDUCED-MOTION
   =================================================================== */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}
