/* «ЕИС»: одна таблица по циклам, режим меняет только колонки. Цвета из темы, с запасными значениями. */
.eis-report { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.eis-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.eis-range-controls { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.eis-range-controls label { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted, rgba(200, 200, 200, 0.75)); font-size: 11px; }
.eis-range-controls input[type="date"] { min-height: 34px; padding: 4px 9px; border: 1px solid rgba(127, 127, 127, 0.24); border-radius: 7px; background: var(--surface, rgba(20, 20, 22, 0.6)); color: inherit; font: inherit; font-size: 12px; }
.eis-range-controls input[type="date"]:focus { outline: none; border-color: var(--accent, #6b8cff); }
.eis-range-controls button, .eis-range-open { min-height: 34px; padding: 0 12px; border: 1px solid rgba(127, 127, 127, 0.25); border-radius: 7px; background: rgba(127, 127, 127, 0.09); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.eis-range-controls button:hover, .eis-range-open:hover { background: rgba(127, 127, 127, 0.17); }
.eis-range-secondary { opacity: 0.78; }

.eis-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(127, 127, 127, 0.12); }
.eis-nav button { width: 30px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: inherit; font-size: 14px; cursor: pointer; }
.eis-nav button:hover:not(:disabled) { background: rgba(127, 127, 127, 0.22); }
.eis-nav button:disabled { opacity: 0.35; cursor: default; }
.eis-nav input[type="date"] { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: inherit; }
.eis-nav input[type="date"]:focus { outline: none; border-color: var(--accent, #6b8cff); }
.eis-year-label { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(127, 127, 127, 0.24); border-radius: 7px; color: var(--text-muted, rgba(200, 200, 200, 0.75)); font-size: 12px; }
.eis-year-label select { border: 0; background: transparent; color: var(--text, rgba(240, 240, 240, 0.95)); font: inherit; font-size: 13px; cursor: pointer; }
.eis-year-label select:focus { outline: 2px solid var(--accent, #6b8cff); outline-offset: 2px; }
[data-theme="dark"] .eis-year-label select { color-scheme: dark; }
[data-theme="dark"] .eis-year-label select option { color: #f1f2f5; background-color: #17181c; }
[data-theme]:not([data-theme="dark"]) .eis-year-label select { color-scheme: light; }

.eis-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(229, 72, 77, 0.14); color: #ff9ca0; font-size: 13px; }
.eis-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-muted, rgba(200, 200, 200, 0.7)); }

.eis-cycle-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.eis-cycle-kpi { display: grid; align-content: start; gap: 8px; min-width: 0; min-height: 104px; padding: 14px; border: 1px solid var(--line, rgba(127,127,127,.2)); border-radius: 16px; background: linear-gradient(135deg, var(--surface-soft, rgba(127,127,127,.08)), var(--surface, rgba(20,20,22,.5))); }
.eis-cycle-kpi > span, .eis-cycle-kpi > small { color: var(--text-muted, rgba(200,200,200,.7)); font-size: 11px; line-height: 1.35; }
.eis-cycle-kpi > strong, .eis-cycle-kpi > button { width: fit-content; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--text, rgba(240,240,240,.95)); font: inherit; font-size: clamp(19px, 2vw, 25px); font-weight: 750; font-variant-numeric: tabular-nums; text-align: left; overflow-wrap: anywhere; }
.eis-cycle-kpi > button { cursor: pointer; text-decoration: underline dotted rgba(127,127,127,.5); text-underline-offset: 3px; }
.eis-cycle-kpi > button:hover { background: transparent; text-decoration-color: var(--accent, #6b8cff); }
.eis-cycle-kpi > small { margin-top: auto; }
.eis-block-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line, rgba(127,127,127,.2)); border-radius: 12px; }
.eis-block-controls legend { padding: 0 5px; color: var(--text-muted, rgba(200,200,200,.7)); font-size: 11px; }
.eis-block-controls label { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 9px; border: 1px solid var(--line, rgba(127,127,127,.2)); border-radius: 999px; color: var(--text-soft, inherit); font-size: 12px; cursor: pointer; user-select: none; }
.eis-block-controls input { accent-color: var(--accent, #6b8cff); margin: 0; }
.eis-block-controls label.is-empty { opacity: .7; }
.eis-block-empty-note { margin: -6px 0 0; color: var(--text-muted, rgba(200,200,200,.7)); font-size: 11px; line-height: 1.45; }
.eis-fullscreen-toggle { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 9px; background: var(--surface-soft, rgba(127,127,127,.09)); color: var(--text, inherit); font: inherit; font-size: 12px; cursor: pointer; }
.eis-fullscreen-toggle:hover { background: var(--surface-strong, rgba(127,127,127,.15)); }

#appShell.eis-fullscreen { grid-template-columns: minmax(0, 1fr); }
#appShell.eis-fullscreen > .sidebar { display: none !important; }
#appShell.eis-fullscreen .analytics-layout { grid-template-columns: minmax(0, 1fr) !important; }
#appShell.eis-fullscreen .analytics-layout > .analytics-subnav-stack { display: none !important; }

/* Панель над таблицей: режим слева, состояние сохранения справа. */
.eis-freshness {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 0 auto;
  padding: 0 8px;
  font-size: 12px;
  color: var(--muted, #8a90a0);
  white-space: nowrap;
}

.eis-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.eis-mode-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(127, 127, 127, 0.12); }
.eis-mode-tab { min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted, rgba(210, 210, 210, 0.8)); font: inherit; font-size: 12.5px; cursor: pointer; }
.eis-mode-tab:hover { background: rgba(127, 127, 127, 0.18); color: inherit; }
.eis-mode-tab.is-active { background: rgba(107, 140, 255, 0.26); color: var(--text, rgba(245, 245, 245, 0.98)); font-weight: 600; }
.eis-toolbar-tail { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.eis-manual-note { font-size: 12px; color: var(--text-muted, rgba(200, 200, 200, 0.7)); }
.eis-inline-error { padding: 4px 9px; font-size: 12px; }
.eis-manual-status { margin: 0; font-size: 12px; color: #8fd6a4; }
.eis-manual-save { min-height: 32px; padding: 0 12px; border: 1px solid rgba(107, 140, 255, 0.45); border-radius: 7px; background: rgba(107, 140, 255, 0.16); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.eis-manual-save:hover { background: rgba(107, 140, 255, 0.26); }

.eis-manager-controls { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin:12px 0; }
.eis-manager-controls label { display:grid; gap:5px; color:var(--text-muted, #999); font-size:11px; }
.eis-manager-controls input,.eis-manager-controls select { min-height:36px; padding:0 9px; border:1px solid var(--line, #333); border-radius:8px; background:var(--surface, #151515); color:var(--text, #eee); }
.eis-manager-controls button,.eis-manager-actions button { min-height:34px; padding:0 11px; border:1px solid var(--line, #333); border-radius:8px; background:var(--surface-soft, #202020); color:inherit; cursor:pointer; }
.eis-manager-metrics { display:flex; flex-wrap:wrap; gap:8px 14px; margin:10px 0; padding:10px; border:1px solid var(--line, #333); border-radius:10px; }
.eis-manager-metrics label { display:flex; align-items:center; gap:5px; font-size:12px; }
.eis-manager-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:10px 0; color:var(--text-muted, #999); font-size:11px; }
.eis-manager-actions span { margin-left:auto; }
.eis-manager-department { margin:10px 0; border:1px solid var(--line, #333); border-radius:12px; overflow:hidden; }
.eis-manager-department-toggle { display:flex; align-items:center; gap:9px; width:100%; min-height:42px; padding:0 13px; border:0; background:var(--surface-soft, #202020); color:inherit; text-align:left; cursor:pointer; }
.eis-manager-department-toggle small { margin-left:auto; color:var(--text-muted, #999); }
.eis-manager-people { display:grid; grid-template-columns:repeat(auto-fill,minmax(245px,1fr)); gap:9px; padding:10px; }
.eis-manager-person { padding:12px; border:1px solid var(--line, #333); border-radius:10px; background:var(--surface, #151515); }
.eis-manager-person h4 { margin:0 0 10px; font-size:14px; }
.eis-manager-value { display:flex; justify-content:space-between; gap:8px; padding:5px 0; border-top:1px solid rgba(127,127,127,.12); font-size:12px; }
.eis-manager-value span { color:var(--text-muted, #999); }
.eis-manager-value strong { text-align:right; white-space:nowrap; }
.eis-manager-value small { color:var(--text-muted, #999); font-weight:400; }
.eis-manager-value .eis-compare-values { display:block; }
.eis-manager-value .eis-compare-delta { display:block; margin-top:2px; font-size:11px; }
.eis-manager-value .eis-compare-delta.is-up { color:#2f9e62; }
.eis-manager-value .eis-compare-delta.is-down { color:#d9534f; }
.eis-manager-value .eis-compare-delta.is-equal { color:var(--text-muted, #999); }
.eis-manager-warning { padding:8px 11px; border-radius:8px; background:rgba(237,177,80,.12); color:#dfbd7a; font-size:12px; }
.eis-snapshot-editor { margin-top:16px; padding:12px; border:1px solid var(--line, #333); border-radius:10px; background:var(--surface-soft, #171717); }
.eis-snapshot-editor summary { color:var(--text-soft, #ddd); font-weight:600; cursor:pointer; }
.eis-snapshot-editor .eis-manager-controls { margin-bottom:4px; }
[data-theme="dark"] .eis-manager-controls select { color-scheme:dark; }
[data-theme="dark"] .eis-manager-controls select option { color:#f1f2f5; background-color:#17181c; }

/* Контейнер таблицы: скролл внутри, закруглённые углы, мягкая тень. */
.eis-grid-wrap { max-height: 74vh; overflow: auto; border-radius: 14px; border: 1px solid rgba(127, 127, 127, 0.22); background: var(--surface, rgba(20, 20, 22, 0.6)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.eis-spec-grid thead tr.eis-spec-section th { top: 0; height: 30px; }
.eis-spec-grid thead tr.eis-spec-group th { top: 30px; height: 30px; }
.eis-spec-grid thead tr.eis-spec-columns th { top: 60px; }
.eis-spec-grid thead tr.eis-spec-section th:not([rowspan]), .eis-spec-grid thead tr.eis-spec-group th { text-align: left; }
.eis-spec-grid thead tr.eis-spec-section th > span, .eis-spec-grid thead tr.eis-spec-group th > span { position: sticky; left: 210px; display: inline-block; }
.eis-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-family: inherit; font-size: 11px; font-variant-numeric: tabular-nums; }
.eis-grid th, .eis-grid td { box-sizing: border-box; padding: 4px 7px; border-bottom: 1px solid rgba(127, 127, 127, 0.12); white-space: nowrap; vertical-align: middle; }
.eis-grid th { text-align: right; }
.eis-grid td { text-align: center; }
.eis-grid th.eis-vertical-head, .eis-grid td.eis-vertical { position: sticky; left: 0; z-index: 6; }
.eis-grid th.eis-week-head, .eis-grid td.eis-vertical-week { position: sticky; left: 30px; z-index: 5; }
.eis-grid th.eis-date-head, .eis-grid td.eis-date { position: sticky; left: 58px; z-index: 4; }
.eis-grid td.eis-sticky-label { position: sticky; left: 30px; z-index: 4; width: 128px; min-width: 128px; max-width: 128px; white-space: normal; line-height: 1.25; background: var(--surface, #111); text-align: left; }
.eis-grid td.eis-sticky-label.eis-total-label { left: 0; width: 158px; min-width: 158px; max-width: 158px; }
.eis-grid td.eis-pinned { position: sticky; z-index: 7; background: var(--surface, #141416); }
.eis-grid th.eis-pinned-head { z-index: 14; }
.eis-grid .eis-pinned-activity { left: 158px; width: 72px; min-width: 72px; max-width: 72px; }
.eis-grid .eis-pinned-applications { left: 230px; width: 82px; min-width: 82px; max-width: 82px; }
.eis-grid .eis-pinned-d { left: 312px; width: 64px; min-width: 64px; max-width: 64px; }
.eis-grid .eis-pinned-e { left: 222px; width: 80px; min-width: 80px; max-width: 80px; }
.eis-grid .eis-pinned-f { left: 302px; width: 68px; min-width: 68px; max-width: 68px; }
.eis-grid th.eis-pinned-d, .eis-grid th.eis-pinned-e, .eis-grid th.eis-pinned-f, .eis-grid th.eis-pinned-activity, .eis-grid th.eis-pinned-applications { padding-left: 3px; padding-right: 3px; }
.eis-grid td.eis-pinned-activity, .eis-grid td.eis-pinned-applications { padding-left: 3px; padding-right: 3px; }
.eis-grid thead th.eis-pinned-activity { min-width: 72px; max-width: 72px; }
.eis-grid thead th.eis-pinned-applications { min-width: 82px; max-width: 82px; }
.eis-grid td.eis-pinned-d, .eis-grid td.eis-pinned-e, .eis-grid td.eis-pinned-f { padding-left: 3px; padding-right: 3px; }
.eis-grid thead th.eis-pinned-d { min-width: 64px; max-width: 64px; }
.eis-grid thead th.eis-pinned-e { min-width: 80px; max-width: 80px; }
.eis-grid thead th.eis-pinned-f { min-width: 68px; max-width: 68px; }
.eis-grid td.eis-pinned-e input[type="number"] { box-sizing: border-box; width: 74px; padding-left: 2px; padding-right: 2px; }
.eis-grid.eis-cycles-hidden th.eis-week-head, .eis-grid.eis-cycles-hidden td.eis-vertical-week { left: 0; }
.eis-grid.eis-cycles-hidden th.eis-date-head, .eis-grid.eis-cycles-hidden td.eis-date { left: 28px; }
.eis-grid.eis-cycles-hidden td.eis-sticky-label { left: 0; width: 100px; min-width: 100px; max-width: 100px; }
.eis-grid.eis-cycles-hidden .eis-pinned-activity { left: 128px; }
.eis-grid.eis-cycles-hidden .eis-pinned-applications { left: 200px; }
.eis-grid.eis-cycles-hidden .eis-pinned-d { left: 282px; }
.eis-grid.eis-cycles-hidden .eis-pinned-e { left: 192px; }
.eis-grid.eis-cycles-hidden .eis-pinned-f { left: 272px; }
.eis-grid.eis-range th.eis-date-head, .eis-grid.eis-range td.eis-date { left: 0; }
.eis-grid.eis-range td.eis-sticky-label.eis-total-label { left: 0; width: 100px; min-width: 100px; max-width: 100px; }
.eis-grid.eis-range .eis-pinned-activity { left: 100px; }
.eis-grid.eis-range .eis-pinned-applications { left: 172px; }
.eis-grid.eis-range .eis-pinned-d { left: 254px; }
.eis-grid.eis-range .eis-pinned-e { left: 164px; }
.eis-grid.eis-range .eis-pinned-f { left: 244px; }
.eis-grid th.eis-vertical-head, .eis-grid td.eis-vertical { width: 30px; min-width: 30px; max-width: 30px; }
.eis-grid th.eis-week-head, .eis-grid td.eis-vertical-week { width: 28px; min-width: 28px; max-width: 28px; }
.eis-grid th.eis-date-head, .eis-grid td.eis-date { width: 100px; min-width: 100px; max-width: 100px; }
.eis-grid th.eis-vertical-head, .eis-grid th.eis-week-head { writing-mode: vertical-rl; transform: rotate(180deg); padding-left: 4px; padding-right: 4px; }
.eis-grid td.eis-date { background: var(--surface, #111); }
.eis-grid tbody tr.eis-cycle-fact td.eis-pinned { background: color-mix(in srgb, var(--surface, #141416) 86%, #6b8cff); }
.eis-grid tbody tr.eis-week-total td.eis-pinned { background: color-mix(in srgb, var(--surface, #141416) 92%, #888888); }
.eis-grid tbody tr.eis-week-plan td.eis-pinned { background: var(--surface, #141416); }
.eis-unobserved { background: var(--surface, rgba(20, 20, 22, 0.6)); }

/* Шапка: липкая, с чертой снизу, бейджи источников и номер колонки листа. */
.eis-grid { --eis-cohort-head-height: 26px; }
.eis-grid thead th { position: sticky; top: var(--eis-cohort-head-height, 0px); z-index: 12; padding: 2px 5px; background: var(--surface-strong, #17181c); border-bottom: 1px solid rgba(127, 127, 127, 0.26); text-align: center; font-size: 9px; font-weight: 500; color: var(--text-soft, rgba(230, 230, 230, 0.9)); }
.eis-grid thead th.eis-date-head, .eis-grid thead th.eis-vertical-head, .eis-grid thead th.eis-week-head { text-align: center; }
.eis-grid .eis-block-tag { display: block; margin-top: 2px; font-size: 8px; font-weight: 400; letter-spacing: 0; text-transform: none; opacity: 1; color: var(--text-muted, rgba(200, 200, 200, 0.62)); }
.eis-grid thead th.eis-col-head { width: 100px; min-width: 100px; max-width: 100px; white-space: normal; overflow-wrap: normal; vertical-align: bottom; line-height: 1.2; }
.eis-grid thead tr.eis-department-row th { top: calc(var(--eis-cohort-head-height, 0px) + var(--eis-metric-head-height, 43px)); z-index: 14; height: 30px; padding: 5px 8px; text-align: center; background: var(--surface-strong, #17181c); }
.eis-grid thead tr.eis-user-row th { position: sticky; top: calc(var(--eis-cohort-head-height, 0px) + var(--eis-metric-head-height, 43px) + var(--eis-department-head-height, 30px)); z-index: 15; height: 30px; padding: 5px 8px; text-align: center; background: var(--surface-strong, #17181c); }
.eis-grid thead tr.eis-metric-row th { position: sticky; top: var(--eis-cohort-head-height, 0px); z-index: 13; background: var(--surface-strong, #17181c); }
.eis-grid thead tr.eis-cohort-row th { top: 0; z-index: 18; height: 26px; padding: 2px 6px; text-align: center; font-size: 9px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: nowrap; border-bottom: 1px solid rgba(127, 127, 127, 0.26); background: var(--surface-strong, #17181c); }
.eis-grid thead tr.eis-cohort-row th.eis-cohort-new { color: #2f4fb0; background: color-mix(in srgb, #6b8cff 18%, var(--surface-strong, #17181c)); }
.eis-grid thead tr.eis-cohort-row th.eis-cohort-repeat { color: #6b3fa0; background: color-mix(in srgb, #b58ae8 18%, var(--surface-strong, #17181c)); }
.eis-grid thead tr.eis-cohort-row th.eis-cohort-core { color: #4a5563; background: color-mix(in srgb, #8d9bac 14%, var(--surface-strong, #17181c)); }
[data-theme="dark"] .eis-grid thead tr.eis-cohort-row th.eis-cohort-new { color: #a9bdff; }
[data-theme="dark"] .eis-grid thead tr.eis-cohort-row th.eis-cohort-repeat { color: #d2b8f5; }
[data-theme="dark"] .eis-grid thead tr.eis-cohort-row th.eis-cohort-core { color: #c2ccd8; }
.eis-grid thead tr.eis-cohort-row th.eis-cohort-corner { position: sticky; left: 0; z-index: 19; background: var(--surface-strong, #17181c); }
.eis-grid th.eis-cohort-start.eis-cohort-start-new, .eis-grid td.eis-cohort-start.eis-cohort-start-new { border-left: 2px solid rgba(107, 140, 255, 0.55); }
.eis-grid th.eis-cohort-start.eis-cohort-start-repeat, .eis-grid td.eis-cohort-start.eis-cohort-start-repeat { border-left: 2px solid rgba(181, 138, 232, 0.6); }
.eis-grid th.eis-cohort-start.eis-cohort-start-core, .eis-grid td.eis-cohort-start.eis-cohort-start-core { border-left: 2px solid rgba(141, 155, 172, 0.5); }
.eis-grid thead th.eis-metric-group-head { text-align: center; vertical-align: bottom; width: 100px; min-width: 100px; max-width: 100px; }
.eis-grid thead th.eis-total-head { width: 100px; min-width: 100px; max-width: 100px; text-align: center; }
.eis-grid thead th.eis-subtotal-head { font-size: 9px; font-weight: 600; color: var(--text, rgba(240, 240, 240, 0.98)); background: color-mix(in srgb, var(--surface-strong, #17181c) 78%, #6b8cff); }
.eis-grid thead th.eis-user-head { width: 104px; min-width: 104px; max-width: 104px; }
.eis-grid thead .eis-metric-toggle { display: grid; place-items: center; width: 16px; height: 16px; margin: 0 auto 2px; padding: 0; border: 1px solid rgba(127,127,127,.25); border-radius: 5px; background: rgba(127,127,127,.08); color: inherit; font: inherit; font-size: 10px; cursor: pointer; vertical-align: middle; }
.eis-grid thead .eis-metric-toggle:hover { background: rgba(127,127,127,.18); }
.eis-grid thead .eis-metric-toggle:focus-visible { outline: 2px solid var(--accent, #6b8cff); outline-offset: 1px; }
.eis-grid thead tr th.eis-pinned-head { z-index: 14; }
.eis-grid thead tr th.eis-vertical-head, .eis-grid thead tr th.eis-week-head, .eis-grid thead tr th.eis-date-head { z-index: 16; }
.eis-grid thead th.eis-department-head, .eis-grid thead th.eis-user-head { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eis-col-head > span:first-child { display: block; }
.eis-col-head small { display: block; margin-top: 1px; color: var(--text-muted, rgba(200, 200, 200, 0.65)); font-size: 8px; font-weight: 400; text-align: center; }

/* Режим редактирования столбцов: ручка перетаскивания и индикаторы вставки. */
.eis-column-edit-controls { display: inline-flex; gap: 4px; }
.eis-grid .eis-col-drag { display: none; place-items: center; width: 22px; height: 22px; margin: 0 0 4px; padding: 0; border: 1px dashed rgba(127, 127, 127, 0.35); border-radius: 5px; background: rgba(127, 127, 127, 0.08); color: var(--text-muted, rgba(210, 210, 210, 0.8)); font-size: 10px; letter-spacing: -1px; cursor: grab; }
.eis-grid .eis-col-drag:active { cursor: grabbing; }
.eis-grid.eis-edit-columns .eis-col-drag { display: inline-grid; }
.eis-grid .eis-col-drag:focus-visible { outline: 2px solid var(--accent, #6b8cff); outline-offset: 1px; }
.eis-grid th.eis-dragging { opacity: 0.45; }
.eis-grid th.eis-drag-over-left { box-shadow: inset 3px 0 0 var(--accent, #6b8cff); }
.eis-grid th.eis-drag-over-right { box-shadow: inset -3px 0 0 var(--accent, #6b8cff); }

/* Левые колонки: цикл и неделя — вертикальные полосы. */
.eis-grid .eis-vertical, .eis-grid .eis-vertical-week { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-weight: 600; letter-spacing: 0.02em; padding: 8px 4px; }
.eis-grid .eis-vertical { min-width: 30px; background: color-mix(in srgb, var(--surface, #111) 84%, #6b8cff); color: #b9c8ff; border-right: 1px solid rgba(127, 127, 127, 0.16); }
.eis-grid .eis-vertical-week { min-width: 28px; background: color-mix(in srgb, var(--surface, #111) 90%, #888); color: var(--text-soft, rgba(230, 230, 230, 0.9)); font-size: 11.5px; font-weight: 500; }
.eis-grid .eis-vertical-head { min-width: 30px; }
.eis-grid .eis-week-head { min-width: 28px; }
.eis-grid .eis-label { text-align: left; }
.eis-grid .eis-date { text-align: left; font-weight: 400; min-width: 100px; color: var(--text, rgba(240, 240, 240, 0.95)); }
.eis-grid .eis-weekend { color: rgba(255, 166, 120, 0.9); }

/* Строки цикла и недели. */
.eis-grid .eis-cycle-fact td { font-weight: 600; background: rgba(107, 140, 255, 0.10); border-top: 1px solid rgba(107, 140, 255, 0.35); border-bottom: 1px solid rgba(107, 140, 255, 0.25); }
.eis-grid .eis-cycle-fact td.eis-label { font-size: 13px; }
.eis-grid .eis-cycle-toggle { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -4px 7px -4px -4px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.eis-grid .eis-cycle-toggle:hover { background: rgba(127, 127, 127, 0.12); }
.eis-grid .eis-cycle-toggle:focus-visible { outline: 2px solid var(--accent, #6b8cff); outline-offset: 1px; }
.eis-grid .eis-week-plan td { color: var(--text-muted, rgba(200, 200, 200, 0.75)); background: transparent; }
.eis-grid .eis-week-plan .eis-label { font-style: italic; font-weight: 500; }
.eis-grid .eis-week-total td { font-weight: 600; background: rgba(127, 127, 127, 0.07); border-top: 1px solid color-mix(in srgb, var(--border, #333) 70%, #888); }
.eis-grid .eis-week-total .eis-label { font-weight: 600; }
.eis-grid .eis-month-fact td { font-weight: 600; background: color-mix(in srgb, var(--surface, #141416) 90%, #6b8cff); }
.eis-grid .eis-month-fact .eis-label { font-weight: 600; font-style: italic; }
.eis-grid .eis-month-fact td.eis-month-blank { background: transparent; }
.eis-grid .eis-cycle-total td { font-weight: 600; background: color-mix(in srgb, var(--surface, #141416) 86%, #6b8cff); border-top: 2px solid color-mix(in srgb, var(--border, #333) 55%, #6b8cff); }
.eis-grid .eis-cycle-total .eis-label { font-weight: 600; }
.eis-grid td.eis-plan-progress { background-image: linear-gradient(90deg, color-mix(in srgb, #6b8cff 32%, transparent) var(--eis-plan-done, 0%), transparent var(--eis-plan-done, 0%)); }
.eis-grid td.eis-plan-progress small { display: block; font-size: 10px; line-height: 1.1; opacity: 0.75; }
.eis-grid .eis-cycle-fact td.eis-vertical { background: color-mix(in srgb, var(--surface, #111) 84%, #6b8cff); }
.eis-grid .eis-cycle-fact td.eis-sticky-label { background: color-mix(in srgb, var(--surface, #111) 90%, #6b8cff); }
.eis-grid .eis-week-plan td.eis-sticky-label, .eis-grid .eis-week-total td.eis-sticky-label { background: var(--surface, #111); }

/* Нули и пустые значения — приглушённым прочерком, чтобы не шуметь. */
.eis-grid .eis-value { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted rgba(127, 127, 127, 0.5); text-underline-offset: 2px; }
.eis-grid .eis-value:hover { background: transparent; text-decoration-color: var(--accent, #6b8cff); }
.eis-grid .eis-value:focus-visible { outline: 2px solid var(--accent, #6b8cff); outline-offset: 2px; border-radius: 2px; }
.eis-grid .eis-value-zero { opacity: 0.55; }
.eis-details { margin-top: 8px; }
.eis-details table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.eis-details th, .eis-details td { padding: 4px 8px; border-bottom: 1px solid rgba(127, 127, 127, 0.2); text-align: left; }
.eis-details th { color: var(--text-muted, rgba(200, 200, 200, 0.7)); font-weight: 600; }

.eis-grid .eis-empty { color: rgba(127, 127, 127, 0.55); font-weight: 400; }

/* Разделение колонок по блокам и акцент на глобальных итогах. */
.eis-grid thead th.eis-global-head { font-weight: 600; background: color-mix(in srgb, var(--surface-strong, #17181c) 86%, #6b8cff); }
.eis-grid tbody td.eis-global-metric { font-weight: 600; background-color: rgba(107, 140, 255, 0.055); }
/* Блоки показателей различаются цветом: шапка, верхняя граница и подпись группы. */
.eis-grid thead th.eis-block-sales { border-top: 2px solid #6b8cff; background: color-mix(in srgb, #6b8cff 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-block-margin, .eis-grid thead th.eis-block-entities { border-top: 2px solid #6cc58c; background: color-mix(in srgb, #6cc58c 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-block-shipment { border-top: 2px solid #e0ad62; background: color-mix(in srgb, #e0ad62 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-block-conv { border-top: 2px solid #b58ae8; background: color-mix(in srgb, #b58ae8 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-block-traffic { border-top: 2px solid #54b8c4; background: color-mix(in srgb, #54b8c4 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-block-addons { border-top: 2px solid #e58ca5; background: color-mix(in srgb, #e58ca5 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-block-funnel { border-top: 2px solid #8d9bac; background: color-mix(in srgb, #8d9bac 16%, var(--surface, #141416)); }
.eis-grid thead th.eis-metric-group-head.eis-block-sales { color: #a9bdff; }
.eis-grid thead th.eis-metric-group-head.eis-block-margin, .eis-grid thead th.eis-metric-group-head.eis-block-entities { color: #a5e2bb; }
.eis-grid thead th.eis-metric-group-head.eis-block-shipment { color: #f0cb9b; }
.eis-grid thead th.eis-metric-group-head.eis-block-conv { color: #d2b8f5; }
.eis-grid thead th.eis-metric-group-head.eis-block-traffic { color: #9ad7de; }
.eis-grid thead th.eis-metric-group-head.eis-block-addons { color: #f2b6c6; }
.eis-grid thead th.eis-metric-group-head.eis-block-funnel { color: #c2ccd8; }
/* Вертикальный разделитель между блоками в теле таблицы. */
.eis-grid td.eis-block-start, .eis-grid th.eis-block-start { border-left: 2px solid color-mix(in srgb, var(--border, #333) 40%, #8d9bac); }
.eis-grid thead th.eis-col-head.eis-pinned-d { min-width: 64px; max-width: 64px; }
.eis-grid thead th.eis-col-head.eis-pinned-activity { min-width: 72px; max-width: 72px; }
.eis-grid thead th.eis-col-head.eis-pinned-applications { min-width: 82px; max-width: 82px; }
.eis-grid thead th.eis-col-head.eis-pinned-e { min-width: 80px; max-width: 80px; }
.eis-grid thead th.eis-col-head.eis-pinned-f { min-width: 68px; max-width: 68px; }
.eis-grid .eis-metric-group-start { border-left: 1px dashed rgba(170, 184, 214, 0.72); }
.eis-grid .eis-metric-group-end { border-right: 1px dashed rgba(170, 184, 214, 0.72); }
.eis-grid thead .eis-metric-group-start, .eis-grid thead .eis-metric-group-end { border-color: rgba(190, 202, 226, 0.9); }
.eis-grid tbody td.eis-subtotal-cell { font-size: 11px; font-weight: 600; color: var(--text, rgba(240, 240, 240, 0.98)); background-color: rgba(107, 140, 255, 0.12); }
.eis-grid tbody td.eis-pinned.eis-global-metric { background-color: var(--surface, #141416); }
.eis-grid tbody tr:hover td { background-color: color-mix(in srgb, var(--surface, #141416) 82%, #6b8cff); }

/* Неподключённый показатель: виден статус источника, а не ноль. */
.eis-grid td.eis-unavailable { color: rgba(200, 160, 110, 0.85); font-size: 11px; font-weight: 500; text-align: center; }

/* План и ручные значения по дням: поле ввода без рамок, фокус сохраняет заметный контур. */
.eis-grid td input[type="number"] { width: 104px; padding: 3px 8px; border: 1px solid transparent; border-radius: 6px; background: rgba(127, 127, 127, 0.08); color: inherit; font: inherit; text-align: center; -moz-appearance: textfield; }
.eis-grid td input[type="number"]::-webkit-inner-spin-button, .eis-grid td input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.eis-grid td input[type="number"]:focus { outline: none; border-color: var(--accent, #6b8cff); background: rgba(107, 140, 255, 0.12); }
/* Поле плана живёт строго внутри своей колонки и не заезжает на соседние. */
.eis-grid td:has(> input.eis-plan-input) { padding: 0 3px; }
.eis-grid td input.eis-plan-input { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; padding: 3px 4px; text-align: right; font-size: 11px; }
.eis-grid td input.eis-manual-input { width: 92px; }
.eis-manual-input.eis-manual-dirty { border-color: rgba(255, 196, 120, 0.7); background: rgba(255, 196, 120, 0.12); }

@media (max-width: 640px) {
  .eis-nav { margin-left: 0; }
  .eis-grid .eis-date { min-width: 94px; }
  .eis-toolbar { align-items: flex-start; flex-direction: column; }
  .eis-toolbar-tail { width: 100%; }
  .eis-cycle-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Окрашивание факта относительно плана: правило задаётся в окне показателя. */
.eis-grid td.eis-plan-color-green { color: #1f7a45; font-weight: 700; background-color: rgba(47, 158, 95, 0.14); }
.eis-grid td.eis-plan-color-red { color: #b33434; font-weight: 700; background-color: rgba(214, 69, 69, 0.13); }
.eis-grid td.eis-plan-color-yellow { color: #8a6410; font-weight: 700; background-color: rgba(201, 151, 31, 0.16); }
[data-theme="dark"] .eis-grid td.eis-plan-color-green { color: #7fe0a6; background-color: rgba(47, 158, 95, 0.22); }
[data-theme="dark"] .eis-grid td.eis-plan-color-red { color: #ff9d9d; background-color: rgba(214, 69, 69, 0.22); }
[data-theme="dark"] .eis-grid td.eis-plan-color-yellow { color: #f0cf82; background-color: rgba(201, 151, 31, 0.24); }

/* Кнопка «План и цвет» в шапке показателя. */
.eis-grid thead th .eis-plan-gear { margin-left: 3px; padding: 0 2px; border: 0; background: transparent; color: inherit; font-size: 11px; line-height: 1; opacity: 0.55; cursor: pointer; }
.eis-grid thead th .eis-plan-gear:hover { opacity: 1; }
.eis-grid thead th .eis-plan-gear:focus-visible { opacity: 1; outline: none; box-shadow: 0 0 0 2px var(--accent, #6b8cff); border-radius: 4px; }

/* Мини-окно плана: оверлей поверх отчёта, форма по центру. */
.eis-plan-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 10, 14, 0.55); }
.eis-plan-dialog { width: min(460px, 100%); max-height: 90vh; overflow: auto; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--border, #333); background: var(--surface, #17181c); color: var(--text, #f1f2f5); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45); }
.eis-plan-dialog h4 { margin: 0 0 12px; font-size: 15px; }
.eis-plan-dialog .eis-plan-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-size: 13px; }
.eis-plan-dialog .eis-plan-field select, .eis-plan-dialog .eis-plan-field input { min-width: 160px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border, #333); background: rgba(127, 127, 127, 0.08); color: inherit; font: inherit; }
.eis-plan-dialog .eis-plan-preview { margin: 6px 0 12px; font-size: 12px; opacity: 0.75; }
.eis-plan-dialog fieldset { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border, #333); border-radius: 8px; }
.eis-plan-dialog fieldset legend { padding: 0 6px; font-size: 12px; opacity: 0.8; }
.eis-plan-dialog .eis-plan-weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.eis-plan-dialog .eis-plan-weeks label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; opacity: 0.85; }
.eis-plan-dialog .eis-plan-weeks input { width: 100%; box-sizing: border-box; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border, #333); background: rgba(127, 127, 127, 0.08); color: inherit; font: inherit; }
.eis-plan-dialog .eis-plan-actions { display: flex; gap: 8px; justify-content: flex-end; }
.eis-plan-dialog .eis-plan-actions button { padding: 7px 14px; border-radius: 7px; border: 1px solid var(--border, #333); background: rgba(127, 127, 127, 0.1); color: inherit; font: inherit; cursor: pointer; }
.eis-plan-dialog .eis-plan-actions .eis-plan-save { border-color: transparent; background: var(--accent, #6b8cff); color: #fff; }
.eis-plan-dialog .eis-plan-actions button:hover { filter: brightness(1.08); }

/* Кнопка сохранения плана: контраст не зависит от темы и переменной --accent. */
.eis-plan-dialog .eis-plan-actions .eis-plan-save,
.eis-plan-dialog .eis-plan-actions .eis-plan-save:visited {
  border-color: #2f6bed;
  background: #2f6bed;
  color: #ffffff;
  font-weight: 600;
}
.eis-plan-dialog .eis-plan-actions .eis-plan-save:hover { background: #2a5fd6; }
[data-theme="dark"] .eis-plan-dialog .eis-plan-actions .eis-plan-save { border-color: #6b8cff; background: #4b6fe0; color: #ffffff; }

/* Журнал изменений плана. */
.eis-plan-journal { margin: 0 0 12px; font-size: 12px; }
.eis-plan-journal summary { cursor: pointer; opacity: 0.85; }
.eis-plan-journal ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 160px; overflow: auto; }
.eis-plan-journal li { display: grid; grid-template-columns: 78px 1fr auto auto; gap: 8px; padding: 3px 0; border-top: 1px solid rgba(127,127,127,.18); }
.eis-plan-journal li span:first-child { opacity: .7; white-space: nowrap; }
.eis-plan-journal li span:last-child { font-variant-numeric: tabular-nums; }
.eis-plan-journal-empty { margin: 6px 0 0; opacity: .7; }

/* Массовый план. */
.eis-plan-dialog-wide { width: min(680px, 100%); }
.eis-bulk-list { max-height: 300px; overflow: auto; margin: 0 0 12px; border: 1px solid var(--border, #333); border-radius: 8px; }
.eis-bulk-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
.eis-bulk-list th, .eis-bulk-list td { padding: 4px 8px; text-align: left; border-bottom: 1px solid rgba(127,127,127,.16); }
.eis-bulk-list th { position: sticky; top: 0; background: var(--surface, #17181c); font-weight: 600; }
.eis-bulk-list td:last-child { width: 130px; }
.eis-bulk-list input[type="number"] { width: 100%; box-sizing: border-box; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border, #333); background: rgba(127,127,127,.08); color: inherit; font: inherit; }
.eis-bulk-list label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
