/* Тёмно-синее «стекло» в духе ночной темы Telegram */
:root {
  --bg: #0b141e;
  --glass: rgba(23, 35, 49, .62);
  --glass-strong: rgba(28, 42, 58, .82);
  --raised: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .075);
  --hi: rgba(255, 255, 255, .07);
  --text: #eef3f8;
  --muted: #7f92a7;
  --faint: #4e6175;
  --accent: #3e9cf1;
  --accent-2: #66b4f7;
  --accent-soft: rgba(62, 156, 241, .16);
  --green: #4fd18b; --green-soft: rgba(79, 209, 139, .14);
  --red: #f0646e;   --red-soft: rgba(240, 100, 110, .14);
  --amber: #f4b740; --amber-soft: rgba(244, 183, 64, .14);
  --r-card: 20px; --r-ctl: 13px;
  --ease: cubic-bezier(.25, .8, .3, 1);
  --spring: cubic-bezier(.25, .8, .3, 1);
  --solid: #15202c;
  --blur: blur(20px) saturate(150%);
  /* поверхности — переопределяются светлой темой */
  --card: linear-gradient(180deg, rgba(30, 44, 60, .78), rgba(22, 33, 46, .78));
  --card-shadow: inset 0 1px 0 var(--hi), 0 8px 24px rgba(0, 0, 0, .18);
  --sunken: rgba(0, 0, 0, .22);
  --sunken-2: rgba(0, 0, 0, .3);
  --hover: rgba(255, 255, 255, .08);
  --row-hover: rgba(255, 255, 255, .025);
  --top-fade: rgba(11, 20, 30, 0);
  --thumb-shadow: inset 0 1px 0 var(--hi), 0 2px 8px rgba(0, 0, 0, .3);
  --tabs-bg: rgba(20, 31, 44, .72);
  --tabs-shadow: inset 0 1px 0 var(--hi), 0 14px 40px rgba(0, 0, 0, .45);
  --toast-bg: rgba(30, 45, 62, .97);
  --toast-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  --ripple: rgba(255, 255, 255, .12);
  --skel-a: rgba(255, 255, 255, .035); --skel-b: rgba(255, 255, 255, .08);
  --chart-cost: #5b7591;
  --hit-sel: rgba(255, 255, 255, .05);
  --primary-shadow: 0 6px 18px rgba(62, 156, 241, .32);
  --scheme: dark;
}

/* ---------- светлая тема ---------- */
:root[data-theme="light"] {
  --bg: #f3f4f7;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --raised: #f4f6f9;
  --line: #e3e7ee;
  --hi: rgba(255, 255, 255, 0);
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #2563eb;
  --accent-2: #2563eb;
  --accent-soft: rgba(37, 99, 235, .1);
  --green: #15803d; --green-soft: rgba(22, 163, 74, .11);
  --red: #dc2626;   --red-soft: rgba(220, 38, 38, .09);
  --amber: #b45309; --amber-soft: rgba(217, 119, 6, .12);
  --solid: #ffffff;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
  --sunken: #eef1f5;
  --sunken-2: #e8ecf2;
  --hover: #eef2f7;
  --row-hover: #f8fafc;
  --top-fade: rgba(243, 244, 247, 0);
  --thumb-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  --tabs-bg: rgba(255, 255, 255, .86);
  --tabs-shadow: 0 10px 30px rgba(15, 23, 42, .12);
  --toast-bg: #0f172a;
  --toast-shadow: 0 12px 30px rgba(15, 23, 42, .25);
  --ripple: rgba(15, 23, 42, .08);
  --skel-a: #eceff4; --skel-b: #f6f8fb;
  --chart-cost: #a7b4c6;
  --hit-sel: rgba(15, 23, 42, .04);
  --primary-shadow: 0 4px 12px rgba(37, 99, 235, .25);
  --scheme: light;
}
:root[data-theme="light"] .bg { display: none; }
:root[data-theme="light"] .toast { color: #f8fafc; }
:root[data-theme="light"] .btn.primary { background: var(--accent); }
html { color-scheme: var(--scheme); transition: background-color .25s; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* фон со светящимися пятнами — чтобы стеклу было что размывать */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; opacity: .9; }
.g1 { width: 760px; height: 760px; left: -300px; top: -320px; background: radial-gradient(circle, rgba(36, 98, 168, .55), rgba(36, 98, 168, 0) 68%); }
.g2 { width: 680px; height: 680px; right: -300px; top: 25%; background: radial-gradient(circle, rgba(26, 74, 128, .5), rgba(26, 74, 128, 0) 68%); animation-duration: 32s; }
.g3 { width: 600px; height: 600px; left: 15%; bottom: -340px; background: radial-gradient(circle, rgba(30, 80, 120, .45), rgba(30, 80, 120, 0) 68%); animation-duration: 38s; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 14px 16px calc(110px + env(safe-area-inset-bottom)); }

/* ---------- стекло ---------- */
.glass { background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--card-shadow); }
.pad { padding: 16px; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 5; margin: -14px -16px 14px; padding: 12px 16px 12px;
  background: linear-gradient(var(--bg) 30%, var(--top-fade)); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 24px; line-height: 1.15; letter-spacing: -.01em; margin: 0; font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
h2 { font-size: 17px; margin: 26px 2px 10px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h2 .ic { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); }

/* ---------- иконки ---------- */
.ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* ---------- кнопки и нажатия ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 15px; cursor: pointer;
  background: var(--raised); transition: transform .12s ease-out, background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff;
  box-shadow: var(--primary-shadow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.good { background: var(--green-soft); color: var(--green); border-color: transparent; }
.btn.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.tap { transition: transform .18s var(--ease); }
.tap:active, .btn:active:not(:disabled) { transform: scale(.98); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: var(--ripple);
  animation: ripple .5s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- сегменты со скользящей подложкой ---------- */
.seg { position: relative; display: flex; padding: 4px; border-radius: 14px; background: var(--sunken);
  border: 1px solid var(--line); overflow: hidden; }
.seg button { position: relative; z-index: 1; flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .2s; }
.seg button.on { color: var(--text); }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 10px;
  background: var(--glass-strong); box-shadow: var(--thumb-shadow);
  transition: transform .26s var(--ease), width .26s var(--ease); }

/* ---------- сетки ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { padding: 14px 14px 13px; }
.kpi .head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.kpi .badge-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi .badge-ic.g { background: var(--green-soft); color: var(--green); }
.kpi .badge-ic.r { background: var(--red-soft); color: var(--red); }
.kpi .badge-ic.a { background: var(--amber-soft); color: var(--amber); }
.kpi .badge-ic .ic { width: 17px; height: 17px; }
.kpi .value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.tiles { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { padding: 11px 12px; border-radius: 15px; background: var(--raised); border: 1px solid var(--line); }
.tile .l { color: var(--muted); font-size: 12px; }
.tile .v { font-size: 17px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- воронка ---------- */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.stage { display: grid; grid-template-columns: 112px 1fr 64px; align-items: center; gap: 12px; }
.stage .name { font-size: 13.5px; color: var(--muted); }
.stage .track { position: relative; height: 30px; border-radius: 10px; background: var(--sunken); overflow: hidden; }
.stage .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 10px;
  background: linear-gradient(90deg, rgba(62, 156, 241, .35), var(--accent));
  transition: width .6s var(--ease); }
.stage.lead .fill { background: linear-gradient(90deg, rgba(79, 209, 139, .3), var(--green)); }
.stage .num { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.stage .conv { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .stage { grid-template-columns: 84px 1fr 52px; gap: 8px; } }

/* ---------- график ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); transition: transform .5s var(--ease), opacity .15s; cursor: pointer; }
.chart.shown .bar { transform: scaleY(1); }
.chart .col:hover .bar, .chart .col.sel .bar { opacity: 1; }
.chart .col .bar { opacity: .82; }
.chart .col.sel .hit { fill: var(--hit-sel); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.day-info { margin-top: 10px; min-height: 22px; font-size: 13px; color: var(--muted); transition: opacity .25s; }

/* ---------- списки и карточки ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { padding: 14px; }
.item .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item .title { font-weight: 650; overflow-wrap: anywhere; }
.item .meta { color: var(--muted); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--raised); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill.info { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }

.offer { padding: 0; overflow: hidden; }
.offer .o-head { padding: 15px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.offer .o-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, rgba(62, 156, 241, .35), rgba(62, 156, 241, .1)); color: var(--accent-2); }
.offer .o-main { flex: 1; min-width: 0; }
.offer .chev { color: var(--muted); transition: transform .25s var(--ease); }
.offer.open .chev { transform: rotate(180deg); }
.offer .o-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.offer.open .o-body { grid-template-rows: 1fr; }
.offer .o-body > div { overflow: hidden; }
.offer .o-in { padding: 0 16px 16px; }
.mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.mini .l { color: var(--muted); font-size: 11.5px; } .mini .v { font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; }
.goal { margin-top: 12px; }
.goal .bar { height: 7px; border-radius: 6px; background: var(--sunken); overflow: hidden; margin-top: 6px; }
.goal .bar i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .6s var(--ease); background: var(--green); }
.goal .bar i.over { background: var(--red); }

/* ---------- таблицы ---------- */
.table { overflow-x: auto; border-radius: var(--r-card); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--solid); z-index: 1; min-width: 150px; max-width: 220px; white-space: normal; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover td { background-color: var(--row-hover); }
td .tn { font-weight: 600; }
td .ts { color: var(--muted); font-size: 12px; }

/* ---------- формы ---------- */
label.f { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.in { width: 100%; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 11px 13px;
  transition: border-color .2s, box-shadow .2s, background .2s; }
.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--sunken-2); }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.in { min-height: 80px; resize: vertical; }
.hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
label.opt { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border-radius: 14px; transition: background .2s; }
label.opt:hover { background: var(--raised); }
label.opt input { appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border-radius: 50%;
  border: 2px solid var(--faint); transition: border-color .15s, box-shadow .2s ease-out; cursor: pointer; }
label.opt input[type=checkbox] { border-radius: 6px; }
label.opt input:checked { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 10px var(--accent); }
label.opt input[type=checkbox]:checked { box-shadow: inset 0 0 0 10px var(--accent); }

/* ---------- нижнее меню ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.tabs-in { position: relative; pointer-events: auto; display: flex; width: 100%; max-width: 520px; padding: 6px;
  background: var(--tabs-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--tabs-shadow); }
.tab { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: transparent; border: 0; padding: 7px 2px 6px; cursor: pointer; color: var(--muted); font-size: 11.5px;
  transition: color .2s; }
.tab .ic { width: 22px; height: 22px; }
.tab.on { color: var(--accent-2); }
.tab-pill { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; border-radius: 18px; background: var(--accent-soft);
  transition: transform .28s var(--ease), width .28s var(--ease); will-change: transform; }
.count { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 700;
  animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; } }

/* ---------- переходы между экранами ---------- */
.view { animation: viewIn .22s ease-out both; }
.view.quiet { animation: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } }
.rise { animation: rise .3s ease-out both; animation-delay: calc(min(var(--i, 0), 6) * 30ms); }
.quiet .rise { animation: none; }
@keyframes rise { from { opacity: 0; } }

/* ---------- загрузка ---------- */
.skel { border-radius: var(--r-card); background: linear-gradient(100deg, var(--skel-a) 30%, var(--skel-b) 50%, var(--skel-a) 70%);
  background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- уведомления ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 440px; display: flex; gap: 10px; align-items: center; padding: 11px 15px; border-radius: 15px;
  background: var(--toast-bg);
  border: 1px solid var(--line); box-shadow: var(--toast-shadow); font-size: 14px;
  animation: toastIn .25s ease-out both; }
.toast.bye { animation: toastOut .3s var(--ease) forwards; }
.toast .ic { width: 18px; height: 18px; color: var(--accent-2); }
.toast.err .ic { color: var(--red); } .toast.okk .ic { color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(4px); } }

/* ---------- вход ---------- */
.center { min-height: 78vh; display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; padding: 28px 22px; text-align: center; }
.login .logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, var(--accent-2), #2a6fb8); box-shadow: 0 12px 30px rgba(62, 156, 241, .35); }
.login .logo .ic { width: 30px; height: 30px; }
.code { font-size: 26px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.slide-open { animation: rise .45s var(--ease) both; }

.empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.empty .ic { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
pre.desc { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }
.event { display: flex; gap: 12px; padding: 13px 14px; }
.event .sev { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.event .sev.r { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.event .sev.g { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .chart .bar { transform: none; }
}

#leadList { transition: opacity .12s; }
.mini .v { white-space: nowrap; }
@media (max-width: 480px) { .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; } }

/* ---------- команда ---------- */
.meta { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.member .meta { display: block; margin-top: 3px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.code-line { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px;
  overflow-wrap: anywhere; user-select: all; line-height: 1.45; }
.sec-t { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 2px 0 2px; }
.sec-t .ic { width: 17px; height: 17px; color: var(--accent); }
.sec-t .meta { font-weight: 400; }
.viewer { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.viewer > .ic { color: var(--muted); }
.viewer .seg { flex: 1; overflow-x: auto; scrollbar-width: none; }
.viewer .seg button { white-space: nowrap; }
.info-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; background: var(--accent-soft); }
.info-bar .ic { color: var(--accent-2); }
tr.total td { font-weight: 650; border-top: 1px solid var(--line); }
.small-btn { padding: 6px 8px; min-height: 0; }
.ro [data-do], .ro [data-edit], .ro #add { display: none !important; }
.daily th:first-child, .daily td:first-child { min-width: 64px; width: 64px; }

/* ---------- период из календаря ---------- */
.range-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.range-box .rng { flex: 1 1 130px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.range-box .in { padding: 9px 11px; color-scheme: var(--scheme); }
.range-box .btn { flex: 0 0 auto; }
.tab.hidden { display: none; }
.pick-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px;
  color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: background .2s; }
.pick-btn:hover { background: var(--raised); }
.pick-btn .badge-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pick-btn .badge-ic .ic { width: 18px; height: 18px; }
.pick-t { flex: 1; font-weight: 600; }
.pick-v { color: var(--muted); font-variant-numeric: tabular-nums; }
.fresh-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--faint); }
.fresh-line .ic { width: 14px; height: 14px; }

/* ---------- переключатель темы ---------- */
.head-actions { display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 40px; height: 40px; padding: 0; border-radius: 13px; flex: none; }
.theme-btn .ic { width: 19px; height: 19px; }
.theme-fab { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 14px; z-index: 20; }

/* ---------- деньги ---------- */
.money-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
@media (min-width: 760px) { .money-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gap-card { display: flex; gap: 12px; padding: 16px; margin-top: 14px; border-color: color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber) 9%, var(--glass)); }
.gap-card .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); margin-top: 7px; flex: none; }
.gap-card b.t { display: block; font-size: 15.5px; margin-bottom: 4px; }
.cal { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 52px 18px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px;
  border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: 0; }
.cal-row .d { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-row .mk { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--green); }
.cal-row .mk.today { background: var(--accent); border-color: var(--accent); }
.cal-row .mk.zero { border-color: var(--red); }
.cal-row .amt { font-weight: 650; font-variant-numeric: tabular-nums; }
.flow-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; }
.flow-row.total { border-bottom: 0; font-weight: 700; }
.money-set { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) { .money-set { grid-template-columns: 1fr; } }
.tabs-in { max-width: 640px; }
@media (max-width: 440px) { .tab { font-size: 10px; padding: 7px 0 6px; } .tab .ic { width: 20px; height: 20px; } }
:root[data-theme="light"] .offer .o-ic { background: var(--accent-soft); color: var(--accent); }
:root[data-theme="light"] .tab.on { color: var(--accent); }
:root[data-theme="light"] .login .logo { background: var(--accent); box-shadow: 0 10px 24px rgba(37, 99, 235, .25); }

/* ---------- пульс: шаги запуска, здоровье, лимит ---------- */
.steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.steps::-webkit-scrollbar { display: none; }
.step { flex: 1 0 auto; min-width: 92px; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 12px; background: var(--sunken); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.step .sn { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--raised); border: 1px solid var(--line); }
.step .sn .ic, .step .sn svg { width: 13px; height: 13px; }
.step.done { color: var(--text); }
.step.done .sn { background: var(--green-soft); color: var(--green); border-color: transparent; }
.step.cur { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.step.cur .sn { background: var(--accent); color: #fff; border-color: transparent; }
.step-about { margin-top: 12px; font-size: 13.5px; line-height: 1.45; }
.health { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hl { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.hl.bad { color: var(--red); background: var(--red-soft); border-color: transparent; }
.hd { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.hd.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.hd.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.hd.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.limit-bar { height: 8px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.limit-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--accent);
  transition: width .6s var(--ease); }
.limit-bar i.over { background: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.grid2 > * { min-width: 0; }
.cmd { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cmd:last-child { border-bottom: 0; }
.cmd .mono { color: var(--accent); min-width: 110px; }

/* ссылки на разделы из «Ещё» — только телефон */
.mlinks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mlink { display: flex; align-items: center; gap: 10px; padding: 13px 12px; color: var(--text); font: inherit;
  font-size: 14px; cursor: pointer; text-align: left; transition: transform .18s var(--ease); }
.mlink:active { transform: scale(.97); }
.mlink > .ic:first-child, .mlink > svg:first-child { color: var(--accent); }
.mlink span { flex: 1; }
.mlink > :last-child { transform: rotate(-90deg); color: var(--faint); width: 16px; height: 16px; }

/* ---------- боковая панель (компьютер) ---------- */
.side { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; }
.brand b { font-size: 14.5px; }
.brand-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: var(--primary-shadow); }
.brand-ic svg { width: 18px; height: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; scrollbar-width: none; }
.side-link { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px;
  border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: inherit; font-size: 14px;
  cursor: pointer; text-align: left; transition: background .18s var(--ease), color .18s var(--ease); }
.side-link svg, .side-link .ic { width: 19px; height: 19px; flex: none; }
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link .count { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red);
  color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.side-foot { margin-top: 12px; padding: 12px; border-radius: 13px; background: var(--sunken); color: var(--muted);
  font-size: 12px; line-height: 1.6; }
.side-foot:empty { display: none; }

@media (min-width: 1024px) {
  body.has-side .side { display: flex; flex-direction: column; position: fixed; z-index: 15; top: 12px; bottom: 12px; left: 12px;
    width: 232px; padding: 14px 10px; border-radius: 22px; border: 1px solid var(--line);
    background: var(--tabs-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--tabs-shadow); }
  body.has-side .tabs { display: none; }
  body.has-side .wrap { margin-left: 256px; margin-right: auto; max-width: 1180px; padding: 18px 28px 40px; }
  body.has-side .mlinks { display: none; }
  .grid2 { grid-template-columns: 1.6fr 1fr; }
  .steps { overflow: visible; }
  .step { min-width: 0; flex: 1 1 0; }
  .step .st { overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
  .step .st { display: none; }
  .step.cur .st { display: inline; }
}
:root[data-theme="light"] .side-foot { background: #f1f4f9; }
:root[data-theme="light"] .step { background: #f1f4f9; }
:root[data-theme="light"] .step.cur { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .limit-bar i, .side-link, .mlink { transition: none; } }

/* сравнение с прошлым периодом */
.kpi .delta { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi .delta span { font-weight: 400; color: var(--faint); }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }

/* выгрузка CSV */
.csv-btn { padding: 6px 11px; font-size: 12.5px; gap: 6px; font-weight: 500; }
.csv-btn svg, .csv-btn .ic { width: 15px; height: 15px; }
h2 .csv-btn { margin-left: auto; }
.csv-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* поиск и фильтры в лидах */
.lead-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.lead-tools .search { grid-column: 1 / -1; }
.lead-tools select.in:only-of-type { grid-column: 1 / -1; }
.lead-tools .search { position: relative; display: block; }
.lead-tools .search > svg, .lead-tools .search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.lead-tools .search .in { padding-left: 38px; width: 100%; }
.lead-tools select.in { width: 100%; }
@media (min-width: 640px) { .lead-tools { grid-template-columns: 2fr 1fr 1fr; } .lead-tools .search { grid-column: auto; } }

/* окно подтверждения */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 10, 16, .55); opacity: 0; transition: opacity .18s var(--ease); }
.modal-wrap.in { opacity: 1; }
.modal { width: 100%; max-width: 420px; padding: 18px; background: var(--glass-strong); backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur); transform: translateY(10px) scale(.98); transition: transform .22s var(--spring); }
.modal-wrap.in .modal { transform: none; }
.modal-t { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.modal-b { font-size: 14px; line-height: 1.5; color: var(--text); }
:root[data-theme="light"] .modal-wrap { background: rgba(15, 23, 42, .3); }
.ck-miss { margin: 6px 0 8px; padding-left: 18px; color: var(--amber); }
.ck-miss li { margin: 2px 0; }

/* чек-лист запуска */
.ck { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.ck summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.ck summary::-webkit-details-marker { display: none; }
.ck summary > :last-child { margin-left: 4px; width: 16px; height: 16px; color: var(--faint); transition: transform .2s var(--ease); }
.ck[open] summary > :last-child { transform: rotate(180deg); }
.ck-h { display: flex; align-items: center; gap: 8px; font-weight: 600; flex: 1; }
.ck-h svg, .ck-h .ic { width: 17px; height: 17px; color: var(--accent); }
.ck-n { font-size: 13px; font-weight: 600; }
.ck-bar { margin-top: 8px; height: 6px; }
.ck-bar i { background: var(--amber); }
.ck-bar i.ok { background: var(--green); }
.ck-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ck-i { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.ck-box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--faint); display: grid; place-items: center; margin-top: 1px; }
.ck-i.done .ck-box { background: var(--green); border-color: var(--green); color: #fff; }
.ck-box svg { width: 13px; height: 13px; }
.ck-i.done > div > div:first-child { color: var(--muted); }
.ck-warn { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 8px 11px; border-radius: 11px;
  background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.ck-warn svg { width: 16px; height: 16px; flex: none; }

/* уведомления */
.nf-g { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 2px 4px; }
.nf-g:first-child { margin-top: 0; }
.nf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.nf.locked { cursor: default; }
.nf .pill { gap: 5px; flex: none; }
.nf .pill svg { width: 12px; height: 12px; }
input.sw { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 25px; border-radius: 13px; margin: 0;
  background: var(--sunken-2); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s var(--ease); }
input.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s var(--spring); }
input.sw:checked { background: var(--accent); border-color: transparent; }
input.sw:checked::after { transform: translateX(17px); }
:root[data-theme="light"] input.sw { background: #dfe4ec; }
:root[data-theme="light"] input.sw:checked { background: var(--accent); }

/* база знаний */
.kb-info { animation: none; }
.kb-cols { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .kb-cols { grid-template-columns: 1fr 1fr; } }
.kb-t { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14.5px; margin-bottom: 6px; }
.kb-t svg, .kb-t .ic { width: 17px; height: 17px; }
.kb-ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.kb-ul li { margin: 5px 0; }
.kb-ul i { font-style: normal; color: var(--accent); }
.kb-sub { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.obs { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.obs:last-child { border-bottom: 0; }
.obs .pill { flex: none; }
.kb-src { font-size: 11px; padding: 1px 8px; margin-right: 4px; }
#kbInfo.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.kb-flow { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 900px) { .kb-flow { grid-template-columns: repeat(3, 1fr); } }
.kb-step { padding: 11px 12px; border-radius: 13px; background: var(--sunken); font-size: 13px; line-height: 1.45; }
.kb-step b { display: block; font-size: 14px; margin-bottom: 4px; color: var(--accent); }
.kb-step i { font-style: normal; font-weight: 600; }
:root[data-theme="light"] .kb-step { background: #f1f4f9; }
.obs { display: block; }
.obs .row1 { gap: 12px; }
.obs-pr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.obs-pr .limit-bar { height: 6px; margin-top: 4px; }
.obs-pr .limit-bar i { background: var(--amber); }
.obs-pr .limit-bar i.ok { background: var(--green); }
.kb-arch { opacity: .6; }
@media (max-width: 639px) { #kbInfo span:not(.ic) { display: none; } #kbInfo { padding: 10px 12px; } }
.kb-fair { margin-top: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); }
.kb-fair .kb-t svg, .kb-fair .kb-t .ic { color: var(--accent); }
