@font-face {
  font-family: "Roboto Condensed";
  src: url("/assets/roboto-condensed-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --page: #f3f7f9;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --ink: #1c2735;
  --muted: #687687;
  --soft: #91a0b0;
  --line: #d8e1e9;
  --blue: #1d67c4;
  --blue-soft: #e6f0ff;
  --green: #176b5c;
  --green-soft: #e1f2ed;
  --red: #bd3f3a;
  --red-soft: #fae9e7;
  --amber: #a96412;
  --amber-soft: #fff0d9;
  --violet: #7655bc;
  --acid: #c9ef54;
  --shadow: 0 12px 32px rgba(42, 67, 91, 0.08);
  --display: "Roboto Condensed", Arial, sans-serif;
  --body: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.42;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }

.report-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.report-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(105, 126, 153, 0.22);
  background: rgba(243, 247, 249, 0.94);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.report-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.report-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #151812;
  color: var(--acid);
  font-family: var(--display);
  font-size: 20px;
}
.brand-title { font-weight: 700; line-height: 1.15; }
.brand-subtitle, .report-period { color: var(--muted); font-size: 14px; }
.report-period { text-align: right; }
.report-period strong { color: var(--ink); }

.report-main { padding: 30px 0 46px; }
.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 16px;
  margin-bottom: 16px;
}
.hero-copy, .hero-summary, .metric-card, .report-card, .decision-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-copy { min-height: 326px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-kicker, .card-kicker, .metric-label, .summary-label, .table-label {
  color: var(--blue);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.hero-copy h1 {
  max-width: 850px;
  margin-top: 20px;
  font-family: var(--display);
  font-size: 52px;
  line-height: 0.98;
  letter-spacing: 0;
}
.hero-lead { max-width: 820px; margin-top: 22px; color: var(--muted); font-size: 18px; }
.hero-summary {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--blue);
  color: #fff;
}
.hero-summary .summary-label { color: #cfe2ff; }
.hero-summary strong { display: block; margin-top: 14px; font-size: 26px; line-height: 1.14; }
.summary-facts { display: grid; gap: 10px; margin-top: 26px; }
.summary-fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 10px;
  font-size: 14px;
}
.summary-fact b { font-size: 18px; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { min-height: 142px; padding: 18px; box-shadow: none; }
.metric-value { display: block; margin-top: 22px; font-family: var(--display); font-size: 34px; line-height: 1; white-space: nowrap; }
.metric-note { margin-top: 10px; color: var(--muted); font-size: 14px; }
.metric-note.good { color: var(--green); }
.metric-note.bad { color: var(--red); }

.report-tabs {
  position: sticky;
  top: 68px;
  z-index: 15;
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(42, 67, 91, 0.06);
}
.tab-button {
  min-height: 42px;
  flex: 1 0 auto;
  border: 0;
  border-radius: 8px;
  padding: 9px 18px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}
.tab-button:hover { background: var(--surface-soft); color: var(--ink); }
.tab-button.is-active { background: var(--ink); color: #fff; }

.tab-panel { margin-bottom: 18px; }
.is-enhanced .tab-panel { display: none; }
.is-enhanced .tab-panel.is-active { display: block; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin: 34px 0 16px; }
.section-heading h2 { margin-top: 6px; font-family: var(--display); font-size: 36px; line-height: 1; }
.section-heading p { max-width: 560px; color: var(--muted); }
.report-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.report-card { min-height: 280px; padding: 24px; box-shadow: none; }
.report-card.compact { min-height: 0; }
.report-card.tint { background: var(--blue-soft); border-color: #c6daf6; }
.report-card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.card-head h3 { margin-top: 6px; font-size: 24px; line-height: 1.12; }
.card-note { color: var(--muted); font-size: 14px; }
.report-card.dark .card-note { color: #b7c4d0; }
.status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.status-chip.alert { border-color: #efc3bd; background: var(--red-soft); color: var(--red); }
.status-chip.good { border-color: #b8ddd3; background: var(--green-soft); color: var(--green); }

.big-insight { font-family: var(--display); font-size: 34px; line-height: 1.08; }
.insight-detail { margin-top: 18px; color: var(--muted); }
.decision-list { display: grid; gap: 10px; margin-top: 24px; }
.decision-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; box-shadow: none; border-radius: 12px; }
.decision-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.decision-card strong { display: block; }
.decision-card span:last-child { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }

.bar-list { display: grid; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 126px minmax(0, 1fr) 74px; gap: 12px; align-items: center; }
.bar-row span, .bar-row b { font-size: 14px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { height: 14px; overflow: hidden; border-radius: 5px; background: #e5ebf0; }
.bar-track i { display: block; width: var(--value); height: 100%; border-radius: inherit; background: var(--bar, var(--blue)); }
.bar-track i.green { --bar: var(--green); }
.bar-track i.red { --bar: var(--red); }
.bar-track i.amber { --bar: #d8942a; }
.bar-track i.violet { --bar: var(--violet); }

.scenario-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scenario {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface-soft);
}
.scenario.is-target { border-color: #a9c7ef; background: var(--blue-soft); }
.scenario strong { display: block; margin-top: 10px; font-family: var(--display); font-size: 34px; }
.scenario p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.scenario-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.scenario-kpis div { border-top: 1px solid var(--line); padding-top: 10px; }
.scenario-kpis b { display: block; font-size: 18px; }
.scenario-kpis span { color: var(--muted); font-size: 13px; }

.line-chart { width: 100%; height: auto; display: block; }
.line-chart .grid-line { stroke: #dbe4eb; stroke-width: 1; }
.line-chart .area { fill: rgba(29, 103, 196, 0.10); }
.line-chart .main-line { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .secondary-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-dasharray: 7 7; }
.line-chart circle { fill: #fff; stroke: var(--blue); stroke-width: 3; }
.axis-row { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 13px; }

.donut-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: center; }
.donut {
  width: 190px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 42%, var(--green) 42% 73%, var(--violet) 73% 93%, #d8942a 93% 100%);
}
.donut::before { content: "9,86 млн ₽"; width: 112px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #fff; font-family: var(--display); font-size: 22px; text-align: center; }
.legend { display: grid; gap: 11px; }
.legend-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--dot); }
.legend-row b { font-variant-numeric: tabular-nums; }

.heat-grid { display: grid; grid-template-columns: 72px repeat(3, minmax(72px, 1fr)); gap: 7px; }
.heat-cell { min-height: 58px; display: grid; place-items: center; border-radius: 10px; background: var(--heat, var(--surface-soft)); font-weight: 700; }
.heat-cell.header, .heat-cell.time { color: var(--muted); background: transparent; font-weight: 400; }
.heat-low { --heat: #fae9e7; color: var(--red); }
.heat-mid { --heat: #fff0d9; color: var(--amber); }
.heat-high { --heat: #e1f2ed; color: var(--green); }

.funnel { display: grid; gap: 11px; }
.funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 78px; gap: 12px; align-items: center; }
.funnel-bar { height: 32px; border-radius: 8px; background: linear-gradient(90deg, var(--blue), #79a9e7); width: var(--value); min-width: 42px; }
.funnel-row b { text-align: right; }

.progress-ring {
  width: 180px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0 12.6%, #e5ebf0 12.6% 100%);
}
.progress-ring::before { content: "12,6%\Aотмен"; white-space: pre; width: 124px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #fff; font-family: var(--display); font-size: 25px; line-height: 1.05; text-align: center; }

.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.report-table th, .report-table td { border-bottom: 1px solid var(--line); padding: 14px 10px; text-align: left; }
.report-table th { color: var(--muted); font-size: 13px; font-weight: 700; }
.report-table td { font-size: 15px; }
.report-table th:not(:first-child), .report-table td:not(:first-child) { text-align: right; }
.table-status { color: var(--blue); font-weight: 700; }
.table-status.alert { color: var(--red); }
.table-status.good { color: var(--green); }

.phase-list { display: grid; gap: 14px; }
.phase-row { display: grid; grid-template-columns: 98px minmax(0, 1fr) 104px; gap: 12px; align-items: center; }
.phase-row span, .phase-row b { font-size: 14px; }
.phase-row b { text-align: right; }
.phase-track { height: 26px; overflow: hidden; border-radius: 7px; background: #e5ebf0; }
.phase-track i { display: block; width: var(--value); height: 100%; background: var(--bar, var(--blue)); }

.report-footer { margin-top: 28px; padding: 18px 0 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.back-link {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  font-weight: 700;
}
.back-link:hover { border-color: var(--blue); color: var(--blue); }

@media (max-width: 980px) {
  .report-hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:first-child { grid-column: 1 / -1; }
  .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .report-shell { width: min(100% - 24px, 1240px); }
  .topbar-inner { min-height: 62px; }
  .brand-subtitle { display: none; }
  .report-period { font-size: 12px; }
  .report-main { padding-top: 18px; }
  .hero-copy, .hero-summary, .report-card { padding: 18px; border-radius: 14px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-lead { font-size: 16px; }
  .hero-summary strong { font-size: 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card:first-child { grid-column: auto; }
  .metric-card { min-height: 0; }
  .metric-value { font-size: 30px; }
  .report-tabs { top: 62px; }
  .section-heading { display: block; }
  .section-heading h2 { font-size: 30px; }
  .section-heading p { margin-top: 10px; }
  .card-head { display: block; }
  .status-chip { display: inline-block; margin-top: 10px; }
  .scenario-grid, .scenario-kpis { grid-template-columns: 1fr; }
  .bar-row, .phase-row { grid-template-columns: 94px minmax(0, 1fr) 58px; gap: 8px; }
  .donut-wrap { grid-template-columns: 1fr; }
  .donut { margin: 0 auto; }
  .heat-grid { grid-template-columns: 52px repeat(3, minmax(58px, 1fr)); }
  .heat-cell { min-height: 50px; font-size: 14px; }
  .funnel-row { grid-template-columns: 80px minmax(0, 1fr) 60px; gap: 8px; }
  .back-link { right: 12px; bottom: 12px; min-height: 42px; padding: 8px 10px; }
}
