@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #10131a;
  --bg-elevated: #171c24;
  --bg-muted: #202734;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #eef3ff;
  --text-muted: #9da8bb;
  --accent: #ffbf47;
  --accent-soft: rgba(255, 191, 71, 0.16);
  --teal: #7de2d1;
  --danger: #ff7c7c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  color-scheme: dark;
  background:
    radial-gradient(circle at top left, rgba(255, 191, 71, 0.12), transparent 25%),
    radial-gradient(circle at top right, rgba(125, 226, 209, 0.1), transparent 28%),
    linear-gradient(180deg, #0c0f14 0%, #10131a 30%, #0e1218 100%);
}

.page-shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.hero-copy,
.panel,
.meta-card {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(28, 34, 45, 0.96), rgba(18, 23, 30, 0.96));
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px 30px;
}

.hero-copy h1 {
  margin: 8px 0 12px;
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.hero-text,
.panel-heading p,
#status-copy {
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.hero-link-primary {
  border: 1px solid rgba(255, 191, 71, 0.3);
  background: var(--accent);
  color: #1d1400;
}

.hero-link-secondary {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.hero-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255, 191, 71, 0.22);
}

.eyebrow,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

.hero-meta {
  display: grid;
  gap: 16px;
}

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

.meta-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.meta-card span[id] {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.panel {
  padding: 24px;
  margin-bottom: 24px;
}

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

.panel-heading h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
}

.panel-heading p {
  margin: 0;
  max-width: 720px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.filters-grid label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.filters-grid select,
.filters-grid input,
.filter-actions button {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  min-height: 48px;
  padding: 0 14px;
  font: inherit;
}

.filters-grid select,
.filters-grid input {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.filters-grid select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.filters-grid select option,
.filters-grid select optgroup {
  color: var(--text);
  background: var(--bg-elevated);
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-self: stretch;
}

.filter-actions button {
  flex: 1;
  background: var(--accent);
  color: #1d1400;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.filter-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255, 191, 71, 0.22);
}

.filter-actions button:disabled {
  cursor: progress;
  opacity: 0.8;
}

.filter-actions .secondary {
  background: transparent;
  color: var(--text);
}

.fetch-notice {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.filters-grid.is-fetching + .fetch-notice {
  border-color: rgba(255, 191, 71, 0.35);
  background: rgba(255, 191, 71, 0.09);
  color: var(--text);
}

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

.summary-card {
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  padding: 18px;
}

.summary-card h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.summary-card strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 1.65rem;
}

.summary-card span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

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

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

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table th {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.country-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.country-link:hover {
  color: var(--accent);
}

.detail-stack[hidden] {
  display: none;
}

.chart-shell {
  min-height: 280px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(125, 226, 209, 0.05), rgba(255, 255, 255, 0.01));
  padding: 20px;
}

.chart-shell svg {
  width: 100%;
  height: 240px;
  display: block;
}

.chart-caption {
  margin-top: 14px;
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}

.legend-tax {
  background: var(--accent);
}

.legend-wage {
  background: var(--teal);
}

.empty-state {
  color: var(--text-muted);
  padding: 18px 0;
}

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

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

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

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

  .panel,
  .hero-copy {
    padding: 18px;
    border-radius: 18px;
  }

  .filters-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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