:root {
  --bg: #ffffff;
  --surface: #f6faf4;
  --surface-2: #eef7ea;
  --ink: #123327;
  --muted: #5f6f66;
  --accent: #2f8f5b;
  --accent-dark: #17613d;
  --accent-deep: #0e472c;
  --gold: #d9a441;
  --gold-dark: #8a6114;
  --gold-soft: #fff7df;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --line: rgba(18, 51, 39, 0.12);
  --line-strong: rgba(18, 51, 39, 0.22);
  --shadow: 0 24px 80px rgba(23, 97, 61, 0.13);
  --shadow-soft: 0 12px 36px rgba(18, 51, 39, 0.08);
  --radius: 24px;
  --ease: cubic-bezier(.2, .9, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 7%, rgba(47, 143, 91, 0.14), transparent 26rem),
    radial-gradient(circle at 92% 4%, rgba(217, 164, 65, 0.15), transparent 23rem),
    linear-gradient(180deg, #fff 0%, #f8fbf5 48%, #fff 100%);
  font-family: "Inter", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .32;
  background-image:
    linear-gradient(rgba(18, 51, 39, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 51, 39, .035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, #000, transparent 48%);
}

button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }

:focus-visible {
  outline: 3px solid rgba(217, 164, 65, .72);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--accent-deep);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }

h1, h2, strong { font-family: "Manrope", Arial, sans-serif; }
h1, h2, p { margin-top: 0; }

.site-header {
  padding: 24px 28px 0;
}

.header-inner,
.dashboard {
  width: min(1360px, 100%);
  margin-inline: auto;
}

.header-inner {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 26px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.brand img { display: block; width: 100%; height: auto; }

.header-copy { min-width: 0; }
.header-copy h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.8rem); line-height: .98; letter-spacing: -.045em; }
.header-copy > p:last-child { max-width: 680px; margin-bottom: 0; color: var(--muted); font-weight: 650; line-height: 1.55; }

.eyebrow,
.section-kicker {
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.section-kicker.light { color: #ccebd6; }

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.updated-at { max-width: 240px; color: var(--muted); font-size: .78rem; font-weight: 750; text-align: right; line-height: 1.4; }

.primary-button,
.text-button {
  min-height: 44px;
  border: 0;
  font-weight: 850;
}

.primary-button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  box-shadow: 0 16px 36px rgba(23, 97, 61, .22);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.primary-button svg { width: 18px; height: 18px; fill: currentColor; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(23, 97, 61, .28); }

.text-button { padding: 8px 4px; color: var(--accent-dark); background: transparent; text-decoration: underline; text-decoration-color: rgba(23, 97, 61, .3); text-underline-offset: 4px; }
.text-button:hover { text-decoration-color: currentColor; }

.dashboard { padding: 26px 28px 48px; }

.filter-panel {
  position: sticky;
  top: 12px;
  z-index: 20;
  padding: 18px 20px 20px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.filter-heading,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.filter-heading { margin-bottom: 14px; }
.filter-heading h2, .panel-header h2 { margin-bottom: 0; font-size: clamp(1.18rem, 2vw, 1.5rem); letter-spacing: -.025em; }

.filter-grid {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) auto minmax(260px, 1.2fr) minmax(210px, 1fr) minmax(190px, .9fr);
  gap: 12px;
  align-items: end;
}

.field,
.status-filter { min-width: 0; }

.field { display: grid; gap: 7px; }
.field > span,
.status-filter legend { color: var(--muted); font-size: .76rem; font-weight: 850; }

.field select,
.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  font-weight: 750;
}

.date-fields { display: grid; grid-template-columns: repeat(2, minmax(138px, 1fr)); gap: 10px; }
.date-fields[hidden] { display: none; }

.status-filter { margin: 0; padding: 0; border: 0; }
.status-filter legend { margin-bottom: 7px; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.status-chip { min-height: 40px; padding: 7px 11px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 850; }
.status-chip:hover { color: var(--accent-dark); }
.status-chip.is-active { color: #fff; background: var(--accent-dark); box-shadow: 0 5px 16px rgba(23, 97, 61, .2); }
[data-status="planned"].is-active { color: #3d2b08; background: var(--gold); }

.notice {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  margin: 16px 0;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, .7);
  font-size: .84rem;
  font-weight: 750;
}

.notice-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(47, 143, 91, .12); }
.notice.is-warning { color: var(--gold-dark); border-color: rgba(217, 164, 65, .35); background: var(--gold-soft); }
.notice.is-warning .notice-dot { background: var(--gold); box-shadow: 0 0 0 5px rgba(217, 164, 65, .15); }
.notice.is-error { color: var(--danger); border-color: rgba(180, 35, 24, .24); background: var(--danger-soft); }
.notice.is-error .notice-dot { background: var(--danger); box-shadow: 0 0 0 5px rgba(180, 35, 24, .12); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card,
.kpi-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-card { min-height: 298px; padding: clamp(24px, 4vw, 42px); }
.hero-card h2 { max-width: 520px; margin-bottom: 10px; font-size: clamp(1.35rem, 2.5vw, 2.1rem); letter-spacing: -.035em; }
.hero-card p:last-child { margin-bottom: 0; line-height: 1.55; }
.hero-value { display: block; margin: 9px 0 1px; font-size: clamp(4.4rem, 9vw, 7.8rem); line-height: .9; letter-spacing: -.075em; }

.hero-realized {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, .13), transparent 28%),
    linear-gradient(135deg, var(--accent-deep), var(--accent-dark) 62%, var(--accent));
  box-shadow: 0 28px 70px rgba(23, 97, 61, .25);
}

.hero-realized::before,
.hero-realized::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}
.hero-realized::before { width: 290px; height: 290px; right: -100px; top: -145px; }
.hero-realized::after { width: 170px; height: 170px; right: 105px; bottom: -120px; }
.hero-copy, .hero-support { position: relative; z-index: 1; }
.hero-copy > p:last-child { color: rgba(255, 255, 255, .75); }

.hero-support { display: grid; gap: 10px; min-width: 190px; }
.hero-support div { padding: 15px 17px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 17px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); }
.hero-support dt { color: rgba(255, 255, 255, .7); font-size: .75rem; font-weight: 750; }
.hero-support dd { margin: 3px 0 0; font-family: "Manrope", sans-serif; font-size: 1.65rem; font-weight: 800; }

.hero-planned {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #3d2b08;
  border-color: rgba(217, 164, 65, .26);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 164, 65, .34), transparent 48%),
    linear-gradient(145deg, #fffdf6, var(--gold-soft));
}
.hero-planned .section-kicker { color: var(--gold-dark); }
.hero-planned .hero-value { color: var(--gold-dark); font-size: clamp(4rem, 7vw, 6.5rem); }
.hero-planned p:last-child { color: #74591d; }
.planned-people { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid rgba(138, 97, 20, .16); }
.planned-people span { font-size: .8rem; font-weight: 800; }
.planned-people strong { font-size: 1.8rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { display: flex; align-items: center; gap: 16px; min-height: 124px; padding: 21px; background: rgba(255, 255, 255, .86); }
.kpi-card > div { display: grid; gap: 3px; min-width: 0; }
.kpi-card > div > span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.kpi-card strong { font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.1; }
.kpi-card small { color: var(--muted); font-weight: 650; }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; color: var(--accent-dark); background: var(--surface-2); }
.kpi-icon.gold { color: var(--gold-dark); background: var(--gold-soft); }
.kpi-icon.soft { color: var(--muted); background: var(--surface); }
.kpi-icon svg { width: 25px; height: 25px; fill: currentColor; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.chart-grid-primary { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.panel { padding: 24px; background: rgba(255, 255, 255, .9); }
.panel-header { min-height: 52px; margin-bottom: 15px; }
.panel-note { max-width: 220px; color: var(--muted); font-size: .76rem; font-weight: 750; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend .green { background: var(--accent-dark); }
.legend .gold { background: var(--gold); }

.chart-wrap { position: relative; min-height: 280px; }
.chart-wrap-tall { min-height: 320px; }
.chart-wrap-donut { min-height: 245px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

.disability-layout { display: grid; grid-template-columns: minmax(210px, .9fr) minmax(180px, 1.1fr); align-items: center; gap: 22px; }
.profile-list { display: grid; gap: 9px; }
.profile-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 36px; }
.profile-row i { width: 12px; height: 12px; border-radius: 4px; }
.profile-row span { color: var(--muted); font-size: .82rem; font-weight: 750; }
.profile-row strong { font-size: .92rem; }

.chart-data { margin-top: 14px; border-top: 1px solid var(--line); }
.chart-data summary { min-height: 44px; padding: 13px 2px 0; color: var(--accent-dark); font-size: .78rem; font-weight: 800; cursor: pointer; }
.chart-data > div { padding-top: 12px; }

.comparison-panel { margin-bottom: 18px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 17px; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: var(--surface); font-size: .72rem; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
td { font-weight: 650; }
td:first-child { color: var(--ink); font-weight: 850; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(238, 247, 234, .52); }
.chart-data table { font-size: .76rem; }
.chart-data th, .chart-data td { padding: 9px 10px; }

.privacy-note { display: flex; gap: 13px; align-items: center; padding: 17px 19px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); background: var(--surface); }
.privacy-note svg { width: 25px; height: 25px; flex: 0 0 25px; fill: var(--accent-dark); }
.privacy-note p { margin: 0; font-size: .8rem; line-height: 1.55; }
.privacy-note strong { color: var(--ink); }

.empty-state { display: grid; place-items: center; min-height: 220px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--muted); background: var(--surface); font-weight: 750; text-align: center; }

body.is-loading .hero-value,
body.is-loading [data-kpi],
body.is-loading [data-quality] {
  color: transparent !important;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.34), rgba(255,255,255,.14));
  background-size: 200% 100%;
  animation: shimmer 1.35s linear infinite;
}
body.is-loading .hero-planned .hero-value,
body.is-loading .kpi-card [data-kpi],
body.is-loading [data-quality] { background-color: rgba(18, 51, 39, .08); background-image: linear-gradient(90deg, rgba(18,51,39,.05), rgba(18,51,39,.13), rgba(18,51,39,.05)); }

@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1160px) {
  .header-inner { grid-template-columns: 130px minmax(0, 1fr); }
  .header-actions { grid-column: 1 / -1; flex-direction: row-reverse; align-items: center; justify-content: space-between; }
  .updated-at { max-width: none; text-align: left; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-fields { grid-column: span 2; }
  .status-filter { grid-column: span 2; }
}

@media (max-width: 900px) {
  .hero-grid, .chart-grid, .chart-grid-primary { grid-template-columns: 1fr; }
  .hero-realized { grid-template-columns: 1fr; }
  .hero-support { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-card { min-height: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .source-card { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .site-header { padding: 16px 16px 0; }
  .dashboard { padding: 20px 16px 36px; }
  .header-inner { grid-template-columns: 92px minmax(0, 1fr); gap: 16px; }
  .brand { min-height: 80px; padding: 9px; border-radius: 20px; }
  .header-copy h1 { font-size: clamp(1.65rem, 9vw, 2.4rem); }
  .header-copy > p:last-child { font-size: .88rem; }
  .header-actions { align-items: stretch; flex-direction: column; }
  .updated-at { text-align: left; }
  .primary-button { width: 100%; }
  .filter-panel { position: relative; top: auto; padding: 17px; }
  .filter-grid { grid-template-columns: 1fr; }
  .date-fields, .status-filter { grid-column: auto; }
  .date-fields { grid-template-columns: 1fr 1fr; }
  .filter-heading { align-items: center; }
  .hero-card, .panel { padding: 21px; border-radius: 20px; }
  .hero-value { font-size: clamp(4rem, 24vw, 6rem); }
  .hero-support { grid-template-columns: 1fr 1fr; min-width: 0; }
  .kpi-grid { grid-template-columns: 1fr; }
  .source-card { grid-column: auto; }
  .disability-layout { grid-template-columns: 1fr; }
  .chart-wrap { min-height: 245px; }
  .chart-wrap-tall { min-height: 300px; }
  .panel-header { flex-direction: column; min-height: 0; }
  .panel-note { max-width: none; text-align: left; }
  .comparison-panel .panel-header { margin-bottom: 18px; }
  .table-scroll { overflow: visible; border: 0; }
  .comparison-panel table, .comparison-panel thead, .comparison-panel tbody, .comparison-panel tr, .comparison-panel th, .comparison-panel td { display: block; }
  .comparison-panel thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .comparison-panel tbody { display: grid; gap: 12px; }
  .comparison-panel tr { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .comparison-panel td { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; border: 0; text-align: right; }
  .comparison-panel td::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 750; text-align: left; }
  .comparison-panel td:first-child { display: block; padding-bottom: 12px; border-bottom: 1px solid var(--line); text-align: left; }
  .comparison-panel td:first-child::before { display: block; margin-bottom: 4px; }
}

@media (max-width: 430px) {
  .header-inner { grid-template-columns: 76px minmax(0, 1fr); }
  .header-copy > p:last-child { display: none; }
  .date-fields, .hero-support { grid-template-columns: 1fr; }
  .segmented-control { grid-template-columns: 1fr; }
  .status-chip { min-height: 44px; }
  .hero-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  body { background: #fff; }
  body::before, .filter-panel, .header-actions, .chart-data { display: none !important; }
  .site-header, .dashboard { padding-inline: 0; }
  .hero-card, .kpi-card, .panel { break-inside: avoid; box-shadow: none; }
  .chart-grid, .hero-grid { grid-template-columns: 1fr 1fr; }
}
