:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --ink: #15221c;
  --muted: #647269;
  --line: #d8e0da;
  --green: #16744f;
  --green-soft: #e7f3ed;
  --gold: #b98216;
  --blue: #315f9f;
  --red: #b64242;
  --shadow: 0 18px 42px rgba(21, 34, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(22, 116, 79, 0.08), rgba(22, 116, 79, 0) 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

h1,
h2,
p {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.hero {
  min-height: 148px;
  border: 1px solid rgba(22, 116, 79, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbf8 55%, #edf7f1 100%);
  box-shadow: var(--shadow);
  padding: 24px;
}

.heroCopy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
}

.heroText {
  max-width: 620px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.status {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.status span:first-child {
  border: 1px solid rgba(22, 116, 79, 0.24);
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 124px;
}

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

.metric span,
.metric small,
.panel p {
  color: var(--muted);
}

.metric span,
.metric small {
  display: block;
}

.metric span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin: 14px 0 8px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric small {
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.75fr);
  gap: 12px;
  margin-bottom: 12px;
}

.layout.lower {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panelHeader p {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 520px;
}

.legendItem {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 6px 9px;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.legendItem:hover {
  border-color: rgba(22, 116, 79, 0.36);
  box-shadow: 0 8px 20px rgba(21, 34, 28, 0.08);
}

.legendItem[aria-pressed="false"] {
  opacity: 0.45;
}

.legendSwatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chartMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chartMeta span {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.interactiveChart {
  position: relative;
  width: 100%;
  height: min(430px, 48vh);
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  background: #fbfcfb;
}

.chartSvg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.chartBg {
  fill: #fbfcfb;
}

.chartGrid {
  stroke: #dfe6e1;
  stroke-width: 1;
}

.chartAxis {
  stroke: #bcc8c0;
  stroke-width: 1.2;
}

.chartTick,
.axisLabel {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.axisLabel {
  fill: #405149;
  font-size: 14px;
  font-weight: 900;
}

.chartLine {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
}

.primaryLine {
  stroke-width: 4;
}

.endPoint,
.hoverDot {
  stroke: #ffffff;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.endLabel {
  font-size: 12px;
  font-weight: 900;
}

.endValue {
  font-size: 11px;
  font-weight: 700;
}

.hoverLine {
  stroke: rgba(21, 34, 28, 0.36);
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
}

.labelLeader {
  opacity: 0.42;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hitArea {
  fill: transparent;
  pointer-events: all;
}

.chartTooltip {
  position: absolute;
  z-index: 3;
  width: 244px;
  pointer-events: none;
  border: 1px solid rgba(21, 34, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(21, 34, 28, 0.16);
  padding: 10px;
}

.chartTooltip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
}

.chartTooltip span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.chartTooltip i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.chartTooltip b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chartTooltip em {
  grid-column: 2 / 4;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.allocationList,
.auditList,
.dataStatusList {
  display: grid;
  gap: 10px;
}

.allocationRow {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.allocationRow:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.barTrack {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9efeb;
}

.barFill {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

.allocationRow strong,
.allocationRow span {
  font-size: 13px;
}

.allocationRow span {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tableWrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 8px;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td:nth-child(2),
td:nth-child(3) {
  font-variant-numeric: tabular-nums;
}

.auditItem {
  border-left: 3px solid var(--green);
  background: var(--panel-soft);
  border-radius: 0 8px 8px 0;
  padding: 9px 10px;
}

.auditItem strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.auditItem span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.statusItem {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.statusItem:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.statusItem strong,
.statusItem span {
  display: block;
}

.statusItem strong {
  font-size: 13px;
}

.statusItem span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  margin-top: 4px;
}

.statusItem p,
.disclaimerPanel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 6px;
}

.disclaimerPanel {
  background: #fffdf8;
  border-color: rgba(185, 130, 22, 0.28);
}

@media (max-width: 940px) {
  .metricGrid,
  .layout,
  .layout.lower {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 16px;
  }

  .hero,
  .metric,
  .panel {
    padding: 14px;
  }

  .panelHeader {
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .interactiveChart {
    height: 360px;
  }
}
