/* ==========================================================================
   TSE - TOTALIZAÇÃO OFICIAL ELEIÇÕES PRESIDENCIAIS 2026
   Painel de Apuração em Tempo Real & Grafo Eleitoral Interativo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg-dark: #070a13;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  
  --cand1-color: #ef4444;
  --cand1-glow: rgba(239, 68, 68, 0.4);
  --cand1-bg: rgba(239, 68, 68, 0.12);

  --cand2-color: #3b82f6;
  --cand2-glow: rgba(59, 130, 246, 0.4);
  --cand2-bg: rgba(59, 130, 246, 0.12);

  --gold-accent: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --tse-yellow: #fbbf24;
  --tse-green: #22c55e;
  --tse-blue: #38bdf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Header de Navegação & Status TSE
   -------------------------------------------------------------------------- */
.tse-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 24px;
}

.header-container {
  max-width: 1720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tse-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e3a8a 0%, #065f46 100%);
  border: 1px solid var(--border-highlight);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tse-title-group h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tse-title-group p {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Indicador AO VIVO */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.05em;
}

.live-badge.historical {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse-glow 1.5s infinite;
}

.live-badge.historical .pulsing-dot {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Barra de Busca Rápida */
.search-wrapper {
  position: relative;
  min-width: 260px;
  max-width: 380px;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--cand2-color);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* Controles de Simulação */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ctrl:hover {
  background: #334155;
  border-color: var(--border-highlight);
  color: #ffffff;
}

.btn-ctrl.btn-live-toggle {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-ctrl.btn-live-toggle.paused {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.btn-ctrl.btn-advance {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.speed-select {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 6px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Container Principal
   -------------------------------------------------------------------------- */
.main-layout {
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   Banner de Escopo Ativo (Breadcrumb de Filtro Geográfico)
   -------------------------------------------------------------------------- */
.scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.scope-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scope-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 6px;
  color: #93c5fd;
}

.scope-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.scope-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  color: #fcd34d;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.scope-reset-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* --------------------------------------------------------------------------
   Jumbotron de Topo (Painel de Urnas e Candidatos)
   -------------------------------------------------------------------------- */
.jumbotron-grid {
  display: grid;
  grid-template-columns: 290px 1fr 340px;
  gap: 16px;
}

@media (max-width: 1280px) {
  .jumbotron-grid {
    grid-template-columns: 1fr;
  }
}

.jumbo-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Card 1: Urnas Apuradas Geral */
.urnas-meter-card {
  align-items: center;
  text-align: center;
}

.urnas-circle-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 10px auto;
}

.circle-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.circle-progress {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 408;
  stroke-dashoffset: 80;
  transition: stroke-dashoffset 0.6s ease-out;
}

.circle-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.urnas-pct-number {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.urnas-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.urnas-stats-footer {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.urnas-stats-footer .stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.urnas-stats-footer .stat-val {
  font-weight: 700;
  color: #ffffff;
}

/* Card 2: Candidatos Presidenciais (Centro Jumbotron) */
.candidates-comparison-card {
  padding: 24px 20px;
  overflow: visible; /* Garante que o badge externamente alinhado apareça com perfeição */
}

.cand-split-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch; /* Ambos os cards esticam para ter exatamente a mesma altura */
  gap: 18px;
  position: relative;
  padding-top: 14px; /* Espaço para o badge externo no topo da moldura */
}

@media (max-width: 768px) {
  .cand-split-container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 20px;
  }
}

.candidate-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  height: 100%; /* Tamanho rigorosamente idêntico */
  min-height: 180px;
}

.candidate-box.cand1 {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.candidate-box.cand2 {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Moldura Dourada Premium no Candidato Líder */
.candidate-box.leading,
.candidate-box.cand1.leading,
.candidate-box.cand2.leading {
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid #fbbf24 !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.38), inset 0 0 16px rgba(245, 158, 11, 0.08) !important;
}

.cand-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cand-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #0f172a;
  border: 3px solid var(--border-highlight);
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: all 0.3s ease;
}

.cand1 .cand-avatar {
  border-color: var(--cand1-color);
  box-shadow: 0 0 18px var(--cand1-glow);
}

.cand2 .cand-avatar {
  border-color: var(--cand2-color);
  box-shadow: 0 0 18px var(--cand2-glow);
}

.cand-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.cand-avatar-svg {
  width: 100%;
  height: 100%;
}

.cand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cand-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.cand-number-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
  letter-spacing: 0.03em;
}

.cand1 .cand-number-tag {
  background: var(--cand1-color);
  color: #ffffff;
}

.cand2 .cand-number-tag {
  background: var(--cand2-color);
  color: #ffffff;
}

.cand-party-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.cand-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-transform: uppercase;
}

.cand-fullname {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.cand-party {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cand-votes-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
}

.cand-pct {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
}

.cand-abs-votes {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Barra de progresso do candidato */
.cand-progress-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

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

.cand1 .cand-progress-fill {
  background: linear-gradient(90deg, #059669, #10b981);
}

.cand2 .cand-progress-fill {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

/* Badge LIDERANDO alinhado externamente ao topo da moldura */
.cand-badge-status {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 14px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.badge-lead {
  background: #f59e0b;
  color: #000000 !important;
  border: 1px solid #fbbf24;
  font-weight: 800;
}

.badge-elected {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  border: 1px solid #34d399;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
  animation: pulse-green 1s infinite;
}

/* Divisor central VS */
.cand-center-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

.vs-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
}

.vote-diff-badge {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}

/* Card 3: Estatísticas Gerais da Eleição */
.general-stats-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.stats-grid-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.stat-values {
  text-align: right;
}

.stat-values .val-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.stat-values .val-abs {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Timeline Scrollável Minuto a Minuto (a partir das 17:00)
   -------------------------------------------------------------------------- */
.timeline-section {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline-title-group h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-title-group p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
}

.timeline-mode-pill.historical {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.timeline-scrubber-container {
  position: relative;
  width: 100%;
  padding: 10px 0 20px;
}

.timeline-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  background: linear-gradient(90deg, #1e293b, #334155);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-accent);
  border: 3px solid #ffffff;
  box-shadow: 0 0 12px var(--gold-glow);
  cursor: grab;
  transition: transform 0.1s;
}

.timeline-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

/* Marcos na timeline */
.milestones-track {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  position: relative;
  overflow-x: auto;
  padding-bottom: 6px;
}

.milestone-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  min-width: 80px;
  text-align: center;
  transition: all 0.2s;
}

.milestone-item:hover .ms-time {
  color: var(--gold-accent);
}

.ms-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ms-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.2s;
}

.milestone-item.active .ms-dot {
  background: var(--gold-accent);
  box-shadow: 0 0 8px var(--gold-accent);
  transform: scale(1.3);
}

.milestone-item.active .ms-time {
  color: #ffffff;
  font-weight: 800;
}

.ms-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  max-width: 90px;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Arena Central (Grafo Interativo & Painel Lateral)
   -------------------------------------------------------------------------- */
.arena-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  min-height: 600px;
}

@media (max-width: 1100px) {
  .arena-grid {
    grid-template-columns: 1fr;
  }
}

.graph-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.graph-toolbar {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
}

.graph-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.graph-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.graph-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #334155;
  color: #ffffff;
}

#networkGraph,
#network-graph,
.graph-canvas-container {
  flex: 1 0 auto;
  width: 100%;
  height: 620px;
  min-height: 540px;
  background: #090d16;
  position: relative;
  touch-action: none !important;
  overscroll-behavior: contain;
}

.vis-network {
  outline: none;
}

.vis-network canvas {
  touch-action: none !important;
}

div.vis-tooltip {
  position: absolute;
  visibility: hidden;
  padding: 10px 14px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 1000;
  line-height: 1.45;
  max-width: 290px;
  transition: opacity 0.15s ease;
}

.graph-instruction-pill {
  position: absolute;
  bottom: 14px;
  left: 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-highlight);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 5;
}

/* Painel Lateral Direito (Estados Decisivos & Feed de Urnas) */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.battleground-table {
  width: 100%;
  border-collapse: collapse;
}

.battleground-table th {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-color);
}

.battleground-table td {
  padding: 8px 6px;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.battleground-table tr {
  cursor: pointer;
  transition: background 0.15s;
}

.battleground-table tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

.uf-tag {
  font-weight: 800;
  color: #ffffff;
}

.leader-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.leader-pill.cand1 {
  background: var(--cand1-bg);
  color: var(--cand1-color);
}

.leader-pill.cand2 {
  background: var(--cand2-bg);
  color: var(--cand2-color);
}

.leader-pill.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Feed de Urnas Recentes */
.urnas-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(30, 41, 59, 0.35);
  border-left: 2px solid var(--gold-accent);
  border-radius: 4px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.feed-time {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Modal do Boletim de Urna (BU) Oficial
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bu-modal-card {
  width: 100%;
  max-width: 580px;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.bu-header {
  background: #0f172a;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bu-title h4 {
  font-size: 0.95rem;
  font-weight: 800;
}

.bu-title p {
  font-size: 0.7rem;
  color: #94a3b8;
}

.btn-close-bu {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.bu-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.receipt-divider {
  border-bottom: 1px dashed #cbd5e1;
  margin: 12px 0;
}

.bu-receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 3px 0;
}

.bu-receipt-row.bold {
  font-weight: 700;
}

.bu-candidate-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  margin: 4px 0;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
}

.bu-candidate-line.cand1 {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
}

.bu-candidate-line.cand2 {
  background: rgba(59, 130, 246, 0.15);
  color: #1e40af;
}

.bu-security-box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.68rem;
  color: #64748b;
  word-break: break-all;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Scrollbar estilizada
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* --------------------------------------------------------------------------
   Responsividade do Grafo & Suporte para Tablets (Galaxy Tab) e Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  #networkGraph,
  #network-graph,
  .graph-canvas-container {
    height: 560px;
    min-height: 480px;
  }
}

@media (max-width: 768px) {
  #networkGraph,
  #network-graph,
  .graph-canvas-container {
    height: 480px;
    min-height: 420px;
  }
  .graph-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .graph-legend {
    flex-wrap: wrap;
    gap: 10px;
  }
  .graph-buttons {
    align-self: flex-end;
  }
}



/* ==========================================================================
   Estilos Oficiais TSE Live & Status Puro
   ========================================================================== */
.tse-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pulsing-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.tse-update-pill {
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.btn-ctrl.btn-refresh {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  cursor: pointer;
}

.btn-ctrl.btn-refresh:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.btn-ctrl.btn-refresh.loading span {
  display: inline-block;
  animation: spin 1s infinite linear;
}

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

.leader-pill.neutral {
  background: rgba(71, 85, 105, 0.2);
  border: 1px solid rgba(71, 85, 105, 0.4);
  color: #94a3b8;
}

/* Painel de Status Oficial TSE */
.tse-official-status-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.status-badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge-item .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-badge-item .val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

/* ==========================================================================
   Auto-Update & Telemetria em Tempo Real (Feedback Visual Contínuo)
   ========================================================================== */
.header-auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.header-auto-badge.fetching {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.auto-update-telemetry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 20px;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.update-countdown-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 300px;
}

.radar-pulse-indicator {
  position: relative;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radar-core {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  transition: background 0.2s;
}

.radar-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: radarWave 1.6s infinite ease-out;
}

.radar-pulse-indicator.fetching .radar-core {
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
}

.radar-pulse-indicator.fetching .radar-ring {
  border-color: #fbbf24;
  animation: radarWave 0.8s infinite ease-out;
}

@keyframes radarWave {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.update-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.update-main-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.update-timer {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.seconds-highlight {
  color: #fbbf24;
  font-weight: 800;
}

.update-progress-track {
  flex: 1;
  max-width: 180px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-left: 10px;
}

.update-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 10px;
  transition: width 0.2s linear;
}

.update-telemetry-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telemetry-pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.76rem;
}

.telemetry-pill.pill-expand {
  max-width: 520px;
}

.pill-label {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.pill-value {
  color: #f8fafc;
  font-weight: 600;
}

.badge-pill-http {
  color: #34d399 !important;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
}

.status-waiting {
  color: #94a3b8;
}

.status-new-batch {
  color: #fbbf24 !important;
  font-weight: 800 !important;
  animation: pulse-glow 1s infinite;
}

/* Efeito visual discreto (flash/pulse) no Jumbotron quando uma checagem é executada */
@keyframes jumbotronCheckPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45);
    border-color: rgba(56, 189, 248, 0.75);
  }
  50% {
    box-shadow: 0 0 20px 2px rgba(56, 189, 248, 0.28);
    border-color: rgba(56, 189, 248, 0.55);
  }
  100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: var(--border-color);
  }
}

.jumbo-card.check-pulse {
  animation: jumbotronCheckPulse 0.85s ease-out;
}
