/* ══════════════════════════════════════════════════════════════
   Career Performance Reports — Metropole Design System
   Asana-inspired dark theme · Inter · v2.0
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Box Model ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg:              #0F1923;
  --card:            #152231;
  --card-hover:      #1a2a3d;

  /* Borders */
  --border:          #1E3347;
  --border-subtle:   rgba(30, 51, 71, 0.6);

  /* Accent */
  --teal:            #4F98A3;
  --teal-dim:        rgba(79, 152, 163, 0.15);
  --teal-glow:       rgba(79, 152, 163, 0.25);

  /* Semantic */
  --green:           #22c55e;
  --green-alt:       #6DAA45;
  --red:             #ef4444;
  --amber:           #eab308;
  --purple:          #7C6DC7;
  --pink:            #D163A7;

  /* Typography */
  --text:            hsl(40, 4%, 90%);
  --text-secondary:  hsl(220, 5%, 56%);
  --text-muted:      hsl(220, 5%, 40%);

  /* Type scale */
  --font:            'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs:    11px;
  --font-size-sm:    12px;
  --font-size-base:  14px;
  --font-size-md:    15px;
  --font-size-lg:    18px;
  --font-size-xl:    20px;
  --font-size-2xl:   24px;

  /* Shape */
  --radius:          8px;
  --radius-sm:       6px;

  /* Shadow */
  --shadow:          0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-hover:    0 4px 16px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);

  /* Spacing */
  --gap:             16px;
  --gap-lg:          24px;
  --section-gap:     32px;
}

/* ══════════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════════ */

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size-base);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--teal);
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ══════════════════════════════════════════════════════════════ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.35s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.loader-sub {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════════
   ARTIST SELECTION PAGE
   ══════════════════════════════════════════════════════════════ */

.page {
  padding: 0;
}

.select-page-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 0;
}

.select-logo {
  margin-bottom: 14px;
  display: block;
}

.select-subtitle {
  font-size: var(--font-size-xs);
  letter-spacing: 0.18em;
  color: var(--teal);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 48px;
}

.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  max-width: 820px;
  width: 100%;
}

.artist-grid-loading {
  text-align: center;
  color: var(--text-secondary);
  grid-column: 1 / -1;
  padding: 32px;
  font-size: var(--font-size-sm);
}

.select-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 48px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   REPORT HEADER
   ══════════════════════════════════════════════════════════════ */

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.report-header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.back-btn:hover {
  border-color: var(--teal);
  color: var(--text);
  background: var(--teal-dim);
}

.report-title {
  min-width: 0;
}

.report-title h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.report-date-text {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
  letter-spacing: 0.02em;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-pdf:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #0F1923;
}

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */

.report-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.report-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tab:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   TAB CONTENT & PANELS
   ══════════════════════════════════════════════════════════════ */

.tab-content {
  padding: var(--gap-lg);
  max-width: 1400px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   SECTION HEADINGS
   ══════════════════════════════════════════════════════════════ */

.section-heading {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--gap);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.01em;
}

section + section {
  margin-top: var(--section-gap);
}

/* ══════════════════════════════════════════════════════════════
   GENERIC CARD BASE
   ══════════════════════════════════════════════════════════════ */

/* Wide selector — applies base card style to all card variants */
.card,
.card-sm,
[class*="-card"],
.stat-card,
.platform-card,
.chart-card,
.gauge-card,
.rank-item,
.ranks-card,
.streaming-card,
.donut-card,
.engagement-card,
.ig-post-card,
.spotify-kpi > div,
.beatport-kpis > div > div {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

/* Hover glow for interactive cards */
.card:hover,
.platform-card:hover,
.chart-card:hover,
.gauge-card:hover,
.rank-item:hover,
.streaming-card:hover,
.ig-post-card:hover {
  border-color: rgba(79, 152, 163, 0.4);
  box-shadow: var(--shadow-hover), 0 0 0 1px var(--teal-dim);
  background: var(--card-hover);
}

/* Ensure nested .card inside wrappers don't double-border */
.gauge-card .card,
.rank-item .card,
.platform-card .card,
.streaming-card .card,
.spotify-kpi .card,
.beatport-kpis .card {
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}

/* Padding variants */
.card {
  padding: var(--gap);
}

.card-sm {
  padding: 12px 14px;
}

/* ══════════════════════════════════════════════════════════════
   CAREER OVERVIEW — GAUGES
   ══════════════════════════════════════════════════════════════ */

.gauges-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
  align-items: stretch;
}

.gauge-card {
  flex: 1 1 180px;
  max-width: 220px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 16px;
  text-align: center;
}

.gauge-card .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  width: 100%;
}

.gauge-svg {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}

.gauge-label {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-top: 4px;
}

.gauge-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* SVG text inherits font */
svg text {
  font-family: var(--font);
}

/* ── Ranks Card ── */
.ranks-card {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding: var(--gap);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rank-item {
  flex: 1 1 140px;
  min-width: 120px;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0;
}

.rank-item .card-sm,
.rank-item .card {
  background: rgba(30, 51, 71, 0.35) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
  width: 100%;
}

.rank-item .card-sm:hover,
.rank-item .card:hover {
  border-color: rgba(79, 152, 163, 0.35) !important;
  background: rgba(79, 152, 163, 0.08) !important;
}

.rank-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.rank-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.rank-change {
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-top: 5px;
}

.rank-change.up   { color: var(--green-alt); }
.rank-change.down { color: var(--red); }
.rank-change.flat { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   PLATFORM CARDS
   ══════════════════════════════════════════════════════════════ */

.platform-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}

.platform-card {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.platform-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-icon svg {
  width: 22px;
  height: 22px;
}

.platform-name {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ── Metric rows (inside platform cards) ── */
.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.metric-row:last-of-type {
  border-bottom: none;
}

.metric-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}

.metric-value {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.metric-delta {
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-left: 4px;
}

.metric-delta.up   { color: var(--green-alt); }
.metric-delta.down { color: var(--red); }

/* ── Sparkline ── */
.sparkline-container {
  margin-top: 12px;
  height: 48px;
  overflow: hidden;
}

.sparkline-container canvas {
  height: 48px !important;
  max-height: 48px;
}

/* ══════════════════════════════════════════════════════════════
   KPI ITEMS (inside streaming/Spotify cards)
   ══════════════════════════════════════════════════════════════ */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: rgba(30, 51, 71, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.kpi-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.kpi-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-sub .up   { color: var(--green-alt); font-weight: 600; }
.kpi-sub .down { color: var(--red); font-weight: 600; }

.up   { color: var(--green-alt); }
.down { color: var(--red); }
.flat { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   CHART CONTAINERS
   ══════════════════════════════════════════════════════════════ */

.chart-card {
  padding: var(--gap);
  overflow: hidden;
}

.chart-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 240px;
}

.chart-lg {
  position: relative;
  width: 100%;
}

.chart-lg canvas {
  width: 100% !important;
  height: 240px !important;
}

canvas {
  max-width: 100%;
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   GRID LAYOUTS
   ══════════════════════════════════════════════════════════════ */

.streaming-grid,
.overview-grid,
.ig-charts-grid,
.tiktok-charts-grid,
.spotify-grid,
.beatport-grid,
.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--gap);
}

.ig-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

/* ══════════════════════════════════════════════════════════════
   STREAMING CARDS (Spotify / SoundCloud containers)
   ══════════════════════════════════════════════════════════════ */

.streaming-card {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.streaming-card .card {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════
   OVERVIEW / DONUT / ENGAGEMENT CARDS
   ══════════════════════════════════════════════════════════════ */

.donut-card {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
}

.donut-card .card {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.donut-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.donut-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.donut-total {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.donut-total-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.engagement-card {
  padding: var(--gap);
}

.engagement-card .card {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ── Benchmark bars (platform share) ── */
.benchmark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.benchmark-platform {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
}

.benchmark-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.benchmark-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.benchmark-value {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════
   SPOTIFY DETAIL TAB
   ══════════════════════════════════════════════════════════════ */

.spotify-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: var(--gap);
}

.spotify-kpi {
  display: flex;
  flex-direction: column;
}

.spotify-kpi .card,
.spotify-kpi .card-sm {
  background: rgba(30, 51, 71, 0.35) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
  border-radius: var(--radius-sm) !important;
  height: 100%;
}

.spotify-kpi .card:hover,
.spotify-kpi .card-sm:hover {
  border-color: rgba(79, 152, 163, 0.35) !important;
  background: rgba(79, 152, 163, 0.08) !important;
}

/* ══════════════════════════════════════════════════════════════
   BEATPORT SECTION
   ══════════════════════════════════════════════════════════════ */

.beatport-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: var(--gap);
}

.beatport-kpis > div {
  display: flex;
  flex-direction: column;
}

.beatport-kpis .card,
.beatport-kpis .card-sm {
  background: rgba(30, 51, 71, 0.35) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
  border-radius: var(--radius-sm) !important;
  text-align: center;
  height: 100%;
}

/* ══════════════════════════════════════════════════════════════
   INSTAGRAM POSTS GRID
   ══════════════════════════════════════════════════════════════ */

.ig-post-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ig-post-card .card {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.ig-post-img {
  background: #1a1a2e;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  position: relative;
}

.ig-post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(21, 34, 49, 0.95);
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
}

.ig-post-likes {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--teal);
}

.ig-post-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.ig-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

/* ══════════════════════════════════════════════════════════════
   AUDIENCE / DEMOGRAPHICS
   ══════════════════════════════════════════════════════════════ */

/* ── Age/Gender bar charts ── */
.demo-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.demo-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-bar-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 36px;
  flex-shrink: 0;
}

.demo-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.demo-bar-male {
  height: 100%;
  background: var(--teal);
  border-radius: 4px 0 0 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-bar-female {
  height: 100%;
  background: var(--pink);
  border-radius: 0 4px 4px 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-bar-pct {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Country bars ── */
.country-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.country-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.country-bar-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 100px;
  flex-shrink: 0;
}

.country-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.country-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.country-bar-value {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════
   CITIES TABLE (Beatport)
   ══════════════════════════════════════════════════════════════ */

.cities-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  margin-top: 12px;
}

.cities-table th {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cities-table td {
  padding: 8px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.cities-table tr:last-child td {
  border-bottom: none;
}

.cities-table tr:hover td {
  background: rgba(79, 152, 163, 0.05);
  color: var(--text);
}

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-success {
  background: rgba(109, 170, 69, 0.2);
  color: var(--green-alt);
  border: 1px solid rgba(109, 170, 69, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */

.site-footer {
  padding: var(--gap-lg);
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: 48px;
  letter-spacing: 0.02em;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--teal);
}

/* ══════════════════════════════════════════════════════════════
   LEGACY COMPATIBILITY (elements hidden by design)
   ══════════════════════════════════════════════════════════════ */

.section-inner { /* no longer needed */ }
.section       { /* basic reset */ }
.section-tall  { /* ignore */ }
.nav-dots      { display: none !important; }
.top-bar       { display: none !important; }
.section-cover { display: none !important; }
.section-contact { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (768px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .streaming-grid,
  .overview-grid,
  .ig-charts-grid,
  .tiktok-charts-grid,
  .spotify-grid,
  .beatport-grid,
  .audience-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .platform-cards-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (768px and below)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --gap:    12px;
    --gap-lg: 16px;
    --section-gap: 24px;
  }

  .report-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .report-header-left {
    flex: 1;
    min-width: 0;
    gap: 12px;
  }

  .report-title h1 {
    font-size: 18px;
    line-height: 1.25;
  }

  .report-date-text {
    font-size: 11px;
  }

  .btn-pdf {
    font-size: 12px;
    padding: 6px 12px;
  }

  .tab-content {
    padding: 16px;
  }

  /* Gauges: 2 across on mobile, last one centered if odd */
  .gauges-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    justify-items: center;
  }

  .gauge-card {
    flex: unset;
    max-width: 100%;
    min-width: unset;
    width: 100%;
  }

  /* Center the last gauge if odd number */
  .gauges-row .gauge-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 50%;
  }

  .ranks-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .rank-item {
    flex: unset;
    min-width: unset;
  }

  .streaming-grid,
  .overview-grid,
  .ig-charts-grid,
  .tiktok-charts-grid,
  .spotify-grid,
  .beatport-grid,
  .audience-grid {
    grid-template-columns: 1fr;
  }

  .platform-cards-row {
    grid-template-columns: 1fr;
  }

  .ig-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .spotify-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .beatport-kpis {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .chart-lg canvas {
    height: 180px !important;
  }

  .chart-container canvas {
    max-height: 180px;
  }
}

@media (max-width: 420px) {
  .gauges-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .ranks-card {
    grid-template-columns: repeat(2, 1fr);
  }

  .ig-posts-grid {
    grid-template-columns: 1fr;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .spotify-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .beatport-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════════════════════════
   PRINT / PDF EXPORT — Light mode override
   ══════════════════════════════════════════════════════════════ */

@media print {
  :root {
    --bg:            #ffffff;
    --card:          #f5f7fa;
    --card-hover:    #f5f7fa;
    --border:        #d0d7e2;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --text:          #1a1f2e;
    --text-secondary: #4a5568;
    --text-muted:    #718096;
    --teal:          #2e7d8a;
    --teal-dim:      rgba(46, 125, 138, 0.1);
    --shadow:        none;
    --shadow-hover:  none;
  }

  html, body {
    background: #ffffff !important;
    color: #1a1f2e !important;
  }

  #mpt-switcher,
  .report-tabs,
  .back-btn,
  .btn-pdf,
  .site-footer,
  .loading-overlay {
    display: none !important;
  }

  .report-header {
    position: static;
    border-bottom-color: #d0d7e2;
    background: transparent;
  }

  .report-title h1 {
    color: #1a1f2e !important;
  }

  .tab-panel {
    display: block !important;
    page-break-inside: avoid;
  }

  .tab-content {
    padding: 0;
  }

  section {
    page-break-inside: avoid;
    margin-bottom: 24px;
  }

  .section-heading {
    color: #1a1f2e;
    border-bottom-color: #d0d7e2;
  }

  .card,
  [class*="-card"],
  .rank-item .card,
  .kpi-item {
    background: #f5f7fa !important;
    border-color: #d0d7e2 !important;
    box-shadow: none !important;
  }

  canvas {
    max-height: 220px;
  }

  .chart-lg canvas {
    height: 200px !important;
  }

  .gauge-svg {
    max-width: 140px;
  }

  .streaming-grid,
  .overview-grid,
  .ig-charts-grid,
  .tiktok-charts-grid,
  .spotify-grid,
  .beatport-grid,
  .audience-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
