/* Тот же стиль, что в Островке: тёмная тема, стеклянные плитки, акцент — голубой. */
:root {
  --bg: #121318;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.10);
  --text: #f2f3f5;
  --secondary: rgba(235, 235, 245, 0.6);
  --accent: rgb(115, 168, 230);
  --good: rgb(115, 209, 148);
  --bad: rgb(245, 120, 120);
  --warn: rgb(245, 199, 97);
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
/* Цветные пятна под стеклом, как фон плиток в Островке. */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 20%, rgba(64, 128, 242, 0.35), transparent 70%),
    radial-gradient(35% 30% at 85% 15%, rgba(153, 89, 230, 0.28), transparent 70%),
    radial-gradient(40% 35% at 60% 90%, rgba(51, 191, 191, 0.22), transparent 70%);
}

/* Вход */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
body.login::before { content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(40% 40% at 30% 30%, rgba(64, 128, 242, 0.35), transparent 70%),
              radial-gradient(40% 40% at 70% 70%, rgba(153, 89, 230, 0.28), transparent 70%); }
.login-card { width: min(360px, 100%); padding: 28px; display: grid; gap: 14px; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card label { display: grid; gap: 6px; color: var(--secondary); font-size: 12.5px; }
input, select {
  font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border); border-radius: 10px; padding: 9px 11px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
button {
  font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 999px;
  padding: 9px 16px; cursor: pointer;
}
button.plain { background: rgba(255, 255, 255, 0.08); color: var(--text); font-weight: 500; }
.error { margin: 0; color: var(--bad); font-size: 13px; }

/* Каркас сайта */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { padding: 16px 10px; border-right: 1px solid var(--panel-border); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: rgba(14, 15, 20, 0.35); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.sidebar h2 { font-size: 16px; margin: 4px 10px 12px; }
/* Группы меню: тонкий полупрозрачный разделитель между разделами */
.nav-group { padding: 8px 0; }
.nav-group + .nav-group { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.sidebar .section { color: rgba(235, 235, 245, 0.42); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: 4px 10px 6px; }
.sidebar > .section { display: none; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 1px 0; border-radius: 9px; color: rgba(242, 243, 245, 0.88);
  text-decoration: none; font-size: 13.5px; transition: background .15s, color .15s; }
.sidebar a:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.sidebar a.active { background: rgba(115, 168, 230, 0.22); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(115, 168, 230, 0.25); }
.sidebar .icon { width: 17px; height: 17px; flex: none; color: rgba(235, 235, 245, 0.55); }
.sidebar a.active .icon, .sidebar a:hover .icon { color: var(--accent); }
.sidebar .icon svg { width: 100%; height: 100%; display: block; }
.content { padding: 16px 20px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topbar h1 { font-size: 22px; margin: 0; }
.topbar .spacer { flex: 1; }
.chip { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--secondary); font-size: 12px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--panel-border); position: static; height: auto; }
  .content { padding: 12px 16px; }
}

/* Общие элементы экранов */
.muted { color: var(--secondary); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
small { color: var(--secondary); font-size: 11.5px; }
/* Загрузка: силуэт страницы, по нему бежит блик. */
.skeleton { height: 320px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.05);
  background: linear-gradient(100deg, rgba(255,255,255,.035) 30%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.035) 70%);
  background-size: 250% 100%; animation: shimmer 1.5s infinite ease-in-out; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.skeleton-page { display: grid; gap: 16px; }
.skeleton-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.skeleton.tile-sk { height: 120px; }
.skeleton.table-sk { height: 300px; animation-delay: .15s; }
.skeleton.half-sk { height: 160px; animation-delay: .3s; }

/* Плитки под мышкой: наклон к курсору и подсветка по стеклу. */
.tile { position: relative; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.tile.tilting { transition: transform .08s linear, box-shadow .25s ease; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .10), transparent 60%); }
.tile.tilting::after { opacity: 1; }
.pill { display: inline-block; margin: 4px 0 2px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.good { color: var(--good); background: rgba(115,209,148,.16); }
.pill.bad { color: var(--bad); background: rgba(245,120,120,.16); }
.tag { font-size: 10.5px; font-weight: 500; color: var(--accent); background: rgba(115,168,230,.15); padding: 2px 8px; border-radius: 999px; }
hr { border: 0; border-top: 1px solid var(--panel-border); margin: 12px 0; }

/* Главная */
#page { max-width: 1280px; display: grid; gap: 18px; }
.day-picker { justify-self: center; display: flex; align-items: center; gap: 14px; padding: 6px 10px; border-radius: 999px; font-weight: 600; }
.day-picker .arrow { background: rgba(255,255,255,.08); color: var(--text); width: 30px; height: 30px; padding: 0; font-size: 18px; line-height: 1; }
.day-picker .arrow:disabled { opacity: .3; cursor: default; }
.departments { display: flex; flex-wrap: wrap; gap: 14px; }
.tile { padding: 16px; border-radius: 20px; }
.department { width: 290px; display: flex; flex-direction: column; gap: 2px; }
.department header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.department h3 { margin: 0; font-size: 16px; }
.big { font-size: 26px; font-weight: 700; }
.mid { font-size: 19px; font-weight: 600; }
.split { margin-top: 6px; display: grid; gap: 4px; }
.split-bar { display: flex; gap: 2px; height: 4px; }
.split-bar span { border-radius: 99px; }
.split-bar.empty { opacity: .2; }
.split-row { display: grid; grid-template-columns: 8px 86px 1fr auto; align-items: center; gap: 6px; font-size: 12.5px; }
.split-row i { width: 6px; height: 6px; border-radius: 50%; }
.split-row .label, .split-row .share { color: var(--secondary); font-size: 11.5px; }
.stats { display: flex; gap: 16px; margin-top: 10px; }
.stats div { display: grid; }
.stats small { font-size: 10.5px; }
.plan { margin-top: 10px; display: grid; gap: 4px; }
.plan-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--secondary); }
.bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { padding: 16px; }
.card h3 { margin: 0 0 2px; font-size: 15px; }
.card > small { display: block; margin-bottom: 10px; }
.person { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.05); }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 700; background: rgba(115,168,230,.35); }
.person .dept { color: var(--secondary); font-size: 10.5px; }
.calendar .cal-head, .calendar .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { color: var(--secondary); font-size: 11px; text-align: center; }
.cal-grid { margin-top: 6px; }
.cell { border-radius: 10px; padding: 6px 8px; min-height: 52px; display: grid; cursor: pointer; border: 1px solid rgba(255,255,255,.06); }
.cell.blank { background: none; border: 0; cursor: default; }
.cell.selected { outline: 2px solid var(--accent); }
.cell span { font-size: 11px; color: var(--secondary); }
.cell b { font-size: 13px; }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .department { width: 100%; }
}

/* Загрузка поверх прежних цифр: размытие и бегущая полоска сверху. */
#page { position: relative; }
#page > * { transition: filter .2s ease, opacity .2s ease; }
#page.loading > *:not(.day-picker) { filter: blur(6px); opacity: .55; pointer-events: none; }
#page.loading::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 10;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: loading-bar 1s infinite ease-in-out; }
@keyframes loading-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* Карточка менеджера */
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 20px; }
.card-head .spacer { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; align-content: start; }
.kpi .big { font-size: 22px; }
.kpi .pill { justify-self: start; }

/* Таблица свода */
.table-wrap { overflow-x: auto; margin-top: 6px; }
table.summary { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.summary th { color: var(--secondary); font-weight: 500; font-size: 11.5px; text-align: right; padding: 6px 10px; white-space: nowrap; }
table.summary th:first-child, table.summary td:first-child { text-align: left; }
table.summary td { text-align: right; padding: 7px 10px; border-top: 1px solid rgba(255,255,255,.06); white-space: nowrap; font-size: 13px; }
table.summary tr.total td { font-weight: 700; background: rgba(115,168,230,.10); }
table.summary tr.total td:first-child { border-radius: 10px 0 0 10px; }
table.summary tr.total td:last-child { border-radius: 0 10px 10px 0; }
table.summary tr.openable { cursor: pointer; }
table.summary tr.openable:hover td { background: rgba(255,255,255,.03); }
table.summary tr.child td { color: var(--secondary); font-size: 12.5px; }
table.summary tr.child td:first-child { padding-left: 30px; }
.chevron { display: inline-block; width: 14px; color: var(--secondary); font-size: 10px; }
.bar.thin { height: 3px; margin-top: 3px; width: 70px; margin-left: auto; }

/* Компактные плитки карточки: в один ряд, без лишней высоты */
.kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { padding: 12px 14px; border-radius: 16px; gap: 2px; }
.kpi .big { font-size: 20px; line-height: 1.2; }
.kpi .pill { margin: 2px 0 0; font-size: 10.5px; padding: 1px 7px; }
.note { margin-top: -8px; }
.kpi.wide { grid-column: span 2; }
.split-line { display: grid; grid-template-columns: 8px 40px 1fr auto auto; align-items: center; gap: 6px; font-size: 13px; }
.split-line i { width: 6px; height: 6px; border-radius: 50%; }
.split-line span { color: var(--secondary); font-size: 11.5px; }
.split-line b { font-size: 15px; }
.split-line .pill { margin: 0; }
@media (max-width: 760px) { .kpi.wide { grid-column: span 1; } }

/* Переключатель-капсула, как в Островке */
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--panel-border); }
.segmented button { background: none; color: var(--secondary); font-weight: 500; padding: 5px 12px; font-size: 12.5px; transition: background .2s, color .2s; }
.segmented button.on { background: rgba(115,168,230,.28); color: var(--text); }

/* План-факт карточки менеджера: одна строка */
.plan-fact { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 18px; align-items: center; padding: 12px 16px; }
.pf-title { display: grid; gap: 2px; }
.pf-title h3 { margin: 0; }
.pf { display: grid; gap: 2px; }
.pf-main { display: flex; align-items: baseline; gap: 8px; }
.pf-main b { font-size: 17px; }
.pf-main span { font-weight: 700; font-size: 13px; }
.bar.thin.wide { width: 100%; margin-left: 0; }
@media (max-width: 760px) { .plan-fact { grid-template-columns: 1fr; } }
.card-title .spacer { flex: 1; }

/* «Где зависли деньги» */
table.matrix td { vertical-align: top; }
table.matrix .sub { color: var(--secondary); font-size: 10.5px; margin-top: 1px; }
table.matrix td.owe { color: rgb(245, 160, 80); font-weight: 600; }
table.matrix tr.total td.owe { color: rgb(245, 160, 80); }
.dates { display: inline-flex; align-items: center; gap: 6px; color: var(--secondary); font-size: 12.5px; }
.dates input { padding: 6px 8px; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-button { background: rgba(255,255,255,.06); color: var(--secondary); border: 1px solid var(--panel-border); font-weight: 500; font-size: 12px; padding: 4px 10px; }
.chip-button.on { background: rgba(115,168,230,.28); color: var(--text); border-color: rgba(115,168,230,.5); }
.dropdown { position: relative; }
.dropdown-button { font-size: 12.5px; padding: 6px 12px; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 8px; display: grid; gap: 2px;
  background: rgba(30, 32, 40, 0.92); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.dropdown-panel[hidden] { display: none; }
.check { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.check:hover { background: rgba(255,255,255,.06); }
.check input { accent-color: var(--accent); }
.dropdown-actions { display: flex; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--panel-border); margin-top: 4px; }
.dropdown-actions button { font-size: 12px; padding: 4px 10px; }
table.summary tr.selected td { background: rgba(115,168,230,.14); }
.chip.view-as { cursor: pointer; border: 1px solid var(--panel-border); }
.chip.view-as:hover { color: var(--text); }
.view-as-panel { min-width: 300px; gap: 6px; }
.view-as-panel button { text-align: left; font-size: 13px; }
.view-as-panel label { display: grid; gap: 4px; color: var(--secondary); font-size: 12px; }

/* Переключатель отделов — по ширине кнопок; широкие таблицы прокручиваются внутри карточки, а не растягивают страницу */
#page > .segmented { justify-self: start; }
#page > * { min-width: 0; }

/* Окно поверх страницы */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.5); }
.modal-card { width: min(900px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; display: grid; gap: 10px; background: rgba(28,30,38,.96); }
.modal-card select { justify-self: start; min-width: 260px; }
.check-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check-line input { accent-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
.person[data-person] { cursor: pointer; }
.person[data-person]:hover .name { color: var(--accent); }

/* Экраны продаж */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filters select { padding: 7px 10px; }
.spark { width: 100%; height: 26px; margin-top: 4px; }
.delta { font-size: 10.5px; margin-top: 1px; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); } .delta.warn { color: var(--warn); }
table.summary .sub { color: var(--secondary); font-size: 10.5px; }
table.summary tr.child.channel td:first-child { font-weight: 600; color: var(--text); }
.person-link { cursor: pointer; }
.person-link:hover { color: var(--accent); }

/* «Месяц по дням» */
.report-table th.group { text-align: center; color: var(--text); font-weight: 600; border-left: 1px solid var(--panel-border); }
.report-table th.group.week { cursor: pointer; }
.report-table th.group.month { background: rgba(255,255,255,.05); }
.report-table th.today { color: var(--accent); }
.report-table td.first, .report-table th.first { border-left: 1px solid var(--panel-border); }
/* Закреплённый столбец — тем же стеклом, что карточка: без тёмного прямоугольника */
.report-table .sticky { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 220px;
  background: rgba(30, 32, 42, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.report-table tr:first-child .sticky, .report-table tr:nth-child(2) .sticky, .report-table tr.section td.sticky { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.report-table tr.section td { color: var(--secondary); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; border-top: 0; padding-top: 12px; }
.report-table tr.stripe td { background: rgba(255,255,255,.025); }
.report-table tr.stripe td.sticky { background: rgba(36, 38, 48, 0.8); }
.report-table tr.bold td { font-weight: 700; }
.report-table td.dim, .report-table tr.dimrow td.sticky { color: var(--secondary); }
.report-table td.good { color: var(--good); } .report-table td.warn { color: var(--warn); } .report-table td.bad { color: var(--bad); }
.report-table td.clickable { cursor: pointer; }

/* «План» */
.plan-layout { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 560px); gap: 14px; align-items: start; }
.plan-column { display: grid; gap: 14px; }
.field { display: grid; grid-template-columns: 1fr 180px; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.slider { display: grid; grid-template-columns: 90px 1fr 110px; align-items: center; gap: 10px; font-size: 12.5px; margin: 6px 0; }
.slider b { text-align: right; font-weight: 600; }
.slider input { accent-color: var(--accent); }
input.small { width: 110px; padding: 5px 8px; }
@media (max-width: 1000px) { .plan-layout { grid-template-columns: 1fr; } }
.slider.wide { grid-template-columns: 80px 220px 50px 1fr; }
.slider.wide small { font-size: 11px; }
td.clickable { cursor: pointer; }
td.clickable:hover { background: rgba(115,168,230,.10); }

/* Отчёты */
table.report-grid th { text-align: right; }
table.report-grid th.left, table.report-grid td:first-child { text-align: left; }
table.report-grid td.strong { font-weight: 700; }
table.report-grid td.good { color: var(--good); } table.report-grid td.bad { color: var(--bad); }
table.report-grid td.warn { color: var(--warn); } table.report-grid td.muted { color: var(--secondary); }
table.report-grid td { border-radius: 4px; }
.dist { display: flex; gap: 1px; width: 220px; height: 10px; border-radius: 99px; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--secondary); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.chart { width: 100%; max-width: 900px; height: auto; }
.chart-label { fill: var(--secondary); font-size: 10px; text-anchor: middle; }
.hbar { display: grid; grid-template-columns: 220px 1fr 130px; align-items: center; gap: 10px; font-size: 12.5px; margin: 4px 0; }
.hbar div { height: 14px; background: rgba(255,255,255,.05); border-radius: 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.hbar b { text-align: right; font-weight: 500; color: var(--secondary); }
.cohorts { display: grid; gap: 14px; }
table.report-grid.wrap td { white-space: normal; font-size: 13.5px; line-height: 1.5; }

/* «Пользователи» */
table.users td { vertical-align: top; }
table.users td:first-child, table.users th:first-child { text-align: left; }
table.users .actions { white-space: nowrap; }
button.small { font-size: 12px; padding: 4px 10px; }
button.danger { color: var(--bad); }
.user-form { width: min(560px, 100%); }
.user-form .field { grid-template-columns: 170px 1fr; }
.password { display: flex; gap: 8px; }
.password input { flex: 1; font-family: ui-monospace, Menlo, monospace; }

/* Кнопка «?» с пояснением */
.help { position: relative; display: inline-flex; vertical-align: middle; margin-left: 8px; }
.help-button { width: 20px; height: 20px; padding: 0; border-radius: 50%; font-size: 11.5px; font-weight: 700; line-height: 1;
  background: rgba(255,255,255,.08); color: var(--secondary); border: 1px solid var(--panel-border); }
.help-button:hover { color: var(--text); background: rgba(115,168,230,.25); }
.help-text { position: absolute; top: 26px; left: -8px; z-index: 30; width: min(420px, 80vw); padding: 10px 12px; border-radius: 12px;
  background: rgba(30, 32, 42, 0.97); border: 1px solid var(--panel-border); box-shadow: 0 12px 30px rgba(0,0,0,.45);
  color: var(--text); font-size: 12.5px; font-weight: 400; line-height: 1.45; white-space: normal; text-transform: none; letter-spacing: 0; }
.help-text[hidden] { display: none; }
h3.with-help { display: flex; align-items: center; }

/* Логотип: «Re» на полупрозрачной стеклянной плашке, как плитки показателей */
.brand { display: flex; align-items: center; gap: 8px; margin: 2px 8px 14px; }
.brand-mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 13px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text);
  background: linear-gradient(145deg, rgba(115, 168, 242, 0.32), rgba(173, 133, 235, 0.20));
  border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.brand-text { display: grid; line-height: 1.15; }
.brand-text b { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.brand-text small { font-size: 11.5px; color: var(--secondary); }
.login-card .brand { margin: 0 0 8px; }
.brand-text { align-self: center; }
.brand-text b { font-size: 19px; line-height: 1; }

/* «Сравнение» — по ширине содержимого, строки плотнее */
#page > section.compare { justify-self: start; width: fit-content; max-width: 100%; }
.compare table.summary { width: auto; }
.compare table.summary td, .compare table.summary th { padding: 5px 16px; font-size: 12.5px; }
.compare table.summary td:first-child { padding-right: 36px; }

/* Отчёты компактнее: карточка по ширине таблицы, строки плотнее, мелкое число — в той же строке */
.cohorts > section.card, .cohorts .grid2 > section.card { width: fit-content; max-width: 100%; }
.cohorts .grid2 { grid-template-columns: repeat(2, fit-content(50%)); }
table.report-grid { width: auto; }
table.report-grid td, table.report-grid th { padding: 5px 14px; font-size: 12.5px; }
table.report-grid td:first-child, table.report-grid th:first-child { padding-right: 28px; }
table.report-grid .sub { display: inline; margin-left: 6px; font-size: 10.5px; }
table.report-grid .sub::before { content: "· "; }

/* Приветствие при входе: «Доброе утро, Имя» — раз за сессию браузера, клик — пропустить. */
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg); cursor: pointer;
  transition: opacity .7s ease, filter .7s ease; }
.splash[hidden] { display: none; }
.splash.leave { opacity: 0; filter: blur(12px); pointer-events: none; }
.splash-glow { position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(40% 35% at 30% 40%, rgba(115, 168, 242, .30), transparent 70%),
              radial-gradient(35% 30% at 70% 60%, rgba(173, 133, 235, .26), transparent 70%),
              radial-gradient(30% 25% at 50% 90%, rgba(90, 200, 170, .14), transparent 70%);
  animation: splash-drift 6s ease-in-out infinite alternate; }
@keyframes splash-drift { from { transform: rotate(0deg) scale(1); } to { transform: rotate(14deg) scale(1.12); } }
.splash-body { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 0 16px; }
.splash-mark { width: 76px; height: 76px; border-radius: 22px; font-size: 30px; animation: splash-pop .9s cubic-bezier(.2, .9, .25, 1.2) both; }
/* Сначала «Re», потом из-за него выезжает «pinsales». */
.splash-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.splash-word { font-size: 40px; font-weight: 800; letter-spacing: -0.01em; animation: splash-word .8s cubic-bezier(.2, .8, .2, 1) .75s both; }
@keyframes splash-word { from { opacity: 0; transform: translateX(-36px); clip-path: inset(0 100% 0 0); filter: blur(6px); }
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); filter: none; } }
@keyframes splash-pop { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
/* «Добрый день, Имя» в одну строку; на узком экране имя уходит вниз. */
.splash-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: .3em; row-gap: 4px; font-size: clamp(30px, 5vw, 52px); }
.splash-hello { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; min-height: 1.2em; }
.splash-hello span { display: inline-block; opacity: 0; animation: splash-letter .55s cubic-bezier(.2, .8, .2, 1) both; white-space: pre; }
@keyframes splash-letter { from { opacity: 0; transform: translateY(.6em) rotateX(70deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.splash-name { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; min-height: 1.3em; opacity: 0;
  background: linear-gradient(90deg, rgb(115, 168, 242), rgb(190, 150, 245), rgb(115, 168, 242)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-name.show { animation: splash-name .8s ease both, splash-shine 2.4s linear .8s infinite; }
@keyframes splash-name { from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes splash-shine { to { background-position: -200% 0; } }
/* Времена года. Всё за текстом и не ловит клики. */
.season { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.season svg { display: block; width: 100%; height: auto; }
.fall { position: absolute; top: -60px; animation: season-fall linear infinite; }
@keyframes season-fall { to { transform: translateY(calc(100vh + 120px)); } }
.sway { animation: season-sway ease-in-out infinite alternate; }
@keyframes season-sway { from { transform: translateX(-26px) rotate(-40deg); } to { transform: translateX(26px) rotate(50deg); } }
.season.autumn .fall, .season.halloween .fall { opacity: .9; }
.season.winter .sway, .season.eve .sway, .season.newyear .sway { animation-name: season-drift; }
@keyframes season-drift { from { transform: translateX(-14px); } to { transform: translateX(14px); } }

/* Хэллоуин: паутина в углу, паук спускается к логотипу, тыква-фонарь снизу слева. */
.web { position: absolute; top: 0; right: 0; width: min(260px, 40vw) !important; animation: fade-in 1.2s ease both; }
.spider { position: absolute; top: 0; width: 84px; filter: drop-shadow(0 0 6px rgba(180, 150, 230, .35)); transform: translateY(var(--drop, 150px));
  animation: spider-drop 2.2s cubic-bezier(.25, .8, .35, 1.08) .2s both, spider-bob 1.8s ease-in-out 2.4s infinite alternate; }
.spider svg { transform: rotate(180deg); }
.spider .thread { position: absolute; bottom: 70%; left: 50%; width: 1px; height: 100vh; background: rgba(230, 230, 240, .45); }
@keyframes spider-drop { from { transform: translateY(-50px); } to { transform: translateY(var(--drop, 150px)); } }
@keyframes spider-bob { from { transform: translateY(var(--drop, 150px)) rotate(-3deg); } to { transform: translateY(calc(var(--drop, 150px) - 10px)) rotate(3deg); } }
.pumpkin { position: absolute; bottom: -8px; animation: pumpkin-rise 1.2s cubic-bezier(.2, .9, .3, 1.15) .4s both; }
/* Большая тыква выглядывает из правого нижнего угла, наклонившись к центру; видна примерно четверть экрана. */
.pumpkin.peek { --w: min(38vw, 64vh); width: var(--w); right: calc(var(--w) * -0.10); bottom: calc(var(--w) * -0.20);
  animation: pumpkin-peek 1.6s cubic-bezier(.2, .9, .3, 1.1) .3s both; }
.pumpkin.peek svg { transform: rotate(-32deg); filter: drop-shadow(0 0 40px rgba(255, 150, 40, .35)); }
@keyframes pumpkin-peek { from { transform: translate(35%, 45%); } to { transform: none; } }
@keyframes pumpkin-rise { from { transform: translateY(110%) rotate(-8deg); } to { transform: none; } }
.pumpkin .face { animation: pumpkin-glow 1.1s steps(1) infinite, pumpkin-flicker .17s ease-in-out infinite alternate; }
.pumpkin svg { filter: drop-shadow(0 0 22px rgba(255, 150, 40, .35)); }
@keyframes pumpkin-flicker { from { opacity: 1; } to { opacity: .72; } }
@keyframes pumpkin-glow { 0% { fill: #ffd36b; } 50% { fill: #ffe9a0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Новый год: гирлянда по верху, лампочки мигают по очереди. */
.garland { position: absolute; top: 0; left: 0; right: 0; height: 110px; animation: fade-in .8s ease both; }
.garland svg { position: absolute; inset: 0; width: 100%; height: 110px; }
.bulb { position: absolute; width: 14px; height: 21px; margin: -2px 0 0 -7px; border-radius: 50% 50% 45% 45% / 40% 40% 60% 60%;
  background: var(--c); box-shadow: 0 0 14px 4px var(--c); animation: bulb-blink 1.2s ease-in-out infinite; }
.bulb::before { content: ""; position: absolute; top: -5px; left: 3px; width: 6px; height: 6px; border-radius: 2px; background: #3a4436; }
@keyframes bulb-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; box-shadow: 0 0 4px 1px var(--c); } }

/* Зима: голова снеговика выглядывает из правого нижнего угла, рука-веточка машет. */
.snowman.peek { position: absolute; --w: min(44vw, 74vh); width: var(--w); right: calc(var(--w) * -0.08); bottom: calc(var(--w) * -0.22);
  animation: pumpkin-peek 1.6s cubic-bezier(.2, .9, .3, 1.1) .3s both; }
.snowman.peek svg { transform: rotate(-28deg); filter: drop-shadow(0 0 30px rgba(190, 220, 255, .25)); }
.snowman .wave { transform-origin: 40px 150px; transform-box: view-box; animation: snow-wave .55s ease-in-out 1.6s infinite alternate; }
@keyframes snow-wave { from { transform: rotate(-18deg); } to { transform: rotate(16deg); } }

@media (prefers-reduced-motion: reduce) {
  .splash-glow, .splash-mark, .splash-word, .splash-hello span, .splash-name.show { animation: none; opacity: 1; }
  .season { display: none; }
}

/* Житель сайта: тыква (Хэллоуин) или снеговик (зима). Маленький, у нижнего края, над содержимым. */
.mascot { position: fixed; bottom: 10px; z-index: 900; cursor: pointer; user-select: none; }
.mascot svg { display: block; width: 100%; height: auto; overflow: visible; }
.mascot-say { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; white-space: nowrap;
  padding: 7px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; color: var(--text);
  background: rgba(40, 42, 54, .92); border: 1px solid var(--panel-border); box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  animation: say-in .25s ease both; pointer-events: none; }
@keyframes say-in { from { opacity: 0; transform: translate(-50%, 6px) scale(.9); } to { opacity: 1; transform: translateX(-50%); } }

.pumpkin-mascot { right: 22px; width: 96px; }
/* Признаки жизни: «дышит», каждые 3 с подскакивает; под мышкой покачивается. */
.pumpkin-mascot .mascot-alive { animation: pumpkin-alive 3s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes pumpkin-alive {
  0%, 100% { transform: scale(1, 1); }
  30% { transform: scale(1.04, .96); }
  60% { transform: scale(.98, 1.03); }
  72% { transform: scale(1.06, .9); }
  80% { transform: translateY(-14px) scale(.97, 1.04); }
  88% { transform: scale(1.05, .93); }
}
.pumpkin-mascot:hover .mascot-alive { animation: pumpkin-wiggle .5s ease-in-out infinite alternate; }
@keyframes pumpkin-wiggle { from { transform: rotate(-8deg) scale(1.06); } to { transform: rotate(8deg) scale(1.06); } }
.pumpkin-mascot .mascot-body { animation: pumpkin-hops 10s ease-in-out 3s infinite; transform-origin: 50% 100%; }
.pumpkin-mascot svg { filter: drop-shadow(0 0 10px rgba(255, 150, 40, .35)); }
.pumpkin-mascot .face { animation: pumpkin-flicker .17s ease-in-out infinite alternate; }
/* Раз в 10 секунд: прыжок влево и прыжок обратно вправо. */
@keyframes pumpkin-hops {
  0%, 86%, 100% { transform: none; }
  87% { transform: scale(1.08, .9); }
  90% { transform: translate(-22px, -30px) rotate(-10deg); }
  92.5% { transform: translate(-30px, 0) scale(1.08, .9); }
  95.5% { transform: translate(-8px, -30px) rotate(10deg); }
  98% { transform: scale(1.06, .92); }
}
.pumpkin-mascot.boo .mascot-body { animation: pumpkin-boo .6s ease; }
.pumpkin-mascot.boo .face { fill: #fff3b0; filter: drop-shadow(0 0 6px #ffd36b); }
@keyframes pumpkin-boo { 0% { transform: none; } 30% { transform: scale(1.35) rotate(-6deg); } 60% { transform: scale(.95) rotate(4deg); } 100% { transform: none; } }

.snowman-mascot { left: 0; width: 62px; will-change: transform; }
.snowman-mascot .mascot-body { animation: snowman-waddle .9s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.snowman-mascot.left svg { transform: scaleX(-1); }
.snowman-mascot.stop .mascot-body { animation: none; }
.snowman-mascot.hop .mascot-body { animation: snowman-hop .7s ease; }
.snowman-mascot .arm { transform-origin: 83px 66px; transform-box: view-box; }
.snowman-mascot.stop .arm, .snowman-mascot.hop .arm { animation: snow-wave .3s ease-in-out infinite alternate; }
@keyframes snowman-waddle { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-2px); } }
@keyframes snowman-hop { 0%, 100% { transform: none; } 20% { transform: scale(1.1, .88); } 50% { transform: translateY(-34px) rotate(-6deg); } 80% { transform: scale(1.08, .92); } }
.snow-puff { position: absolute; left: 50%; bottom: 30%; pointer-events: none; }
.snow-puff i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0;
  animation: puff .9s ease-out both; }
@keyframes puff { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))); } }

/* Нет данных на сервере — спокойная надпись вместо ошибки. */
.soft-note { display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 20px 22px; }
.soft-note .soft-icon { font-size: 28px; }
.soft-note b { display: block; font-size: 16px; margin-bottom: 2px; }
