:root {
  color-scheme: light;
  --bg: #f6fbf7;
  --bg-accent: #dff3e7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #173a34;
  --muted: #56756d;
  --line: rgba(23, 58, 52, 0.1);
  --brand: #0b6e4f;
  --brand-strong: #084c38;
  --shadow: 0 18px 48px rgba(7, 39, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(223, 243, 231, 0.95), transparent 35%),
    linear-gradient(180deg, #f7fcf8 0%, #eef7f1 100%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero-card,
.controls-card,
.stat-card,
.chart-card,
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1,
h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.25rem;
}

.hero-copy,
.section-header p,
.stat-label,
label,
#statusText {
  color: var(--muted);
}

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
  line-height: 1.6;
}

.controls-card {
  margin-top: 20px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.92rem;
  font-weight: 500;
}

select,
button {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(11, 110, 79, 0.16);
  font: inherit;
}

select {
  background: var(--surface-strong);
  padding: 0 14px;
  color: var(--text);
}

.button-row {
  display: flex;
  gap: 12px;
}

button {
  padding: 0 16px;
  background: var(--brand);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: white;
  color: var(--brand-strong);
}

.stats-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 18px 20px;
}

.stat-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
}

.chart-card,
.table-card {
  margin-top: 20px;
  padding: 22px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: clamp(280px, 42vh, 420px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 900px) {
  .controls-card,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .controls-card,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

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