:root {
  --onpe-blue: #1a3d6a;
  /* Azul oscuro estilo RPP / ONPE verdadero */
  --onpe-dark: #1a1a1a;
  --onpe-gold: #f1b434;
  /* Amarillo RPP / Elecciones */
  --onpe-gray-bg: #e9ecef;
  --paper-bg: #fdfdfd;
  --paper-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --border-oficial: 2px solid #333;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--onpe-gold);
  color: #222;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Pantalla de Inicio */
#pantalla-inicio {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.card-inicio {
  max-width: 450px;
  width: 100%;
  background: #fff;
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  text-align: center;
  border-top: 8px solid var(--onpe-blue);
}

.logo-header {
  width: 180px;
  /* Más grande para el logo del partido */
  margin-bottom: 20px;
  border-radius: 10px;
}

.card-title {
  font-weight: 800;
  color: var(--onpe-blue);
  letter-spacing: -0.5px;
}

.card-body p {
  color: #666;
  margin-bottom: 25px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

.form-control:focus {
  border-color: var(--onpe-blue);
  outline: none;
}

.btn-accion {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-primario {
  background: #000;
  color: #fff;
  border: 2px solid #000;
}

.btn-primario:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-resultados {
  background: #fff;
  color: #000;
  border: 2px solid #000;
}

.btn-resultados:hover {
  background: #f0f0f0;
}

/* Cédula Layout */
#pantalla-cedula {
  max-width: 1400px;
  margin: 20px auto;
  background: var(--paper-bg);
  box-shadow: var(--paper-shadow);
  border-radius: 4px;
  padding: 0;
  border: 1px solid #ddd;
  position: relative;
  overflow: hidden;
}

/* Header de la Cédula */
.cedula-header-top {
  background: #fff;
  border-bottom: 5px solid #000;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  position: relative;
}

.barcode-area {
  position: absolute;
  top: 15px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0.8;
}

.barcode-sim {
  font-family: monospace;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -2px;
}

.barcode-num {
  font-size: 0.6rem;
  font-weight: 700;
}

.header-onpe {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-onpe img {
  height: 60px;
}

.header-text {
  text-align: left;
}

.header-text h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.header-text p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #444;
}

.region-badge {
  background: #000;
  color: #fff;
  padding: 8px 30px;
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.instruccion-general {
  background: #eee;
  padding: 10px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  border-bottom: 2px solid #333;
}

.cruz-ejemplo,
.aspa-ejemplo {
  color: #c00;
  font-size: 1.2rem;
  margin: 0 5px;
}

.contenedor-doble {
  display: flex;
  gap: 10px;
}

.cedula-scroll {
  display: flex;
  justify-content: flex-start;
  /* Alinea al inicio cuando hace scroll */
  align-items: flex-start;
  padding: 20px 10px 120px 10px;
  border-bottom: 5px solid #000;
  background: #ccc;
  width: 100%;
  min-height: 500px;
  overflow-x: auto;
  /* Permite scroll horizontal en lugar de aplastar */
  flex-wrap: nowrap;
}

.columna-voto {
  background: var(--paper-bg);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  min-width: 250px;
  max-width: 700px;
  /* Ancho generoso para navegación de columna única */
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #777;
  overflow: hidden;
}

.col-header {
  background: var(--onpe-gray-bg);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  box-sizing: border-box;
  border-bottom: 2px solid #dee2e6;
  min-height: 110px;
}

.col-header h4 {
  color: var(--onpe-blue);
  margin: 0;
  font-size: 0.95rem;
  /* Un tamaño más recatado para encajar siempre */
  font-weight: 900;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.col-header h4 small {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 3px;
}

.instruccion-columna {
  font-size: 0.8rem;
  color: var(--onpe-blue);
  line-height: 1.3;
  font-weight: 800;
  width: 95%;
  margin: 0 auto;
}

.col-subheader {
  display: flex;
  background: var(--onpe-blue);
  border-bottom: 2px solid var(--onpe-blue);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  padding: 10px 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sh-org {
  flex: 1;
  flex-shrink: 0;
  text-align: center;
}

.sh-sim {
  flex: 1;
  text-align: center;
}

.sh-fot,
.sh-pref {
  flex: 1;
  text-align: center;
}

/* Colores de fondo por tipo (simulando papel impreso) */
.columna-voto[data-tipo="p"] .cuerpo-col {
  background: #ffffff;
}

.columna-voto[data-tipo="sn"] .cuerpo-col {
  background: #fce4ec;
  /* Rosado tenue */
}

.columna-voto[data-tipo="sr"] .cuerpo-col {
  background: #e8f5e9;
  /* Verde tenue */
}

.columna-voto[data-tipo="d"] .cuerpo-col {
  background: #e3f2fd;
  /* Azul tenue */
}

.columna-voto[data-tipo="pa"] .cuerpo-col {
  background: #fff8e1;
  /* Amarillo tenue */
}

.cuerpo-col {
  padding: 0;
  flex: 1;
}

/* Opción de Partido */
.op-partido {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
  padding: 15px 15px;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 100px;
  box-sizing: border-box;
  background: transparent;
}

.op-partido:hover {
  background: rgba(0, 0, 0, 0.03);
}

.op-partido.seleccionado {
  background: rgba(255, 215, 0, 0.1);
}

.left-col {
  flex: 1;
  flex-shrink: 0;
  padding-right: 10px;
  display: flex;
  align-items: center;
}

.nombre-partido {
  font-size: 0.85rem;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

.op-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 2;
  justify-content: space-around;
}

.contenedor-logo,
.casilla-voto {
  width: 65px;
  height: 65px;
  flex-shrink: 0;
  border: 2px solid #555;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-partido,
.img-cedula {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

/* Marca X - se aplica en las casillas individuales dentro de contenedor-doble */
.casilla-voto.marcado {
  position: relative;
}

.casilla-voto.marcado::before,
.casilla-voto.marcado::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 55px;
  height: 8px;
  background: #c00;
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
}

.casilla-voto.marcado::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.casilla-voto.marcado::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Marca X para contenedor-logo (columnas no presidenciales) */
.contenedor-logo.marcado {
  position: relative;
}

.contenedor-logo.marcado::before,
.contenedor-logo.marcado::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 55px;
  height: 8px;
  background: #c00;
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
}

.contenedor-logo.marcado::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.contenedor-logo.marcado::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Voto Preferencial */
.voto-preferencial {
  display: flex;
  gap: 8px;
  margin-left: 10px;
  /* Separar un poco del logo */
  justify-content: center;
}

.voto-preferencial:empty {
  display: none;
}

.input-num {
  width: 38px;
  height: 48px;
  border: 2px solid #333;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  padding: 0;
  border-radius: 0;
  background: #fff;
}

.input-num:focus {
  outline: none;
  background: #fff;
  border-color: var(--onpe-blue);
  box-shadow: 0 0 0 2px rgba(26, 61, 106, 0.3);
}

.foto-placeholder {
  font-size: 0.6rem;
  font-weight: 800;
  color: #ccc;
}

/* Footer Botones */
.contenedor-botones {
  padding: 20px;
  background: #f8f9fa;
  /* Gris muy claro/Off-white */
  border-top: 2px solid #ddd;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1000;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

.btn-nav,
.btn-finalizar {
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  max-width: 450px;
  /* Botones anchos */
  transition: all 0.2s ease;
}

.btn-siguiente,
.btn-finalizar {
  background: #ffc107;
  /* Amarillo/Dorado RPP */
  color: #000;
  border: 2px solid #ffc107;
}

.btn-atras {
  background: #fff;
  border: 2px solid #ccc;
  color: #333;
}

.btn-nav:hover,
.btn-finalizar:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn-atras:hover {
  background: #f0f0f0;
}

/* =========================================
   MODALES (DIBUJO Y NUMPAD)
   ========================================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.1, 0, 0, 1);
}

@keyframes modalIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-dibujo-content {
  border-radius: 24px;
  max-width: 400px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
}

.modal-drag-handle {
  width: 40px;
  height: 4px;
  background-color: #d1d5db;
  border-radius: 4px;
  margin: 0 auto 16px auto;
}

.modal-title {
  color: #111827;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.modal-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0 0 24px 0;
}

.aspa-azul,
.cruz-azul {
  color: #1d4ed8;
  font-weight: bold;
}

.canvas-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-target-img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  position: absolute;
  top: 10%;
  left: 10%;
  z-index: 1;
  pointer-events: none;
}

.canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  cursor: crosshair;
}

#canvas-voto {
  width: 100%;
  height: 100%;
  display: block;
}

#feedback-voto-correcto {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

.check-circle {
  width: 70px;
  height: 70px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.feedback-titulo {
  font-weight: 900;
  color: #10b981;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.feedback-subtitulo {
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
}

.modal-actions-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.btn-modal {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirmar {
  background-color: var(--onpe-gold);
  color: #111;
  border: 2px solid transparent;
}

.btn-confirmar:hover {
  background-color: #dcb030;
}

.btn-limpiar {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.btn-limpiar:hover {
  background-color: #e5e7eb;
}

.btn-cancelar {
  background-color: #f3f4f6;
  color: #4b5563;
}

.btn-cancelar:hover {
  background-color: #e5e7eb;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Numpad */
.numpad-display {
  font-family: monospace;
  font-size: 3rem;
  font-weight: 900;
  color: var(--onpe-blue);
  background: #fdfdfd;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 20px;
  letter-spacing: 5px;
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.btn-numpad {
  background: #f0f0f0;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  color: #333;
}

.btn-numpad:active {
  background: #ddd;
  transform: scale(0.95);
}

.btn-numpad-action {
  background: #ffebee;
  color: #c00;
  border-color: #ffcdd2;
}

/* Botones Modales Generales */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  justify-content: center;
}

.btn-modal {
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  flex: 1;
}

.btn-cancelar {
  background: #ddd;
  color: #333;
}

.btn-limpiar {
  background: #f1b434;
  color: #000;
}

.btn-confirmar {
  background: var(--onpe-blue);
  color: #fff;
}

/* Mobile */
/* Mobile Adjustments */
/* Distribución flexible interna global (aplica a todos los viewports) */
.contenedor-doble {
  flex: 1;
  display: flex;
}

/* Cada casilla ocupa su mitad y centra el recuadro */
.contenedor-doble>.casilla-voto {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
}

/* El recuadro visual real dentro de cada casilla */
.contenedor-doble>.casilla-voto .img-cedula,
.contenedor-doble>.casilla-voto .foto-placeholder {
  width: 65px;
  height: 65px;
  border: 2px solid #555;
  background: #fff;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voto-preferencial {
  margin-left: auto;
}

@media (max-width: 1000px) {
  .cedula-scroll {
    display: block;
  }

  .columna-voto {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0;
    margin: 0;
  }

  #pantalla-cedula {
    margin: 0;
    border: none;
    border-radius: 0;
    width: 100%;
  }

  .cedula-header-top {
    padding: 20px 10px;
  }

  .cedula-scroll {
    display: block;
    /* Eliminar flex para que las columnas ocupen el 100% natural */
    padding: 0 0 120px 0;
  }

  .columna-voto {
    max-width: 100%;
    /* Permite usar todo el ancho de la pantalla sin márgenes */
    border-radius: 0;
    /* Opción: eliminar bordes en móvil para un look más integrado */
    border-left: none;
    border-right: none;
    margin: 0;
  }

  .barcode-area {
    display: none;
  }

  .header-onpe img {
    height: 40px;
  }
}

@media (max-width: 380px) {
  .op-partido {
    padding: 8px 10px;
  }

  .left-col {
    width: 65px;
    padding-right: 3px;
  }

  .nombre-partido {
    font-size: 0.55rem;
  }

  .contenedor-logo,
  .casilla-voto {
    width: 36px;
    height: 36px;
  }

  .voto-preferencial {
    gap: 4px;
    margin-left: 5px;
  }

  .input-num {
    width: 32px;
    height: 42px;
    font-size: 1.2rem;
  }

  .col-subheader {
    padding: 5px 10px;
    font-size: 0.5rem;
  }

  .sh-org {
    width: 65px;
    padding-right: 3px;
  }

  .sh-sim {
    width: 36px;
  }
}

@media (max-width: 800px) {
  .contenedor-botones {
    flex-direction: row;
    padding: 15px;
    gap: 10px;
  }

  .btn-nav,
  .btn-finalizar {
    max-width: 100%;
  }
}

/* ==========================================
   Dashboard de Resultados — Responsivo
   ========================================== */
.results-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ━━ Header ━━ */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  background: white;
  padding: 20px 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-left: 6px solid var(--onpe-blue);
}

.results-title {
  margin: 0;
  font-size: 1.4rem;
  color: var(--onpe-blue);
}

.results-header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.results-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-filter label {
  font-weight: 700;
  color: #444;
  white-space: nowrap;
}

.results-select {
  width: 200px;
  margin-bottom: 0;
}

.results-actions {
  display: flex;
  gap: 8px;
}

.btn-results {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-results-primary {
  background: var(--onpe-blue);
  color: #fff;
}

.btn-results-primary:hover {
  background: #0a1f50;
  transform: translateY(-1px);
}

.btn-results-secondary {
  background: #666;
  color: #fff;
}

.btn-results-secondary:hover {
  background: #444;
  transform: translateY(-1px);
}

/* ━━ Barra de Participación ━━ */
.participation-bar-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 16px 25px;
  border-radius: 12px;
  border: 1px solid #eee;
}

.participation-info {
  flex: 1;
  max-width: 450px;
  min-width: 200px;
}

.participation-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #555;
}

.participation-pct {
  font-size: 1rem;
  font-weight: 900;
  color: #28a745;
}

.bar-participation {
  height: 14px;
  background: #e0e0e0;
}

.bar-fill-green {
  background: linear-gradient(90deg, #28a745, #5ddc7c) !important;
}

.last-update-text {
  color: #888;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ━━ Grid de Resultados ━━ */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 20px;
}

.result-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  animation: fadeInSlide 0.5s ease-out both;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--onpe-blue);
  text-transform: uppercase;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 12px;
}

/* ━━ Filas de Resultado ━━ */
.result-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  padding: 6px 0;
}

.result-logo,
.logo-small {
  width: 45px;
  height: 45px;
  min-width: 45px;
  border-radius: 6px;
  border: 1px solid #eee;
  padding: 3px;
  object-fit: contain;
  background: white;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-party-name {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
}

/* ━━ Barras de Progreso ━━ */
.bar-container {
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--onpe-blue), #2563eb);
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.1, 0, 0, 1);
  width: 0;
}

/* ━━ Estadísticas (votos + porcentaje) ━━ */
.result-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 5px;
  color: #555;
  font-weight: 600;
}

.result-stats span:last-child {
  color: var(--onpe-blue);
  font-weight: 800;
  font-size: 0.9rem;
}

.no-votes {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
  grid-column: 1 / -1;
}

/* ━━ Animación ━━ */
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ━━ Media Queries: Resultados ━━ */
@media (max-width: 768px) {
  .results-container {
    padding: 12px;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .results-title {
    font-size: 1.1rem;
    text-align: center;
  }

  .results-header-right {
    flex-direction: column;
    gap: 10px;
  }

  .results-filter {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .results-select {
    width: 100%;
  }

  .results-actions {
    justify-content: stretch;
  }

  .results-actions .btn-results {
    flex: 1;
    justify-content: center;
  }

  .participation-bar-wrapper {
    flex-direction: column;
    padding: 14px;
    gap: 8px;
  }

  .participation-info {
    max-width: 100%;
    width: 100%;
  }

  .last-update-text {
    text-align: center;
    width: 100%;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .result-card {
    padding: 16px;
  }

  .result-logo,
  .logo-small {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .result-party-name {
    font-size: 0.75rem;
  }

  .result-stats {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .results-title {
    font-size: 1rem;
  }

  .btn-results {
    font-size: 0.8rem;
    padding: 8px 14px;
  }

  .result-row {
    gap: 8px;
  }

  .result-logo,
  .logo-small {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
}

.result-card {
  animation: fadeInSlide 0.5s ease forwards;
}