/* ==========================================================================
   RADAR FISCAL | OSORIO AI LABS — DESIGN SYSTEM & MODERN UI
   Paleta oficial: fiscal.osorioailabs.com.br / www.osorioailabs.social.br
   ========================================================================== */

:root {
  /* Core Palette - Osorio AI Labs */
  --bg-deep: #0f0f14;
  --bg-base: #1a1a24;
  --card-bg: #1e1e2c;
  --card-light: #252535;
  --card-glass: rgba(30, 30, 44, 0.72);
  --accent: #00bfff;
  --accent2: #0080c8;
  --accent-glow: rgba(0, 191, 255, 0.25);
  --accent-soft: rgba(0, 191, 255, 0.08);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --text-dim: #646482;
  --border: rgba(0, 191, 255, 0.14);
  --border-strong: rgba(0, 191, 255, 0.35);

  /* Semantic & Chart Colors */
  --dp-bruta: #00bfff;
  --dp-liquida: #a855f7;
  --dp-inflacao: #f59e0b;
  --dp-selic: #f43f5e;
  --dp-juroreal: #10b981;

  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.3);

  --crimson: #ef4444;
  --crimson-bg: rgba(239, 68, 68, 0.12);
  --crimson-border: rgba(239, 68, 68, 0.3);

  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.3);

  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.12);
  --purple-border: rgba(168, 85, 247, 0.3);

  /* Layout & Typography */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 24px;
  --nav-height: 76px;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background-color: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #2a2a3d;
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================================================
   ANIMATED BACKGROUND — PARTICLES & RADIAL GLOW
   ========================================================================== */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 25% 18%, var(--accent-glow) 0%, transparent 45%),
    radial-gradient(ellipse at 75% 82%, rgba(0, 128, 200, 0.14) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
  animation: glowPulse 9s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0%   { opacity: 0.65; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.06); }
}

/* ==========================================================================
   GLASSMORPHISM NAVBAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(15, 15, 20, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 64px);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(15, 15, 20, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(0, 191, 255, 0.2);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
  transition: transform 0.3s ease;
}

.navbar-brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.06);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.12rem;
  letter-spacing: -0.4px;
}

.brand-title span {
  color: var(--accent);
}

.brand-sub {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  background: rgba(26, 26, 36, 0.75);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-tab-btn i {
  font-size: 0.82rem;
  opacity: 0.8;
}

.nav-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab-btn.active {
  color: #fff;
  font-weight: 500;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 0 22px rgba(0, 191, 255, 0.35);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

.edition-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 191, 255, 0.08);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edition-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.mobile-toggle {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ==========================================================================
   MAIN CONTAINER & VIEW TRANSITIONS
   ========================================================================== */
main {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
  min-height: calc(100vh - 120px);
}

.view-section {
  display: none;
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 48px) 80px;
  animation: viewFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   REUSABLE HERO & SECTION HEADERS
   ========================================================================== */
.section-hero {
  text-align: center;
  max-width: 860px;
  margin: 12px auto 44px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  background: rgba(0, 191, 255, 0.06);
}

.section-hero h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3.35rem);
  line-height: 1.14;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #60efff 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-hero p {
  font-size: clamp(0.98rem, 1.5vw, 1.14rem);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 26px rgba(0, 191, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 42px rgba(0, 191, 255, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  background: rgba(0, 191, 255, 0.04);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(0, 191, 255, 0.12);
  box-shadow: 0 0 28px rgba(0, 191, 255, 0.28);
}

/* Spotlight Glass Card */
.glass-card {
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(0, 191, 255, 0.07),
    transparent 40%
  );
  pointer-events: none;
  z-index: 0;
}

.glass-card > * {
  position: relative;
  z-index: 1;
}

.glass-card:hover {
  border-color: rgba(0, 191, 255, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 25px rgba(0, 191, 255, 0.08);
}

/* ==========================================================================
   VIEW 1: DÍVIDA PÚBLICA (1994 - 2026) + NOVOS GRÁFICOS & SIMULADOR
   ========================================================================== */

/* Top Live KPI Strip */
.kpi-grid-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.kpi-box {
  background: linear-gradient(160deg, var(--card-bg) 0%, rgba(26, 26, 36, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.kpi-box:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.kpi-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--kpi-color, var(--accent));
}

.kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2rem;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Series Toggles & Mandate Quick Filter */
.chart-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dp-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dp-toggle .swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 8px var(--sw);
  opacity: 0.45;
  transition: all 0.25s ease;
}

.dp-toggle.active {
  color: var(--text);
  border-color: var(--sw);
  background: rgba(30, 30, 44, 0.95);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.3);
}

.dp-toggle.active .swatch {
  opacity: 1;
  transform: scale(1.15);
}

.mandate-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mandate-pill {
  padding: 6px 13px;
  font-size: 0.78rem;
  border-radius: 999px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mandate-pill:hover,
.mandate-pill.active {
  color: #fff;
  border-color: var(--accent);
  background: rgba(0, 191, 255, 0.14);
}

/* Mandate Info Banner when selected */
.mandate-banner {
  background: rgba(0, 191, 255, 0.07);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
}

.mandate-banner.visible {
  display: flex;
}

/* Chart Card & SVG Stage */
.chart-card {
  margin-bottom: 36px;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.chart-header h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  letter-spacing: -0.4px;
}

.chart-subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: rgba(0, 191, 255, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.svg-chart-container {
  position: relative;
  width: 100%;
  height: 430px;
  user-select: none;
}

.svg-chart-container svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Interactive Floating Tooltip */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 14px 16px;
  min-width: 230px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 191, 255, 0.2);
  z-index: 50;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  font-size: 0.84rem;
}

.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tt-year {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--accent);
}

.tt-gov {
  font-size: 0.74rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
}

.tt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 5px 0;
}

.tt-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}

.tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tt-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.tt-milestone {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 191, 255, 0.25);
  font-size: 0.76rem;
  color: #60efff;
}

/* Historical Milestones Strip */
.milestones-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 2px 6px;
  margin-top: 14px;
}

.milestone-chip {
  flex: 0 0 auto;
  background: rgba(26, 26, 36, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 240px;
}

.milestone-chip:hover {
  border-color: var(--accent);
  background: rgba(0, 191, 255, 0.08);
  transform: translateY(-2px);
}

.milestone-chip strong {
  color: var(--accent);
  font-family: var(--font-mono);
  margin-right: 6px;
}

/* Juros vs Déficit KPI Trio */
.flow-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.flow-kpi-card {
  background: rgba(26, 26, 36, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.flow-kpi-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.flow-kpi-num {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.1rem;
  margin: 6px 0;
}

.flow-kpi-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* New Enriched Charts Grid (Composition, Holders, International) */
.enriched-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.hbar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.hbar-item {
  background: rgba(15, 15, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s ease;
}

.hbar-item:hover {
  border-color: var(--border-strong);
}

.hbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 7px;
}

.hbar-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hbar-pct {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.hbar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hbar-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Interactive Debt Simulator 2027-2030 */
.simulator-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.45fr;
  gap: 28px;
  align-items: center;
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sim-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.sim-preset-btn {
  padding: 7px 14px;
  font-size: 0.78rem;
  border-radius: 999px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-preset-btn:hover,
.sim-preset-btn.active {
  background: rgba(0, 191, 255, 0.14);
  color: #fff;
  border-color: var(--accent);
}

.slider-group {
  background: rgba(15, 15, 20, 0.55);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.slider-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

input[type="range"].cyber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #2a2a3d;
  border-radius: 999px;
  outline: none;
}

input[type="range"].cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"].cyber-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sim-result-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 191, 255, 0.08);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 6px;
}

/* Interactive Historical Table */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
  max-height: 520px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.dp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: right;
}

.dp-table th {
  position: sticky;
  top: 0;
  background: #14141f;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.dp-table th:first-child,
.dp-table td:first-child {
  text-align: left;
}

.dp-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
}

.dp-table tr:hover td {
  background: rgba(0, 191, 255, 0.06);
}

.dp-table td.pos {
  color: var(--emerald);
}

.dp-table td.neg {
  color: var(--crimson);
}

/* ==========================================================================
   VIEW 2: EXPLORAR PROPOSTAS (44 PROPOSTAS + FILTROS CRUZADOS)
   ========================================================================== */
.explorer-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 28px;
  align-items: start;
}

.filters-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  max-height: calc(100vh - var(--nav-height) - 40px);
  overflow-y: auto;
  padding: 22px;
}

.filter-group {
  margin-bottom: 22px;
}

.filter-group-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-input-wrap {
  position: relative;
  margin-bottom: 18px;
}

.search-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.cyber-input {
  width: 100%;
  background: rgba(15, 15, 20, 0.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px 11px 38px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cyber-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 191, 255, 0.2);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  padding: 6px 12px;
  font-size: 0.79rem;
  border-radius: 999px;
  background: rgba(15, 15, 20, 0.6);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: rgba(0, 191, 255, 0.35);
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 500;
  box-shadow: 0 0 14px rgba(0, 191, 255, 0.3);
}

/* Explorer Top Toolbar */
.explorer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px 22px;
}

.cand-Segmented {
  display: inline-flex;
  background: rgba(15, 15, 20, 0.75);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.cand-seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.cand-seg-btn img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.cand-seg-btn.active {
  background: var(--card-light);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Proposal Cards Grid */
.proposals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.proposals-grid.side-by-side {
  grid-template-columns: 1fr 1fr;
}

.prop-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.prop-card:hover {
  transform: translateY(-4px);
}

.prop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.cand-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.85rem;
}

.cand-badge img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent);
}

.party-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.tema-tag {
  font-size: 0.74rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(0, 191, 255, 0.1);
  color: var(--accent);
  border: 1px solid var(--border);
}

.prop-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text);
}

.prop-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.prop-meta-block {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.mini-pill {
  font-size: 0.73rem;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.mini-pill.dep {
  background: rgba(168, 85, 247, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.prop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 0.8rem;
}

.prop-source-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

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

.btn-open-modal {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-open-modal:hover {
  text-decoration: underline;
}

/* ==========================================================================
   VIEW 3: ANÁLISE MACROECONÔMICA (52 MEDIDAS - PRIMÁRIO & PIB)
   ========================================================================== */
.macro-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stacked-bar-wrap {
  margin: 18px 0;
}

.stacked-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stacked-track {
  width: 100%;
  height: 26px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.05);
}

.stacked-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  transition: width 0.6s ease;
}

.macro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.macro-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.macro-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
}

.macro-tag-pill.positiva {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}

.macro-tag-pill.negativa {
  background: var(--crimson-bg);
  color: #f87171;
  border: 1px solid var(--crimson-border);
}

.macro-tag-pill.neutra {
  background: var(--amber-bg);
  color: #fbbf24;
  border: 1px solid var(--amber-border);
}

/* ==========================================================================
   VIEW 4: ENTREVISTAS E SABATINAS (10 CONFRONTOS + 42 DECLARAÇÕES)
   ========================================================================== */
.confrontos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.confronto-q {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin: 12px 0;
  display: flex;
  gap: 10px;
}

.confronto-q i {
  color: var(--accent);
  margin-top: 4px;
}

.quote-box {
  background: rgba(15, 15, 20, 0.65);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.tema-section-block {
  margin-bottom: 36px;
}

.tema-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 18px;
}

.alinhamento-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  margin-top: 12px;
}

.alinhamento-pill.presente {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}

.alinhamento-pill.ausente {
  background: var(--amber-bg);
  color: #fbbf24;
  border: 1px solid var(--amber-border);
}

.alinhamento-pill.conflito {
  background: var(--crimson-bg);
  color: #f87171;
  border: 1px solid var(--crimson-border);
}

/* ==========================================================================
   VIEW 5: PLANOS COMPLETOS & METODOLOGIA CONSTITUCIONAL
   ========================================================================== */
.plans-duo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.plan-hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plan-cand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.plan-cand-header img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.eixos-list {
  list-style: none;
  margin: 16px 0 24px;
}

.eixos-list li {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eixos-list li i {
  color: var(--accent);
  font-size: 0.78rem;
}

/* Modal Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.82);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 191, 255, 0.18);
  position: relative;
  animation: viewFadeIn 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--crimson);
  border-color: var(--crimson);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(15, 15, 20, 0.9);
  padding: 48px clamp(20px, 5vw, 80px);
  text-align: center;
}

.footer-quote {
  max-width: 640px;
  margin: 0 auto 24px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .explorer-layout,
  .simulator-grid,
  .tema-columns-grid,
  .proposals-grid.side-by-side {
    grid-template-columns: 1fr;
  }
  .filters-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .nav-tabs {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(15, 15, 20, 0.97);
    flex-direction: column;
    border-radius: 0;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }
  .nav-tabs.open {
    transform: translateY(0);
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .enriched-grid,
  .plans-duo-grid,
  .confrontos-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   10 NEW ENHANCEMENTS — STYLES (LIGHT THEME, CLOCK, QUIZ, AI, VIABILITY)
   ========================================================================== */

html.light-theme {
  color-scheme: light;
  --bg-deep: #f4f7fb;
  --bg-base: #eaf0f8;
  --card-bg: #ffffff;
  --card-light: #f0f5fc;
  --card-glass: rgba(255, 255, 255, 0.88);
  --accent: #0077b6;
  --accent2: #0096c7;
  --accent-glow: rgba(0, 119, 182, 0.14);
  --text: #111827;
  --text-muted: #4b5563;
  --text-dim: #6b7280;
  --border: rgba(0, 119, 182, 0.18);
  --border-strong: rgba(0, 119, 182, 0.42);
}

html.light-theme .navbar {
  background: rgba(255, 255, 255, 0.88);
}

html.light-theme .nav-tabs {
  background: #e5ecf6;
}

html.light-theme .dp-table th {
  background: #e5ecf6;
  color: #1f2937;
}

html.light-theme .chart-tooltip {
  background: rgba(255, 255, 255, 0.97);
  color: #111827;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

html.light-theme .cyber-input,
html.light-theme .slider-group,
html.light-theme .hbar-item,
html.light-theme .flow-kpi-card,
html.light-theme .quote-box {
  background: #f8fafc;
}

html.light-theme .site-footer {
  background: #e5ecf6;
}

/* Theme & Action Icon Buttons */
.icon-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 191, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.icon-action-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 18px var(--accent-glow);
}

/* Fullscreen Chart Card */
.chart-card.fullscreen-active {
  position: fixed !important;
  inset: 16px !important;
  z-index: 3000 !important;
  margin: 0 !important;
  background: var(--bg-deep) !important;
  overflow-y: auto !important;
  padding: 32px !important;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
}

/* Live Debt Clock Strip */
.debt-clock-banner {
  background: linear-gradient(135deg, rgba(30, 30, 44, 0.92) 0%, rgba(15, 15, 20, 0.96) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  align-items: center;
  box-shadow: 0 0 32px rgba(0, 191, 255, 0.1);
}

html.light-theme .debt-clock-banner {
  background: linear-gradient(135deg, #ffffff 0%, #eef5fc 100%);
}

.clock-item-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clock-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulseDot 1.2s infinite;
}

.clock-item-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.18rem, 2vw, 1.48rem);
  color: var(--accent);
}

.clock-item-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Viability Thermometer Badge on Proposal Cards */
.viab-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.73rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  width: 100%;
}

.viab-dots {
  display: inline-flex;
  gap: 3px;
}

.viab-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.viab-baixa {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}
.viab-baixa .viab-dots span:nth-child(1) { background: #10b981; box-shadow: 0 0 6px #10b981; }

.viab-media {
  background: var(--amber-bg);
  color: #fbbf24;
  border: 1px solid var(--amber-border);
}
.viab-media .viab-dots span:nth-child(1),
.viab-media .viab-dots span:nth-child(2) { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }

.viab-alta {
  background: var(--crimson-bg);
  color: #f87171;
  border: 1px solid var(--crimson-border);
}
.viab-alta .viab-dots span { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

/* Split-Screen Theme Comparison */
.split-theme-block {
  margin-bottom: 28px;
}

.split-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}

.split-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 191, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
}

/* AI Assistant Box */
.ai-assistant-card {
  margin-bottom: 32px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(0, 191, 255, 0.07) 0%, var(--card-glass) 100%);
}

.ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.ai-prompt-chip {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: 999px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-prompt-chip:hover {
  border-color: var(--accent);
  background: rgba(0, 191, 255, 0.14);
  transform: translateY(-2px);
}

.ai-response-box {
  background: rgba(15, 15, 20, 0.65);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 14px;
  display: none;
}

html.light-theme .ai-response-box {
  background: #ffffff;
}

.ai-response-box.visible {
  display: block;
  animation: viewFadeIn 0.3s ease;
}

/* Quiz Match UI */
.quiz-container {
  max-width: 880px;
  margin: 0 auto;
}

.quiz-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.35s ease;
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  background: rgba(15, 15, 20, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.5;
  cursor: pointer;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.22s ease;
}

html.light-theme .quiz-option-btn {
  background: #f8fafc;
}

.quiz-option-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 191, 255, 0.09);
  transform: translateX(4px);
}

.quiz-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 191, 255, 0.14);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .split-theme-grid {
    grid-template-columns: 1fr;
  }
}
