/* ========================================================================
   dash861.css — CK-DASHBOARD-861-EXECUTIVE (16.10): Дашборд руководителя ЦК, вкладка «№ 861-р».
   Слой поверх screens.css / workbench.css (токены app_v2.css, .cap, .db-pop, .thermo, .plan-state).
   Откат — убрать <link> в index.html и вернуть analytics.js из _backup/20261016-dash861/.

   Правило app_v2.css: в компонентах нет hex — только var(...). Свои цвета экрана (статус «Маршрутизирован»,
   звёзды CSAT, мягкая заливка строк) живут в двух блоках токенов ниже. Цвета сегментов данных приходят из JS
   переменной --c (валидированный категориальный набор, как у графиков вкладки «Цифровая приёмная»).
   ======================================================================== */
:root {
  --st-routed: #4a3aa7; --st-routed-weak: rgba(74, 58, 167, .1);
  --row-risk: rgba(227, 73, 72, .06); --row-risk-hover: rgba(227, 73, 72, .1);
  --row-routed: rgba(74, 58, 167, .05); --row-routed-hover: rgba(74, 58, 167, .09);
  --star: #e8a200;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --st-routed: #a99ff2; --st-routed-weak: rgba(169, 159, 242, .14);
    --row-risk: rgba(248, 113, 113, .08); --row-risk-hover: rgba(248, 113, 113, .13);
    --row-routed: rgba(169, 159, 242, .08); --row-routed-hover: rgba(169, 159, 242, .13);
    --star: #fbbf24;
  }
}
:root[data-theme="dark"] {
  --st-routed: #a99ff2; --st-routed-weak: rgba(169, 159, 242, .14);
  --row-risk: rgba(248, 113, 113, .08); --row-risk-hover: rgba(248, 113, 113, .13);
  --row-routed: rgba(169, 159, 242, .08); --row-routed-hover: rgba(169, 159, 242, .13);
  --star: #fbbf24;
}

/* ---------- Шапка вью: [⟳ Обновить данные] ---------- */
.dash-refresh { gap: 6px; color: var(--text-2); }
.dash-refresh:hover { color: var(--accent-strong); }

/* ---------- Каркас: верхний ярус 30/70 + реестр во всю ширину ---------- */
.dash-body.is-861 { display: flex; flex-direction: column; gap: 16px; }
.d861-top { display: grid; grid-template-columns: clamp(340px, 32%, 400px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.d861-pane-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.d861-pane-ico {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-weak); color: var(--accent-strong);
}
.d861-eyebrow { font-size: 14.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.is-pending .d861-kpi-body, .d861-kpi.is-pending .d861-kpi-body, .d861-reg.is-pending .d861-table-wrap { opacity: .5; transition: opacity .15s; }
.d861-kpi-body, .d861-table-wrap { transition: opacity .2s; }

/* ---------- Чипсы (фильтры реестра, пресеты поповера и модалки) ---------- */
.d861-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.d861-chip:hover { border-color: var(--border-strong); color: var(--text); }
.d861-chip.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-strong); }
.d861-chip:disabled { opacity: .42; cursor: not-allowed; }
.d861-chip-n { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.d861-chip.on .d861-chip-n { color: inherit; }
.d861-chip.is-seg .ico { color: var(--c); }
.d861-chip.is-seg.on { background: color-mix(in srgb, var(--c) 11%, var(--surface)); border-color: var(--c); color: var(--text); }
.d861-chip.st-closed .ico { color: var(--ok); }
.d861-chip.st-in_work .ico { color: var(--info); }
.d861-chip.st-risk .ico { color: var(--danger); }
.d861-chip.st-routed .ico { color: var(--st-routed); }
.d861-chip.is-star .ico { color: var(--star); fill: currentColor; }
.d861-chip.is-star.is-low .ico { color: var(--danger); }

/* ══════════ Календарь нагрузки ══════════ */
.d861-cal { display: flex; flex-direction: column; padding: 14px 14px 12px; min-width: 0; }
.d861-cal-head { position: relative; display: flex; flex-direction: column; gap: 10px; }
.d861-cal-total { margin-left: auto; white-space: nowrap; }
.d861-cal-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d861-modes .segmented-item { padding: 4px 11px; font-size: 12.5px; }
.d861-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.d861-nav .icon-btn { width: 28px; height: 28px; }
.d861-nav .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.d861-period {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 132px; height: 30px; padding: 0 8px 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: border-color .15s, color .15s;
}
.d861-period .ico { color: var(--text-3); transition: transform .15s; }
.d861-period:hover, .d861-period[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-strong); }
.d861-period[aria-expanded="true"] .ico { transform: rotate(180deg); color: var(--accent-strong); }
.d861-cal-range { display: flex; align-items: center; gap: 8px; min-height: 28px; margin: 10px 0 8px; font-size: 12.5px; min-width: 0; }
.d861-range-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: var(--r-full);
  background: var(--accent-weak); color: var(--accent-strong); font-weight: 700; white-space: nowrap;
}
.d861-range-dates { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.d861-range-x { width: 24px; height: 24px; margin-left: auto; flex: none; }
.d861-cal-range .hint-ico { margin-left: auto; flex: none; }
.d861-cal-body { position: relative; flex: 1; min-height: 318px; display: flex; }
.d861-cal-body > * { flex: 1; }

/* «Месяц»: 6 недель всегда — высота не прыгает */
.d861-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 18px repeat(6, minmax(44px, 1fr)); gap: 3px; touch-action: none; }
.d861-wd { align-self: center; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.d861-wd.is-we { opacity: .7; }
.d861-day {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 5px 5px 5px 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; user-select: none; transition: border-color .12s, background-color .12s, box-shadow .12s;
}
.d861-day:hover { border-color: var(--border-strong); }
.d861-day.is-we { background: var(--surface-2); }
.d861-day.is-out { opacity: .38; }
.d861-dnum { font-size: 11.5px; font-weight: 600; line-height: 1; color: var(--text-2); }
.d861-day.is-future .d861-dnum { color: var(--text-3); }
.d861-dcnt { position: absolute; top: 5px; right: 6px; font-size: 12px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.d861-seg { display: flex; gap: 1px; height: 4px; min-width: 6px; border-radius: 2px; overflow: hidden; }
.d861-seg i { display: block; min-width: 2px; }
.d861-day.in-range { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.d861-day.in-range.is-future { background: color-mix(in srgb, var(--accent-weak) 45%, var(--surface)); border-style: dashed; }
.d861-day.r-start, .d861-day.r-end { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.d861-day.is-today .d861-dnum {
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-width: 18px; height: 18px; margin: -3px 0 0 -3px;
  padding: 0 4px; border-radius: var(--r-full); background: var(--accent-strong); color: var(--on-accent);
}

/* «Год»: 12 плиток в той же высоте */
.d861-ygrid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 6px; touch-action: none; }
.d861-mtile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; user-select: none; transition: border-color .12s, background-color .12s;
}
.d861-mtile:hover { border-color: var(--border-strong); }
.d861-mt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.d861-mt-name { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.d861-mt-val { font-size: 17px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.d861-mt-track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.d861-mt-track .d861-seg { height: 100%; border-radius: 3px; }
.d861-mt-plan { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); opacity: .55; }
.d861-mt-sub { font-size: 11px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d861-mt-sub.is-ok { color: var(--accent-strong); }
.d861-mt-sub.is-low { color: var(--warn); }
.d861-mtile.is-future { opacity: .55; }
.d861-mtile.is-current { box-shadow: inset 0 0 0 1.5px var(--accent); }
.d861-mtile.in-range { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.d861-mtile.in-part { border-style: dashed; border-color: var(--accent); }
.d861-cal-empty {
  position: absolute; left: 10%; right: 10%; top: 38%; padding: 10px 12px; text-align: center;
  border-radius: var(--r-s); background: var(--surface); box-shadow: var(--shadow-1);
}
.d861-cal-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; }
.d861-lg { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.d861-lg i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.d861-lg b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Поповер быстрого выбора периода */
.db-pop.d861-pop { top: 76px; left: auto; right: 0; z-index: 46; width: 304px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.d861-pop-year { display: flex; align-items: center; justify-content: space-between; }
.d861-pop-year b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.d861-pop-year .icon-btn { width: 30px; height: 30px; }
.d861-pop-year .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.d861-pop-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.d861-pop-m {
  height: 36px; border: 1px solid transparent; border-radius: var(--r-s); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .12s, background-color .12s;
}
.d861-pop-m:hover { border-color: var(--accent); }
.d861-pop-m.in { background: var(--accent-weak); color: var(--accent-strong); }
.d861-pop-m.is-now:not(.on) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.d861-pop-m.on { background: var(--accent-strong); color: var(--on-accent); }
.d861-pop-m:disabled { opacity: .38; cursor: not-allowed; border-color: transparent; }
.d861-pop-sep { height: 1px; background: var(--border); }
.d861-pop-presets { display: flex; flex-wrap: wrap; gap: 5px; }

/* ══════════ Дашборд выполнения целевых показателей ══════════ */
.d861-kpi { display: flex; flex-direction: column; gap: 14px; padding: 14px 18px 16px; min-width: 0; }
.d861-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.d861-kpi-period { margin-left: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d861-kpi-badge { gap: 5px; flex: none; }
/* 17.10 CK-DASHBOARD-861-PLANS: «Плановые показатели» — кнопка в шапке, карандаши на карточках, баннер «не утверждён» */
.d861-kpi-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.d861-plan-btn { gap: 6px; height: 30px; border: 1px solid var(--border); }
.d861-plan-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.d861-norm-edit { flex: none; width: 24px; height: 24px; min-height: 0; padding: 0; border-radius: 7px; color: var(--text-3); opacity: .7; }
.d861-norm-edit:hover, .d861-norm-edit:focus-visible { opacity: 1; color: var(--accent-strong); background: var(--accent-weak); }
.d861-hero-cap { display: inline-flex; align-items: center; gap: 4px; }
.d861-plan-note { display: flex; align-items: center; gap: 9px; padding: 8px 10px 8px 12px; border-radius: var(--r-m); background: var(--warn-weak); color: var(--text); font-size: 13px; }
.d861-plan-note > .ico { flex: none; color: var(--warn); }
.d861-plan-note > span { flex: 1; min-width: 0; }
.d861-plan-note .btn { flex: none; border: 1px solid var(--warn); }
.plan-state.is-muted { background: var(--surface-2); color: var(--text-3); }
.d861-kpi-body { display: flex; flex-direction: column; gap: 16px; }
.d861-hero { display: flex; flex-direction: column; gap: 11px; padding: 14px 16px 14px; border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface-2); }
.d861-hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.d861-hero-num { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d861-hero-cap { font-size: 12.5px; font-weight: 600; }
.d861-hero-val { white-space: nowrap; }
.d861-hero-val b { font-size: 38px; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.d861-hero-val span { font-size: 17px; font-weight: 600; color: var(--text-2); }
.d861-hero-pct { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.d861-hero-pct b { font-size: 30px; font-weight: 750; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.d861-hero-pct span { font-size: 12px; font-weight: 600; color: var(--text-3); }
.d861-hero-pct.is-ok b { color: var(--accent-strong); }
.d861-hero-pct.is-warn b { color: var(--warn); }
.d861-hero-pct.is-bad b { color: var(--danger); }
.d861-hero .thermo { height: 12px; background: var(--surface); }
.d861-hero .thermo-pace { top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; }
.d861-hero-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.d861-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.d861-meta-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.d861-meta.is-ok .d861-meta-ico { border-color: transparent; background: var(--ok-weak); color: var(--accent-strong); }
.d861-meta.is-bad .d861-meta-ico { border-color: transparent; background: var(--danger-weak); color: var(--danger); }
.d861-meta-txt { display: flex; flex-direction: column; min-width: 0; font-size: 11.5px; line-height: 1.3; }
.d861-meta-txt .muted { line-height: 1.25; }
.d861-meta-txt b { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.d861-meta.is-ok .d861-meta-txt b { color: var(--accent-strong); }
.d861-meta.is-bad .d861-meta-txt b { color: var(--danger); }
.d861-sub-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 9px; }
.d861-sub-h b { font-size: 13.5px; color: var(--text); }
.d861-sub-h .hint-ico { align-self: center; }

/* 17.10: 2×2 — полные русские названия показателей в одну строку (в 4 колонки ~150px они не помещаются) */
.d861-norm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.d861-norm {
  display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 10px 12px 10px 15px;
  border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface); box-shadow: inset 3px 0 0 var(--q, var(--border-strong));
}
.d861-norm.is-ok { --q: var(--ok); }
.d861-norm.is-warn { --q: var(--warn); }
.d861-norm.is-bad { --q: var(--danger); }
.d861-norm.is-muted { --q: var(--border-strong); }
.d861-norm-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.d861-norm-n {
  flex: none; width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700;
}
.d861-norm-lbl { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d861-norm-st { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.d861-norm-st em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.d861-norm .plan-state { height: 20px; padding: 0 8px; font-size: 11px; }
.d861-norm-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.d861-norm-val { white-space: nowrap; }
.d861-norm-val b { font-size: 24px; font-weight: 750; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.d861-norm-val span { font-size: 14px; font-weight: 600; color: var(--text-2); }
.d861-norm-val .d861-norm-unit { font-size: 12px; color: var(--text-3); }
.d861-norm-val em { margin-left: 8px; font-style: normal; font-size: 13px; font-weight: 700; color: var(--text-2); }
.d861-norm .thermo { height: 8px; }
.d861-norm-sub { line-height: 1.35; }

.d861-split-pct { font-size: 16px; font-weight: 750; color: var(--st-routed); font-variant-numeric: tabular-nums; }
.d861-split-bar { display: flex; gap: 2px; height: 12px; border-radius: var(--r-full); overflow: hidden; background: var(--surface-2); }
.d861-split-tg { background: var(--ok); }
.d861-split-rt { background: var(--st-routed); }
.d861-split-legend { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 9px; font-size: 13px; color: var(--text-2); }
.d861-split-k { display: inline-flex; align-items: baseline; gap: 6px; }
.d861-split-k i { align-self: center; width: 10px; height: 10px; border-radius: 3px; }
.d861-split-k.is-tg i { background: var(--ok); }
.d861-split-k.is-rt i { background: var(--st-routed); }
.d861-split-k b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.d861-rt-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.d861-rt-parts > .ico { color: var(--st-routed); }
.d861-rt-part b { margin-left: 5px; color: var(--text); font-variant-numeric: tabular-nums; }
.d861-conv { margin-top: 9px; font-size: 12.5px; color: var(--text-2); }
.d861-conv b { color: var(--text); }
.d861-conv-gain { margin-left: 8px; padding: 1px 8px; border-radius: var(--r-full); background: var(--ok-weak); color: var(--accent-strong); font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* ══════════ Реестр консультаций ══════════ */
.d861-reg { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 12px; min-width: 0; scroll-margin-top: 72px; }
.d861-reg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.d861-reg-head .d861-pane-title { flex: 1 1 auto; }
.d861-reg-cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.d861-period-ctl { display: flex; align-items: center; gap: 6px; }
.d861-ctl-lbl { font-size: 13px; white-space: nowrap; }
.d861-date { width: 142px; height: 34px; font-variant-numeric: tabular-nums; }
.d861-sync {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding: 3px 10px 3px 8px; border-radius: var(--r-full);
  background: var(--info-weak); color: var(--info); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.d861-sync.is-flash { animation: d861flash 1s ease; }
@keyframes d861flash {
  0% { background: var(--accent-weak); color: var(--accent-strong); box-shadow: 0 0 0 0 var(--accent-ring); }
  60% { box-shadow: 0 0 0 6px transparent; }
}
.d861-export-btn { height: 36px; padding: 0 14px; gap: 7px; white-space: nowrap; }
.d861-tb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.d861-search { flex: 1 1 300px; min-width: 200px; height: 34px; padding: 0 10px; }
.d861-search-inp { flex: 1; min-width: 0; height: 100%; font-size: 13.5px; }
.d861-search-inp::-webkit-search-cancel-button { cursor: pointer; }
.d861-sel { height: 34px; gap: 6px; padding: 0 4px 0 10px; }
.d861-sel-inp { height: 100%; max-width: 230px; padding-right: 4px; font-size: 13px; cursor: pointer; }
.d861-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.d861-chips.is-inline { flex-wrap: nowrap; }
.d861-chips-cap { font-size: 12px; font-weight: 600; margin-right: 2px; white-space: nowrap; }
.d861-tb-sep { width: 14px; }
.d861-tb-grow { flex: 1; }
.d861-tint { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.d861-tint input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.d861-tint .ico { color: var(--text-3); }
.d861-reset { gap: 5px; }

.d861-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-m); }
.d861-table { min-width: 1060px; font-size: 13px; }
.d861-table th { padding: 9px 10px; background: var(--surface-2); font-size: 11.5px; letter-spacing: .01em; }
.d861-table td { padding: 9px 10px; vertical-align: top; }
.d861-table tbody tr:last-child td { border-bottom: 0; }
.d861-table .c-no { width: 58px; }
.d861-table .c-st { width: 148px; }
.d861-table .c-dt { width: 66px; }
.d861-table .c-inn { width: 138px; }
.d861-table .c-exp { width: 106px; }
.d861-table .c-csat { width: 92px; }
.d861-th-sort {
  display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none;
  font: inherit; font-weight: 700; color: inherit; cursor: pointer; white-space: nowrap;
}
.d861-th-sort .ico { color: var(--text-3); opacity: .5; }
.d861-th-sort.on { color: var(--accent-strong); }
.d861-th-sort.on .ico { color: var(--accent-strong); opacity: 1; }
.d861-no { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.d861-c1 { color: var(--text); line-height: 1.35; }
.d861-c1.is-strong { font-weight: 600; }
.d861-c1.is-mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.d861-c2 { margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--text-3); }
.d861-st-cell { display: flex; flex-direction: column; align-items: flex-start; }
.d861-st { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; white-space: nowrap; }
.d861-st.st-closed { background: var(--ok-weak); color: var(--accent-strong); }
.d861-st.st-in_work { background: var(--info-weak); color: var(--info); }
.d861-st.st-risk { background: var(--danger-weak); color: var(--danger); }
.d861-st.st-routed { background: var(--st-routed-weak); color: var(--st-routed); }
.d861-dt { font-variant-numeric: tabular-nums; }
.d861-dt b { display: block; font-weight: 600; }
.d861-dt span { font-size: 12px; color: var(--text-3); }
.d861-app { display: flex; align-items: flex-start; gap: 8px; }
.d861-seg-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--c); }
.d861-routed-res { display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--st-routed); }
.d861-csat { display: inline-flex; gap: 1px; color: var(--border-strong); }
.d861-star { display: inline-flex; }
.d861-star.on { color: var(--star); }
.d861-star.on .ico { fill: currentColor; }
.d861-csat.is-low .d861-star.on { color: var(--danger); }
.d861-csat.is-none { color: var(--text-3); }
.d861-risk-note { color: var(--danger); font-weight: 600; }
/* Мягкая подсветка строк по статусу (чекбокс над таблицей) */
.d861-tinted tr.tr-risk td { background: var(--row-risk); }
.d861-tinted tr.tr-routed td { background: var(--row-routed); }
.d861-tinted tr.tr-risk td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.d861-tinted tr.tr-routed td:first-child { box-shadow: inset 3px 0 0 var(--st-routed); }
.d861-tinted tbody tr.tr-risk:hover td { background: var(--row-risk-hover); }
.d861-tinted tbody tr.tr-routed:hover td { background: var(--row-routed-hover); }
.d861-empty-row:hover td { background: none !important; }
.d861-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 10px; color: var(--text-2); }
.d861-empty .ico { color: var(--text-3); }

.d861-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 2px; }
.d861-pg-info { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.d861-pg-nav { display: flex; align-items: center; gap: 4px; }
.d861-pg-step { gap: 4px; }
.d861-pg {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.d861-pg:hover { border-color: var(--border-strong); color: var(--text); }
.d861-pg.on { border-color: var(--accent-strong); background: var(--accent-strong); color: var(--on-accent); }
.d861-pg-gap { padding: 0 2px; color: var(--text-3); }
.d861-pg-size { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.d861-size { width: 74px; height: 32px; }

/* ══════════ Модалка выгрузки ══════════ */
.d861-ex { display: flex; flex-direction: column; gap: 16px; }
.d861-ex-org { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--r-s); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.d861-ex-org .ico { color: var(--accent-strong); flex: none; }
.d861-ex-h { margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.d861-ex-dates { display: flex; align-items: center; gap: 8px; }
.d861-ex-dates .inp { width: 156px; height: 34px; }
.d861-ex-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.d861-ex-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.d861-ex-fmt {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--r-m);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.d861-ex-fmt:hover { border-color: var(--border-strong); }
.d861-ex-fmt input { position: absolute; opacity: 0; pointer-events: none; }
.d861-ex-fmt.on { border-color: var(--accent); background: var(--accent-weak); box-shadow: 0 0 0 3px var(--accent-ring); }
.d861-ex-fmt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.d861-ex-fmt-ico { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.d861-ex-fmt.on .d861-ex-fmt-ico { background: var(--surface); color: var(--accent-strong); }
.d861-ex-fmt-txt { display: flex; flex-direction: column; gap: 3px; }
.d861-ex-fmt-txt b { font-size: 15px; color: var(--text); }
.d861-ex-fmt-txt .small { line-height: 1.35; }
.d861-ex-opt { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.d861-ex-opt input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.d861-ex-opt > span { display: flex; flex-direction: column; gap: 2px; }
.d861-ex-opt b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.d861-ex-sum { display: flex; align-items: flex-start; gap: 8px; min-height: 42px; padding: 10px 12px; border-radius: var(--r-s); background: var(--info-weak); font-size: 13px; color: var(--text); }
.d861-ex-sum > .ico { flex: none; margin-top: 2px; color: var(--info); }
.d861-ex-err { color: var(--danger); }

/* ══════════ Окно «Плановые показатели» (dash861_plan) ══════════ */
.d861-pl { display: flex; flex-direction: column; gap: 14px; }
.d861-pl-years { display: flex; flex-wrap: wrap; gap: 6px; }
.d861-pl-year { gap: 6px; height: 32px; padding: 0 12px; font-size: 13.5px; }
.d861-pl-dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--text-3); }
.d861-pl-dot.is-saved { border-color: var(--ok); background: var(--ok); }
.d861-pl-cur { font-size: 11px; font-weight: 600; color: var(--text-3); }
.d861-pl-year.on .d861-pl-cur { color: inherit; }
.d861-pl-status { display: flex; align-items: flex-start; gap: 8px; min-height: 38px; padding: 9px 12px; border-radius: var(--r-s); background: var(--surface-2); font-size: 13px; color: var(--text); }
.d861-pl-status > .ico { flex: none; margin-top: 1px; }
.d861-pl-status.is-saved { background: var(--ok-weak); }
.d861-pl-status.is-saved > .ico { color: var(--accent-strong); }
.d861-pl-status.is-draft { background: var(--warn-weak); }
.d861-pl-status.is-draft > .ico { color: var(--warn); }
.d861-pl-form { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-m); transition: opacity .15s; }
.d861-pl-form.is-pending { opacity: .5; }
.d861-pl-row { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 6px 16px; padding: 11px 14px; }
.d861-pl-row + .d861-pl-row { border-top: 1px solid var(--border); }
.d861-pl-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
.d861-pl-lbl b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.d861-pl-lbl .small { line-height: 1.35; }
.d861-pl-ctl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d861-pl-in { display: flex; align-items: center; gap: 8px; }
.d861-pl-inp { width: 96px; height: 34px; text-align: right; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.d861-pl-inp.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.d861-pl-unit { font-size: 12.5px; line-height: 1.25; }
.d861-pl-aux { font-variant-numeric: tabular-nums; }
.d861-pl-err { font-size: 12px; font-weight: 600; color: var(--danger); }
.d861-pl-err:empty { display: none; }
.d861-pl-foot { display: flex; align-items: flex-start; gap: 7px; line-height: 1.4; }
.d861-pl-foot > .ico { flex: none; margin-top: 2px; }

/* ══════════ Складывание: при нехватке ширины — иконки с подсказками ══════════ */
@media (max-width: 1279px) {
  .d861-hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d861-reg-cap { display: none; }
}
@media (max-width: 1023px) {
  .d861-top { grid-template-columns: minmax(0, 1fr); }
  .d861-reg .d861-lbl, .d861-plan-btn .d861-lbl { display: none; }
  .d861-plan-btn { width: 32px; padding: 0; justify-content: center; }
  .d861-export-btn { width: 36px; padding: 0; }
  .d861-sync { padding: 4px 6px; }
  .d861-chips, .d861-chips.is-inline { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
  .d861-chips::-webkit-scrollbar { display: none; }
  .d861-tb-2 { flex-wrap: wrap; }
  .d861-tb-sep, .d861-tb-grow { display: none; }
  .d861-pg-step { padding: 0 8px; }
}
@media (max-width: 639px) {
  .d861-cal, .d861-kpi, .d861-reg { padding: 12px; }
  .d861-hero-top { flex-direction: column; align-items: flex-start; }
  .d861-hero-pct { align-items: flex-start; }
  .d861-hero-val b { font-size: 30px; }
  .d861-norm-grid { grid-template-columns: minmax(0, 1fr); }
  .d861-pl-row { grid-template-columns: minmax(0, 1fr); }
  .d861-plan-note { flex-wrap: wrap; }
  .d861-kpi-period { display: none; }
  .d861-period-ctl { flex-wrap: wrap; }
  .d861-date { width: 132px; }
  .d861-search { flex-basis: 100%; }
  .d861-sel { flex: 1 1 140px; }
  .d861-sel-inp { max-width: none; width: 100%; }
  .d861-table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .d861-table { min-width: 0; }
  .d861-table.tbl-cards td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 10px; width: 100%; padding: 4px 0; text-align: left; }
  .d861-table.tbl-cards td::before { grid-column: 1; grid-row: 1; font-size: 12px; }
  .d861-table.tbl-cards td > * { grid-column: 2; min-width: 0; }
  .d861-table.tbl-cards td.c-no { padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
  .d861-table.tbl-cards .d861-empty-row td { display: block; }
  .d861-tinted tr.tr-risk td, .d861-tinted tr.tr-routed td,
  .d861-tinted tr.tr-risk td:first-child, .d861-tinted tr.tr-routed td:first-child { background: none; box-shadow: none; }
  .d861-tinted tr.tr-risk { background: var(--row-risk); border-left: 3px solid var(--danger); }
  .d861-tinted tr.tr-routed { background: var(--row-routed); border-left: 3px solid var(--st-routed); }
  .d861-pg, .d861-pg-gap { display: none; }
  .d861-pg.on { display: inline-block; }
  .d861-ex-formats { grid-template-columns: minmax(0, 1fr); }
  .d861-ex-fmt { flex-direction: row; align-items: center; }
}
