/* Economark – Economic Intelligence Dashboard */
:root {
  --teal: #0D9488;
  --teal-light: #14B8A6;
  --teal-dark: #0F766E;
  --teal-bg: rgba(13, 148, 136, 0.08);
  --teal-bg-hover: rgba(13, 148, 136, 0.14);
  --charcoal: #1a1a2e;
  --charcoal-light: #22223a;
  --charcoal-mid: #2a2a45;
  --surface: #16162b;
  --text: #e8e8ef;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --border: rgba(255,255,255,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: Optima, 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--charcoal);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.back-link:hover { color: var(--teal-light); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand img { width: 36px; height: 36px; }
.brand h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--teal-light);
  letter-spacing: 0.02em;
}
.brand-tag {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--teal-bg);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-spacer { flex: 1; }
.data-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Controls Bar ── */
.controls-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
}
.controls-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  gap: 0;
  background: var(--charcoal);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text); background: var(--teal-bg); }
.filter-btn.active {
  background: var(--teal);
  color: #fff;
}
.toggle-group {
  display: flex;
  gap: 0;
  background: var(--charcoal);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-left: auto;
}

/* ── Main Content ── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

/* ── Stats Strip ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--teal);
  border-radius: 2px 0 0 2px;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.stat-change {
  font-size: 0.82rem;
  margin-top: 0.35rem;
  font-weight: 500;
}
.stat-change.up { color: var(--red); }
.stat-change.down { color: var(--green); }
.stat-change.flat { color: var(--amber); }
.stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ── Chart Panels ── */
.chart-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-grid.full { grid-template-columns: 1fr; }
.chart-grid.half { grid-template-columns: 1fr 1fr; }
.chart-grid.third { grid-template-columns: 2fr 1fr; }

.chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.chart-panel h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.chart-panel .chart-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.chart-container {
  position: relative;
  width: 100%;
}
.chart-container.tall { height: 380px; }
.chart-container.medium { height: 300px; }
.chart-container.short { height: 240px; }

/* ── YoY Comparison ── */
.yoy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}
.yoy-card {
  background: var(--charcoal);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.yoy-year {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.yoy-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.3rem 0;
}
.yoy-change {
  font-size: 0.78rem;
  font-weight: 500;
}

/* ── State Bars ── */
.state-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.state-label {
  width: 36px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}
.state-bar-track {
  flex: 1;
  height: 24px;
  background: var(--charcoal);
  border-radius: 4px;
  overflow: hidden;
}
.state-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 2px;
}
.state-bar-value {
  width: 50px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
}

/* ── Prediction Panel ── */
.prediction-box {
  background: var(--teal-bg);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-top: 0.5rem;
}
.prediction-label {
  font-size: 0.72rem;
  color: var(--teal-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.prediction-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal-light);
}
.prediction-range {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.prediction-method {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .chart-grid.half,
  .chart-grid.third { grid-template-columns: 1fr; }
  .yoy-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .header-inner { padding: 0; }
  .controls-bar, .main { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 600px) {
  .stats-strip { grid-template-columns: 1fr; }
  .filter-btn { padding: 0.4rem 0.6rem; font-size: 0.72rem; }
}
