@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/montserrat.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --green-700: #047a2b;
  --green-600: #00a83f;
  --green-500: #00d451;
  --green-100: rgba(0, 212, 81, 0.14);
  --cyan: #00a7c7;
  --amber: #d58a00;
  --red: #d8404d;
  --violet: #7068d9;
  --ink: #101513;
  --muted: #64706a;
  --line: rgba(21, 35, 27, 0.12);
  --bg: #eef5f1;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.52);
  --input-bg: rgba(255, 255, 255, 0.78);
  --on-green: #001a08;
  --button-ink: #001a08;
  --row-hover: rgba(0, 212, 81, 0.08);
  --funnel-1: #00d451;
  --funnel-2: #00a83f;
  --funnel-3: #00a7c7;
  --funnel-4: #323a35;
  --goal-bg: rgba(7, 13, 10, 0.88);
  --goal-ink: #ffffff;
  --goal-muted: rgba(255, 255, 255, 0.68);
  --goal-line: rgba(255, 255, 255, 0.14);
  --tooltip-bg: rgba(7, 13, 10, 0.94);
  --tooltip-ink: #ffffff;
  --chart-budget: #26322c;
  --chart-sold: #00d451;
  --chart-cyan: #00a7c7;
  --chart-plot: rgba(255, 255, 255, 0.38);
  --shadow: 0 24px 70px rgba(20, 35, 24, 0.13);
  --glass-border: rgba(255, 255, 255, 0.58);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --green-700: #2df06d;
  --green-600: #16d65c;
  --green-500: #2df06d;
  --green-100: rgba(45, 240, 109, 0.14);
  --cyan: #48d7f2;
  --amber: #ffbc4a;
  --red: #ff6b78;
  --violet: #a49cff;
  --ink: #f4f7f5;
  --muted: #a7b1ac;
  --line: rgba(255, 255, 255, 0.12);
  --bg: #0b0f0d;
  --surface: rgba(24, 29, 26, 0.62);
  --surface-strong: rgba(28, 34, 31, 0.86);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(255, 255, 255, 0.08);
  --on-green: #001a08;
  --button-ink: #001a08;
  --row-hover: rgba(45, 240, 109, 0.08);
  --funnel-1: #2df06d;
  --funnel-2: #16d65c;
  --funnel-3: #48d7f2;
  --funnel-4: #7c8580;
  --goal-bg: rgba(9, 13, 11, 0.78);
  --goal-ink: #ffffff;
  --goal-muted: rgba(255, 255, 255, 0.66);
  --goal-line: rgba(255, 255, 255, 0.12);
  --tooltip-bg: rgba(255, 255, 255, 0.94);
  --tooltip-ink: #070d0a;
  --chart-budget: #a7b1ac;
  --chart-sold: #2df06d;
  --chart-cyan: #48d7f2;
  --chart-plot: rgba(255, 255, 255, 0.04);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --glass-border: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 212, 81, 0.16), transparent 34%),
    linear-gradient(225deg, rgba(0, 167, 199, 0.14), transparent 38%),
    var(--bg);
  font-family: "Montserrat", sans-serif;
  transition: color 180ms ease, background-color 180ms ease;
}

.report {
  width: min(1340px, 100%);
  margin: 0 auto;
  padding: 22px 20px 34px;
}

.report-header,
.goal-highlight,
.panel,
.kpi {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

html[data-panel-safe="true"] {
  --surface: rgba(255, 255, 255, 0.86);
  --surface-soft: rgba(255, 255, 255, 0.64);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --shadow: 0 18px 48px rgba(20, 35, 24, 0.11);
}

html[data-theme="dark"][data-panel-safe="true"] {
  --surface: rgba(24, 29, 26, 0.84);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(30, 36, 33, 0.94);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

html[data-panel-safe="true"] body {
  background: var(--bg);
}

html[data-panel-safe="true"] .report-header,
html[data-panel-safe="true"] .goal-highlight,
html[data-panel-safe="true"] .panel,
html[data-panel-safe="true"] .kpi {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-panel-safe="true"] * {
  animation-duration: 1ms !important;
  scroll-behavior: auto !important;
}

.report-header {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 92px;
  padding: 10px 0 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand-block,
.brand-copy {
  min-width: 0;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  display: block;
  width: 220px;
  max-width: 42%;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.brand-copy {
  display: flex;
  align-self: stretch;
  align-items: flex-end;
  min-width: 170px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-copy p,
.panel-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.header-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

h1,
.panel-title,
.kpi span,
.date-filter span,
footer {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 360px;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 700;
}

.date-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 8px;
  min-width: 520px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.theme-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.theme-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color 180ms ease;
}

.theme-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
  transition: transform 180ms ease, background-color 180ms ease;
}

.theme-control input:checked + .theme-switch {
  background: var(--green-500);
}

.theme-control input:checked + .theme-switch::after {
  background: var(--on-green);
  transform: translateX(20px);
}

.theme-control:focus-within .theme-switch {
  outline: 3px solid var(--green-100);
  outline-offset: 2px;
}

.date-filter span,
.kpi span,
.meta-grid span,
.rate-grid span,
.order-funnel span,
.progress-lines span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.date-filter input {
  width: 100%;
  height: 38px;
  margin-top: 4px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.date-filter input:focus {
  border-color: var(--green-500);
  outline: 3px solid var(--green-100);
}

.date-actions {
  display: flex;
  gap: 6px;
}

.date-actions button {
  height: 38px;
  padding: 0 14px;
  color: var(--button-ink);
  background: linear-gradient(180deg, var(--green-500), var(--green-600));
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.date-actions button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.date-actions button.secondary {
  color: var(--green-700);
  background: var(--surface-strong);
  border-color: var(--line);
}

.date-filter strong {
  grid-column: 1 / -1;
  font-size: 14px;
}

.goal-highlight {
  margin-top: 18px;
  padding: 22px;
  color: var(--goal-ink);
  background:
    linear-gradient(135deg, rgba(0, 212, 81, 0.2), transparent 48%),
    linear-gradient(225deg, rgba(0, 167, 199, 0.12), transparent 52%),
    var(--goal-bg);
}

.goal-heading,
.goal-layout,
.goal-metrics {
  display: grid;
}

.goal-heading {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--goal-line);
}

.goal-eyebrow,
.goal-period > span {
  display: block;
  margin-bottom: 5px;
  color: var(--green-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.goal-heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
}

.goal-period {
  text-align: right;
}

.goal-period strong {
  font-size: 13px;
  font-weight: 600;
}

.goal-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: center;
  padding-top: 18px;
}

.goal-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.goal-metrics > div {
  min-width: 0;
  padding: 2px 18px;
  border-left: 1px solid var(--goal-line);
}

.goal-metrics > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.goal-metrics .metric-label,
.goal-highlight .progress-lines > div > span {
  color: var(--goal-muted);
}

.goal-metrics strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: 21px;
  line-height: 1.15;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.kpi {
  position: relative;
  min-height: 108px;
  padding: 18px;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green-500);
}

.kpi.budget::before {
  background: var(--chart-budget);
}

.kpi.conversion::before {
  background: var(--amber);
}

.kpi.commission::before {
  background: var(--violet);
}

.kpi strong {
  display: block;
  margin-top: 14px;
  overflow-wrap: anywhere;
  font-size: 29px;
  line-height: 1;
}

.split,
.chart-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.split {
  grid-template-columns: 1.08fr 0.92fr;
}

.chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-height: 260px;
  padding: 18px;
}

.panel-title {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.panel-heading .panel-title {
  margin-bottom: 0;
}

.panel-heading strong {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--green-700);
  background: var(--green-100);
  border: 1px solid rgba(0, 212, 81, 0.18);
  border-radius: 999px;
  font-size: 12px;
}

.timeline-panel {
  min-height: 0;
  margin-bottom: 12px;
}

.timeline-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.timeline-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.budget-dot {
  background: var(--chart-budget);
}

.sold-dot {
  background: var(--chart-sold);
}

.timeline-chart {
  min-height: 265px;
}

.timeline-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.timeline-plot {
  fill: var(--chart-plot);
}

.timeline-grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.timeline-grid text,
.timeline-date {
  fill: var(--muted);
  font-size: 11px;
}

.timeline-grid text {
  text-anchor: end;
}

.timeline-date {
  text-anchor: middle;
}

.timeline-budget {
  fill: var(--chart-budget);
  opacity: 0.2;
}

.timeline-area {
  fill: url(#soldAreaGradient);
}

.timeline-line {
  fill: none;
  stroke: var(--chart-sold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.timeline-budget-line {
  fill: none;
  stroke: var(--chart-budget);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0.72;
}

.timeline-point {
  fill: var(--surface-strong);
  stroke: var(--chart-sold);
  stroke-width: 3;
}

.empty-chart {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.funnel {
  display: grid;
  gap: 10px;
  width: 100%;
}

.funnel-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.45fr) minmax(112px, 0.78fr) minmax(86px, 0.48fr);
  gap: 10px;
  align-items: center;
}

.funnel-stage,
.funnel-value,
.funnel-rate span {
  display: flex;
  align-items: center;
  min-height: 64px;
  border-radius: 8px;
}

.funnel-stage {
  justify-content: flex-start;
  padding: 0 18px;
  color: #06210f;
  background: linear-gradient(180deg, var(--funnel-1), var(--funnel-2));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.funnel-row:nth-child(2) .funnel-stage {
  margin-left: 24px;
  background: linear-gradient(180deg, var(--funnel-2), var(--green-700));
}

.funnel-row:nth-child(3) .funnel-stage {
  margin-left: 52px;
  color: #00151a;
  background: linear-gradient(180deg, var(--green-600), var(--funnel-3));
}

.funnel-row:nth-child(4) .funnel-stage {
  margin-left: 80px;
  color: #ffffff;
  background: linear-gradient(180deg, #3f9e4b, #2e7f3a);
}

.funnel-stage span {
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.funnel-value {
  justify-content: center;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.funnel-value strong {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.funnel-rate {
  display: grid;
  place-items: center;
  min-height: 64px;
}

.funnel-rate span {
  justify-content: center;
  min-width: 78px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
}

.rate-grid,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rate-grid div,
.meta-grid div {
  min-height: 74px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rate-grid strong,
.meta-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.05;
}

.metric-label {
  display: flex !important;
  align-items: center;
  gap: 7px;
}

.hint {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  color: currentColor;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 700 11px/1 "Montserrat", sans-serif;
  cursor: help;
  opacity: 0.78;
}

.hint::after {
  content: attr(data-hint);
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 9px);
  width: min(250px, 70vw);
  padding: 9px 10px;
  color: var(--tooltip-ink);
  background: var(--tooltip-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.hint:hover::after,
.hint:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hint:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
}

.donut-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.donut {
  position: relative;
  width: 178px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green-600) 0deg, var(--green-600) 1deg, var(--amber) 1deg, var(--amber) 2deg, var(--red) 2deg);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 36px rgba(0, 0, 0, 0.11);
}

.donut::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 42%);
  pointer-events: none;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 37px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.donut > span {
  position: absolute;
  inset: 37px;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut > span strong,
.donut > span small {
  display: block;
}

.donut > span strong {
  font-size: 25px;
}

.donut > span small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.legend {
  display: grid;
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.legend-item > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legend-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.order-funnel {
  display: grid;
  gap: 10px;
}

.order-panel {
  display: flex;
  flex-direction: column;
}

.order-panel .panel-title {
  flex: 0 0 auto;
}

.order-panel .order-funnel {
  flex: 1;
}

.split .order-panel {
  min-height: 260px;
}

.split .order-funnel {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 196px;
}

.split .order-funnel .funnel-row {
  grid-template-columns: minmax(168px, 1fr) minmax(86px, 0.42fr) minmax(76px, 0.3fr);
  align-items: stretch;
}

.order-funnel .funnel-row {
  grid-template-columns: minmax(220px, 1fr) minmax(112px, 0.38fr) minmax(92px, 0.28fr);
}

.order-funnel .funnel-row:nth-child(2) .funnel-stage {
  margin-left: 36px;
}

.split .order-funnel .funnel-row:nth-child(2) .funnel-stage {
  margin-left: 20px;
}

.split .order-funnel .funnel-stage,
.split .order-funnel .funnel-value,
.split .order-funnel .funnel-rate,
.split .order-funnel .funnel-rate span {
  height: 100%;
  min-height: 0;
}

.split .order-funnel .funnel-stage {
  padding: 0 20px;
}

.split .order-funnel .funnel-value strong {
  font-size: 28px;
}

.split .order-funnel .funnel-rate span {
  min-width: 84px;
}

.order-panel {
  margin-bottom: 12px;
}

.split .order-panel {
  margin-bottom: 0;
}

.mini-rates {
  min-height: 0;
  margin-bottom: 12px;
}

.progress-lines {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.goal-highlight .progress-lines {
  margin-top: 0;
}

.goal-highlight .progress {
  background: var(--goal-line);
}

.progress-meta {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-meta strong {
  color: var(--goal-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.progress {
  height: 12px;
  margin-top: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green-500), var(--cyan));
}

.progress-lines > div:last-child .progress span {
  background: linear-gradient(90deg, var(--green-500), var(--green-700));
}

.table-panel {
  min-height: 0;
}

.table-heading,
.pagination-bar,
.page-controls,
.page-size-control {
  display: flex;
  align-items: center;
}

.table-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.table-heading .panel-title {
  margin-bottom: 0;
}

.page-size-control {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.page-size-control span {
  white-space: nowrap;
}

.page-size-control select {
  height: 34px;
  min-width: 76px;
  padding: 0 28px 0 10px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.86);
  text-align: left;
  text-transform: uppercase;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td:nth-child(6) {
  font-weight: 700;
}

tbody tr:hover {
  background: var(--row-hover);
}

.pagination-bar {
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.page-controls {
  gap: 10px;
}

.page-controls button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.page-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.page-controls strong {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.is-won {
  color: var(--on-green);
  background: linear-gradient(180deg, var(--green-500), var(--green-600));
}

.status-pill.is-lost {
  color: #ffffff;
  background: linear-gradient(180deg, var(--red), #b82f3d);
}

.status-pill.is-open {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 4px;
  color: var(--muted);
  font-size: 12px;
}

footer a {
  color: var(--green-700);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 920px) {
  .report-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .date-filter {
    width: 100%;
    min-width: 0;
  }

  .header-controls {
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .theme-control {
    justify-self: start;
  }

  .goal-layout {
    grid-template-columns: 1fr;
  }

  .split,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .donut-row {
    grid-template-columns: 1fr;
  }

  .funnel-row {
    grid-template-columns: minmax(170px, 1fr) minmax(104px, 0.56fr) minmax(78px, 0.38fr);
  }

  .funnel-row:nth-child(2) .funnel-stage {
    margin-left: 14px;
  }

  .funnel-row:nth-child(3) .funnel-stage {
    margin-left: 28px;
  }

  .funnel-row:nth-child(4) .funnel-stage {
    margin-left: 42px;
  }

  .order-funnel .funnel-row {
    grid-template-columns: minmax(170px, 1fr) minmax(104px, 0.56fr) minmax(78px, 0.38fr);
  }
}

@media (max-width: 540px) {
  .report {
    padding: 8px 8px 20px;
  }

  .kpi,
  .panel,
  .report-header {
    padding: 12px;
  }

  .rate-grid,
  .order-funnel {
    grid-template-columns: 1fr;
  }

  .goal-highlight {
    padding: 16px 12px;
  }

  .goal-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .goal-period {
    text-align: left;
  }

  .goal-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
  }

  .goal-metrics > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .date-filter {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .brand-block,
  .header-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo {
    width: 220px;
    max-width: 100%;
  }

  .brand-copy {
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  h1 {
    font-size: 23px;
  }

  .panel-heading {
    display: grid;
  }

  .panel-heading strong {
    justify-self: start;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi strong {
    font-size: 28px;
  }

  .date-filter strong {
    grid-column: auto;
  }

  .date-actions button {
    flex: 1;
  }

  .funnel-row,
  .order-funnel .funnel-row {
    grid-template-columns: 1fr;
  }

  .funnel-row:nth-child(n) .funnel-stage,
  .order-funnel .funnel-row:nth-child(n) .funnel-stage {
    margin-left: 0;
  }

  .funnel-stage,
  .funnel-value,
  .funnel-rate {
    min-height: 52px;
  }

  .funnel-rate {
    place-items: stretch;
  }

  .funnel-rate span {
    width: 100%;
    min-height: 40px;
  }

  .donut-row {
    justify-items: center;
  }

  .legend {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  .table-heading,
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-size-control,
  .page-controls {
    justify-content: space-between;
  }

  table {
    min-width: 0;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    padding: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }
}
