/* ONUAudit — тёмная тема */
:root {
  --bg: #0a0f1c;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .10), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(45, 212, 191, .06), transparent 60%);
  --panel: #111827;
  --panel-2: #0d1422;
  --panel-3: #162033;
  --line: #1f2a3d;
  --line-2: #2a3850;
  --ink: #e5eaf3;
  --ink-2: #c3cddd;
  --muted: #8b9ab3;
  --faint: #5d6b84;
  --accent: #818cf8;
  --accent-2: #6366f1;
  --accent-ink: #ffffff;
  --added: #34d399;
  --replaced: #fbbf24;
  --removed: #f87171;
  --moved: #60a5fa;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #818cf8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .25);
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  color: var(--ink); font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #a5b4fc; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin: 2px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 650; margin: 0; letter-spacing: -.1px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-3); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink { color: var(--ink); }
.ok { color: var(--ok); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.mono-h { font-family: var(--mono); font-weight: 650; letter-spacing: -.5px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── Верхняя панель ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 58px;
  background: rgba(13, 20, 34, .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; font-size: 16px; letter-spacing: -.2px; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--ink-2); font-weight: 550; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
}
.chip .dot, .dotline::before { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; content: ""; }
.chip-ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
.chip-warn .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .15); }
.chip-bad { color: #fca5a5; border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .10); font-weight: 650; }
.chip-bad:hover { color: #fecaca; }
.chip-bad .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, .22); }
.dotline.bad::before { background: var(--bad); }

/* ── Сбой источника ─────────────────────────────── */
.source-alert {
  display: flex; align-items: flex-start; gap: 10px 18px; flex-wrap: wrap; padding: 13px 18px; margin-bottom: 16px;
  border-radius: var(--radius); border: 1px solid rgba(248, 113, 113, .45);
  background: linear-gradient(90deg, rgba(248, 113, 113, .17), rgba(248, 113, 113, .06) 70%), var(--panel);
  box-shadow: 0 10px 30px rgba(248, 113, 113, .08);
}
.sa-title { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 15px; color: #fca5a5; white-space: nowrap; }
.sa-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: sa-pulse 1.8s ease-out infinite; flex: none; }
@keyframes sa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .6); }
  70% { box-shadow: 0 0 0 9px rgba(248, 113, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
}
@media (prefers-reduced-motion: reduce) { .sa-dot { animation: none; } }
.sa-list { list-style: none; margin: 1px 0 0; padding: 0; flex: 1; min-width: 260px; color: var(--ink-2); font-size: 13px; }
.sa-list li + li { margin-top: 4px; }
.sa-list b { color: var(--ink); }
.sa-more { color: #fca5a5; font-weight: 650; white-space: nowrap; margin-top: 1px; }
.sa-more:hover { color: #fecaca; }
.table tbody tr.fail td { background: rgba(248, 113, 113, .06); }
.table tbody tr.fail td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.fail-tag { display: block; font-size: 11px; font-weight: 700; color: #fca5a5; letter-spacing: .2px; }
.vcard.fail { border-color: rgba(248, 113, 113, .55); box-shadow: 0 0 0 1px rgba(248, 113, 113, .12), var(--shadow); }
.dotline { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dotline.ok::before { background: var(--ok); }
.dotline.warn::before { background: var(--warn); }

/* ── Каркас ─────────────────────────────── */
.container { width: 100%; max-width: 1480px; margin: 0 auto; padding: 22px 24px 30px; flex: 1; }
.footer { text-align: center; color: var(--faint); font-size: 12px; padding: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 40%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head.wrap { flex-wrap: wrap; }
.cols { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cols > .card { flex: 1 1 320px; }
.cols > .grow2 { flex: 2 1 560px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ── Кнопки и поля ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2);
  font: 550 13px/1 var(--sans); cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { background: #1c2840; border-color: #3a4a66; color: var(--ink); }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger:hover { background: rgba(248, 113, 113, .14); border-color: var(--bad); color: var(--bad); }
.btn-warn { border-color: rgba(251, 191, 36, .5); color: var(--warn); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 42px; font-size: 14px; }
.btn.disabled { opacity: .4; pointer-events: none; }
.btn[disabled], .btn.busy { opacity: .6; cursor: progress; }
.input, .select, .range input {
  height: 36px; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 0 11px; font: 13.5px var(--sans); outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .range input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(129, 140, 248, .18); }
.input-sm { height: 30px; font-size: 12.5px; width: 150px; }
.select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b9ab3' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select option { background: var(--panel); }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 550; }
.field .input { width: 100%; height: 40px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); margin: 4px 0 14px; cursor: pointer; }
.check input { accent-color: var(--accent-2); width: 16px; height: 16px; }
.form { max-width: 420px; }

/* ── Фильтры ─────────────────────────────── */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: 13px; white-space: nowrap; }
.seg a:hover { color: var(--ink); background: rgba(255, 255, 255, .03); }
.seg a.on { background: var(--panel-3); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2) inset; }
.range {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; height: 36px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--muted);
}
.range.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(129, 140, 248, .14); color: var(--ink); }
.range input { border: 0; height: 32px; padding: 0 6px; background: transparent; box-shadow: none !important; width: 132px; }
.range input.fp-range { width: 230px; cursor: pointer; color: var(--ink); }
.range input::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
.search { position: relative; display: inline-flex; align-items: center; min-width: 220px; }
.search.grow { flex: 1; max-width: 460px; }
.search .ico { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 34px; width: 100%; }
.evfilter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -18px 4px; padding: 0 14px; overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 10px; color: var(--muted); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11.5px; color: var(--faint); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.tabs a.on .n { color: var(--ink-2); }

/* ── Карточки статистики ─────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--shadow);
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c, var(--accent)); }
.stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--accent)) 16%, transparent), transparent 70%);
}
.stat-added { --c: var(--added); }
.stat-replaced { --c: var(--replaced); }
.stat-removed { --c: var(--removed); }
.stat-total { --c: var(--accent); }
.stat-installed { --c: #2dd4bf; }
.c-installed { color: #2dd4bf !important; }
.cnt.c-installed { background: rgba(45, 212, 191, .12); }
.reason.pending { color: var(--warn); }
.stat-label { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat-num { font-size: 34px; font-weight: 750; letter-spacing: -1px; line-height: 1.15; margin: 4px 0 2px; color: var(--c); }
.stat-total .stat-num { color: var(--ink); }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.delta { font-weight: 650; color: var(--muted); }
.delta.up { color: var(--added); }
.delta.down { color: var(--removed); }

/* ── Таблицы ─────────────────────────────── */
.tablewrap { overflow-x: auto; margin: 0 -18px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 12px; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table thead th {
  font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid rgba(31, 42, 61, .7); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .018); }
.table tbody tr.sel td { background: rgba(129, 140, 248, .07); }
.table tfoot td { border-top: 1px solid var(--line-2); font-weight: 700; background: var(--panel-2); }
.table .num { text-align: right; white-space: nowrap; }
.table td.desc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.table td.desc.wide { max-width: 420px; }
.rowlink { cursor: pointer; }
.cnt { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 7px; font-weight: 700; text-align: center; }
.cnt.zero { color: var(--faint); font-weight: 500; }
.cnt.c-added { background: rgba(52, 211, 153, .12); }
.cnt.c-replaced { background: rgba(251, 191, 36, .12); }
.cnt.c-removed { background: rgba(248, 113, 113, .12); }
.cnt.c-moved { background: rgba(96, 165, 250, .12); }
.c-added { color: var(--added) !important; }
.c-replaced { color: var(--replaced) !important; }
.c-removed { color: var(--removed) !important; }
.c-moved { color: var(--moved) !important; }
th.c-added, th.c-replaced, th.c-removed, th.c-moved { opacity: .9; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-added { background: rgba(52, 211, 153, .14); color: var(--added); }
.badge-replaced { background: rgba(251, 191, 36, .14); color: var(--replaced); }
.badge-removed { background: rgba(248, 113, 113, .14); color: var(--removed); }
.badge-moved { background: rgba(96, 165, 250, .14); color: var(--moved); }
.reason { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pill { display: inline-block; font-size: 11px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: rgba(52, 211, 153, .13); color: var(--ok); }
.pill-bad { background: rgba(248, 113, 113, .13); color: var(--bad); }
.pill-warn { background: rgba(251, 191, 36, .13); color: var(--warn); }
.pill-info { background: rgba(129, 140, 248, .15); color: var(--info); }
.pill-x { background: var(--panel-3); color: var(--muted); }
.sig { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.sig-ok { color: #86efac; }
.sig-warn { color: #fcd34d; }
.sig-crit { color: #fca5a5; font-weight: 650; }
.chg { display: flex; flex-direction: column; line-height: 1.35; }
.chg .was { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(248, 113, 113, .55); }
.chg .now { color: var(--ink); }
.chg .now::before { content: "→ "; color: var(--faint); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.sw-added { background: var(--added); }
.sw-replaced { background: var(--replaced); }
.sw-removed { background: var(--removed); }
.sw-moved { background: var(--moved); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0 2px; color: var(--muted); font-size: 13px; }

/* ── Сообщения ─────────────────────────────── */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; border: 1px solid var(--line-2); background: var(--panel); border-left: 3px solid var(--info); }
.flash-ok { border-left-color: var(--ok); }
.flash-warn { border-left-color: var(--warn); }
.flash-error { border-left-color: var(--bad); background: rgba(248, 113, 113, .07); }
.flash-info { border-left-color: var(--info); }
.flash code { white-space: nowrap; }

/* ── График ─────────────────────────────── */
.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-family: var(--sans); }
.chart .bar-added { fill: var(--added); }
.chart .bar-replaced { fill: var(--replaced); }
.chart .bar-removed { fill: var(--removed); }
.chart .col-hit { fill: transparent; cursor: default; }
.chart .col-hit:hover { fill: rgba(255, 255, 255, .035); }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: #0b1222; border: 1px solid var(--line-2);
  border-radius: 10px; padding: 8px 11px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); white-space: nowrap;
}
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.tip span.v { margin-left: auto; padding-left: 14px; font-weight: 700; color: var(--ink); }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.lg {
  display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px; padding: 4px 11px; font: 550 12px var(--sans); cursor: pointer;
}
.lg.on { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.lg:not(.on) .sw { opacity: .3; }

/* ── Синхронизация ─────────────────────────────── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.vcard { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.vcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vname { font-weight: 700; font-size: 15px; }
.vnum { font-size: 28px; font-weight: 750; letter-spacing: -.6px; }
.vmsg { font-size: 12px; padding: 7px 9px; border-radius: 8px; line-height: 1.4; }
.vmsg.bad { background: rgba(248, 113, 113, .08); color: #fca5a5; }
.vmsg.warn { background: rgba(251, 191, 36, .08); color: #fcd34d; }
.vactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 22px; margin: 0; }
.kv dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 650; margin-bottom: 3px; }
.kv dd { margin: 0; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 6px; margin: 0; }

/* ── Вход ─────────────────────────────── */
.login-page .container { display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 400px; margin: 7vh auto; }
.login-card { padding: 28px; }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.login-title { font-size: 21px; font-weight: 750; letter-spacing: -.3px; }

/* ── flatpickr (тёмная тема) ─────────────────────────────── */
.flatpickr-calendar {
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  border-radius: 12px; color: var(--ink); width: auto !important;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--line-2); }
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { border-top-color: var(--line-2); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: var(--ink); fill: var(--ink); background: transparent; }
.flatpickr-current-month .flatpickr-monthDropdown-months option { background: var(--panel); }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--muted); fill: var(--muted); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--accent); }
span.flatpickr-weekday { color: var(--faint); font-weight: 600; }
.flatpickr-day { color: var(--ink-2); border-radius: 8px; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--panel-3); border-color: var(--panel-3); color: var(--ink); }
.flatpickr-day.today { border-color: var(--accent); }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover { color: #3a4760; }
.flatpickr-day.inRange, .flatpickr-day.inRange:hover {
  background: rgba(129, 140, 248, .18); border-color: transparent; box-shadow: -5px 0 0 rgba(129, 140, 248, .18), 5px 0 0 rgba(129, 140, 248, .18); color: var(--ink);
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover {
  background: var(--accent-2); border-color: var(--accent-2); color: #fff;
}
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { box-shadow: -10px 0 0 var(--accent-2); }
.flatpickr-day.week.selected { box-shadow: none; }
.fp-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 12px; border-top: 1px solid var(--line); }
.fp-shortcuts button {
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 7px;
  padding: 4px 9px; font: 550 12px var(--sans); cursor: pointer;
}
.fp-shortcuts button:hover { border-color: var(--accent); color: var(--ink); }

/* ── Адаптивность ─────────────────────────────── */
@media (max-width: 1300px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px 0; gap: 8px 14px; }
  .nav { order: 3; width: 100%; overflow-x: auto; height: 42px; }
  .topbar-right .who { display: none; }
  .container { padding: 16px 12px 24px; }
  .card { padding: 14px; }
  .tablewrap { margin: 0; }
  .tabs { margin: 0 -14px 8px; }
  .table thead { display: none; }
  .table, .table tbody, .table tfoot { display: block; }
  .table tr { display: block; background: var(--panel-2); border: 1px solid var(--line) !important; border-radius: 12px; margin-bottom: 10px; padding: 4px 12px; }
  .table td, .table td:first-child, .table td:last-child {
    display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 7px 0;
    border-bottom: 1px solid var(--line); text-align: right; white-space: normal; max-width: none !important;
  }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
  .table td.desc { white-space: normal; }
  .chg { align-items: flex-end; }
  .filterbar > * { flex: 1 1 auto; }
  .range input.fp-range { width: 100%; }
  .search { min-width: 0; width: 100%; }
  .stat-num { font-size: 28px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .seg a { padding: 6px 9px; }
}
