/* Демо финансовой панели ADM.
   Макет: тёмное боковое меню слева (полуночный синий → бордо), справа рабочая область
   из панелей на сетке; все таблицы в цветах P&L, шапки закреплены. */
:root {
  --c1: #1E2F6E; --c1m: #2A2152; --c1b: #3A4F95; --c2: #BCC6DE; --c3: #6E1A2C; --c3b: #A2475C; --c4: #7D8FC4;
  --hdr: #1E2F6E; --hdr2: #3A4F95; --hdrInk: #FFFFFF;
  --bg: #F2F3F8; --paper: #FFFFFF; --paper2: #F4F6FB; --soft: #EDF0F7; --hi: rgba(30, 47, 110, .07);
  --ink: #191C24; --ink2: #2C3247; --muted: #5A6070; --line: #E3E6EC; --line2: #D3D8E2;
  --tot: #D6DEF1; --subrow: #E7ECF7; --det: #F7F3ED;
  --ok: #2F7356; --okBg: #E4F1EA; --warn: #9A6412; --warnBg: #FBF0DC; --bad: #8C2238; --badBg: #F7E4E8;
  --menu: linear-gradient(180deg, #0C1430 0%, #0C1430 35%, #261540 58%, #4A1630 80%, #5A1424 100%);
  --band: linear-gradient(100deg, #0C1430 0%, #0C1430 45%, #261540 70%, #4A1630 88%, #5A1424 100%);
  --tileDark: linear-gradient(150deg, #0C1430 0%, #0C1430 40%, #4A1630 85%, #5A1424 100%);
  --frame: linear-gradient(135deg, #D6DCEA 0%, #EEF0F5 45%, #E2DCE6 100%);
  --headGrad: linear-gradient(180deg, #EEF1F8, #F8F9FC);
  --shadow: 0 1px 2px rgba(20, 28, 36, .04), 0 6px 22px rgba(20, 32, 44, .06);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c1: #8DA0E4; --c1m: #9A86C8; --c1b: #6E83C9; --c2: #4A5687; --c3: #D27C90; --c3b: #B45C72; --c4: #5F6FA6;
    --hdr: #24366F; --hdr2: #33478A; --hdrInk: #FFFFFF;
    --bg: #0D1120; --paper: #151A2B; --paper2: #1A2034; --soft: #1E2540; --hi: rgba(141, 160, 228, .09);
    --ink: #E7EAF3; --ink2: #CBD1E2; --muted: #98A0B8; --line: #283048; --line2: #333C58;
    --tot: #24305A; --subrow: #1F2848; --det: #241F27;
    --ok: #6CC79C; --okBg: #173226; --warn: #E1AE5A; --warnBg: #33281A; --bad: #E58A9D; --badBg: #3A1C25;
    --frame: linear-gradient(135deg, #2A3250 0%, #1E2438 45%, #33243A 100%);
    --headGrad: linear-gradient(180deg, #1C2338, #171C2E);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 22px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c1: #8DA0E4; --c1m: #9A86C8; --c1b: #6E83C9; --c2: #4A5687; --c3: #D27C90; --c3b: #B45C72; --c4: #5F6FA6;
  --hdr: #24366F; --hdr2: #33478A; --hdrInk: #FFFFFF;
  --bg: #0D1120; --paper: #151A2B; --paper2: #1A2034; --soft: #1E2540; --hi: rgba(141, 160, 228, .09);
  --ink: #E7EAF3; --ink2: #CBD1E2; --muted: #98A0B8; --line: #283048; --line2: #333C58;
  --tot: #24305A; --subrow: #1F2848; --det: #241F27;
  --ok: #6CC79C; --okBg: #173226; --warn: #E1AE5A; --warnBg: #33281A; --bad: #E58A9D; --badBg: #3A1C25;
  --frame: linear-gradient(135deg, #2A3250 0%, #1E2438 45%, #33243A 100%);
  --headGrad: linear-gradient(180deg, #1C2338, #171C2E);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 22px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c1b); outline-offset: 2px; }
h2, h3 { text-wrap: balance; }

.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 20px; max-width: 1640px; margin: 0 auto; padding-block: 16px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- меню ---------- */
.nav { position: sticky; top: 16px; align-self: start; height: calc(100vh - 32px); background: var(--menu); border-radius: 22px; padding: 18px 12px 12px; color: #E6E9F4; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 18px 40px rgba(12, 20, 48, .24); overflow-y: auto; scrollbar-width: thin; }
.brand { display: grid; gap: 6px; padding: 2px 10px 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(217, 222, 230, .14); }
.brandMark { font-family: var(--display); font-weight: 600; font-size: 46px; line-height: .9; color: #fff; letter-spacing: -.02em; }
.brandWords { display: grid; gap: 1px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.brandWords span { display: flex; justify-content: space-between; gap: 8px; }
.brandWords b { font-weight: 700; color: #fff; }
.brandWords small { font-size: 10.5px; letter-spacing: .02em; text-transform: none; color: #9EA6C4; }
.navLbl { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #9EA6C4; padding: 12px 10px 4px; }
.navBtn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: #E6E9F4; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; line-height: 1.25; }
.navBtn:hover { background: rgba(255, 255, 255, .07); }
.navBtn.on { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #fff; }
.navBtn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.gen { font-weight: 500; opacity: .72; }
.navBtn small { display: block; font-size: 11px; font-weight: 500; color: #9EA6C4; }
.navFoot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(217, 222, 230, .14); display: grid; gap: 2px; }
.navUser { display: flex; align-items: center; gap: 10px; padding: 10px 10px 2px; }
.ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-weight: 800; font-size: 12px; flex: none; }
.navUser b { display: block; font-size: 13px; color: #fff; }
.navUser small { color: #9EA6C4; font-size: 11.5px; }

/* ---------- шапка ---------- */
.top { background: var(--band); color: #fff; border-radius: 20px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; box-shadow: 0 14px 34px rgba(12, 20, 48, .16); }
.topMain { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28); font-family: var(--display); font-weight: 600; font-size: 22px; flex: none; }
.logo svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.top h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.top p { margin: 2px 0 0; font-size: 12.5px; color: #C9CFE4; }
.topAside { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.chip:hover { background: rgba(255, 255, 255, .16); }
.chip.demo { background: #fff; color: #5A1424; border-color: #fff; cursor: default; }
.chip select { background: transparent; border: 0; color: #fff; font-weight: 700; cursor: pointer; padding: 0; }
.chip select option { color: #191C24; }

/* ---------- заголовок раздела и период ---------- */
.pageHead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pageHead h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.015em; }
.pageHead p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--hdr); color: #fff; }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.sel { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; }

/* ---------- плитки ---------- */
.tiles { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1360px) { .tiles.many { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .tiles, .tiles.many { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile[data-tip] { cursor: help; }
.tile[data-tip]:hover { box-shadow: 0 0 0 2px var(--c1b) inset, var(--shadow); }
.tileLbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tileVal { font-size: 24px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.tileVal.txt { font-size: 17px; white-space: normal; line-height: 1.25; padding-top: 3px; }
.advice { display: grid; gap: 10px; }
.advice div { display: grid; grid-template-columns: 120px 1fr; gap: 2px 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.advice div:last-child { border-bottom: 0; padding-bottom: 0; }
.advice b { color: var(--c1); font-size: 13.5px; }
.advice small { grid-column: 1; color: var(--muted); font-size: 11.5px; }
.advice span { grid-column: 2; grid-row: 1 / span 2; font-size: 13px; }
.tileSub { font-size: 12px; color: var(--muted); min-height: 1.45em; }
.tile.dark { background: var(--tileDark); border-color: transparent; color: #fff; }
.tile.dark .tileLbl, .tile.dark .tileSub { color: #D9DEE6; }
.delta { font-weight: 800; font-size: 11.5px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--ok); background: var(--okBg); }
.delta.down { color: var(--bad); background: var(--badBg); }
.tile.dark .delta.up { color: #BFF0D6; background: rgba(255, 255, 255, .12); }
.tile.dark .delta.down { color: #FFC9D3; background: rgba(255, 255, 255, .12); }

/* ---------- панели ---------- */
.grid { display: grid; gap: 16px; align-items: stretch; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.g12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.panel { background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--frame) border-box; border: 1px solid transparent; border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel.blue { background: linear-gradient(var(--paper), var(--paper)) padding-box, linear-gradient(var(--c1), var(--c1)) border-box; }
.panel.wine { background: linear-gradient(var(--paper), var(--paper)) padding-box, linear-gradient(var(--c3), var(--c3)) border-box; }
.panel.wine > .panelHead { box-shadow: inset 0 3px 0 var(--c3); }
.panelHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--headGrad); border-bottom: 1px solid var(--line); }
.panelHead h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--c1); display: flex; align-items: center; gap: 9px; }
.panelHead h3::before { content: ""; width: 4px; height: 17px; border-radius: 4px; background: var(--c1); flex: none; }
.panel.wine .panelHead h3::before { background: var(--c3); }
.panelNote { font-size: 12px; color: var(--muted); font-weight: 600; }
.panelBody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.panelBody > .tblWrap { margin: 0 -16px -16px; border-radius: 0; }
.panelBody > .tblWrap:not(:last-child) { margin-bottom: 0; }
.note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 95ch; }
.note b { color: var(--ink); }
.unit { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: -6px; }

/* ---------- легенда ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--c); display: inline-block; }
.legend i.ln { height: 3px; width: 16px; border-radius: 2px; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }

/* ---------- графики ---------- */
.chart { width: 100%; position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax0 { stroke: var(--line2); stroke-width: 1.4; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .xlbl { fill: var(--muted); font-size: 11.5px; font-weight: 600; }
.chart .xlbl.on { fill: var(--c1); font-weight: 800; }
.chart .vlbl { fill: var(--ink2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.dash { stroke-dasharray: 5 5; }
.chart .dot { fill: var(--paper); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: help; }
.chart .hit:hover { fill: var(--hi); }
.chart .quad { fill: transparent; }
.chart .quad.q1 { fill: var(--hi); }
.chart .quad.q2 { fill: var(--badBg); opacity: .55; }
.chart .qlbl { fill: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.chart .mid { stroke: var(--line2); stroke-dasharray: 4 4; }
.chart .axl { fill: var(--muted); font-size: 11.5px; font-weight: 700; }
.chart .pt { stroke: var(--paper); stroke-width: 1.5; opacity: .92; cursor: help; }
.chart .plbl { fill: var(--ink2); font-size: 11px; font-weight: 600; }
.chart .wfLink { stroke: var(--line2); stroke-dasharray: 3 3; }
.chart rect[data-tip], .donut path { cursor: help; }
.donutBox { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut .dBig { fill: var(--ink); font-size: 17px; font-weight: 800; }
.donut .dSmall { fill: var(--muted); font-size: 11px; font-weight: 600; }
.donutLeg { display: grid; gap: 6px; flex: 1; min-width: 180px; }
.donutLeg div { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.donutLeg i { width: 11px; height: 11px; border-radius: 3px; }
.donutLeg b { font-variant-numeric: tabular-nums; }

/* ---------- полосы ---------- */
.bars { display: grid; }
.barRow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(36px, 1fr) auto 54px; gap: 10px; align-items: center; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.barRow:last-child { border-bottom: 0; }
.barRow.head { font-size: 12.5px; font-weight: 800; color: var(--c1); border-bottom: 2px solid var(--c2); padding-top: 0; }
.barRow.head span:nth-child(3), .barRow.head span:nth-child(4) { text-align: right; }
.barRow.sec { grid-template-columns: 1fr; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 12px; border-bottom: 0; }
.barRow .lbl { min-width: 0; }
.barRow .trk { height: 8px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.barRow .trk i { display: block; height: 100%; border-radius: 6px; background: var(--c1); }
.barRow .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barRow .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.barRow.tot { font-weight: 800; background: var(--tot); border-radius: 8px; padding-inline: 8px; margin-top: 4px; border-bottom: 0; }
.barRow.sub { font-weight: 800; }
.barRow.sub .trk i { background: var(--c3); }
.barRow[data-tip] { cursor: help; }
.barRow[data-tip]:hover { background: var(--hi); }

/* ---------- таблицы ---------- */
.tblWrap { overflow: auto; border-radius: 14px; max-width: 100%; }
.tblWrap.scrollY { overscroll-behavior: contain; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--hdr); color: var(--hdrInk); font-weight: 700; font-size: 13px; text-align: center; padding: 10px 10px; line-height: 1.25; vertical-align: middle; }
.tbl thead tr + tr th { top: 38px; background: var(--hdr2); font-size: 12px; padding: 6px 8px; }
.tbl thead th:first-child { text-align: left; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.num { text-align: right; white-space: nowrap; }
.tbl tbody tr:nth-child(even) td { background: var(--paper2); }
.tbl tr.sec td { background: var(--hdr2) !important; color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-bottom: 0; }
.tbl tr.sub td { background: var(--subrow) !important; font-weight: 700; }
.tbl tr.tot td { background: var(--tot) !important; color: var(--c1); font-weight: 800; }
.tbl tr.kid td { background: var(--det) !important; color: var(--ink2); font-size: 12.5px; }
.tbl tr.kid td:first-child { padding-left: 34px; }
.tbl tr.pc td { color: var(--muted); font-style: italic; font-size: 12.5px; }
.tbl tr.grp { cursor: pointer; }
.tbl tr.grp:hover td { background: var(--hi) !important; }
.tbl tr[data-tip] { cursor: help; }
.tbl tr[data-tip]:hover td { background: var(--hi); }
.tbl tfoot td { position: sticky; bottom: 0; background: var(--tot); color: var(--c1); font-weight: 800; padding: 8px 10px; border-top: 1px solid var(--line2); }
.tbl tfoot td.num { text-align: right; white-space: nowrap; }
.chev { display: inline-block; width: 16px; margin-right: 4px; transition: transform .15s; }
.chev::before { content: "▸"; color: var(--c1b); }
tr.open .chev { transform: rotate(90deg); }
.tbl .muted, .muted { color: var(--muted); }
.tbl .neg { color: var(--bad); }
.tbl .pos { color: var(--ok); }
.lbl2 small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.tbl.compact td { padding: 5px 8px; }
.tbl tr.kid td.num, .tbl td.num { font-variant-numeric: tabular-nums; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--okBg); }
.pill.warn { color: var(--warn); background: var(--warnBg); }
.pill.bad { color: var(--bad); background: var(--badBg); }
.pill.info { color: var(--c1); background: var(--soft); }
.abc { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12px; color: #fff; }
.abc.A { background: var(--c1); } .abc.B { background: var(--c4); } .abc.C { background: var(--c3); }

/* ---------- тепловая карта ---------- */
.heat { border-collapse: separate; border-spacing: 3px; font-size: 11.5px; font-variant-numeric: tabular-nums; width: 100%; }
.heat th { font-weight: 700; color: var(--muted); padding: 2px 4px; white-space: nowrap; }
.heat tbody th { text-align: left; color: var(--ink2); }
.heat td { text-align: center; padding: 7px 2px; border-radius: 6px; background: rgba(30, 47, 110, var(--a)); color: var(--ink); min-width: 34px; }
.heat td.dk { color: #fff; }
.heat td.na { background: var(--paper2); }
:root[data-theme="dark"] .heat td { background: rgba(141, 160, 228, var(--a)); }
:root[data-theme="dark"] .heat td.dk { color: #0D1120; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .heat td { background: rgba(141, 160, 228, var(--a)); } :root:not([data-theme="light"]) .heat td.dk { color: #0D1120; } }
.heat td.na { background: var(--paper2) !important; }

/* ---------- внимание ---------- */
.alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.alert { border-radius: 14px; padding: 11px 14px; border: 1px solid var(--line); background: var(--paper); display: grid; grid-template-columns: 8px 1fr; gap: 12px; align-items: stretch; }
.alert::before { content: ""; border-radius: 6px; background: var(--c1); }
.alert.bad::before { background: var(--bad); } .alert.warn::before { background: var(--warn); } .alert.ok::before { background: var(--ok); }
.alert b { display: block; font-size: 13.5px; }
.alert span { font-size: 12.5px; color: var(--muted); }

/* ---------- календарь ---------- */
.calWrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: calc((100vh - 280px) * 7 / 6); }
.cal .wd { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.day { aspect-ratio: 1 / 1; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 7px 8px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; text-align: left; min-width: 0; }
.day:hover { border-color: var(--c1b); }
.day.out { visibility: hidden; }
.day.we { background: var(--paper2); }
.day.today { box-shadow: inset 0 0 0 2px var(--c3); }
.day.sel { background: var(--soft); box-shadow: inset 0 0 0 2px var(--c1); }
.day .dn { font-weight: 800; font-size: 13px; color: var(--ink2); }
.day .ds { font-weight: 800; font-size: 13px; color: var(--c1); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.big .ds { color: var(--c3); }
.day.past .ds { color: var(--muted); }
.day .dc { font-size: 10.5px; color: var(--muted); text-align: right; }
.calSide { display: flex; flex-direction: column; gap: 12px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-variant-numeric: tabular-nums; }
.kv .tt { color: var(--ink); font-weight: 800; border-top: 1px solid var(--line); padding-top: 6px; }

/* ---------- «что если» ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.slider { display: grid; gap: 4px; }
.slider label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.slider label b { color: var(--c1); font-variant-numeric: tabular-nums; }
.slider input[type=range] { width: 100%; accent-color: var(--c1b); }
.slider small { color: var(--muted); font-size: 11.5px; }
.simOut { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.simOut .tile { box-shadow: none; }
.meter { display: grid; gap: 6px; }
.meterTop { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.meterTrk { position: relative; height: 10px; border-radius: 6px; background: var(--soft); }
.meterTrk i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, var(--c1), var(--c3)); }

/* ---------- загрузка файлов ---------- */
.drop { border: 2px dashed var(--line2); border-radius: 16px; padding: 26px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--paper2); }
.drop.over { border-color: var(--c1b); background: var(--soft); }
.drop b { font-size: 15px; }
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 800; font-size: 13px; background: var(--hdr); color: #fff; cursor: pointer; }
.btn:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--c1); box-shadow: inset 0 0 0 1.5px var(--c2); }
.toast { font-size: 13px; color: var(--ok); font-weight: 700; min-height: 1.4em; }

/* ---------- настройки ---------- */
.biz { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.bizCard { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--paper); cursor: pointer; display: grid; gap: 4px; text-align: left; }
.bizCard:hover { border-color: var(--c1b); }
.bizCard.on { border-color: var(--c1); box-shadow: inset 0 0 0 1.5px var(--c1); background: var(--soft); }
.bizCard svg { width: 26px; height: 26px; fill: none; stroke: var(--c1); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bizCard b { font-size: 14px; }
.bizCard small { color: var(--muted); font-size: 12px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field input, .field select { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; background: var(--paper); }
.tbl input.ti { width: 100%; min-width: 110px; border: 1px solid var(--line2); border-radius: 8px; padding: 5px 8px; background: var(--paper); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13px; cursor: pointer; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }

/* ---------- подсказка ---------- */
.tipBox { position: fixed; z-index: 50; max-width: 360px; background: #0C1430; color: #F1F3F9; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); pointer-events: none; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .tipBox { background: #2A3352; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g21, .grid.g12 { grid-template-columns: minmax(0, 1fr); }
  .calWrap { grid-template-columns: minmax(0, 1fr); }
  .cal { max-width: none; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-top: 10px; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 8px; gap: 4px; border-radius: 16px; }
  .brand, .navLbl, .navUser { display: none; }
  .navFoot { margin: 0; padding: 0; border: 0; display: flex; gap: 4px; }
  .navBtn { white-space: nowrap; width: auto; }
  .navBtn small { display: none; }
  .navBtn.on { box-shadow: inset 0 -3px 0 #fff; }
  .grid.g2, .grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .sim { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .tiles, .tiles.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tileVal { font-size: 19px; }
  .pageHead h2 { font-size: 22px; }
  .barRow { grid-template-columns: minmax(0, 1.4fr) minmax(40px, .8fr) auto; }
  .barRow .pct { display: none; }
  .day { padding: 4px; border-radius: 8px; }
  .day .ds { font-size: 9.5px; letter-spacing: -.03em; text-overflow: clip; }
  .cal { gap: 3px; }
  .top { padding: 12px 14px; }
  .chip span { display: none; }
  .day .dn { font-size: 11px; }
  .simOut { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.panelBody > .btn { align-self: flex-start; }
