
  :root {
    --bg: #F0F0F2; --surface: #FFFFFF; --surface-sunken: #F1F1F3;
    --column-bg: #E9E9EC; --track-bg: #E3E3E7;
    --border: #E7E7EA; --border-strong: #D7D7DD;
    --shell-bg: #EAEAEE; --header-bg: #FFFFFF;
    --sidebar-bg: linear-gradient(180deg, #FFFFFF 0%, #EFEFF3 100%);
    --ink-rgb: 23,23,26;
    --card-shadow: 0 1px 2px rgba(20,20,24,.04), 0 6px 16px -8px rgba(20,20,24,.10);
    --text: #17171A; --text-secondary: #6E6E78; --text-tertiary: #9C9CA6;
    --ozon: #005BFF; --ozon-soft: #EAF1FF; --ozon-ink: #0047CC;
    --wb: #7A1FE0; --wb-soft: #F3EBFE; --wb-ink: #5E17B3;
    --success: #12805C; --success-soft: #E4F5EE;
    --danger: #D0333D; --danger-soft: #FBEAEB;
    --warning: #B4780A; --warning-soft: #FCF2E1;
    --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
    --font: 'Onest', 'Segoe UI', system-ui, sans-serif;
  }
  * { box-sizing: border-box; }
  html, body { background: var(--sidebar-bg); background-attachment: fixed; color: var(--text); font-family: var(--font); margin: 0; -webkit-font-smoothing: antialiased; height: 100%; }
  body { padding: 0; overflow: hidden; }
  a { color: inherit; text-decoration: none; }
  svg { display: block; }
  :focus-visible { outline: 2px solid var(--ozon); outline-offset: 2px; }

  button { font-family: inherit; cursor: pointer; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease; }
  button:active { transform: scale(.96); }
  .cal-pop button:active, .hint-chip:active, .notif-pop button:active { transform: none; }
  @media (prefers-reduced-motion: reduce) { button, button:active { transition: none; transform: none; } }

  * { scrollbar-width: thin; scrollbar-color: rgba(20,20,24,.16) transparent; }
  *::-webkit-scrollbar { width: 8px; height: 8px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background-color: rgba(20,20,24,.16); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
  *::-webkit-scrollbar-thumb:hover { background-color: rgba(20,20,24,.32); }

  .content-col { max-width: 1400px; margin: 0 auto; padding: 16px 20px 40px; }
  .island { box-shadow: var(--card-shadow); }

  /* ============ App shell: sidebar + tabs stay fixed, only the content island scrolls ============ */
  .app-shell { display: flex; height: 100vh; }
  @media (max-width: 860px) { .app-shell { flex-direction: column; height: auto; } }

  .app-sidebar { width: 184px; flex-shrink: 0; background: var(--sidebar-bg); background-attachment: fixed; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: none; }
  .app-sidebar::-webkit-scrollbar { display: none; }
  .app-brand { display: flex; align-items: center; gap: 8px; padding: 2px 6px 18px; }
  .app-brand-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text); }
  .app-brand-name { font-size: 13.5px; font-weight: 800; color: var(--text); }
  .app-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: rgba(var(--ink-rgb),.55); cursor: pointer; }
  .app-nav-item svg { flex-shrink: 0; color: rgba(var(--ink-rgb),.42); }
  .app-nav-item.active { background: var(--ozon-soft); color: var(--ozon-ink); }
  .app-nav-item.active svg { color: var(--ozon); }
  .app-nav-item:hover:not(.active) { background: rgba(var(--ink-rgb),.045); }
  .app-section-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: rgba(var(--ink-rgb),.3); padding: 14px 10px 5px; }
  .app-sub-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: rgba(var(--ink-rgb),.55); cursor: pointer; }
  .app-sub-item:hover { background: rgba(var(--ink-rgb),.07); }
  .app-sub-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

  .app-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
  .app-user { display: flex; align-items: center; gap: 9px; border-top: 1px solid rgba(var(--ink-rgb),.08); padding: 12px 6px 2px; cursor: pointer; }
  .app-user:hover { background: rgba(var(--ink-rgb),.07); border-radius: 7px; }
  .app-user-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(var(--ink-rgb),.14); flex-shrink: 0; }
  .app-user-name { font-size: 12.5px; font-weight: 700; color: var(--text); }
  .app-user-email { font-size: 11px; color: rgba(var(--ink-rgb),.4); }

  .app-main { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; gap: 0; padding: 12px 12px 12px 0; }
  @media (max-width: 860px) { .app-main { padding: 12px; height: auto; } }

  /* Chrome icons: Linear-style — 24 viewBox, 2px stroke, round caps */
  .app-sidebar svg, .app-tabs svg, .app-brand-icon svg, .app-search svg, .app-icon-btn svg, .app-account svg {
    stroke-linecap: round; stroke-linejoin: round;
  }

  /* Top menu: folder tabs sitting on the gray content island */
  .app-tabs { flex-shrink: 0; padding: 6px 12px 0 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; position: relative; z-index: 2; margin-bottom: -1px; }
  .app-tabs-list { display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
  .app-tabs-list::-webkit-scrollbar { display: none; }
  .app-tab { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 9px 14px 12px; font-size: 13px; font-weight: 600; color: rgba(var(--ink-rgb),.5); white-space: nowrap; cursor: pointer; background: none; position: relative; z-index: 1; }
  .app-tab svg { flex-shrink: 0; color: rgba(var(--ink-rgb),.42); }
  .app-tab.active { color: var(--text); font-weight: 700; background: var(--bg); border-radius: 12px 12px 0 0; z-index: 3; }
  .app-tab.active svg { color: var(--text); }
  .app-tab.active::before,
  .app-tab.active::after { content: ''; position: absolute; bottom: 0; width: 12px; height: 12px; background: var(--bg); pointer-events: none; }
  .app-tab.active::before { left: -12px; -webkit-mask: radial-gradient(circle at 0 0, transparent 12px, #000 12.5px); mask: radial-gradient(circle at 0 0, transparent 12px, #000 12.5px); }
  .app-tab.active::after { right: -12px; -webkit-mask: radial-gradient(circle at 100% 0, transparent 12px, #000 12.5px); mask: radial-gradient(circle at 100% 0, transparent 12px, #000 12.5px); }
  .app-tab:hover:not(.active) svg { color: rgba(var(--ink-rgb),.58); }
  .app-tabs-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-bottom: 6px; }
  .app-search { display: flex; align-items: center; gap: 8px; height: 40px; min-width: 210px; padding: 0 8px 0 12px; border: none; border-radius: 999px; background: rgba(var(--ink-rgb),.08); color: rgba(var(--ink-rgb),.48); font-size: 13px; font-weight: 600; }
  .app-search:hover { background: rgba(var(--ink-rgb),.14); color: rgba(var(--ink-rgb),.68); }
  .app-search span { flex: 1; text-align: left; }
  .app-search kbd { margin-left: auto; font-size: 11px; font-weight: 700; color: rgba(var(--ink-rgb),.5); background: rgba(var(--ink-rgb),.08); border-radius: 6px; padding: 3px 7px; font-family: inherit; }
  .app-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(var(--ink-rgb),.08); color: rgba(var(--ink-rgb),.78); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .app-icon-btn:hover { background: rgba(var(--ink-rgb),.15); color: var(--text); }
  .notif-wrap { position: relative; }
  .notif-wrap .app-icon-btn { position: relative; }
  .notif-wrap.open .app-icon-btn { background: #fff; color: var(--text); box-shadow: 0 0 0 1px rgba(var(--ink-rgb),.08); }
  .notif-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ozon); box-shadow: 0 0 0 2px var(--shell-bg); pointer-events: none; }
  .notif-pop {
    position: absolute; top: calc(100% + 10px); right: -6px; z-index: 4;
    width: 372px; max-width: min(372px, calc(100vw - 32px));
    background: #fff; border-radius: 16px;
    box-shadow: 0 1px 3px rgba(20,20,24,.08), 0 18px 44px -12px rgba(20,20,24,.28);
    transform-origin: calc(100% - 20px) 0;
    transform: translateY(-10px) scale(.92);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .2s ease, visibility 0s linear .28s;
  }
  .notif-wrap.open .notif-pop {
    transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .18s ease, visibility 0s;
  }
  .notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
  .notif-head h3 { font-size: 13.5px; font-weight: 800; margin: 0; }
  .notif-head button { border: none; background: none; padding: 0; font-size: 12px; font-weight: 700; color: var(--ozon); }
  .notif-head button:hover { color: var(--ozon-ink); }
  .notif-list { display: flex; flex-direction: column; padding: 0 8px 8px; max-height: 420px; overflow-y: auto; }
  .notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; text-align: left; width: 100%; border: none; background: none; }
  .notif-item:hover { background: var(--surface-sunken); }
  .notif-item.unread { background: var(--ozon-soft); }
  .notif-item.unread:hover { background: #dce8ff; }
  .notif-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .notif-ico.danger { background: var(--danger-soft); color: var(--danger); }
  .notif-ico.warning { background: var(--warning-soft); color: var(--warning); }
  .notif-ico.success { background: var(--success-soft); color: var(--success); }
  .notif-ico.ozon { background: var(--ozon-soft); color: var(--ozon-ink); }
  .notif-body { min-width: 0; flex: 1; }
  .notif-title { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.35; }
  .notif-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--text-tertiary); }
  .notif-unread { width: 6px; height: 6px; border-radius: 50%; background: var(--ozon); flex-shrink: 0; }
  .notif-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(23,23,26,.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }
  body.notifs-open .notif-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s ease, visibility 0s; }
  body.notifs-open .app-tabs { z-index: 120; }
  @media (prefers-reduced-motion: reduce) {
    .notif-pop, .notif-wrap.open .notif-pop, .notif-backdrop, body.notifs-open .notif-backdrop { transition: none; transform: none; }
  }
  .app-account { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 4px; border-radius: 999px; background: rgba(var(--ink-rgb),.08); cursor: pointer; }
  .app-account:hover { background: rgba(var(--ink-rgb),.15); }
  .app-account-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(var(--ink-rgb),.16); color: rgba(var(--ink-rgb),.72); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .app-account-text { display: flex; flex-direction: column; line-height: 1.2; }
  .app-account-name { font-size: 12.5px; font-weight: 700; color: var(--text); }
  .app-account-email { font-size: 10.5px; color: rgba(var(--ink-rgb),.42); }
  .app-tab:hover:not(.active) { color: rgba(var(--ink-rgb),.75); }

  .app-content { flex: 1; min-height: 0; background: var(--bg); border-radius: 16px; padding: 0 0 40px; overflow-y: auto; }

  /* ---- header ---- */
  .page-header { background: none; border-radius: 0; padding: 4px 0 8px; box-shadow: none; }
  .page-header-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .page-header-text { flex: 0 1 260px; min-width: 200px; }
  .eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 10px; }
  .page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .page-title-row h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.01em; color: var(--text); }
  .info-dot { width: 17px; height: 17px; border-radius: 50%; background: var(--surface-sunken); color: var(--text-secondary); font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: default; }
  .updated-note { font-size: 12px; color: var(--text-tertiary); margin-top: 8px; }
  .demo-banner { background: var(--surface-sunken); border-radius: var(--radius-lg); padding: 14px 16px; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); margin-top: 18px; }

  /* ---- kpi row: recessed panel sitting under the title, same language as the main shell header ---- */
  .kpi-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 0; flex: 1.35 1 440px; max-width: 980px; }
  @media (max-width: 900px) {
    .page-header-top { flex-direction: column; align-items: stretch; }
    .kpi-row { margin-top: 20px; max-width: none; }
  }
  .hero-card { flex: 1; min-width: 168px; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 10px; }
  .hero-card .hc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 0; }
  .hero-card .hc-label { font-size: 11.5px; font-weight: 700; }
  .hero-card .hc-icon { flex-shrink: 0; display: flex; }
  .hero-card .hc-icon svg { stroke-linecap: round; stroke-linejoin: round; }
  .hero-card .hc-tile { background: #fff; border-radius: 8px; padding: 12px 14px; }
  .hero-card .hc-period { font-size: 10.5px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 4px; }
  .hero-card .hc-value { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
  .hero-card .hc-trend { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
  .hero-card .hc-delta { font-size: 10.5px; font-weight: 700; letter-spacing: -.01em; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; line-height: 1.4; }
  .hero-card .hc-delta.up { background: var(--success-soft); color: var(--success); }
  .hero-card .hc-delta.down { background: var(--danger-soft); color: var(--danger); }
  .hero-card .hc-spark { width: 92px; height: 36px; flex-shrink: 0; overflow: visible; }
  .hero-card .hc-spark-line, .hero-card .hc-spark-glow, .hero-card .hc-spark-shine { fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .hero-card .hc-spark-line, .hero-card .hc-spark-glow { stroke-dasharray: 260; stroke-dashoffset: 260; }
  .hero-card .hc-spark-fill, .hero-card .hc-spark-dot { opacity: 0; }
  .hero-card .hc-spark-glow { stroke-width: 4.5; opacity: .35; }
  .hero-card .hc-spark-line { stroke-width: 2.1; }
  .hero-card .hc-spark-shine { stroke: #fff; stroke-width: 1.8; stroke-dasharray: 10 90; opacity: 0; }
  .hero-card .hc-spark-dot { transform-box: fill-box; transform-origin: center; }
  .hero-card .hc-trend.up { color: var(--success); }
  .hero-card .hc-trend.down { color: var(--danger); }
  .hero-card.is-drawn .hc-spark-dot { animation: hc-pulse 1.7s ease-in-out infinite; }
  .hero-card.is-drawn .hc-spark-shine { animation: hc-shine 2.6s linear infinite; opacity: .55; }
  .hero-card.is-drawn .hc-spark-fill { animation: hc-breathe 3.2s ease-in-out infinite; }
  @keyframes hc-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.55); } }
  @keyframes hc-shine { from { stroke-dashoffset: 100; } to { stroke-dashoffset: -100; } }
  @keyframes hc-breathe { 0%, 100% { opacity: .22; } 50% { opacity: .38; } }
  @media (prefers-reduced-motion: reduce) {
    .hero-card .hc-spark-line, .hero-card .hc-spark-glow { stroke-dashoffset: 0; }
    .hero-card .hc-spark-fill { opacity: .28; }
    .hero-card .hc-spark-dot { opacity: 1; }
    .hero-card.is-drawn .hc-spark-dot, .hero-card.is-drawn .hc-spark-shine, .hero-card.is-drawn .hc-spark-fill { animation: none; }
  }
  .hero-card .hc-sub { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-top: 6px; }
  .hero-card.hc-danger { background: linear-gradient(145deg, #FBEAEB 0%, #F5D0D2 45%, #FCE8E9 100%); } .hero-card.hc-danger .hc-label, .hero-card.hc-danger .hc-icon { color: var(--danger); }
  .hero-card.hc-ozon { background: linear-gradient(145deg, #EAF1FF 0%, #D6E4FF 45%, #EDF3FF 100%); } .hero-card.hc-ozon .hc-label, .hero-card.hc-ozon .hc-icon { color: var(--ozon-ink); }
  .hero-card.hc-success { background: linear-gradient(145deg, #E4F5EE 0%, #C8EBDD 45%, #E8F5F0 100%); } .hero-card.hc-success .hc-label, .hero-card.hc-success .hc-icon { color: var(--success); }

  section.block { padding: 20px 0 28px; border-bottom: 1px solid var(--border); }
  .content-col > section.block:first-of-type { padding-top: 4px; }
  section.block:last-of-type { border-bottom: none; }
  .block-head { margin-bottom: 16px; }
  .block-head h2 { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
  .block-head .note { font-size: 12.5px; color: var(--text-tertiary); }

  /* ---- controls ---- */
  .seg-toggle { position: relative; display: inline-flex; border: none; border-radius: 10px; padding: 3px; gap: 2px; background: var(--track-bg); flex-shrink: 0; }
  .seg-toggle button { position: relative; z-index: 1; border: none; background: transparent; padding: 7px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
  .seg-toggle button.active { color: var(--text); }
  .seg-toggle.compact button { padding: 6px 11px; }
  .seg-indicator { position: absolute; top: 3px; bottom: 3px; left: 0; z-index: 0; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 3px rgba(20,20,24,.14); pointer-events: none; transition: left .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1); }

  .control-group { display: flex; flex-direction: column; gap: 8px; }
  .control-label { font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
  .check-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; user-select: none; white-space: nowrap; }
  .check-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; }
  .check-box.on { background: var(--ozon); border-color: var(--ozon); color: #fff; }

  .btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 8px; padding: 9px 15px; font-size: 12.5px; font-weight: 700; }
  .btn-secondary { background: var(--surface-sunken); color: var(--text); }
  .btn-secondary:hover { background: var(--track-bg); }
  .btn-primary { background: var(--ozon); color: #fff; }
  .btn-primary:hover { background: var(--ozon-ink); }

  /* ---- sticky filter bar: same grey as the page, opaque at top, fades out ---- */
  .filter-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 10px -32px 0;
    padding: 12px 32px;
    background: linear-gradient(180deg, #F0F0F2 0%, #F0F0F2 calc(100% - 12px), rgba(240,240,242,0) 100%);
  }
  .filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; min-height: 36px; }
  .filter-bar .btn-primary { margin-left: auto; flex-shrink: 0; }
  .filter-divider { width: 1px; height: 22px; background: var(--border-strong); flex-shrink: 0; }
  .checks-row { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; flex-shrink: 0; }

  .date-field { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 8px; border-radius: 10px; background: rgba(var(--ink-rgb),.07); font-size: 12.5px; font-weight: 700; color: var(--text); cursor: pointer; user-select: none; white-space: nowrap; flex-shrink: 0; }
  .date-field:hover, .date-field.open { background: var(--track-bg); }
  .date-field svg { color: var(--text-secondary); flex-shrink: 0; }
  .date-field .date-chevron { transition: transform .18s ease; }
  .date-field.open .date-chevron { transform: rotate(180deg); }
  .date-meta { font-weight: 600; color: var(--text-tertiary); }

  .cal-pop { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 584px; max-width: min(584px, calc(100vw - 48px)); background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(20,20,24,.08), 0 16px 40px -12px rgba(20,20,24,.22); padding: 16px 16px 14px; }
  .date-field.open .cal-pop { display: block; }
  .cal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  @media (max-width: 680px) { .cal-months { grid-template-columns: 1fr; } .cal-pop { width: 300px; } }
  .cal-month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; min-height: 28px; }
  .cal-month-title { font-size: 13px; font-weight: 800; }
  .cal-nav { width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
  .cal-nav:hover { background: var(--surface-sunken); color: var(--text); }
  .cal-nav.ghost { visibility: hidden; pointer-events: none; }
  .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
  .cal-week span { font-size: 10.5px; font-weight: 700; color: var(--text-tertiary); text-align: center; padding: 4px 0; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
  .cal-day { height: 34px; border: none; background: transparent; border-radius: 0; font-size: 12px; font-weight: 600; color: var(--text); font-family: inherit; position: relative; }
  .cal-day.empty { pointer-events: none; }
  .cal-day:hover:not(.empty):not(.selected) { background: var(--surface-sunken); border-radius: 8px; }
  .cal-day.in-range { background: var(--surface-sunken); }
  .cal-day.range-start { border-radius: 8px 0 0 8px; }
  .cal-day.range-end { border-radius: 0 8px 8px 0; }
  .cal-day.range-start.range-end { border-radius: 8px; }
  .cal-day.selected { background: var(--ozon); color: #fff; border-radius: 8px; z-index: 1; }
  .cal-day.selected.in-range.range-start { border-radius: 8px 0 0 8px; }
  .cal-day.selected.in-range.range-end:not(.range-start) { border-radius: 0 8px 8px 0; }
  .cal-day.today:not(.selected)::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ozon); }
  .cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
  .cal-foot-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
  .cal-foot .btn { padding: 7px 12px; }

  /* ---- remainder hint popover ---- */
  .hint-wrap { position: relative; }
  .hint-chip { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--surface-sunken); border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 700; color: var(--text-secondary); font-family: inherit; }
  .hint-chip:hover, .hint-wrap.open .hint-chip { background: var(--track-bg); color: var(--text); }
  .hint-chip svg { color: var(--text-tertiary); }
  .hint-pop { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 35; width: 360px; max-width: calc(100vw - 48px); background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(20,20,24,.08), 0 16px 40px -12px rgba(20,20,24,.22); font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); font-weight: 600; }
  .hint-wrap.open .hint-pop { display: block; }
  .hint-pop b { color: var(--text); font-weight: 800; }

  /* ---- period chart ---- */

  .app-tab { border: none; }
  .page-header { padding-bottom: 0; }

  .dashboard { display: flex; flex-direction: column; gap: 16px; transition: opacity .22s ease; }
  .dashboard.is-fading { opacity: .35; pointer-events: none; }
  .dash-r1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: stretch; }
  .dash-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; min-height: 0; }
  .dash-r2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
  .dash-r3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  @media (max-width: 1100px) {
    .dash-r1, .dash-r2, .dash-r3 { grid-template-columns: 1fr; }
  }

  .viz-card {
    background: #fff; border: 1px solid #E7E4E3; border-radius: 24px; padding: 20px;
    display: flex; flex-direction: column; gap: 20px;
    min-height: 356px; box-shadow: var(--card-shadow);
  }
  .dash-r1 .viz-hero { min-height: 728px; height: 100%; }
  .dash-stack .viz-card { min-height: 0; height: 100%; }
  .viz-head { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
  .viz-title-row { display: flex; align-items: center; gap: 8px; min-height: 40px; }
  .viz-ico { width: 24px; height: 24px; display: flex; color: var(--text); flex-shrink: 0; }
  .viz-title-row h3 { font-size: 16px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -.01em; line-height: 24px; }
  .viz-more { width: 40px; height: 40px; border: none; border-radius: 999px; background: #F7F7F7; color: var(--text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .viz-more:hover { background: var(--track-bg); }
  .viz-sub { margin: 0; font-size: 15px; font-weight: 400; color: rgba(31,31,33,.56); line-height: 24px; }
  .viz-kpi { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .viz-kpi-left { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
  .viz-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 36px; }
  .viz-badge { background: var(--ozon); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
  .viz-pct { color: var(--ozon); font-size: 20px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
  .viz-tabs { display: flex; width: 100%; background: #F7F7F7; border-radius: 32px; padding: 2px; gap: 4px; }
  .viz-tabs button { flex: 1; border: none; background: transparent; border-radius: 999px; padding: 8px 12px; font-size: 15px; font-weight: 500; color: var(--text); }
  .viz-tabs button.active { background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(20,20,24,.12); }
  .viz-pills { display: flex; gap: 6px; flex-wrap: wrap; }
  .viz-pills button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
  .viz-pills button.active { background: #17171A; color: #fff; border-color: #17171A; }
  .viz-split { display: grid; grid-template-columns: 132px 1fr; gap: 12px; flex: 1; min-height: 0; align-items: center; }
  .viz-body { flex: 1; min-height: 168px; position: relative; overflow: hidden; }
  .viz-hero .viz-body { min-height: 280px; }
  .viz-body svg { width: 100%; height: 100%; display: block; overflow: visible; }
  .viz-split .viz-body { display: flex; align-items: center; justify-content: center; overflow: visible; }
  #svgDonut { width: min(100%, 240px); height: auto; aspect-ratio: 1; overflow: visible; }
  .viz-legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
  .viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
  .viz-legend .hatch { background: repeating-linear-gradient(-45deg, #D7D7DD, #D7D7DD 1px, #F1F1F3 1px, #F1F1F3 4px); border: 1px solid #E3E3E7; box-sizing: border-box; }

  .hc-spark-line, .hc-spark-glow, .hc-spark-shine { fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .hc-spark-line, .hc-spark-glow { stroke-dasharray: 260; stroke-dashoffset: 260; }
  .hc-spark-glow { stroke-width: 4.5; opacity: .35; }
  .hc-spark-line { stroke-width: 2.1; }
  .hc-spark-shine { stroke: #fff; stroke-width: 1.8; stroke-dasharray: 10 90; opacity: 0; }
  .hc-spark-fill { opacity: 0; }
  .hc-spark-dot { transform-box: fill-box; transform-origin: center; opacity: 0; }
  .is-spine-drawn .hc-spark-dot { animation: hc-pulse 1.7s ease-in-out infinite; opacity: 1; }
  .is-spine-drawn .hc-spark-shine { animation: hc-shine 2.6s linear infinite; opacity: .55; }
  .is-spine-drawn .hc-spark-fill { animation: hc-breathe 3.2s ease-in-out infinite; opacity: .28; }

  .chart-part { cursor: pointer; transition: opacity .18s ease, filter .18s ease; transform-box: fill-box; transform-origin: center; }
  .chart-interactive.has-focus .chart-part.is-dimmed { opacity: .28; filter: blur(1.6px); }
  .chart-interactive.has-focus .chart-part.is-focused { opacity: 1; filter: none; }
  .axis-label { font-family: var(--font); font-size: 11px; font-weight: 500; fill: var(--text-tertiary); }
  .axis-grid { stroke: #EFEFEF; stroke-width: 1; }
  .donut-pill { font-family: var(--font); font-size: 11px; font-weight: 700; fill: var(--text); }
  .tree-title { font-family: var(--font); font-size: 12px; font-weight: 700; }
  .tree-val { font-family: var(--font); font-size: 22px; font-weight: 700; }
  .hbar-lab, .flow-lab { font-family: var(--font); font-size: 12px; font-weight: 600; fill: var(--text); }
  .hbar-sub, .flow-sub { font-family: var(--font); font-size: 11px; font-weight: 500; fill: var(--text-secondary); }
  .chart-tooltip { position: fixed; z-index: 100; background: #111; color: #fff; border-radius: 10px; padding: 8px 10px; box-shadow: 0 10px 28px rgba(0,0,0,.28); font-size: 12px; font-weight: 700; pointer-events: none; opacity: 0; transition: opacity .12s; max-width: 220px; line-height: 1.4; }
  .chart-tooltip.visible { opacity: 1; }
  .chart-tooltip .tt-sub { font-size: 11px; font-weight: 500; color: rgba(255,255,255,.62); margin-top: 2px; }


.chart-card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px 18px; }
  .chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
  .chart-head h3 { font-size: 14px; font-weight: 800; margin: 0; }
  .chart-legend { display: flex; gap: 16px; }
  .legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
  .legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
  .split-row { display: grid; grid-template-columns: 96px 1fr 148px; align-items: center; gap: 14px; padding: 7px 0; }
  .split-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
  .split-label .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
  .split-track { height: 20px; border-radius: 6px; overflow: hidden; display: flex; background: var(--surface-sunken); }
  .split-seg { height: 100%; }
  .split-seg.cost { background: var(--danger); }
  .split-seg.income { background: var(--success); }
  .split-pct { font-size: 11.5px; color: var(--text-tertiary); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

  /* ---- table ---- */
  .tbl-wrap { background: var(--surface); border-radius: var(--radius-lg); overflow: visible; }
  .tbl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .tbl-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .tbl-scroll { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .data-table { width: 100%; border-collapse: collapse; min-width: 1180px; }
  .data-table thead th { text-align: right; font-size: 11px; font-weight: 700; color: var(--text-secondary); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  .data-table thead tr.group-row th { text-align: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-tertiary); border-bottom: 1px solid var(--border); padding-top: 12px; }
  .data-table thead th.left, .data-table thead tr.group-row th.left { text-align: left; }
  .data-table td { padding: 11px 12px; font-size: 12.5px; border-bottom: 1px solid var(--border); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .data-table td.left { text-align: left; white-space: normal; }
  .data-table tr:last-child td { border-bottom: none; }
  .data-table tbody tr:hover td { background: var(--surface-sunken); }
  .data-table tr.total-row td { background: var(--surface-sunken); font-weight: 800; }
  .dt-name { font-weight: 700; display: block; }
  .dt-art { display: block; font-size: 11px; color: var(--text-tertiary); font-weight: 500; margin-top: 1px; }
  .dt-pct { display: block; font-size: 10.5px; color: var(--text-tertiary); font-weight: 600; margin-top: 1px; }
  .dt-pct.warn { color: var(--danger); }
  .dt-good { color: var(--success); font-weight: 700; }

  .tbl-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-tertiary); font-weight: 600; }