.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar__launch-id { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }

.topbar__live {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--positive);
}

.topbar__live-dot.pulse { animation: pulse 0.6s ease-out; }
.topbar__live-dot.stale { background: var(--warning); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.topbar__nav {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  font-size: 13px;
}

.topbar__nav a { color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.topbar__nav a:hover { color: var(--text-primary); }

.module {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  scroll-margin-top: 60px;
  position: relative;
}

.module__header { margin: 0 0 var(--space-4) 0; }

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.module__title { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; margin: 0; letter-spacing: -0.01em; }

/* Brilhos ambiente atrás do topo da página — decoração sutil, fixos em relação ao
   viewport pra não repetir a cada seção numa página longa de scroll. */
.orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.orb--1 { width: 620px; height: 620px; top: -220px; left: 8%; background: radial-gradient(circle, rgba(79, 142, 247, 0.14) 0%, transparent 70%); }
.orb--2 { width: 420px; height: 420px; top: -80px; right: 5%; background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.chart-card--wide { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .module { padding: var(--space-4) var(--space-3); }
  .kpi-card__value { font-size: 22px; }
  .topbar__nav { font-size: 12px; gap: var(--space-2); }
  .orb--1, .orb--2 { width: 280px; height: 280px; filter: blur(60px); }
  .chart-card__canvas-wrap { height: 220px; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media print {
  /* Redefine os tokens de cor pro fundo branco — como quase todo elemento usa essas
     variáveis (não classes com cor fixa), isso corrige o contraste da página inteira
     de uma vez, sem precisar sobrescrever componente por componente. */
  :root {
    --bg-base: #ffffff;
    --bg-elevated: #f2f2f2;
    --bg-card: #ffffff;
    --border-subtle: #cccccc;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-tertiary: #555555;
  }
  .topbar, .filters-bar, .no-print, .orb { display: none !important; }
  .module { page-break-inside: avoid; padding: var(--space-4) 0; }
  .chart-card__export { display: none; }
  canvas { max-width: 100%; }
}
