
:root {
  color-scheme: light;
  --red: #EE3124;
  --grad-red: #EE3024;
  --grad-berry: #BC1A4E;
  --grad-plum: #8A0379;
  --ink: #212121;
  --paper: #FFFFFF;
  --panel: #F7F7F7;
  --track: #ECECEC;
  --bar: #B5B5B5;
  --rule: #DDDDDD;
  --line: #E3E3E3;
  --muted: #838383;
  --faint: #ABABAB;
  --shadow-ink: rgba(33, 33, 33, .14);
  --on-ink-rule: rgba(255, 255, 255, .18);
  --series-1: var(--red);
  --series-2: var(--ink);
  --series-3: var(--muted);
  --font: "Roboto", system-ui, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --r-xl: 24px;
  --r-l: 20px;
  --r-s: 10px;
  --fold-time: .4s;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; }
button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

/* Шапка */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 14px 32px; padding: 22px 0; border-bottom: 1px solid var(--track);
}
.brand { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; min-width: 0; }
.brand-logo { height: 28px; width: auto; max-width: 100%; }
.brand-sep { width: 1px; height: 36px; background: var(--rule); flex: none; }
.product { display: grid; gap: 3px; }
.product-name { font-size: 20px; font-weight: 700; line-height: 1.05; }
.product-sub { font-size: 12px; line-height: 1.2; color: var(--muted); }
.context { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.context-meta { display: grid; justify-items: end; gap: 3px; text-align: right; }
.context-pair { font-size: 14px; font-weight: 700; line-height: 1.2; }
.context-upd { font-size: 13px; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; }
.mark { height: 26px; width: auto; flex: none; }

/* Раскладка: навигация слева, содержимое справа */
.layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px clamp(24px, 2.6vw, 40px); align-items: start; padding-top: 32px;
}
.main { min-width: 0; }

/* Клиенты и проекты */
.sidenav {
  position: sticky; top: 16px; padding: 16px 12px 14px; overflow: hidden;
  background: var(--panel); border-radius: var(--r-xl);
}
.sidenav-head { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-bottom: 6px; padding-left: 10px; }
.sidenav-title {
  flex: 1 1 auto; min-width: 0; margin: 0; font-size: 12px; font-weight: 700; white-space: nowrap;
  letter-spacing: .04em; text-transform: uppercase;
}
.sidenav-toggle {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink); transition: background-color .15s ease;
}
.sidenav-toggle:hover { background: var(--track); }
.sidenav-toggle-icon { transition: transform .3s ease; }
.sidenav-body { width: 236px; }
.sidenav-rail { display: none; flex-direction: column; align-items: flex-end; gap: 8px; margin-top: 10px; }
.coin {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; line-height: 1;
  transition: background-color .15s ease, opacity .15s ease;
}
.coin:hover { opacity: .85; }
.coin[aria-current="true"] { background: var(--red); }
.tree, .tree-projects { list-style: none; margin: 0; padding: 0; }
.tree-client + .tree-client { margin-top: 2px; }
.client-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 10px;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 700; line-height: 20px; text-align: left;
  transition: background-color .15s ease;
}
.client-btn:hover { background: var(--track); }
.client-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.client-btn[aria-expanded="true"] .client-chev { transform: rotate(90deg); }
.client-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree-projects { display: grid; gap: 2px; padding: 2px 0 8px 20px; }
.tree-projects[hidden] { display: none; }
.project-btn {
  display: block; width: 100%; min-height: 34px; padding: 7px 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 20px; text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.project-btn:hover { background: var(--track); }
.project-btn[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* Заголовок страницы */
.title {
  margin: 0; color: var(--red); font-weight: 700; text-transform: uppercase;
  font-size: clamp(26px, 2.6vw, 36px); line-height: 1.08;
}
.lede { margin: 10px 0 0; font-size: 18px; line-height: 1.4; }

/* Период */
.filters {
  margin-top: 24px; padding: 16px 24px; display: grid; gap: 14px;
  background: var(--panel); border-radius: var(--r-xl);
}
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.filter-label {
  flex: none; width: 64px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--track); color: var(--ink);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.pill:hover { background: var(--rule); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.period { display: flex; flex: 1 1 0; min-width: 0; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.dates { display: flex; align-items: center; gap: 8px; }
.dates label { font-size: 14px; color: var(--muted); }
.date-input {
  height: 36px; padding: 0 10px 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.date-input:hover { border-color: var(--bar); }
.date-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
.period-note { font-size: 13px; color: var(--muted); }

/* Разделы */
.section { margin-top: 52px; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 22px; }
.section-title {
  margin: 0; color: var(--red); font-size: 20px; line-height: 1.2;
  font-weight: 700; text-transform: uppercase;
}
.scope { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scope strong { color: var(--ink); font-weight: 700; }
.section-aside { margin: 0 0 0 auto; font-size: 13px; color: var(--muted); transition: color .2s ease; }
.section-aside.is-alert { color: var(--red); }
.section-tools {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
  margin-left: auto; align-self: center;
}
.tool-anchor { position: relative; }
.export-error { position: absolute; top: calc(100% + 4px); right: 0; margin: 0; font-size: 13px; line-height: 16px; color: var(--red); white-space: nowrap; }
.export-error[hidden] { display: none; }

/* KPI */
.kpi-wrap { container: kpi / inline-size; }
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px clamp(16px, 3cqi, 36px);
}
.kpi-eyebrow {
  grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.kpi-eyebrow--metrika { margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--rule); }
.kpi { min-width: 0; }
.fig-value {
  margin: 0; color: var(--red); font-weight: 700; white-space: nowrap;
  font-size: clamp(36px, 5.2cqi, 60px); line-height: .95; letter-spacing: -.015em;
}
.fig-unit { font-size: .42em; letter-spacing: 0; }
.fig-label { margin-top: 10px; font-size: 15px; line-height: 1.3; color: var(--muted); }
.goal { margin-top: 14px; font-size: 13px; line-height: 18px; color: var(--muted); }
.goal strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bar { position: relative; flex: 1; min-width: 0; height: 10px; background: var(--track); overflow: hidden; }
.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--red); transition: width .4s ease; }
.bar-pct { flex: none; min-width: 46px; text-align: right; font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.goal--threshold { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.status {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.status--alert { background: var(--red); }
.flight { grid-column: 3 / 5; align-self: start; padding: 16px 20px; background: var(--panel); border-radius: var(--r-l); }
.flight-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.flight-dates { margin-top: 6px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flight .goal-bar { margin-top: 10px; }
.flight .bar { background: var(--paper); }
.flight .bar-fill { background: var(--bar); }
.flight-note { margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@container kpi (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .flight { grid-column: 1 / -1; }
  .fig-value { font-size: clamp(34px, 9cqi, 56px); }
}

/* Свёрнутый график */
.fold { display: flex; align-items: center; gap: 16px; margin-top: 44px; }
.fold::before, .fold::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.fold-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .15s ease;
}
.fold-btn:hover { background: var(--panel); }
.fold-icon { transition: transform var(--fold-time) ease; }
.fold-btn[aria-expanded="true"] .fold-icon { transform: rotate(180deg); }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--fold-time) ease; }
.collapse.is-open { grid-template-rows: 1fr; }
.collapse-inner { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s linear var(--fold-time); }
.collapse.is-open .collapse-inner { visibility: visible; transition-delay: 0s; }
.collapse.is-settled .collapse-inner { overflow: visible; }
.section--chart { margin-top: 0; padding-top: 28px; }

/* График */
.chips { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 26px; }
.chip-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-set-label {
  margin-right: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 12px;
  border: 0; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.chip:hover { background: var(--panel); }
.chip-key { width: 16px; height: 3px; border-radius: 2px; background: var(--rule); flex: none; }
.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip[aria-pressed="true"] .chip-key { background: var(--key, var(--ink)); }
.chip[aria-disabled="true"] { color: var(--faint); background: var(--paper); cursor: not-allowed; }
.chip[aria-disabled="true"] .chip-key { background: var(--track); }

.axis-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  min-height: 18px; margin-bottom: 6px; font-size: 12px; line-height: 1.3; color: var(--muted);
}
.axis-side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.axis-side--right { justify-content: flex-end; }
.axis-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.axis-key { width: 14px; height: 3px; border-radius: 2px; background: var(--key); }
.axis-name { color: var(--ink); font-weight: 500; }
.axis-unit { color: var(--muted); font-weight: 400; }
.chart-wrap { position: relative; }
#chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
#chart:focus { outline: none; }
#chart:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }
#chart .wk { fill: var(--panel); }
#chart .grid { stroke: var(--track); stroke-width: 1; shape-rendering: crispEdges; }
#chart .base { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
#chart .tick { fill: var(--muted); font-family: var(--font); font-size: 12px; font-variant-numeric: tabular-nums; }
#chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#chart .dot { stroke: var(--paper); stroke-width: 2; }
#chart .end-label {
  fill: var(--ink); font-family: var(--font); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--paper);
  stroke-width: 4px; stroke-linejoin: round;
}
#chart .xhair { stroke: var(--bar); stroke-width: 1; shape-rendering: crispEdges; }
#chart .empty { fill: var(--muted); font-family: var(--font); font-size: 14px; }
.chart-foot { display: flex; justify-content: flex-end; margin-top: 10px; font-size: 12px; color: var(--muted); }
.wk-key {
  display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--track); border-radius: 2px;
}
.tip {
  position: absolute; left: 0; top: 0; z-index: 5; min-width: 176px; padding: 10px 12px 9px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 24px var(--shadow-ink); pointer-events: none;
  font-size: 13px; line-height: 1.3;
}
.tip[hidden] { display: none; }
.tip-date { margin-bottom: 6px; font-weight: 700; }
.tip-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; padding: 2px 0; }
.tip-key { width: 14px; height: 3px; border-radius: 2px; }
.tip-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-name { color: var(--muted); white-space: nowrap; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--panel); }
.btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.btn[aria-expanded="true"] .btn-count { color: var(--faint); }
.btn-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.btn:disabled, .btn[aria-disabled="true"] { border-color: var(--rule); color: var(--muted); background: var(--paper); cursor: default; }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: var(--ink); color: var(--paper); opacity: .88; }
.btn--plain { border-color: transparent; padding: 0 12px; }
.btn--plain:hover { background: var(--track); }
.icon-btn {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--track); }
.icon-btn:disabled { color: var(--rule); background: transparent; cursor: default; }

/* Таблица */
.table-scroll {
  position: relative; overflow: auto; max-height: min(76vh, 860px);
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--paper);
  overscroll-behavior-x: contain;
}
.stats {
  border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%;
  font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stats th, .stats td {
  padding: 10px 14px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--rule); background: var(--paper);
}
.stats thead th {
  position: sticky; z-index: 3; vertical-align: bottom; white-space: normal;
  background: var(--ink); color: var(--paper); border-bottom: 0;
  font-size: 11px; font-weight: 700; line-height: 14px; letter-spacing: .03em; text-transform: uppercase;
}
.stats .row-groups th { top: 0; padding: 14px 14px 9px; font-size: 12px; line-height: 15px; text-align: left; }
.stats .row-cols th { top: var(--h-groups, 0px); width: var(--w, 104px); min-width: var(--w, 104px); padding-top: 9px; padding-bottom: 12px; }
.stats thead th.th-corner {
  top: 0; left: 0; z-index: 5; min-width: 152px; padding: 12px 14px 12px 20px; text-align: left;
  box-shadow: inset -1px 0 0 var(--on-ink-rule);
}
.stats .th-group::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--red);
}
.stats .th-group-label { position: sticky; left: calc(var(--w-date, 152px) + 14px); display: inline-block; }
.stats thead th.grp-start { box-shadow: inset 1px 0 0 var(--on-ink-rule); }
.stats td.grp-start { border-left: 1px solid var(--rule); }
.stats tbody th {
  position: sticky; left: 0; z-index: 2; padding-left: 20px; text-align: left;
  font-weight: 700; color: var(--ink); box-shadow: inset -1px 0 0 var(--rule);
}
.stats tbody td { color: var(--muted); }
.stats .cell-sub { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.stats .row-total > th, .stats .row-total > td {
  position: sticky; top: var(--h-head, 0px); z-index: 3;
  background: var(--panel); color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--ink);
}
.stats .row-total > th { left: 0; z-index: 4; }
.stats tbody tr:not(.row-total):hover > th,
.stats tbody tr:not(.row-total):hover > td { background: var(--panel); color: var(--ink); }
.is-scrolled-x .stats tbody th { box-shadow: inset -1px 0 0 var(--rule), 8px 0 10px -8px var(--shadow-ink); }
.is-scrolled-x .stats thead th.th-corner { box-shadow: inset -1px 0 0 var(--on-ink-rule), 8px 0 10px -8px var(--shadow-ink); }

/* Менеджер колонок */
.cm {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: 380px; max-width: calc(100vw - 32px); max-height: min(72vh, 660px); overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: 0 18px 40px var(--shadow-ink);
}
.cm[hidden] { display: none; }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 6px 20px; }
.cm-title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cm-fixed {
  display: flex; align-items: center; gap: 10px; margin: 6px 8px 0; padding: 8px 12px;
  border-radius: var(--r-s); background: var(--panel); font-size: 14px; font-weight: 700;
}
.cm-fixed-note { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.cm-group-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 16px 20px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.cm-group-count { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-list { list-style: none; margin: 0; padding: 0 8px; }
.cm-item {
  position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto;
  align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: var(--r-s);
}
.cm-item:hover { background: var(--panel); }
.cm-item.is-dragging { opacity: .35; }
.cm-item.drop-before::before, .cm-item.drop-after::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 2px; border-radius: 1px; background: var(--red);
}
.cm-item.drop-before::before { top: -1px; }
.cm-item.drop-after::after { bottom: -1px; }
.cm-grip { display: grid; place-items: center; color: var(--faint); cursor: grab; }
.cm-item:active .cm-grip { cursor: grabbing; }
.cm-check { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; font-size: 14px; cursor: pointer; }
.cm-check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.cm-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-foot {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding: 12px 20px 16px; background: var(--paper); border-top: 1px solid var(--track);
}

/* Подвал */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  margin-top: 72px; padding: 22px 0 26px; border-top: 1px solid var(--track);
  font-size: 13px; color: var(--muted);
}
.footer-src { color: var(--ink); }
.brand-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--grad-red) 0%, var(--grad-red) 50%, var(--grad-berry) 75%, var(--grad-plum) 100%);
}

/* Свёрнутая панель — только на широких экранах */
@media (min-width: 1101px) {
  .layout { transition: grid-template-columns .32s ease; }
  .layout.no-anim, .layout.no-anim * { transition: none !important; }
  .layout.is-side-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
  .is-side-collapsed .sidenav { padding: 12px; }
  .is-side-collapsed .sidenav-title, .is-side-collapsed .sidenav-body { display: none; }
  .is-side-collapsed .sidenav-head { margin-bottom: 0; padding-left: 0; }
  .is-side-collapsed .sidenav-rail { display: flex; }
  .is-side-collapsed .sidenav-toggle-icon { transform: rotate(180deg); }
}

/* Узкие окна: навигация встаёт над содержимым */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: static; }
  .sidenav-toggle { display: none; }
  .sidenav-body { width: auto; }
  .tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2px 16px; align-items: start; }
  .tree-client + .tree-client { margin-top: 0; }
}
@media (max-width: 720px) {
  .brand-sep { display: none; }
  .filters { padding: 16px 18px; }
  .filter-label { width: 100%; }
  .section-tools { margin-left: 0; justify-content: flex-start; }
  .export-error { left: 0; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --fold-time: 0s; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
