:root {
  --bg: #070B12; --side: #0A0F17; --card: #0E141E; --raise: #121A26; --hover: #111925; --field: #0B111A;
  --line: #1A2330; --line2: #243041; --line3: #131B26;
  --text: #EEF3F6; --text2: #C5D2D8; --muted: #A3B4BD; --dim: #8FA3AD;
  --mint: #41F0C9; --mint2: #86F7DD; --mintbg: rgba(65,240,201,.10); --ink: #04231B;
  --orange: #FFB45C; --orangebg: rgba(255,180,92,.12); --red: #FF8A8E; --redbg: rgba(255,107,112,.12);
  --blue: #8DB8FF; --bluebg: rgba(110,168,255,.12); --gray: rgba(255,255,255,.06);
  --r: 16px; --head: Manrope, sans-serif; --body: 'Golos Text', system-ui, sans-serif; --mono: 'JetBrains Mono', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
a { color: var(--mint); } a:hover { color: var(--mint2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; } h3 { font-size: 14px; font-weight: 700; }
.num { font-family: var(--head); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .mint { color: var(--mint); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.hidden { display: none !important; }

/* каркас */
.shell { display: flex; min-height: 100vh; }
.side { width: 260px; flex: none; background: var(--side); border-right: 1px solid #151D29; padding: 20px 14px 18px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 32px; border-bottom: 1px solid var(--line3); }
.top .ttl { flex: 1 1 220px; min-width: 0; }
.top h1 { font-size: 24px; line-height: 1.2; margin-top: 3px; }
.crumb { font-size: 13px; color: var(--dim); }
.content { padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1360px; }
.btn.menu-btn { display: none; }
.scrim { display: none; }
.banner-as { background: #2A2216; color: #FFD7A8; padding: 10px 32px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media (max-width: 960px) {
  .side { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .btn.menu-btn { display: inline-flex; }
  .top, .content, .banner-as { padding-left: 16px; padding-right: 16px; }
}

/* меню */
.logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px; min-width: 0; }
.logo .mark { width: 32px; height: 32px; border-radius: 10px; background: var(--mint); color: var(--ink); display: flex; align-items: center; justify-content: center; font: 800 16px/1 var(--head); }
.logo .word { font: 800 18px/1.1 var(--head); letter-spacing: -.01em; }
.logo .sub { font-size: 12px; font-weight: 600; color: var(--mint); margin-top: 3px; white-space: nowrap; }
.pill { font-size: 11px; font-weight: 600; color: var(--mint); background: var(--mintbg); padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.botcard { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #1C2533; border-radius: 12px; background: var(--card); color: var(--text); text-decoration: none; width: 100%; cursor: pointer; text-align: left; }
.botcard:hover { background: var(--hover); color: var(--text); }
.ava { border-radius: 50%; background: #1B3140; color: var(--mint2); display: flex; align-items: center; justify-content: center; font: 700 13px/1 var(--head); flex: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); display: inline-block; flex: none; }
.dot.off { background: var(--orange); } .dot.err { background: var(--red); }
.nav { display: flex; flex-direction: column; gap: 14px; }
.nav .grp { display: flex; flex-direction: column; gap: 2px; }
.nav .gt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6F8590; padding: 0 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: #142030; color: var(--text); font-weight: 600; }
.nav a svg { color: #7A8D97; flex: none; } .nav a.on svg { color: var(--mint); }
.nav .badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); background: #141D2A; padding: 3px 8px; border-radius: 999px; }
.nav .badge.hot { color: #1F1405; background: var(--orange); }
.helpcard { padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid #1C2533; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.dropdown { position: relative; }
.dropdown .list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--raise); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; z-index: 20; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.dropdown .list button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 14px; }
.dropdown .list button:hover { background: var(--hover); }

/* элементы */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--raise); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #172131; color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.p { background: var(--mint); border-color: var(--mint); color: var(--ink); } .btn.p:hover { background: #6AF4D6; color: var(--ink); }
.btn.d { color: var(--red); border-color: #3A2229; background: #1A1216; } .btn.d:hover { background: #22161B; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.icon { width: 42px; padding: 0; }
.in { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--field); color: var(--text); font-size: 14px; }
.in:focus { border-color: var(--mint); outline: none; }
textarea.in { padding: 12px 14px; line-height: 1.55; resize: vertical; }
select.in { cursor: pointer; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.45; }
.field { display: flex; flex-direction: column; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.c-active { color: var(--mint); background: var(--mintbg); } .c-trial { color: var(--blue); background: var(--bluebg); }
.c-soon, .c-pending, .c-new { color: var(--orange); background: var(--orangebg); } .c-expired { color: var(--text2); background: rgba(255,255,255,.07); }
.c-none { color: var(--dim); background: rgba(255,255,255,.04); } .c-blocked, .c-rejected { color: var(--red); background: var(--redbg); }
.c-paid, .c-done { color: var(--mint); background: var(--mintbg); } .c-scheduled, .c-sending { color: var(--blue); background: var(--bluebg); } .c-cancelled { color: var(--dim); background: var(--gray); }
.segs { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.seg .n { font-size: 12px; color: var(--dim); }
.seg.on { background: #142030; border-color: #2A4A52; color: var(--text); } .seg.on .n { color: var(--mint); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.tabs button { min-height: 34px; padding: 0 14px; border-radius: 9px; border: 0; cursor: pointer; font-size: 13px; font-weight: 600; background: transparent; color: var(--dim); }
.tabs button.on { background: #1B2738; color: var(--text); }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice button { flex: 1; white-space: nowrap; min-width: 64px; min-height: 44px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; border: 1px solid var(--line2); background: var(--field); color: var(--muted); padding: 0 12px; }
.choice button.on { background: #142030; border-color: var(--mint); color: var(--text); }
.switch { width: 52px; height: 44px; border: 0; padding: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; flex: none; }
.switch span { width: 42px; height: 24px; border-radius: 999px; padding: 3px; display: flex; justify-content: flex-start; background: var(--line2); transition: background .15s; }
.switch span i { width: 18px; height: 18px; border-radius: 50%; background: var(--dim); display: block; }
.switch.on span { justify-content: flex-end; background: var(--mint); } .switch.on span i { background: var(--ink); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.toggle-row .t { flex: 1; font-size: 14px; color: var(--text2); line-height: 1.4; }

/* сетки */
.row-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.grow { flex: 999 1 520px; min-width: 0; } .aside { flex: 1 1 320px; min-width: 0; }
.kpis { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi { flex: 1 1 210px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi .l { font-size: 13px; color: var(--dim); } .kpi .v { font: 700 30px/1.15 var(--head); font-variant-numeric: tabular-nums; } .kpi .n { font-size: 13px; color: var(--dim); }
.kpi.hero { border-color: #24484A; background: #0E1A1F; } .kpi.hero .v { font-size: 34px; font-weight: 800; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.gap8 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* таблицы */
.tbl { overflow-x: auto; }
.tbl .in-tbl { min-width: var(--minw, 640px); }
.th, .tr { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 11px 20px; }
.th { font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
.tr { border-bottom: 1px solid var(--line3); font-size: 14px; }
.tr.click { cursor: pointer; } .tr.click:hover, .tr.sel { background: #111925; } .tr.sel { background: #122033; }
.r { text-align: right; } .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--dim); font-size: 14px; line-height: 1.5; }

/* выезжающая карточка, окна, уведомления */
.drawer { flex: 1 1 360px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: #16212F; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.err { border-color: #5A2A30; color: #FFC2C4; } .toast.ok { border-color: #1F4A44; }

/* превью Telegram */
.tg { border-radius: 18px; background: #0C1520; border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tg .head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bubble { background: #17222F; border-radius: 14px 14px 14px 4px; overflow: hidden; }
.bubble .tx { padding: 12px 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bubble .tx a { color: #6AB3F3; }
.bubble img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.tgb { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border-radius: 10px; background: #1F2C3D; color: #DCE7EC; font-size: 13px; font-weight: 500; text-align: center; margin-top: 6px; }

/* график */
.chart { position: relative; height: 220px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .tip { position: absolute; background: #152030; border: 1px solid #26344A; border-radius: 10px; padding: 8px 12px; white-space: nowrap; pointer-events: none; transform: translate(calc(-100% - 14px), -50%); }
.chart .tip.right { transform: translate(14px, -50%); }
.chart .cross { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #3A4757; pointer-events: none; }
.chart .pt { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px var(--card); pointer-events: none; }
.bar { height: 8px; border-radius: 4px; background: #141D2A; } .bar > i { display: block; height: 8px; border-radius: 4px; background: var(--mint); }

/* вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .box { width: 100%; max-width: 440px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line2); font-size: 14px; }
.steps .k { width: 26px; height: 26px; border-radius: 50%; background: #1A2535; color: var(--muted); display: flex; align-items: center; justify-content: center; font: 700 12px/1 var(--head); flex: none; }
.steps li.done .k { background: var(--mint); color: var(--ink); }
.spin { width: 16px; height: 16px; border: 2px solid var(--line2); border-top-color: var(--mint); border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #0E141E, #131C29, #0E141E); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
