:root {
  --bg: #f4ecde;
  --bg-accent: rgba(216, 91, 41, 0.12);
  --bg-accent-strong: rgba(18, 110, 92, 0.14);
  --panel: rgba(255, 250, 242, 0.88);
  --panel-border: rgba(34, 28, 22, 0.08);
  --ink: #211a15;
  --muted: #6e655c;
  --accent: #d85b29;
  --accent-dark: #9f3b15;
  --accent-soft: rgba(216, 91, 41, 0.18);
  --teal: #126e5c;
  --teal-soft: rgba(18, 110, 92, 0.18);
  --danger: #8d3131;
  --shadow: 0 22px 80px rgba(40, 24, 9, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--bg-accent), transparent 28rem),
    radial-gradient(circle at top right, var(--bg-accent-strong), transparent 24rem),
    linear-gradient(180deg, #fbf6ef 0%, var(--bg) 100%);
  font-family: "Space Grotesk", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero-copy,
.hero-meta,
.panel,
.kpi-card {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 1.8rem;
  padding: 2rem;
}

.hero-copy h1,
.panel-head h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  max-width: 12ch;
}

.hero-text {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-meta {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1.8rem;
}

.meta-card {
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.65);
}

.meta-label,
.kpi-label,
.kpi-footnote,
.table-state,
th {
  color: var(--muted);
}

.meta-card strong,
.status-pill,
.kpi-value {
  display: block;
  margin-top: 0.45rem;
}

.status-pill {
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.92rem;
}

.status-idle {
  color: var(--muted);
  background: rgba(110, 101, 92, 0.12);
}

.status-loading {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.status-ready {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-error {
  color: var(--danger);
  background: rgba(141, 49, 49, 0.12);
}

.dashboard {
  display: grid;
  gap: 1.25rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card,
.panel {
  border-radius: 1.5rem;
}

.kpi-card {
  padding: 1.35rem 1.4rem;
}

.kpi-label {
  display: block;
  font-size: 0.9rem;
}

.kpi-value {
  margin: 0.55rem 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
}

.kpi-footnote {
  font-size: 0.92rem;
}

.panel {
  padding: 1.35rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.reload-button {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, #f08b4c 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 12px 24px rgba(216, 91, 41, 0.28);
}

.reload-button:hover,
.reload-button:focus-visible {
  transform: translateY(-1px);
}

.reload-button:disabled {
  cursor: progress;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.chart-wrap {
  position: relative;
  min-height: 360px;
}

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

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

th,
td {
  padding: 0.9rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid rgba(33, 26, 21, 0.08);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody td:last-child,
thead th:last-child {
  text-align: right;
}

tbody td:nth-child(2),
thead th:nth-child(2) {
  text-align: center;
}

.table-state {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .hero,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-meta,
  .kpi-card,
  .panel {
    border-radius: 1.25rem;
  }
}

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

  .hero-copy,
  .hero-meta,
  .panel,
  .kpi-card {
    padding: 1rem;
  }

  .panel-head {
    flex-direction: column;
  }

  .reload-button {
    width: 100%;
  }

  .chart-wrap {
    min-height: 290px;
  }
}
