/* ═══════════════════════════════════════════════════════════════════
   ЕПУ · базовая дизайн-система, токены, компоненты и панель собственника
   Стили мастера вынесены в /css/setup.css, отчёта «Где деньги?» — в /css/advisory.css
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --surface-3: #e6eaf0;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #8a93a3;
  --border: #e3e7ed;
  --border-strong: #cbd2dc;

  --accent: #3657d6;
  --accent-hover: #2b47b8;
  --accent-bg: #edf1fe;
  --accent-border: #c4d0fb;
  --on-accent: #ffffff;

  --green: #17803d;
  --green-bg: #e6f5eb;
  --green-border: #b6e2c4;
  --yellow: #9a5b00;
  --yellow-bg: #fdf3dd;
  --yellow-border: #f3d79b;
  --red: #c53030;
  --red-bg: #fdecec;
  --red-border: #f5c2c2;
  --bar: #c3cad4;

  --pointer: #ea6a1a;
  --pointer-bg: #fff1e8;
  --pointer-ring: rgba(234, 106, 26, .35);

  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 26px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .16);
  --focus: 0 0 0 3px rgba(54, 87, 214, .28);

  --t-fast: 120ms ease;
  --t: 180ms ease;

  --glass-hi: rgba(255, 255, 255, .85);
  --glass-hi-soft: rgba(255, 255, 255, .35);
  --glass-edge: rgba(255, 255, 255, .7);
  --glass-blur: 16px;

  --c-mgmt: #7c3aed; --c-sales: #0284c7; --c-prod: #c026d3; --c-fin: #0d9488;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015; --surface: #161a21; --surface-2: #1d222b; --surface-3: #262c37;
    --text: #edf0f4; --text-2: #b1b9c6; --text-3: #7f8898;
    --border: #2a303b; --border-strong: #3b4351;
    --accent: #8ea6ff; --accent-hover: #a9bcff; --accent-bg: #1c2442; --accent-border: #33407a; --on-accent: #0b1020;
    --green: #5fd38f; --green-bg: #132e1f; --green-border: #24533a;
    --yellow: #f2c46a; --yellow-bg: #32270e; --yellow-border: #5a4618;
    --red: #ff8f86; --red-bg: #391918; --red-border: #6a2d2a;
    --bar: #4a525e;
    --pointer: #ff9a57; --pointer-bg: #3a2414; --pointer-ring: rgba(255, 154, 87, .35);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 6px 18px rgba(0, 0, 0, .45); --shadow-pop: 0 14px 36px rgba(0, 0, 0, .6);
    --focus: 0 0 0 3px rgba(142, 166, 255, .35);
    --glass-hi: rgba(255, 255, 255, .28); --glass-hi-soft: rgba(255, 255, 255, .08); --glass-edge: rgba(255, 255, 255, .16);
    --c-mgmt: #a78bfa; --c-sales: #38bdf8; --c-prod: #e879f9; --c-fin: #2dd4bf;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1015; --surface: #161a21; --surface-2: #1d222b; --surface-3: #262c37;
  --text: #edf0f4; --text-2: #b1b9c6; --text-3: #7f8898;
  --border: #2a303b; --border-strong: #3b4351;
  --accent: #8ea6ff; --accent-hover: #a9bcff; --accent-bg: #1c2442; --accent-border: #33407a; --on-accent: #0b1020;
  --green: #5fd38f; --green-bg: #132e1f; --green-border: #24533a;
  --yellow: #f2c46a; --yellow-bg: #32270e; --yellow-border: #5a4618;
  --red: #ff8f86; --red-bg: #391918; --red-border: #6a2d2a;
  --bar: #4a525e;
  --pointer: #ff9a57; --pointer-bg: #3a2414; --pointer-ring: rgba(255, 154, 87, .35);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 6px 18px rgba(0, 0, 0, .45); --shadow-pop: 0 14px 36px rgba(0, 0, 0, .6);
  --focus: 0 0 0 3px rgba(142, 166, 255, .35);
  --glass-hi: rgba(255, 255, 255, .28); --glass-hi-soft: rgba(255, 255, 255, .08); --glass-edge: rgba(255, 255, 255, .16);
  --c-mgmt: #a78bfa; --c-sales: #38bdf8; --c-prod: #e879f9; --c-fin: #2dd4bf;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-bg); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

/* ── Topbar & Page ── */
.topbar {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: inset 0 -1px 0 var(--glass-hi-soft);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand-mark { background: var(--text); color: var(--surface); font-weight: 600; font-size: 12px; padding: 4px 8px; border-radius: 6px; letter-spacing: .04em; }
.brand-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-switch { display: flex; align-items: center; gap: 4px; margin: 0 auto; position: relative; }
.month-label { font-weight: 600; min-width: 132px; text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 18px; line-height: 1; color: var(--text-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.chip.warn { background: var(--yellow-bg); color: var(--yellow); border-color: transparent; }
.chip.red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.chip.busy { opacity: .7; cursor: progress; }

.page { max-width: 1120px; margin: 0 auto; padding: 16px 16px 40px; }
.page.wide { max-width: 1480px; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 12px; min-height: 20px; }
.crumbs a { color: var(--text-2); }
.crumbs span.sep { margin: 0 6px; }
.footer { text-align: center; color: var(--text-3); font-size: 12px; padding: 0 16px 24px; }
.empty { color: var(--text-3); padding: 40px 0; text-align: center; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
h2.section-title { font-size: 15px; font-weight: 600; margin: 24px 0 10px; }

/* ── Шапка: календарь и тема ── */
.month-btn { display: inline-flex; gap: 8px; align-items: center; border: 1px solid transparent; background: none; color: var(--text); font-weight: 600; font-size: var(--fs-base); height: 34px; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer; min-width: 150px; justify-content: center; transition: background var(--t-fast), border-color var(--t-fast); }
.month-btn:hover, .month-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.month-btn .ico { color: var(--text-3); }
.popover { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 60; width: 300px; padding: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop), inset 0 1px 0 var(--glass-hi-soft); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-m { height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: var(--fs-sm); position: relative; transition: background var(--t-fast), border-color var(--t-fast); }
.cal-m:hover { border-color: var(--accent); background: var(--accent-bg); }
.cal-m.sel { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-m.now:not(.sel)::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.cal-m:disabled { opacity: .35; cursor: default; }
.cal-foot { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cal-foot .btn { flex: 1; justify-content: center; }
#btnTheme .ico { transition: transform var(--t); }
#btnTheme:hover .ico { transform: rotate(-20deg); }

/* ── Кнопки, поля, карточки ── */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 10px; }
.btn-ghost:hover { background: var(--accent-bg); border-color: transparent; }
.btn-danger { border-color: var(--red-border); color: var(--red); background: var(--surface); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-lg { height: 42px; padding: 0 20px; font-size: var(--fs-md); }
.btn.small, .btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-xs); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.input { height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); min-width: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input::placeholder { color: var(--text-3); }
select.input { padding: 0 28px 0 10px; }
.input.num { width: 160px; text-align: right; }
.input.num-sm { width: 130px; text-align: right; padding: 4px 8px; }
.input.grow { flex: 1 1 180px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > .field-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.field > .field-hint { font-size: var(--fs-xs); color: var(--text-3); }
.field.grow { flex: 1 1 200px; }
.fields { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-error { color: var(--red); font-size: 12px; margin-top: 6px; }
.helpers { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

.panel, .tile, .stage, .found, .list, .block-card, .bstage-card { border-radius: var(--radius); box-shadow: var(--shadow-1); }
.panel { background: var(--surface); border: 1px solid var(--border); padding: var(--sp-4) 18px; min-width: 0; }
.panel h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; display: flex; justify-content: flex-start; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel h3 > .spacer { flex: 1; }
.panel + .panel { margin-top: 12px; }
.panel-sub { color: var(--text-2); font-size: var(--fs-sm); margin: -4px 0 12px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.card-question { color: var(--text-2); margin-top: 2px; }

.pill { display: inline-block; font-size: var(--fs-xs); font-weight: 500; padding: 2px 10px; line-height: 18px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.pill.green, .pill.approved { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.pill.yellow, .pill.draft { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.pill.red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.pill.no_plan { background: var(--accent-bg); color: var(--accent); }
.pill.no_fact, .pill.derived { background: var(--surface-2); color: var(--text-2); }
.pill.new { background: var(--pointer-bg); color: var(--pointer); border-color: var(--pointer-ring); }
.pill .ico { margin-right: 3px; }

.notice { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--yellow-bg); color: var(--yellow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--yellow-border); line-height: 1.5; }
.notice::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 1px; background: var(--yellow); -webkit-mask: url(/icons/lucide/triangle-alert.svg) center / contain no-repeat; mask: url(/icons/lucide/triangle-alert.svg) center / contain no-repeat; }
.notice.info { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.notice.info::before { background: var(--accent); -webkit-mask-image: url(/icons/lucide/info.svg); mask-image: url(/icons/lucide/info.svg); }
.notice.success { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.notice.success::before { background: var(--green); -webkit-mask-image: url(/icons/lucide/circle-check.svg); mask-image: url(/icons/lucide/circle-check.svg); }
.notice.danger { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.notice.danger::before { background: var(--red); -webkit-mask-image: url(/icons/lucide/circle-x.svg); mask-image: url(/icons/lucide/circle-x.svg); }
.notice > div { min-width: 0; flex: 1; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.term { border-bottom: 1px dashed currentColor; cursor: help; text-decoration: none; }
.help { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; background: var(--surface-3); color: var(--text-2); cursor: help; vertical-align: 1px; flex: none; border: 0; padding: 0; }
.help:hover, .help:focus-visible { background: var(--accent); color: var(--on-accent); }
.tooltip, .toast { background: color-mix(in srgb, var(--text) 88%, transparent); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--shadow-pop); color: var(--surface); }
.tooltip { position: fixed; z-index: 100; max-width: 320px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.45; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity var(--t-fast), transform var(--t-fast); }
.tooltip.show { opacity: 1; transform: none; }
.tooltip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.tooltip[data-side="top"]::after { bottom: -5px; }
.tooltip[data-side="bottom"]::after { top: -5px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; z-index: 120; max-width: min(520px, 92vw); padding: 10px 16px; border-radius: var(--radius-sm); font-size: var(--fs-sm); display: flex; gap: 8px; align-items: center; transition: opacity var(--t), transform var(--t); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Значки .ico и .glyph ── */
.ico { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-xs { width: 12px; height: 12px; vertical-align: -1px; stroke-width: 2.5; }
.ico-sm { width: 14px; height: 14px; vertical-align: -2px; }
.ico-lg { width: 20px; height: 20px; vertical-align: -4px; stroke-width: 1.8; }
.ico-xl { width: 24px; height: 24px; vertical-align: -6px; stroke-width: 1.75; }
.btn .ico, .chip .ico, .pill .ico { vertical-align: 0; }
.ico.spin { animation: spin 1.1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

.glyph { --g: var(--accent); --gs: 32px; position: relative; isolation: isolate; flex: none; display: inline-grid; place-items: center; width: var(--gs); height: var(--gs); border-radius: calc(var(--gs) * .34); color: var(--g);
  background: radial-gradient(130% 90% at 28% -10%, var(--glass-hi) 0%, transparent 52%), linear-gradient(155deg, color-mix(in srgb, var(--g) 24%, transparent), color-mix(in srgb, var(--g) 9%, transparent) 70%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%); backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--g) 28%, var(--glass-edge));
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -2px 4px color-mix(in srgb, var(--g) 18%, transparent), 0 6px 16px -6px color-mix(in srgb, var(--g) 55%, transparent);
  transition: transform var(--t), box-shadow var(--t); }
.glyph::after { content: ""; position: absolute; inset: 2px 3px auto; height: 42%; border-radius: calc(var(--gs) * .3) calc(var(--gs) * .3) 40% 40% / calc(var(--gs) * .3) calc(var(--gs) * .3) 60% 60%; background: linear-gradient(180deg, var(--glass-hi-soft), transparent); pointer-events: none; z-index: -1; }
.glyph-sm { --gs: 24px; } .glyph-md { --gs: 32px; } .glyph-lg { --gs: 44px; }
.glyph-accent { --g: var(--accent); } .glyph-green { --g: var(--green); } .glyph-yellow { --g: var(--yellow); } .glyph-red { --g: var(--red); } .glyph-pointer { --g: var(--pointer); } .glyph-neutral { --g: var(--text-2); }
.glyph-mgmt { --g: var(--c-mgmt); } .glyph-sales { --g: var(--c-sales); } .glyph-prod { --g: var(--c-prod); } .glyph-fin { --g: var(--c-fin); }

/* ── Пульс, Блоки, Списки ── */
.advisory-cta-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.advisory-cta { border-color: var(--accent-border) !important; background: linear-gradient(120deg, var(--accent-bg), var(--surface)); }
.pulse { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--text-2); }
.tile-value { font-size: 30px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.tile-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tone-green { color: var(--green); } .tone-red { color: var(--red); } .tone-muted { color: var(--text-3); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.trio .tile-value { font-size: 22px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }

.planbar { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.planbar-text { flex: 1 1 260px; min-width: 0; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--accent); }

.b-mgmt { --bc: var(--c-mgmt); } .b-sales { --bc: var(--c-sales); } .b-prod { --bc: var(--c-prod); } .b-fin { --bc: var(--c-fin); }
.blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.block-card { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; color: var(--text); text-decoration: none !important; display: block; position: relative; overflow: hidden; transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast); }
.block-card:hover { box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--bc, var(--accent)) 45%, var(--border)); }
.block-card[class*="b-"]::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--bc); }
.block-card.block-locked { opacity: .82; background: var(--surface-2); }
.block-card .block-head { display: flex; gap: 10px; align-items: center; }
.block-name { font-size: 13px; color: var(--text-2); }
.block-value { font-size: 26px; font-weight: 600; margin: 4px 0 2px; }
.block-meta { font-size: 12px; color: var(--text-3); }
.dots { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.dot.green { background: var(--green); border-color: var(--green); } .dot.yellow { background: var(--yellow); border-color: var(--yellow); } .dot.red { background: var(--red); border-color: var(--red); }

.list { background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 130px 110px 104px; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.row:first-child { border-top: 0; }
a.row:hover { background: var(--surface-2); }
.row.head { font-size: 12px; color: var(--text-3); padding-top: 9px; padding-bottom: 9px; }
.row .num { text-align: right; white-space: nowrap; }
.row .st { text-align: right; }
.row-name { font-weight: 500; }
.row-meta { font-size: 12px; color: var(--text-3); }
.sec { display: block; font-size: 11px; color: var(--text-3); }
.row.has-block { box-shadow: inset 3px 0 0 var(--bc); }
.btag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--bc); background: color-mix(in srgb, var(--bc) 12%, transparent); border-radius: 99px; padding: 1px 8px 1px 6px; white-space: nowrap; }
.btag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bc); }

.chart { width: 100%; height: 150px; display: block; }
.chart text { fill: var(--text-3); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bars .bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.bars .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar-track { height: 4px; background: var(--surface-2); border-radius: 99px; margin-top: 3px; }
.bars .bar-track span { display: block; height: 100%; background: var(--bar); border-radius: 99px; }
.bars .bar-value { text-align: right; white-space: nowrap; }
.actions-list { list-style: none; padding: 0; margin: 0 0 10px; }
.actions-list li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.actions-list li.done span { text-decoration: line-through; color: var(--text-3); }
dl.def { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
dl.def dt { color: var(--text-3); } dl.def dd { margin: 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

details.docs { margin-top: 12px; }
details.docs summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.doc-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: 8px; }
.doc-table th, .doc-table td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--border); vertical-align: middle; }
.doc-table th { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; background: var(--surface-2); border-top: 0; white-space: nowrap; }
.doc-table th.num, .doc-table td.num { text-align: right; white-space: nowrap; }
.doc-table tbody tr:hover td { background: var(--surface-2); }
.doc-table select.input { max-width: 240px; }

/* ── Таблицы и прокрутка (.hscroll) ── */
.hscroll-bar { display: flex; align-items: center; gap: 6px; justify-content: flex-end; position: sticky; top: 64px; z-index: 6; padding: 6px 8px; margin: 0 -8px 6px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hscroll-bar[hidden] { display: none; }
.hscroll-hint { margin-right: auto; font-size: var(--fs-xs); color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }
.hscroll-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.hscroll-view { position: relative; }

/* ── Карты должностей, Демо, Внимание, Динамика ── */
.erow { grid-template-columns: minmax(0, 1fr) 150px 150px 104px; }
.team-row { grid-template-columns: minmax(0, 1fr) 110px 130px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.todo li:first-child { border-top: 0; }
.todo .pill { min-width: 92px; text-align: center; }
.demo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; background: var(--yellow-bg); color: var(--yellow); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.demo-banner.quiet { background: var(--accent-bg); color: var(--accent); }

.attention { margin-top: var(--sp-5); border: 1px solid var(--red-border); border-radius: var(--radius-lg); background: linear-gradient(180deg, color-mix(in srgb, var(--red-bg) 85%, transparent), var(--surface) 140px); box-shadow: var(--shadow-1); overflow: hidden; }
.attention-head { display: flex; gap: 14px; align-items: center; padding: 16px 18px 10px; flex-wrap: wrap; }
.attention-title { font-size: var(--fs-lg); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.attention-count { font-size: var(--fs-sm); font-weight: 700; color: #fff; background: var(--red); border-radius: 99px; padding: 1px 10px; }
.attention-sub { color: var(--text-2); font-size: var(--fs-sm); flex-basis: 100%; margin-left: 58px; margin-top: -6px; }
.attention-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 12px 76px; }
.attention .list { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.attention .row, .attention .row.head { grid-template-columns: 22px minmax(0, 1fr) 110px 130px 110px 128px; }
.reason { font-size: 11px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.reason.red { color: var(--red); } .reason.yellow { color: var(--yellow); } .reason.plan { color: var(--accent); }
.sev { display: grid; place-items: center; }
.attention-empty { display: flex; gap: 12px; align-items: center; margin-top: var(--sp-5); padding: 14px 18px; border-radius: var(--radius-lg); border: 1px solid var(--green-border); background: var(--green-bg); color: var(--green); font-weight: 600; }

.trend-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.trend-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.trend-filters button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 99px; height: 30px; padding: 0 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-sm); }
.trend-filters button.on { border-color: var(--bc, var(--accent)); color: var(--bc, var(--accent)); background: color-mix(in srgb, var(--bc, var(--accent)) 10%, var(--surface)); font-weight: 600; }
.trend-filters button[class*="b-"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bc); }
.trend { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-xs); table-layout: fixed; min-width: 0; }
.trend th, .trend td { padding: 5px 3px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend th:first-child, .trend td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; width: 210px; white-space: normal; }
.trend thead th { color: var(--text-3); font-weight: 600; border-bottom: 1px solid var(--border); }
.trend thead th.cur { color: var(--accent); }
.trend tr.block-row td { padding-top: 14px; font-weight: 700; font-size: var(--fs-sm); color: var(--bc); border-bottom: 2px solid color-mix(in srgb, var(--bc) 40%, transparent); }
.trend tr.total-row td { font-weight: 700; font-size: var(--fs-sm); border-bottom: 1px solid var(--border); }
.trend td.cell a { display: block; padding: 4px 3px; border-radius: 6px; color: var(--text); text-decoration: none; }
.trend td.cell.green a { background: var(--green-bg); color: var(--green); }
.trend td.cell.yellow a { background: var(--yellow-bg); color: var(--yellow); }
.trend td.cell.red a { background: var(--red-bg); color: var(--red); }
.trend td.cell.no_plan a, .trend td.cell.no_fact a { color: var(--text-3); }
.trend td.metric-name { padding-left: 14px !important; box-shadow: inset 3px 0 0 var(--bc); }
.trend-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-2); margin-top: 10px; }
.trend-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

.nums-mobile { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 900px) {
  .blocks, .advisory-cta-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .trend { table-layout: auto; min-width: 860px; }
}
@media (max-width: 640px) {
  .topbar { position: static; }
  .topbar-inner { gap: 6px 8px; padding: 8px 12px; }
  .topbar-right { order: 3; flex: 1 1 100%; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .advisory-cta-row, .trio { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name st" "nums nums"; row-gap: 4px; }
  .row.head, .attention .row.head { display: none; }
  .row > .row-main { grid-area: name; } .row > .st { grid-area: st; } .row > .num { display: none; }
  .row > .nums-mobile { display: flex !important; grid-area: nums; gap: 12px; font-size: 12px; color: var(--text-2); }
  .attention .row:not(.head) { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "sev name st" "sev nums nums"; }
  .attention .row > .sev { grid-area: sev; } .attention-sub, .attention-filters { margin-left: 0; padding-left: 18px; }
}
@media (max-width: 480px) { .blocks, .pulse { grid-template-columns: minmax(0, 1fr); } }
