/* Fantasia panel — тот же язык, что у лендингов: indigo / orchid / gold. */
:root {
  --indigo: #1b1530;
  --indigo-2: #241c3d;
  --ink: #0c0914;
  --orchid: #c4a0d8;
  --orchid-2: #e7d4f2;
  --gold: #c9a86a;
  --gold-2: #f0ddb0;
  --silk: #f4efe8;
  --muted: rgba(244, 239, 232, .62);
  --faint: rgba(244, 239, 232, .38);
  --line: rgba(244, 239, 232, .12);
  --line-2: rgba(244, 239, 232, .2);
  --card: rgba(27, 21, 48, .62);
  --card-2: rgba(36, 28, 61, .7);
  --good: #8fd19e;
  --bad: #ef8a8a;
  --warn: #f0c27a;
  --blue: #8aa4f0;
  --teal: #7fd1c2;
  --rose: #e58fb3;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --radius: 18px;
  --side: 252px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--silk);
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(196, 160, 216, .20), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(201, 168, 106, .08), transparent 55%),
    var(--ink);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--orchid-2); text-decoration: none; }
a:hover { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(196, 160, 216, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(244, 239, 232, .14); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(244, 239, 232, .28); background-clip: padding-box; border: 2px solid transparent; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(27, 21, 48, .92), rgba(12, 9, 20, .92));
  backdrop-filter: blur(14px);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.brand img.mark { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(196, 160, 216, .35)); }
.brand img.word { height: 26px; width: auto; }
.brand small { display: block; color: var(--faint); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; margin-top: 2px; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; color: var(--faint); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0; border-radius: 12px;
  color: var(--muted); font-weight: 500; transition: background .25s var(--ease), color .25s var(--ease);
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(244, 239, 232, .06); color: var(--silk); }
.nav a.on {
  color: var(--silk);
  background: linear-gradient(90deg, rgba(196, 160, 216, .22), rgba(196, 160, 216, .04));
  box-shadow: inset 2px 0 0 var(--gold);
}
.nav a .badge { margin-left: auto; }
.badge {
  min-width: 20px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--gold); color: #24180c; font-size: 11px; font-weight: 700;
}
.badge.red { background: var(--bad); }
.side-foot { margin-top: 22px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(244, 239, 232, .03); color: var(--muted); font-size: 12px; }
.side-foot b { color: var(--silk); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(12, 9, 20, .94), rgba(12, 9, 20, .78));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .grow { flex: 1; }
.burger { display: none; }
.page { padding: 26px 24px 70px; width: min(1480px, 100%); margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 {
  margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500;
  font-size: clamp(32px, 4vw, 46px); line-height: 1; letter-spacing: -.02em;
}
.page-head h1 em {
  font-style: italic; background: linear-gradient(100deg, var(--silk), var(--orchid-2) 55%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.kicker { color: var(--gold); letter-spacing: .22em; text-transform: uppercase; font-size: 11px; font-weight: 600; margin-bottom: 6px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 999px; padding: 9px 16px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #24180c;
  font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(201, 168, 106, .22);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(201, 168, 106, .34); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--silk); box-shadow: none; border: 1px solid rgba(201, 168, 106, .5); }
.btn.ghost:hover { background: rgba(201, 168, 106, .1); box-shadow: none; }
.btn.soft { background: rgba(244, 239, 232, .07); color: var(--silk); box-shadow: none; border: 1px solid var(--line); font-weight: 600; }
.btn.soft:hover { background: rgba(244, 239, 232, .12); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #f3a3a3, #d96b6b); color: #2a0c0c; box-shadow: 0 6px 20px rgba(217, 107, 107, .22); }
.btn.good { background: linear-gradient(180deg, #b4e6bf, #7bc68b); color: #0d2414; box-shadow: 0 6px 20px rgba(123, 198, 139, .2); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn.xs { padding: 3px 9px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

.inp, .sel, .ta {
  width: 100%; padding: 9px 13px; border-radius: 12px;
  background: rgba(12, 9, 20, .55); border: 1px solid var(--line-2); color: var(--silk);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.inp::placeholder, .ta::placeholder { color: var(--faint); }
.inp:focus, .sel:focus, .ta:focus { border-color: var(--orchid); box-shadow: 0 0 0 3px rgba(196, 160, 216, .18); }
.sel { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23c4a0d8' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.sel option { background: #1b1530; }
.ta { min-height: 80px; resize: vertical; }
.inp.sm, .sel.sm { padding: 6px 11px; font-size: 13px; }
label.fld { display: block; }
label.fld > span { display: block; margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--muted); user-select: none; }
.chk input { accent-color: var(--orchid); width: 16px; height: 16px; }

/* ---------- карточки ---------- */
.card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--card-2), var(--card));
  padding: 18px 20px; min-width: 0;
}
.card.pad0 { padding: 0; overflow: hidden; }
.card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.card .sub { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.card-head .sub { margin: 2px 0 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; }
.mt0 { margin-top: 0; }

.kpi { padding: 16px 18px 14px; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .val small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--faint); min-height: 18px; flex-wrap: wrap; }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 46px; opacity: .9; pointer-events: none; }
.kpi.accent { border-color: rgba(201, 168, 106, .45); background: linear-gradient(160deg, rgba(201, 168, 106, .14), rgba(36, 28, 61, .75)); }
.kpi .ic { position: absolute; right: 14px; top: 12px; width: 22px; height: 22px; color: var(--orchid); opacity: .5; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); background: rgba(143, 209, 158, .12); }
.delta.down { color: var(--bad); background: rgba(239, 138, 138, .12); }
.delta.flat { color: var(--faint); background: rgba(244, 239, 232, .06); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: rgba(244, 239, 232, .08); color: var(--muted); border: 1px solid transparent;
}
.tag.good { color: var(--good); background: rgba(143, 209, 158, .12); }
.tag.bad { color: var(--bad); background: rgba(239, 138, 138, .12); }
.tag.warn { color: var(--warn); background: rgba(240, 194, 122, .12); }
.tag.info { color: var(--blue); background: rgba(138, 164, 240, .12); }
.tag.gold { color: var(--gold-2); background: rgba(201, 168, 106, .16); }
.tag.orchid { color: var(--orchid-2); background: rgba(196, 160, 216, .16); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; text-align: left; padding: 11px 14px; white-space: nowrap;
  color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); background: rgba(27, 21, 48, .9);
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--silk); }
.tbl th.sorted { color: var(--gold-2); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid rgba(244, 239, 232, .06); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(196, 160, 216, .07); }
.tbl tbody tr.click { cursor: pointer; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.tbl .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; color: var(--muted); }
.tbl .dim { color: var(--faint); }
.empty { padding: 38px 20px; text-align: center; color: var(--faint); }
.empty b { display: block; color: var(--muted); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.pager .pages { display: flex; gap: 4px; }
.pager button { min-width: 32px; padding: 5px 9px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.pager button:hover { color: var(--silk); border-color: var(--line-2); }
.pager button.on { background: var(--gold); color: #24180c; border-color: var(--gold); font-weight: 700; }
.pager button:disabled { opacity: .35; pointer-events: none; }

.who { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #1b1530; background: linear-gradient(140deg, var(--orchid-2), var(--orchid)); }
.who b { font-weight: 600; display: block; line-height: 1.15; }
.who small { color: var(--faint); font-size: 11.5px; display: block; }

/* ---------- фильтры ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters .fld { min-width: 130px; flex: 0 1 auto; }
.filters .fld.wide { min-width: 220px; flex: 1 1 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.chip:hover { color: var(--silk); border-color: var(--orchid); }
.chip.on { background: rgba(196, 160, 216, .2); border-color: var(--orchid); color: var(--silk); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(27, 21, 48, .7); }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.seg button:hover { color: var(--silk); }
.seg button.on { background: var(--silk); color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { position: relative; border: 0; background: transparent; padding: 10px 16px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button:hover { color: var(--silk); }
.tabs button.on { color: var(--silk); }
.tabs button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--orchid)); border-radius: 2px; }

/* выпадающие меню */
.dd { position: relative; }
.dd-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(27, 21, 48, .75); font-weight: 600; font-size: 13px; }
.dd-btn:hover { border-color: var(--orchid); }
.dd-btn svg { width: 14px; height: 14px; color: var(--orchid); }
.dd-btn .lbl { color: var(--faint); font-weight: 500; }
.dd-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 250px;
  padding: 8px; border-radius: 16px; border: 1px solid var(--line-2);
  background: rgba(27, 21, 48, .98); box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: pop .18s var(--ease);
}
.dd-menu.right { left: auto; right: 0; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; background: transparent; border-radius: 10px; text-align: left; color: var(--muted); }
.dd-item:hover { background: rgba(244, 239, 232, .07); color: var(--silk); }
.dd-item.on { color: var(--silk); background: rgba(196, 160, 216, .16); }
.dd-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-list { max-height: 300px; overflow-y: auto; margin-top: 6px; }
/* крутилка часового пояса */
.tzw-wrap { width: 260px; }
.tzw-box { position: relative; height: 180px; }
.tzw-band { position: absolute; left: 4px; right: 4px; top: 72px; height: 36px; border-radius: 10px; background: rgba(196, 160, 216, .16); border: 1px solid var(--line-2); pointer-events: none; }
.tzw {
  position: relative; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; outline: none; cursor: grab;
  scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-y; user-select: none;
  -webkit-mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
  mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
}
.tzw::-webkit-scrollbar { display: none; }
.tzw.drag { scroll-snap-type: none; cursor: grabbing; }
.tzw-pad { height: 72px; }
.tzw-row { height: 36px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; color: var(--faint); font-weight: 600; font-size: 14px; transition: color .15s; }
.tzw-row.on { color: var(--silk); font-size: 15px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- графики ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: rgba(244, 239, 232, .07); }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(12, 9, 20, .96); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); font-size: 12px;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip .t { color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.tip .l { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.tip .l i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.tip .l b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar .top2 { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 4px; }
.hbar .top2 span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .top2 b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .track { height: 8px; border-radius: 999px; background: rgba(244, 239, 232, .07); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 999px; transition: width .7s var(--ease); }
.hbar small { color: var(--faint); font-size: 11.5px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.donut-legend div { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.donut-legend b { font-variant-numeric: tabular-nums; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fstep { position: relative; }
.fstep .bar { height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-weight: 700; background: linear-gradient(90deg, rgba(196, 160, 216, .55), rgba(196, 160, 216, .22)); min-width: 120px; transition: width .7s var(--ease); }
.fstep:nth-child(2) .bar { background: linear-gradient(90deg, rgba(138, 164, 240, .55), rgba(138, 164, 240, .2)); }
.fstep:nth-child(3) .bar { background: linear-gradient(90deg, rgba(201, 168, 106, .65), rgba(201, 168, 106, .25)); }
.fstep:nth-child(4) .bar { background: linear-gradient(90deg, rgba(143, 209, 158, .55), rgba(143, 209, 158, .2)); }
.fstep .bar span { font-weight: 600; font-size: 13px; }
.fstep .conv { margin: 3px 0 0 6px; color: var(--faint); font-size: 11.5px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10.5px; color: var(--faint); }
.heat .cell { aspect-ratio: 1 / .78; border-radius: 4px; background: rgba(244, 239, 232, .05); position: relative; }
.heat .lab { display: flex; align-items: center; }
.heat .hl { text-align: center; }

/* ---------- прочее ---------- */
.split { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed rgba(244, 239, 232, .08); }
.split:last-child { border-bottom: 0; }
.split span { color: var(--muted); }
.split b { font-variant-numeric: tabular-nums; text-align: right; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.alert { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(244, 239, 232, .04); display: flex; gap: 12px; align-items: center; }
.alert.warn { border-color: rgba(240, 194, 122, .4); background: rgba(240, 194, 122, .08); }
.alert.bad { border-color: rgba(239, 138, 138, .4); background: rgba(239, 138, 138, .08); }
.alerts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.alert a { margin-left: auto; font-weight: 700; white-space: nowrap; }
.feed { display: flex; flex-direction: column; }
.feed .it { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(244, 239, 232, .06); }
.feed .it:last-child { border-bottom: 0; }
.feed .it .grow b { display: block; }
.feed .it .grow small { color: var(--faint); }
.feed .amt { font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
.skeleton { border-radius: 14px; min-height: 120px; background: linear-gradient(100deg, rgba(244, 239, 232, .04) 30%, rgba(244, 239, 232, .09) 50%, rgba(244, 239, 232, .04) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(244, 239, 232, .2); border-top-color: var(--gold); animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.gold { color: var(--gold-2); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }

/* модальные окна и уведомления */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(8, 5, 14, .7); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; border-radius: 22px; border: 1px solid var(--line-2); background: linear-gradient(160deg, #271e44, #1b1530); box-shadow: 0 40px 100px rgba(0, 0, 0, .65); animation: pop .22s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.modal-h h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 28px; letter-spacing: -.01em; }
.modal-x { border: 0; background: rgba(244, 239, 232, .07); width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 18px; line-height: 1; }
.modal-x:hover { color: var(--silk); }
.modal-b { padding: 14px 22px 8px; color: var(--muted); }
.modal-b .form { display: grid; gap: 14px; margin-top: 8px; color: var(--silk); }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(27, 21, 48, .98); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: slide .3s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-color: rgba(143, 209, 158, .5); }
.toast.err { border-color: rgba(239, 138, 138, .55); }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 34px 32px; text-align: center; border-radius: 28px; border: 1px solid transparent; background: linear-gradient(#1b1530, #17112a) padding-box, linear-gradient(160deg, rgba(240, 221, 176, .9), rgba(196, 160, 216, .2) 42%, rgba(201, 168, 106, .45)) border-box; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.login-card img.mark { width: 84px; height: 84px; margin: 0 auto 16px; filter: drop-shadow(0 0 18px rgba(196, 160, 216, .4)); }
.login-card h1 { margin: 0 0 8px; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 40px; line-height: 1; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.login-card .err { color: var(--bad); margin-top: 14px; min-height: 20px; }
.login-card code { background: rgba(244, 239, 232, .08); padding: 2px 8px; border-radius: 8px; color: var(--gold-2); }
.petals { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.petals i { position: absolute; top: -12vh; width: 11px; height: 16px; border-radius: 70% 10% 70% 10%; background: linear-gradient(160deg, rgba(231, 212, 242, .85), rgba(196, 160, 216, .15)); opacity: .5; animation: fall linear infinite; }
.petals i:nth-child(1) { left: 8%; animation-duration: 16s; animation-delay: -2s; }
.petals i:nth-child(2) { left: 28%; animation-duration: 21s; animation-delay: -9s; width: 8px; height: 12px; }
.petals i:nth-child(3) { left: 51%; animation-duration: 18s; animation-delay: -4s; }
.petals i:nth-child(4) { left: 72%; animation-duration: 23s; animation-delay: -12s; width: 14px; height: 18px; }
.petals i:nth-child(5) { left: 92%; animation-duration: 19s; animation-delay: -6s; }
@keyframes fall { 0% { transform: translate3d(0, -10vh, 0) rotate(0); } 100% { transform: translate3d(40px, 110vh, 0) rotate(220deg); } }
.login-card, .login .wrapz { position: relative; z-index: 1; }

/* ---------- адаптив ---------- */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: 30px 0 80px rgba(0, 0, 0, .6); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(8, 5, 14, .6); z-index: 25; }
  .burger { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(27, 21, 48, .8); }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .top, .page { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 21px; }
  .kpi .spark { display: none; }
  .heat { font-size: 8px; }
  .modal-h h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
