/* ═══════════════════════════════════════════════════════════════
   The VC Corner Dashboard - Landscape-first, zoom-safe (all px)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-void: #0A0A0B;
  --bg-base: #111113;
  --bg-raised: #18181B;
  --bg-card: #1C1C20;
  --bg-hover: #232328;
  --border: #2A2A30;
  --border-subtle: #222228;
  --text-primary: #E8E8EC;
  --text-secondary: #9898A0;
  --text-tertiary: #68686F;
  --text-muted: #48484E;
  --accent: #C8A96E;
  --accent-dim: rgba(200,169,110,0.12);
  --accent-glow: rgba(200,169,110,0.06);
  --green: #34D399;
  --green-dim: rgba(52,211,153,0.12);
  --red: #F87171;
  --red-dim: rgba(248,113,113,0.12);
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ─── Upload Screen - Split-Screen Hero ─── */
#upload-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  background: var(--bg-void);
}

/* Animated grid background */
.upload-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(200,169,110,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(200,169,110,0.07) 1px, transparent 1px);
  background-size: 56px 56px;
}

.upload-grid-bg::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 22%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,110,0.10) 0%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from { transform: translate(-50%, -50%) scale(0.95); opacity: 1; }
  to   { transform: translate(-50%, -50%) scale(1.05); opacity: 0.6; }
}

/* Left branding panel */
.upload-left {
  flex: 0 0 45%;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px 48px 64px;
}

.upload-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 28px;
  filter: drop-shadow(0 0 32px rgba(200,169,110,0.25));
}

.upload-heading {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 10px;
}

.upload-tagline {
  color: var(--text-tertiary);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 24px;
}

.upload-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

/* Right upload panel */
.upload-right {
  flex: 0 0 55%;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 64px 48px 40px;
}

#drop-zone {
  padding: 36px 32px 28px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  cursor: pointer;
  transition: all 0.35s var(--ease);
  position: relative;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 60px var(--accent-glow), inset 0 0 60px var(--accent-glow);
  transform: translateY(-3px);
}

.drop-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--text-tertiary);
  margin-bottom: 16px;
  transition: all 0.35s var(--ease);
}

#drop-zone:hover .drop-ring {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 24px var(--accent-dim);
}

.drop-ring svg {
  width: 26px;
  height: 26px;
}

#drop-zone h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#drop-zone p {
  color: var(--text-tertiary);
  font-size: 13px;
}

.drop-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg-void);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

#error-msg {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.download-template {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.download-template:hover {
  color: var(--accent);
}

.download-template svg {
  opacity: 0.7;
}

.download-template:hover svg {
  opacity: 1;
}

/* ─── Dashboard Nav ─── */
#dashboard-screen {
  display: none;
  min-height: 100vh;
  background: var(--bg-void);
}

.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 42px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

#back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-badge {
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─── Dashboard Container ─── */
#dashboard {
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 20px 24px;
}

/* ─── Header Card ─── */
.dash-header {
  position: relative;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.dash-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}

.dash-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.dash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

/* ─── KPI Strip ─── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.kpi-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  border-color: var(--border);
  background: var(--bg-card);
}

.kpi-label {
  font-size: 9px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  margin-left: 4px;
  vertical-align: middle;
  padding: 1px 4px;
  border-radius: 3px;
}

.trend-up {
  color: var(--green);
  background: var(--green-dim);
}

.trend-down {
  color: var(--red);
  background: var(--red-dim);
}

/* ─── Chart Grid - 3-column landscape ─── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ─── Section Card ─── */
.section-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--section-accent, transparent);
  border-radius: var(--radius);
  padding: 12px;
  transition: border-color 0.25s;
}

.section-card:hover {
  border-color: var(--border);
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─── Chart Legend (HTML, outside canvas) ─── */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  padding: 2px 0;
  margin-bottom: 4px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.75;
  white-space: nowrap;
}

.chart-legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-wrap {
  height: 190px;
  margin-bottom: 6px;
  position: relative;
}

/* ─── Table Toggle ─── */
.table-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 auto;
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 500;
  font-family: var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  width: 100%;
}

.table-toggle:hover {
  background: var(--bg-hover, rgba(0,0,0,0.03));
  color: var(--text-secondary);
}

.table-toggle svg {
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
}

.table-toggle:hover svg {
  opacity: 0.8;
}

.table-toggle.is-open svg {
  transform: rotate(180deg);
}

/* ─── Data Table ─── */
.data-table {
  margin-top: 8px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table thead th {
  background: var(--bg-card);
  color: var(--text-tertiary);
  padding: 5px 8px;
  text-align: right;
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table thead th:first-child {
  text-align: left;
}

.data-table tbody td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tbody td.row-label {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font);
  font-size: 11px;
}

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

.data-table tbody tr:hover td {
  background: var(--bg-hover);
}

.data-table tbody tr.row-total {
  background: var(--bg-card);
}

.data-table tbody tr.row-total td {
  color: var(--text-primary);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.data-table tbody tr.row-total td.row-label {
  color: var(--text-primary);
}

.data-table tbody tr.row-pct td {
  color: var(--text-muted);
  font-style: italic;
}

.data-table tbody tr.row-formula td {
  color: var(--text-secondary);
}

/* ─── Privacy Badge ─── */
.privacy-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  border-top: 1px solid var(--border-subtle);
}

.privacy-badge svg {
  flex-shrink: 0;
  opacity: 0.5;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg-void: #F5F5F7;
  --bg-base: #FFFFFF;
  --bg-raised: #FFFFFF;
  --bg-card: #FAFAFA;
  --bg-hover: #F0F0F2;
  --border: #D4D4D8;
  --border-subtle: #E4E4E8;
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-muted: #9CA3AF;
  --accent: #6B6B76;
  --accent-dim: rgba(107,107,118,0.10);
  --accent-glow: rgba(107,107,118,0.06);
  --green: #059669;
  --green-dim: rgba(5,150,105,0.10);
  --red: #DC2626;
  --red-dim: rgba(220,38,38,0.10);
}

[data-theme="light"] .upload-grid-bg {
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px);
}

[data-theme="light"] .upload-grid-bg::after {
  background: radial-gradient(circle, rgba(107,107,118,0.08) 0%, transparent 70%);
}

[data-theme="light"] .dash-nav {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="light"] .section-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

[data-theme="light"] .kpi-card {
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

[data-theme="light"] .upload-logo {
  filter: drop-shadow(0 0 32px rgba(107,107,118,0.15));
}

/* ─── Theme Controls (nav-center) ─── */
.nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.theme-toggle-btn:hover {
  color: var(--text-secondary);
}

.theme-toggle-btn.active {
  background: var(--accent);
  color: var(--bg-void);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Palette Picker */
.palette-picker {
  position: relative;
}

.palette-picker-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.palette-picker-btn:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}

.palette-picker-btn.open {
  border-color: var(--accent);
}

.palette-picker-btn svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.palette-picker-btn.open svg {
  transform: rotate(180deg);
}

.palette-picker-swatches,
.palette-option-swatches {
  display: flex;
  align-items: center;
  gap: 3px;
}

.palette-swatch-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.palette-picker-label,
.palette-option-label {
  line-height: 1;
}

.palette-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s var(--ease);
  z-index: 300;
}

.palette-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.palette-option {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.palette-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.palette-option.active {
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* ─── No-animate helper ─── */
.no-animate .dash-header,
.no-animate .kpi-strip,
.no-animate .chart-grid,
.no-animate .section-card,
.no-animate .kpi-card {
  animation: none !important;
}

/* ─── Entrance Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dash-header { animation: fadeUp 0.5s var(--ease) both; }
.kpi-strip { animation: fadeUp 0.5s var(--ease) 0.06s both; }
.chart-grid { animation: fadeIn 0.6s var(--ease) 0.12s both; }

.section-card {
  animation: fadeUp 0.4s var(--ease) both;
}
.section-card:nth-child(1) { animation-delay: 0.08s; }
.section-card:nth-child(2) { animation-delay: 0.12s; }
.section-card:nth-child(3) { animation-delay: 0.16s; }
.section-card:nth-child(4) { animation-delay: 0.20s; }
.section-card:nth-child(5) { animation-delay: 0.24s; }
.section-card:nth-child(6) { animation-delay: 0.28s; }
.section-card:nth-child(7) { animation-delay: 0.32s; }
.section-card:nth-child(8) { animation-delay: 0.36s; }
.section-card:nth-child(9) { animation-delay: 0.40s; }
.section-card:nth-child(10) { animation-delay: 0.44s; }

.kpi-card {
  animation: fadeUp 0.35s var(--ease) both;
}
.kpi-card:nth-child(1) { animation-delay: 0.04s; }
.kpi-card:nth-child(2) { animation-delay: 0.07s; }
.kpi-card:nth-child(3) { animation-delay: 0.10s; }
.kpi-card:nth-child(4) { animation-delay: 0.13s; }
.kpi-card:nth-child(5) { animation-delay: 0.16s; }
.kpi-card:nth-child(6) { animation-delay: 0.19s; }
.kpi-card:nth-child(7) { animation-delay: 0.22s; }
.kpi-card:nth-child(8) { animation-delay: 0.25s; }

/* ─── Responsive breakpoints ─── */

@media (max-width: 1100px) {
  .chart-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #dashboard {
    padding: 10px 12px 24px;
  }
}

@media (max-width: 768px) {
  #upload-screen {
    flex-direction: column;
  }
  .upload-left,
  .upload-right {
    flex: none;
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .upload-left {
    padding: 40px 24px 24px;
  }
  .upload-right {
    padding: 0 24px 40px;
  }
  .upload-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
  }
  .upload-heading {
    font-size: 28px;
  }
  .upload-pills {
    justify-content: center;
  }
  .upload-grid-bg::after {
    left: 50%;
    width: 300px;
    height: 300px;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  #dashboard {
    padding: 8px;
  }
  .dash-header {
    padding: 14px;
  }
  .dash-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-title {
    font-size: 16px;
  }
  .dash-nav {
    padding: 0 10px;
  }
  .nav-center {
    gap: 5px;
  }
  .palette-picker-label {
    display: none;
  }
}

@media (max-width: 600px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-value {
    font-size: 15px;
  }
  .chart-wrap {
    height: 160px;
  }
}

@media (min-width: 1920px) {
  .chart-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ─── Category Group Headers ─── */
.category-group-header {
  grid-column: 1 / -1;
  position: sticky;
  top: 42px;
  z-index: 150;
  padding: 5px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-variant: small-caps;
  color: var(--text-tertiary);
  background: rgba(10,10,11,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 6px;
}

[data-theme="light"] .category-group-header {
  background: rgba(245,245,247,0.85);
}

/* ─── YoY Badge ─── */
.yoy-badge {
  font-size: 9px;
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  white-space: nowrap;
}

.yoy-badge.positive {
  background: var(--green-dim);
  color: var(--green);
}

.yoy-badge.negative {
  background: var(--red-dim);
  color: var(--red);
}

/* ─── Radar Scorecard Card ─── */
.radar-scorecard-card {
  grid-column: 1 / -1;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
  animation: fadeUp 0.5s var(--ease) 0.1s both;
}

.radar-scorecard-card .radar-chart-wrap {
  height: 200px;
  position: relative;
}

.radar-scorecard-card .radar-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-score-display {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.radar-score-display small {
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.radar-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radar-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.radar-metric-row .metric-val {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .radar-scorecard-card {
    grid-template-columns: 1fr;
  }
}

/* ─── Gauge Container ─── */
.gauge-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* ─── Donut + KPI Grid ─── */
.donut-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ─── Export PDF Button ─── */
.export-pdf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  margin-right: 8px;
}

.export-pdf-btn:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}

.export-pdf-btn svg {
  width: 13px;
  height: 13px;
}

/* ─── No-animate - also cover new elements ─── */
.no-animate .section-card,
.no-animate .kpi-card,
.no-animate .radar-scorecard-card,
.no-animate .category-group-header {
  animation: none !important;
}

/* ─── Print Mode ─── */
@media print {
  .dash-nav,
  .export-pdf-btn,
  .table-toggle,
  .theme-toggle,
  .palette-picker,
  .upload-grid-bg,
  #upload-screen,
  #back-btn {
    display: none !important;
  }

  body, html {
    background: #fff !important;
    color: #000 !important;
  }

  #dashboard-screen {
    display: block !important;
  }

  #dashboard {
    max-width: 100% !important;
    padding: 10px !important;
  }

  .chart-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .section-card,
  .kpi-card,
  .dash-header,
  .radar-scorecard-card {
    background: #fff !important;
    border-color: #ddd !important;
    box-shadow: none !important;
    animation: none !important;
    break-inside: avoid;
  }

  .section-title,
  .kpi-label,
  .kpi-value,
  .chart-legend-item,
  .dash-title,
  .meta-tag,
  .privacy-badge,
  .category-group-header {
    color: #000 !important;
    opacity: 1 !important;
  }

  .privacy-badge {
    border-top-color: #ddd !important;
  }
}

.print-mode .dash-nav,
.print-mode .export-pdf-btn,
.print-mode .table-toggle,
.print-mode .theme-toggle,
.print-mode .palette-picker,
.print-mode #back-btn {
  display: none !important;
}

.print-mode .chart-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

.print-mode .section-card,
.print-mode .kpi-card,
.print-mode .dash-header,
.print-mode .radar-scorecard-card {
  animation: none !important;
}
