:root {
  color-scheme: dark;
  /* палитра демо-лендинга atolko (BAR-47): графит с зеленью, медь, «бумага» */
  --plane: #141615;
  --surface-1: #1d201e;
  --surface-2: #252c23;
  --surface-3: #30392d;
  --ink-1: #f3f1eb;
  --ink-2: #b5c0aa;
  --ink-muted: #8f9688;
  --grid: #2a2f2a;
  --axis: #3a4038;
  --text-primary: var(--ink-1);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-muted);
  --border: rgba(255, 255, 255, 0.12);
  --border-warm: #c6b49640;
  --accent: #d7a47d;
  --accent-hover: #eac4a1;
  --accent-deep: #936542;
  --on-accent: #181a18;
  --paper: #f1eee7;
  --paper-card: #faf8f2;
  --paper-ink: #1c211d;
  --paper-muted: #656a61;
  --serif: "Source Serif 4", Georgia, serif;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #398769;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --seq-100: #cde2fb;
  --seq-150: #b7d3f6;
  --seq-200: #9ec5f4;
  --seq-250: #86b6ef;
  --seq-300: #6da7ec;
  --seq-350: #5598e7;
  --seq-400: #3987e5;
  --seq-450: #2a78d6;
  --seq-500: #256abf;
  --seq-550: #1c5cab;
  --seq-600: #184f95;
  --seq-650: #104281;
  --seq-700: #0d366b;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --good: var(--status-good);
  --warn: var(--status-warning);
  --bad: var(--status-critical);
  --delta-good: #88c49b;
  --delta-bad: #ee9c8c;
  --sidebar: 224px;
  font-family:
    Inter,
    Arial,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--surface-1);
  color: var(--text-primary);
  font:
    14px/1.45 Inter,
    Arial,
    -apple-system,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.brand {
  font-weight: 700;
  margin-right: 10px;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  align-items: center;
}
.tab {
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active {
  color: var(--text-primary);
  border-color: var(--accent);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0 2px;
  font-size: 13px;
}
.toolbar select,
.toolbar input,
.form select,
.form input,
.form textarea,
button.btn {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
}
button.btn {
  cursor: pointer;
}
button.btn.primary {
  background: var(--accent);
  color: var(--ink-1);
  border-color: var(--accent);
}
button.btn.small {
  padding: 2px 8px;
  font-size: 12px;
}
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 12px;
  background: var(--surface-3);
  color: var(--text-secondary);
}
.badge.good {
  background: color-mix(in srgb, var(--good) 18%, transparent);
  color: var(--good);
}
.badge.bad {
  background: color-mix(in srgb, var(--bad) 18%, transparent);
  color: var(--bad);
}
.badge.warn {
  background: color-mix(in srgb, var(--warn) 22%, transparent);
  color: var(--warn);
}
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}
h2 {
  font-size: 17px;
  margin: 22px 0 10px;
}
h3 {
  font-size: 14px;
  margin: 14px 0 6px;
  color: var(--text-secondary);
}
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.cols {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.kpi .t {
  color: var(--text-muted);
  font-size: 12px;
}
.kpi .v {
  font-size: 22px;
  font-weight: 600;
  margin: 2px 0;
}
.kpi .n {
  color: var(--text-muted);
  font-size: 11px;
}
.chart-wrap {
  position: relative;
  height: 260px;
}
.chart-wrap.tall {
  height: 340px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  border-bottom: 1px solid var(--border);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: var(--surface-3);
}
.scroll {
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}
.heat {
  display: grid;
  gap: 2px;
  font-size: 11px;
}
.heat .cell {
  padding: 4px 2px;
  text-align: center;
  border-radius: 4px;
  color: var(--text-primary);
  min-width: 34px;
}
.heat .lbl {
  color: var(--text-muted);
  padding: 4px 2px;
}
.hint {
  color: var(--text-muted);
  font-size: 12px;
}
.note {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0;
}
.list li {
  margin: 4px 0;
}
.form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}
.form input {
  max-width: 160px;
}
.sig {
  border-left: 4px solid var(--warn);
  padding: 8px 12px;
  margin: 8px 0;
  background: var(--surface-2);
  border-radius: 8px;
}
.sig.high {
  border-color: var(--bad);
}
.sig.low {
  border-color: var(--text-muted);
}
.funnel .bar {
  height: 22px;
  background: var(--series-1);
  border-radius: 4px;
  color: var(--ink-1);
  padding: 0 8px;
  line-height: 22px;
  font-size: 12px;
  white-space: nowrap;
}
#toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--bad);
  color: var(--ink-1);
  padding: 10px 14px;
  border-radius: 10px;
  display: none;
  z-index: 20;
  max-width: 480px;
}
.loading {
  color: var(--text-muted);
  padding: 20px;
}
/* чат */
.msg {
  margin: 10px 0;
  display: flex;
}
.msg.user {
  justify-content: flex-end;
}
.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.user .bubble {
  background: var(--accent);
  color: var(--ink-1);
  border-bottom-right-radius: 4px;
}
.assistant .bubble {
  background: var(--surface-2);
  border-bottom-left-radius: 4px;
}
.via {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 6px;
  align-self: flex-end;
}
#composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: none;
}
#composer form {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}
#composer input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
}
#composer button {
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink-1);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.kind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.report {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 10px 0;
  overflow: hidden;
}
.report-head {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  background: var(--surface-2);
}
.report-body {
  padding: 4px 14px 14px;
  display: none;
  white-space: pre-wrap;
}
.report.open .report-body {
  display: block;
}
.report-body table {
  white-space: normal;
  margin: 8px 0;
}
@media (max-width: 600px) {
  .kpi .v {
    font-size: 18px;
  }
  main {
    padding: 10px 12px 96px;
  }
}
/* Application chrome */
[hidden] {
  display: none !important;
}
body {
  background: var(--plane);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.012em;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--ink-2);
  text-underline-offset: 4px;
}
button,
a,
select {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  z-index: 30;
  padding: 28px 14px 12px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1.4px;
  text-decoration: none;
  color: var(--ink-1);
}
.brand-symbol {
  width: 39px;
  height: 39px;
  display: grid;
  place-content: center;
  position: relative;
  background: var(--accent);
  border-radius: 12px;
  color: var(--on-accent);
  font-size: 36px;
  line-height: 1;
  padding-bottom: 5px;
}
.brand-symbol span {
  position: absolute;
  right: 4px;
  bottom: 1px;
}
.brand-sub {
  display: block;
  font-size: 8px;
  letter-spacing: 2.4px;
  color: var(--ink-muted);
  line-height: 1.2;
  margin-top: 1px;
}
.workspace-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--ink-muted);
  margin: 32px 14px 5px;
}
#nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.nav-label {
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 19px 14px 7px;
}
.nav-label:first-child {
  display: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 7px;
  padding: 10px 13px;
  color: var(--ink-2);
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s;
}
.tab .icon {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.7;
}
.tab:hover {
  background: var(--surface-2);
  color: var(--ink-1);
}
.tab.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.tab.active .icon {
  opacity: 1;
}
.sidebar-footer {
  margin-top: auto;
  padding: 22px 6px 0;
  display: flex;
  gap: 9px;
  align-items: center;
}
.sidebar-footer b {
  display: block;
  font-size: 10px;
  color: var(--ink-2);
  font-weight: 500;
}
.sidebar-footer span:not(.avatar) {
  display: block;
  color: var(--ink-muted);
  font-size: 9px;
  margin-top: 3px;
}
.avatar {
  display: grid;
  place-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
  font-size: 12px;
}
.topbar {
  margin-left: var(--sidebar);
  padding: 0 36px;
  background: var(--plane);
  backdrop-filter: blur(16px);
}
.topbar-line {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.breadcrumb {
  color: var(--ink-muted);
  font-size: 11px;
}
.breadcrumb span {
  margin: 0 13px;
  color: var(--axis);
}
.breadcrumb b {
  font-weight: 400;
  color: var(--ink-2);
}
.topbar-end {
  display: flex;
  align-items: center;
  gap: 16px;
}
.quiet-label {
  color: var(--ink-muted);
  font-size: 10px;
}
.toolbar {
  padding: 0 0 16px;
  gap: 8px;
}
.toolbar select,
.toolbar input {
  font-size: 11px;
  min-height: 34px;
  background: var(--surface-1);
  border-radius: 6px;
}
.toolbar #branch {
  max-width: 270px;
}
.toolbar #rolebadge {
  margin-left: auto;
  font-size: 10px;
  background: transparent;
}
.toolbar #custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
main {
  margin-left: var(--sidebar);
  max-width: 1600px;
  padding: 30px 36px 72px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 27px;
}
.eyebrow {
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 2.1px;
  font-weight: 600;
}
h1 {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -1.2px;
  margin: 9px 0;
}
.page-heading p {
  color: var(--ink-muted);
  font-size: 12px;
  margin: 0;
}
.btn,
.assistant-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 13px;
  color: var(--ink-2);
  background: var(--surface-1);
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
  min-height: 32px;
}
.assistant-link {
  color: var(--accent);
}
.assistant-link span {
  margin-left: 20px;
}
button.btn.primary,
#composer button {
  color: var(--on-accent);
  background: var(--accent);
}
.btn:hover {
  border-color: var(--ink-muted);
}
button.btn.small {
  min-height: 28px;
  padding: 4px 10px;
}
.menu-toggle {
  display: none;
}
.refresh-status {
  font-size: 11px;
  color: var(--accent);
  min-height: 0;
}
.refresh-status:not(:empty) {
  margin-bottom: 12px;
}
#view {
  transition: opacity 0.15s;
  min-height: 320px;
}
#view.is-refreshing {
  opacity: 0.45;
  pointer-events: none;
}
#view > h2:first-child {
  margin-top: 0;
}
h2 {
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  margin: 28px 0 14px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0 0 14px;
}
.card {
  border-radius: 12px;
  background: var(--surface-1);
  padding: 21px 22px;
  min-width: 0;
  border: 1px solid var(--border);
}
.grid {
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}
.cols {
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 137px;
  overflow: hidden;
}
.kpi .t {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-muted);
}
.kpi .v {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -1px;
  font-variant-numeric: normal;
}
.kpi .n {
  color: var(--ink-muted);
  line-height: 1.6;
  font-size: 10px;
}
.kpi-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}
.badge {
  padding: 3px 7px;
  font-size: 10px;
  border-radius: 5px;
}
.badge.good {
  color: var(--delta-good);
  background: color-mix(in srgb, var(--status-good) 9%, transparent);
}
.badge.bad {
  color: var(--delta-bad);
  background: color-mix(in srgb, var(--status-critical) 12%, transparent);
}
.badge.warn {
  color: var(--status-warning);
}
.comparison-note {
  color: var(--ink-muted);
  font-size: 9px;
}
.sparkline {
  width: 88px;
  height: 30px;
  margin-left: auto;
  overflow: visible;
}
.sparkline polyline {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark-data {
  margin-top: 4px;
}
.spark-data summary {
  font-size: 10px;
  color: var(--ink-muted);
  cursor: pointer;
}
.dash-primary {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
  gap: 16px;
}
.revenue-card {
  padding: 24px 26px 18px;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hero-label {
  font-size: 12px;
  color: var(--ink-2);
}
.period-tag {
  font-size: 10px;
  color: var(--ink-muted);
}
.hero-value {
  font-size: clamp(38px, 4vw, 55px);
  line-height: 1.12;
  letter-spacing: -2.4px;
  font-weight: 500;
  margin: 17px 0 9px;
}
.hero-context {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 24px;
}
.hero-context .comparison-note {
  font-size: 10px;
}
.revenue-card .chart-wrap {
  height: 220px;
}
.dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}
.director-card {
  display: flex;
  flex-direction: column;
  padding: 23px;
}
.director-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 13px;
}
.ai-symbol {
  display: grid;
  place-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 21px;
}
.director-caption {
  margin: 12px 0 18px;
  font-size: 11px;
  color: var(--ink-muted);
}
.insight {
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.insight p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 6px 0 0;
}
.insight-label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink-muted);
  font-size: 10px;
}
.insight-label span {
  color: var(--accent);
}
.director-card > .btn {
  margin-top: auto;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 27px 0 13px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading a {
  font-size: 11px;
  color: var(--ink-muted);
  text-decoration: none;
}
.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.chart-head h3 {
  margin: 3px 0;
}
.chart-wrap {
  height: 270px;
}
.chart-wrap.tall {
  height: 350px;
}
.plot {
  width: 100%;
  height: 100%;
}
.chart-tabs {
  display: flex;
  gap: 1px;
  flex: none;
  padding: 2px;
  background: var(--plane);
  border-radius: 5px;
}
.chart-tabs button {
  font-size: 9px;
  border: 0;
  border-radius: 3px;
  padding: 4px 7px;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
}
.chart-tabs button[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--ink-2);
}
.chart-table {
  max-height: 320px;
  overflow: auto;
}
.chart-footnote {
  color: var(--ink-muted);
  font-size: 10px;
  margin-top: 9px;
}
.stat-single {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}
.stat-single strong {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -1.5px;
}
.stat-single span {
  color: var(--ink-2);
  font-size: 12px;
}
.svg-bars {
  width: 100%;
  min-width: 280px;
  display: block;
}
.svg-chart-scroll {
  overflow: auto;
  max-height: 360px;
}
.mark {
  fill: var(--series-1);
}
.chart-text {
  fill: var(--ink-2);
  font-size: 12px;
}
.chart-muted {
  fill: var(--ink-muted);
  font-size: 10px;
}
.chart-axis {
  stroke: var(--axis);
  stroke-width: 1;
}
.hit {
  fill: transparent;
}
.svg-bars .bar-value {
  font-size: 11px;
  fill: var(--ink-2);
}
.empty-state {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 24px;
  border: 1px dashed var(--axis);
  border-radius: 10px;
  color: var(--ink-muted);
}
.empty-state b {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.empty-state p {
  margin: 0;
  font-size: 11px;
  max-width: 360px;
}
.empty-icon {
  font-size: 22px;
  color: var(--accent);
}
.meter {
  margin-top: 12px;
}
.meter svg {
  width: 100%;
  height: 23px;
  display: block;
}
.meter-track {
  fill: var(--surface-3);
}
.meter-norm {
  fill: var(--ink-muted);
  opacity: 0.45;
}
.meter-value {
  stroke: var(--ink-1);
  stroke-width: 3;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 9px;
  margin-top: 3px;
}
.meter-exact {
  color: var(--ink-2);
}
.heatmap-svg {
  width: 100%;
  min-width: 480px;
  display: block;
}
.heatmap-svg text {
  font-size: 10px;
}
.heat-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 10px;
  margin: 10px 0;
}
.heat-scale {
  width: 100px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--seq-100),
    var(--seq-400),
    var(--seq-700)
  );
}
.heat-cell {
  stroke: var(--surface-1);
  stroke-width: 2;
}
.heat-cell:hover,
.heat-cell:focus {
  stroke: var(--ink-1);
  outline: none;
}
.legend {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--ink-muted);
  margin: 8px 0;
}
.legend-item {
  display: flex;
  gap: 6px;
  align-items: center;
}
.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--series-1);
}
.legend-compare {
  background: var(--ink-muted);
}
.scroll {
  border: 1px solid var(--border);
  border-radius: 9px;
}
.card .scroll {
  border: 0;
  border-radius: 0;
}
th,
td {
  padding: 11px 12px;
  font-size: 11px;
}
th {
  font-weight: 400;
  color: var(--ink-muted);
  background: var(--surface-1);
  white-space: nowrap;
}
td {
  color: var(--ink-2);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: color-mix(in srgb, var(--ink-1) 2%, transparent);
}
.hint,
.note {
  line-height: 1.65;
  font-size: 11px;
}
.note {
  color: var(--ink-2);
}
.list {
  padding-left: 20px;
}
.list li {
  padding: 6px 0;
  color: var(--ink-2);
}
.sig {
  border-left-width: 2px;
  padding: 17px 19px;
  margin: 10px 0;
  background: var(--surface-1);
}
.sig b {
  font-weight: 500;
}
.sig .badge {
  margin-left: 7px;
}
.form {
  gap: 9px;
  padding: 12px 0;
}
.form input,
.form select,
.form textarea,
table input {
  background: var(--surface-1);
  color: var(--ink-2);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  min-width: 0;
}
#composer {
  left: var(--sidebar);
  background: var(--plane);
}
#composer form {
  max-width: 1000px;
}
.bubble {
  font-size: 14px;
  padding: 18px 20px;
}
.user .bubble {
  color: var(--on-accent);
}
.msg.assistant .card {
  width: 100%;
}
#toast {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--ink-1);
  font-size: 12px;
  box-shadow: 0 8px 30px var(--plane);
}
.flush {
  margin-top: 0;
}
.mt {
  margin-top: 16px;
}
.mt-sm {
  margin-top: 8px;
}
.compact-scroll {
  max-height: 360px;
}
.input-80 {
  width: 80px;
}
.input-90 {
  width: 90px;
}
.input-100 {
  width: 100px;
}
.input-140 {
  width: 140px;
}
.readable {
  max-width: 700px;
}
.inline-title {
  display: inline-block;
  margin-left: 10px;
}
.skip-link {
  position: fixed;
  left: 240px;
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
@media (min-width: 1700px) {
  main {
    margin-right: auto;
  }
}
@media (max-height: 850px) and (min-width: 901px) {
  .sidebar {
    padding-top: 18px;
  }
  .workspace-label {
    margin-top: 22px;
  }
  .tab {
    padding: 8px 13px;
  }
  .nav-label {
    margin-top: 13px;
  }
  .sidebar-footer {
    padding-top: 12px;
  }
}
@media (max-width: 1200px) {
  :root {
    --sidebar: 200px;
  }
  main {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .dash-primary {
    grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  }
  .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .card {
    padding: 18px;
  }
  .quiet-label {
    display: none;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar: 0px;
  }
  .sidebar {
    width: 224px;
    transform: translateX(-100%);
    transition: transform 0.2s;
    box-shadow: 20px 0 80px var(--plane);
  }
  .menu-open .sidebar {
    transform: translateX(0);
  }
  .menu-open .menu-toggle {
    margin-left: 215px;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .topbar-line {
    gap: 14px;
  }
  .breadcrumb {
    margin-right: auto;
  }
  .topbar-end {
    margin-left: auto;
  }
  .dash-primary {
    grid-template-columns: minmax(0, 1.8fr) minmax(235px, 1fr);
  }
}
@media (max-width: 700px) {
  main {
    padding: 22px 16px 80px;
  }
  .topbar {
    padding: 0 16px;
    position: relative;
  }
  .topbar-line {
    min-height: 56px;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar select {
    flex: 1;
    max-width: 100%;
    min-width: 0;
  }
  .toolbar #branch {
    width: 100%;
    flex-basis: 100%;
    max-width: 100%;
  }
  .toolbar #rolebadge {
    margin-left: 0;
  }
  .toolbar #tokenbox {
    width: 100%;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading .assistant-link {
    font-size: 0;
    width: 35px;
    padding: 8px;
  }
  .assistant-link:first-letter {
    font-size: 16px;
  }
  .assistant-link span {
    font-size: 16px;
    margin: 0;
  }
  h1 {
    font-size: 27px;
  }
  .dash-primary {
    grid-template-columns: 1fr;
  }
  .director-card {
    min-height: 0;
  }
  .director-card > .btn {
    margin-top: 14px;
  }
  .dashboard-kpis,
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .kpi .v {
    font-size: 25px;
  }
  .kpi {
    padding: 16px;
  }
  .kpi-footer {
    flex-wrap: wrap;
  }
  .sparkline {
    width: 65px;
  }
  .comparison-note {
    font-size: 8px;
  }
  .hero-value {
    font-size: 43px;
  }
  .hero-top {
    flex-wrap: wrap;
  }
  .page-heading p {
    max-width: 270px;
  }
  .card {
    padding: 18px;
  }
  .chart-head {
    gap: 8px;
  }
  .chart-head h3 {
    max-width: 70%;
  }
  .chart-wrap {
    height: 250px;
  }
  .skip-link {
    left: 15px;
  }
  .form {
    align-items: stretch;
  }
  .form input {
    max-width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  :root {
    --ink-1: #111;
    --ink-2: #333;
    --ink-muted: #555;
    --plane: #fff;
    --surface-1: #fff;
    --surface-2: #fff;
    --border: #ccc;
  }
  .sidebar,
  .topbar,
  .assistant-link,
  #composer,
  .chart-tabs {
    display: none !important;
  }
  main {
    margin: 0;
    padding: 0;
  }
  .card {
    break-inside: avoid;
  }
  .chart-table[hidden] {
    display: block !important;
  }
  .chart-pane {
    display: none;
  }
  .cols,
  .dash-primary {
    display: block;
  }
}
@media (forced-colors: active) {
  .chart-table[hidden] {
    display: block !important;
  }
  .chart-pane {
    display: none;
  }
  .meter svg {
    forced-color-adjust: auto;
  }
  .tab.active {
    outline: 1px solid Highlight;
  }
}
.static-chart {
  height: auto;
  min-height: 210px;
}
.static-chart .plot {
  height: auto;
}
.cohort-table {
  min-width: 700px;
}
.cohort-cell {
  text-align: right;
  color: var(--plane);
  border: 2px solid var(--surface-1);
}
.cohort-cell:is(.seq-450, .seq-500, .seq-550, .seq-600, .seq-650, .seq-700) {
  color: var(--ink-1);
}
.cohort-future {
  color: var(--ink-muted);
  background: var(--surface-2);
}
.heat-missing {
  fill: var(--surface-3);
}
.seq-100 {
  fill: var(--seq-100);
  background: var(--seq-100);
}
.seq-150 {
  fill: var(--seq-150);
  background: var(--seq-150);
}
.seq-200 {
  fill: var(--seq-200);
  background: var(--seq-200);
}
.seq-250 {
  fill: var(--seq-250);
  background: var(--seq-250);
}
.seq-300 {
  fill: var(--seq-300);
  background: var(--seq-300);
}
.seq-350 {
  fill: var(--seq-350);
  background: var(--seq-350);
}
.seq-400 {
  fill: var(--seq-400);
  background: var(--seq-400);
}
.seq-450 {
  fill: var(--seq-450);
  background: var(--seq-450);
}
.seq-500 {
  fill: var(--seq-500);
  background: var(--seq-500);
}
.seq-550 {
  fill: var(--seq-550);
  background: var(--seq-550);
}
.seq-600 {
  fill: var(--seq-600);
  background: var(--seq-600);
}
.seq-650 {
  fill: var(--seq-650);
  background: var(--seq-650);
}
.seq-700 {
  fill: var(--seq-700);
  background: var(--seq-700);
}
.series-1 {
  fill: var(--series-1);
  background: var(--series-1);
}
.series-2 {
  fill: var(--series-2);
  background: var(--series-2);
}
.series-3 {
  fill: var(--series-3);
  background: var(--series-3);
}
.series-4 {
  fill: var(--series-4);
  background: var(--series-4);
}
.series-5 {
  fill: var(--series-5);
  background: var(--series-5);
}
.series-6 {
  fill: var(--series-6);
  background: var(--series-6);
}
.series-7 {
  fill: var(--series-7);
  background: var(--series-7);
}
.series-8 {
  fill: var(--series-8);
  background: var(--series-8);
}
.detail-json {
  white-space: pre-wrap;
  font-size: 11px;
}
.detail-card {
  margin: 10px 0;
}
.plan-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.plan-row:last-child {
  border: 0;
}
.plan-row > span {
  display: block;
  color: var(--ink-muted);
  font-size: 11px;
}
.plan-row > b {
  display: block;
  margin-top: 7px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
.plan-row small {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}
.forecast-value {
  font-size: 36px;
  letter-spacing: -1.2px;
  margin: 17px 0;
}
.forecast-options {
  display: flex;
  gap: 30px;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 18px;
  color: var(--ink-muted);
  font-size: 10px;
}
.forecast-options b {
  display: block;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 400;
  margin-top: 6px;
}
.text-link {
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
}
#composer:not([hidden]) {
  display: block;
}

.dashboard-kpis > .kpi:last-child:nth-child(4n + 3) {
  grid-column: span 2;
}
@media (max-width: 1200px) and (min-width: 701px) {
  .dashboard-kpis > .kpi:last-child:nth-child(4n + 3) {
    grid-column: auto;
  }
}
@media (max-width: 700px) {
  .dashboard-kpis > .kpi:last-child:nth-child(4n + 3) {
    grid-column: span 2;
  }
  .svg-bars {
    min-width: 500px;
  }
}
/* Reading sizes and touch targets remain comfortable on compact screens. */
.tab {
  font-size: 13px;
}
.toolbar select,
.toolbar input {
  font-size: 12px;
}
h3 {
  font-size: 13px;
}
th,
td {
  font-size: 12px;
}
.kpi .t {
  font-size: 12px;
}
.kpi .n,
.note,
.hint {
  font-size: 11px;
}
.chart-tabs button {
  min-height: 28px;
  font-size: 11px;
  padding: 4px 8px;
}
.director-caption,
.insight-label {
  font-size: 11px;
}
.insight p {
  font-size: 13px;
}
.comparison-note,
.period-tag {
  font-size: 11px;
}
.spark-data summary {
  font-size: 11px;
}
@media (max-width: 700px) {
  .toolbar #preset {
    flex: 1 1 38%;
  }
  .toolbar #compare {
    flex: 1 1 56%;
  }
  .toolbar #rolebadge {
    display: none;
  }
  .toolbar #tokenbtn {
    position: absolute;
    right: 57px;
    top: 14px;
  }
  .topbar-end {
    margin-left: 68px;
  }
  .chart-tabs button {
    min-height: 30px;
    font-size: 10px;
  }
  .chart-head {
    flex-wrap: wrap;
  }
  .chart-head h3 {
    max-width: 100%;
  }
  .kpi .v {
    font-size: 26px;
  }
  .kpi .n {
    font-size: 11px;
  }
  .hero-value {
    font-size: 46px;
  }
}
.chat-welcome {
  max-width: 650px;
  margin: 65px auto;
  text-align: center;
}
.welcome-star {
  font-size: 50px;
  color: var(--accent);
}
.chat-welcome h2 {
  font-size: 24px;
  color: var(--ink-1);
  letter-spacing: -0.8px;
}
.chat-welcome p {
  color: var(--ink-muted);
  font-size: 13px;
  max-width: 430px;
  margin: 0 auto 30px;
}
.suggestions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.suggestions button {
  padding: 14px;
}
.access-state > h3 { color: var(--ink-2); margin-bottom: 8px; }
.access-state > p { color: var(--ink-2); font-size: 12px; max-width: 760px; }
.access-state > .hint { color: var(--ink-muted); margin-bottom: 0; }
.access-model {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.access-model b { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.access-model p { color: var(--ink-muted); font-size: 12px; margin: 6px 0 0; }
@media (max-width: 700px) { .access-model { grid-template-columns: 1fr; gap: 14px; } }

.demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 6%, var(--plane));
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.demo-notice p { margin: 0; }
.demo-tag {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
}
.demo-date { color: var(--ink-muted); font-size: 11px; }
.msg > div:has(.chart-card) { min-width: 0; width: 100%; }
@media print {
  .topbar:has(.demo-notice:not([hidden])) {
    display: block !important;
    margin: 0;
    padding: 0;
  }
  .topbar-line, .toolbar { display: none !important; }
}

/* Keep all seven days visible; only horizontal scrolling is needed on phones. */
.heatmap-svg { min-width:720px; }
.svg-visual > .chart-pane > .scroll:has(.heatmap-svg) { max-height:none; overflow-y:hidden; }
.svg-visual .chart-pane { overflow-x:auto; }

.form .check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* компактные заметки KPI на телефоне */
@media (max-width: 560px) {
  /* на телефоне заметка под KPI занимала две трети карточки */
  .kpi .n {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}


/* ───────────── стиль демо-лендинга atolko (BAR-47) ─────────────
 * Серифные заголовки и крупные цифры (Source Serif 4), медный акцент, маленькие скругления,
 * тонкие тёплые рамки вместо теней. Токены — :root выше. */
h1,
.hero-value,
.kpi .v,
.stat-single strong,
.auth-title {
  font-family: var(--serif);
  font-weight: 400;
}
h1 {
  font-size: 34px;
  letter-spacing: -0.047em;
  line-height: 1.1;
}
h1 em {
  color: var(--accent);
  font-style: italic;
}
.kpi .v {
  font-size: 32px;
  letter-spacing: -0.04em;
}
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.card {
  border-radius: 6px;
  border-color: var(--border-warm);
}
.btn,
.assistant-link,
.toolbar select,
.toolbar input,
.form select,
.form input,
.form textarea,
button.btn {
  border-radius: 4px;
}
button.btn.primary,
#composer button {
  border-color: var(--accent);
  font-weight: 600;
  transition:
    background 0.2s,
    transform 0.2s;
}
button.btn.primary:hover,
#composer button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.assistant-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.brand-symbol {
  border-radius: 6px;
}
.tab {
  border-radius: 4px;
}
.tab.active {
  box-shadow: inset 2px 0 0 var(--accent);
}
.badge {
  border-radius: 3px;
}
.director-card {
  border-left: 3px solid var(--accent);
}

/* меню: «Ещё» и раздел платформы — свёрнутые группы */
.nav-group summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 19px 14px 7px;
  display: flex;
  justify-content: space-between;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary::after {
  content: "+";
}
.nav-group[open] summary::after {
  content: "−";
}
.nav-group > a.tab {
  margin-top: 3px;
}

/* пользователь в сайдбаре */
.me-block {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
}
.me-block > div {
  min-width: 0;
  flex: 1;
}
.me-block b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-role {
  color: var(--accent) !important;
}
.logout-btn {
  background: none;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 4px;
}
.logout-btn:hover {
  color: var(--accent);
}

/* ───────────── экран входа и регистрации ───────────── */
body.auth-mode .sidebar,
body.auth-mode .topbar,
body.auth-mode main {
  display: none;
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  background: var(--plane);
}
.auth-pitch {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  background:
    radial-gradient(1200px 600px at 0% 100%, #22301f 0%, transparent 60%),
    var(--plane);
  border-right: 1px solid var(--border);
}
.auth-pitch .brand {
  padding: 0;
}
.auth-pitch h1 {
  font-size: clamp(40px, 4.6vw, 68px);
  margin: 0 0 22px;
  max-width: 13ch;
}
.auth-pitch p {
  color: #b2b7b0;
  font-size: 16px;
  line-height: 1.75;
  max-width: 46ch;
  margin: 0;
}
.auth-points {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.auth-points li {
  border-top: 1px solid var(--border-warm);
  padding-top: 14px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}
.auth-points b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.auth-side {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 5px;
  padding: 34px 32px;
}
.auth-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #6b735f;
  margin-bottom: 14px;
}
.auth-label span:last-child {
  color: var(--accent-deep);
}
.auth-title {
  font-size: 31px;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 22px;
  color: var(--paper-ink);
}
.auth-card label {
  display: block;
  font-size: 14px;
  color: #4b5741;
  margin: 0 0 18px;
}
.auth-card input {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 8px;
  background: #fbfaf5;
  border: 1px solid #53604333;
  border-radius: 3px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--paper-ink);
}
.auth-card input::placeholder {
  color: #838a7b;
}
.auth-card input:focus {
  outline: none;
  border-color: #977452;
  box-shadow: 0 0 0 3px #97745222;
}
.auth-submit {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: #252e21;
  color: var(--paper);
  border: 0;
  border-radius: 4px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
}
.auth-submit:hover {
  background: #3c4934;
}
.auth-submit:disabled {
  opacity: 0.6;
}
.auth-error {
  color: #9a3527;
  background: #9a35270c;
  border: 1px solid #9a35272a;
  border-radius: 3px;
  padding: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.auth-switch {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--paper-muted);
}
.auth-switch a,
.auth-link {
  color: #765132;
  border-bottom: 1px solid #93654260;
  text-decoration: none;
  cursor: pointer;
  background: none;
  padding: 0;
  font: inherit;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}
.auth-switch a:hover,
.auth-link:hover {
  color: #46331f;
}
.auth-note {
  font-size: 12px;
  color: #707968;
  line-height: 1.6;
  margin: 18px 0 0;
}
.auth-demo {
  margin-top: 18px;
  padding: 12px 14px;
  background: #e8e6dc;
  border-radius: 4px;
  font-size: 13px;
  color: #4b5741;
  line-height: 1.6;
}
.auth-demo code {
  font-size: 12px;
}
@media (max-width: 900px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-pitch {
    padding: 32px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 24px;
  }
  .auth-points {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 26px 20px;
  }
}

/* Академия: каркас разделов (BAR-45) */
.academy-intro {
  margin-bottom: 12px;
}
.academy-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--ink-1);
  margin: 10px 0 12px;
}
.academy-title em {
  color: var(--accent);
}
.academy-grid {
  display: grid;
  margin-bottom: 12px;
}
.academy-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 2px 0 var(--surface-3);
}
.academy-tile h3 {
  color: var(--ink-1);
  font-size: 15px;
  margin: 0;
}
.academy-tile .badge {
  margin-top: auto;
  align-self: flex-start;
}

/* ───────────── BAR-92: фильтр мастера в шапке ───────────── */
.staff-filter {
  position: relative;
  font-size: 13px;
}
.staff-filter summary {
  list-style: none;
  cursor: pointer;
  padding: 5px 28px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.staff-filter summary::-webkit-details-marker {
  display: none;
}
.staff-filter summary::after {
  content: "▾";
  position: absolute;
  right: 9px;
  color: var(--ink-muted);
}
.staff-filter[open] summary {
  border-color: var(--accent);
}
.staff-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface-1);
  border: 1px solid var(--border-warm);
  border-radius: 6px;
  box-shadow: 0 20px 50px #0006;
}
.staff-filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-1);
}
.staff-filter-menu label:hover {
  background: var(--surface-2);
}
.staff-filter-menu label.is-fired {
  color: var(--ink-muted);
}
.staff-filter-menu .staff-filter-all {
  border-bottom: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  margin-bottom: 4px;
}
.staff-filter-menu input {
  accent-color: var(--accent);
}
@media (max-width: 700px) {
  .staff-filter summary {
    max-width: none;
  }
  .staff-filter-menu {
    left: auto;
    right: 0;
  }
}

/* ───────────── справка «Как считается» (BAR-94) ───────────── */
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.help-link {
  color: var(--ink-2);
}
.help-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100%);
  z-index: 60;
  overflow-y: auto;
  background: var(--surface-1);
  border-left: 1px solid var(--border-warm);
  box-shadow: -20px 0 60px #0006;
  padding: 26px 28px 40px;
}
.help-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.help-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  color: var(--ink-1);
  margin: 6px 0 10px;
  letter-spacing: -0.03em;
}
.help-panel h3 {
  margin: 22px 0 8px;
  color: var(--ink-1);
  font-size: 13px;
}
.help-panel p {
  color: var(--ink-2);
  line-height: 1.6;
}
.help-def {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.help-def summary {
  cursor: pointer;
  color: var(--ink-1);
}
.help-def p {
  margin: 8px 0 4px;
  font-size: 13px;
}
.help-table td {
  vertical-align: top;
  font-size: 12px;
  line-height: 1.5;
}
.help-table td:first-child {
  min-width: 140px;
}
@media (max-width: 700px) {
  .help-panel {
    padding: 18px 16px 32px;
  }
}

/* ───────────── база выручки: по оплате / по визиту (BAR-95) ───────────── */
.basis-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-size: 12px;
}
.basis-toggle span {
  padding: 0 8px;
  color: var(--ink-muted);
}
.basis-toggle button {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 0;
  border-left: 1px solid var(--border);
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}
.basis-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* ───────────── демо-стенд (BAR-98): кнопка «Смотреть демо» на входе, плашка в кабинете ───────────── */
.auth-demo-cta {
  margin: 18px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-demo-cta > span {
  font-size: 12px;
  color: #707968;
}
.auth-demo-btn {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid var(--accent-deep);
  border-radius: 4px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.auth-demo-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.auth-or {
  font-size: 12px;
  color: #707968;
  margin: 14px 0 12px;
  text-align: center;
}
.sidebar-footer:has(.demo-bar) {
  flex-wrap: wrap;
}
.demo-bar {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-warm);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 11px;
  color: var(--ink-2);
}
.demo-bar b {
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.demo-bar select {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink-1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 6px;
  font: inherit;
}

/* W3 finance/dash/booking: каскад факторов выручки (BAR-85), пометка игнора фильтра (BAR-90),
 * ОПЗ и потери (BAR-84, BAR-87) */
.waterfall .wf-total {
  fill: var(--accent);
  opacity: 0.85;
}
.waterfall .wf-pos {
  fill: var(--delta-good);
}
.waterfall .wf-neg {
  fill: var(--delta-bad);
}
.waterfall .wf-link {
  stroke: var(--axis);
  stroke-dasharray: 2 3;
}
.waterfall .wf-value-pos {
  fill: var(--delta-good);
}
.waterfall .wf-value-neg {
  fill: var(--delta-bad);
}
.factors-lead {
  margin: 0 0 12px;
  color: var(--ink-1);
  font-size: 15px;
}
.factors-lead b {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--accent);
}
.factors-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.factors-switch [aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.delta-up {
  color: var(--delta-good);
}
.delta-down {
  color: var(--delta-bad);
}
.filter-ignored {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-muted);
}
.filter-ignored::before {
  content: "⊘ ";
}
details.card > summary {
  cursor: pointer;
}

/* ───────────── W3 clients/staff/admins: провал до клиентов (BAR-25) ───────────── */
.drill-card {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  transition: box-shadow 0.15s;
}
.drill-card:hover,
.drill-card:focus-visible {
  box-shadow: 0 0 0 1px var(--accent);
}
.drill-card > .card {
  height: 100%;
}
.drill-hint {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.8;
}
.drill-panel {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border-warm);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-1);
}
.drill-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
