/* ==============================================
   VARIABLES GLOBALES
   Cambia estos valores para cambiar toda la paleta
============================================== */
:root {
  /* Colores de Marca (Impulso Ciudadano) */
  --color-primary: #facc15;
  /* Amarillo vibrante */
  --color-primary-dark: #eab308;
  /* Amarillo oscuro para estados hover */
  --color-secondary: #ffffff;
  /* Blanco puro */
  --color-dark: #1e293b;
  /* Azul pizarra oscuro para textos y sidebar */
  --color-purple: #6535c5;
  /* Morado corporativo */
  --color-purple-soft: rgba(124, 58, 237, 0.08);
  /* Morado suave para fondos */

  /* Sistema de Diseño */
  --bg-pagina: #f8fafc;
  --bg-tarjeta: rgba(255, 255, 255, 0.65);
  /* Más transparente para el efecto glass */
  --borde: rgba(0, 0, 0, 0.05);
  --borde-glass: rgba(255, 255, 255, 0.5);

  --texto: #1e293b;
  --texto-sec: #64748b;
  --texto-muted: #94a3b8;

  /* Semántica */
  --exito: #10b981;
  --error: #ef4444;
  --aviso: #f59e0b;

  /* Estética Premium */
  --radio: 20px;
  --radio-sm: 10px;
  --sombra: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --sombra-premium: 0 20px 50px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(20px);
  /* Desenfoque más fuerte */

  /* Dimensiones */
  --sidebar-ancho: 280px;
  --topbar-alto: 70px;

  /* Tipografía */
  --fuente: 'Inter', sans-serif;
  --fuente-titulo: 'DM Serif Display', serif;
}

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

body {
  font-family: var(--fuente);
  background: var(--bg-pagina);
  color: var(--texto);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select {
  font-family: inherit;
}


/* ==============================================
   MI PERFIL
 ============================================== */
.perfil-container {
  padding: 0.5rem;
}

.perfil-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.perfil-avatar-grande {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-primary), #fde047);
  color: var(--color-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(250, 204, 21, 0.2);
}

.perfil-nombre-tit {
  font-family: var(--fuente-titulo);
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.badge-rol {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.badge-owner {
  background: #fef3c7;
  color: #92400e;
}

.badge-admin {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-lider {
  background: #dbeafe;
  color: #1e40af;
}

.badge-amigo {
  background: #f1f5f9;
  color: #475569;
}

.perfil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--borde);
}

.perfil-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.perfil-info-item label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.perfil-info-item span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--texto);
}

.perfil-subtit {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.perfil-desc-sec {
  font-size: 0.85rem;
  color: var(--texto-sec);
  margin-bottom: 1.25rem;
}

/* ==============================================
   PANTALLA DE LOGIN
============================================== */
#pantalla-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-dark), #0f172a);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Círculos decorativos de fondo para el login */
#pantalla-login::before,
#pantalla-login::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: var(--color-primary);
  filter: blur(100px);
  opacity: 0.1;
  z-index: 0;
}

#pantalla-login::before {
  top: -100px;
  right: -100px;
}

#pantalla-login::after {
  bottom: -100px;
  left: -100px;
}

.login-caja {
  background: var(--bg-tarjeta);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--borde-glass);
  border-radius: 30px;
  padding: 3.5rem 3rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--sombra-premium);
  position: relative;
  z-index: 10;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--color-primary);
  color: var(--color-dark);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
  transition: all 0.3s ease;
}

.login-logo-link {
  text-decoration: none;
  display: inline-block;
}

.login-logo-link:hover .login-logo {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 25px rgba(250, 204, 21, 0.4);
}

.login-titulo {
  font-family: var(--fuente-titulo);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-dark);
}

.login-subtitulo {
  font-size: 0.95rem;
  color: var(--texto-sec);
  margin-bottom: 2.5rem;
}

#form-login .campo {
  margin-bottom: 1.5rem;
  text-align: left;
}

#form-login label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--texto-sec);
  margin-bottom: 0.5rem;
  display: block;
}

.campo-password-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.campo-password-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.8rem !important;
}

.btn-mostrar-pass {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-muted);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.btn-mostrar-pass:hover {
  color: var(--texto-pri);
}

.btn-login {
  width: 100%;
  padding: 1rem;
  background: var(--color-primary);
  color: var(--color-dark);
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.2);
}

.btn-login:hover {
  transform: translateY(-2px);
  background: var(--color-primary-dark);
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
}

/* ==============================================
   BOTONES
============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radio-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primario {
  background: var(--color-primary);
  color: var(--color-dark);
}

.btn-primario:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.btn-secundario {
  background: transparent;
  color: var(--texto);
  border: 1.5px solid var(--borde);
}

.btn-exito {
  background: var(--exito);
  color: #fff;
}

.btn-peligro {
  background: #fee2e2;
  color: var(--error);
  border: 1.5px solid rgba(239, 68, 68, 0.1);
}

.btn-bloque {
  width: 100%;
  justify-content: center;
  padding: 0.75rem;
}

.btn-icono {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radio-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-sec);
  transition: all 0.2s;
}

.btn-icono:hover {
  background: var(--bg-pagina);
  color: var(--texto);
}

.btn-icono svg {
  width: 20px;
  height: 20px;
}

/* ==============================================
   CAMPOS DE FORMULARIO
============================================== */
.campo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.campo label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.campo input,
.campo select {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio-sm);
  font-size: 0.875rem;
  background: #fafbfc;
  color: var(--texto);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.campo input:focus,
.campo select:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
  background: #fff;
}

/* ==============================================
   ALERTAS
============================================== */
.alerta {
  border-radius: var(--radio-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.alerta-exito {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alerta-error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

/* ==============================================
   LAYOUT DEL APP (sidebar + área principal)
============================================== */
#app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Blobs de fondo para que el glassmorphism brille */
#app::before,
#app::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  z-index: 0;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
}

#app::before {
  background: var(--color-primary);
  top: -100px;
  right: -100px;
}

#app::after {
  background: #3b82f6;
  bottom: -100px;
  left: 20%;
}

/* ── SIDEBAR ── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-ancho);
  height: 100vh;
  background: var(--color-dark);
  display: flex;
  flex-direction: column;
  z-index: 150;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  /* Línea morada sutil en el borde derecho */
  box-shadow: 2px 0 0 0 rgba(124, 58, 237, 0.18);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.5rem;
  height: var(--topbar-alto);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease;
}

.sidebar-logo:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-logo:hover .logo-marca {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.4);
}

.logo-marca {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--color-dark);
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4);
}

.sidebar-logo-texto {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 1px;
  align-items: center;
  text-align: center;
  width: 100%;
}
.logo-impulso {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.3rem;
  color: #d946a8;
  letter-spacing: 0.02em;
}
.logo-ciudadano {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.3rem;
  color: #facc15;
  letter-spacing: 0.02em;
}

.logo-texto {
  display: flex;
  flex-direction: column;
}

.logo-nombre {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.logo-sub {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Espacio entre botones */
  overflow-y: auto;
}

.nav-seccion {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.22);
  padding: 0.75rem 0.75rem 0.35rem;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  background: rgba(124, 58, 237, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item.activo {
  background: var(--color-primary) !important;
  color: var(--color-dark) !important;
  font-weight: 700;
  box-shadow: 0 10px 20px -5px rgba(250, 204, 21, 0.3);
}

.nav-item.activo svg {
  opacity: 1;
  stroke-width: 2.5;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--sidebar-borde);
  flex-shrink: 0;
}

.usuario-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-dark);
  flex-shrink: 0;
}

.usuario-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.usuario-nombre {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usuario-rol {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── ÁREA PRINCIPAL ── */
#area-principal {
  margin-left: var(--sidebar-ancho);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  /* Para estar encima de los blobs pero permitir el blur */
}

/* ── TOPBAR ── */
#topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-ancho);
  right: 0;
  height: var(--topbar-alto);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--borde);
  box-shadow: 0 1px 0 0 rgba(124, 58, 237, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-izquierda {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texto);
}

/* ── CONTENIDO ── */
#contenido {
  margin-top: var(--topbar-alto);
  padding: 1.5rem 3.5rem;
  /* Aumentamos el margen lateral para que no esté pegado */
  flex: 1;
}

/* ==============================================
   SECCIONES (solo una visible a la vez)
============================================== */
.seccion {
  display: none;
}

.seccion.activa {
  display: block;
}

/* ==============================================
   ENCABEZADO DE PÁGINA
============================================== */
.pagina-encabezado {
  margin-bottom: 1.5rem;
  padding-top: 0;
}

.pagina-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
  /* Subrayado morado sutil bajo el título */
  background: linear-gradient(90deg, var(--color-purple) 0%, transparent 60%);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: bottom left;
  padding-bottom: 6px;
}

.pagina-subtitulo {
  font-size: 0.875rem;
  color: var(--texto-sec);
}

/* ==============================================
   TARJETAS
============================================== */
.tarjeta {
  background: var(--bg-tarjeta);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radio);
  padding: 1.75rem;
  box-shadow: var(--sombra);
  border: 1px solid var(--borde-glass);
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-premium), 0 0 0 1px rgba(124, 58, 237, 0.07);
}

.tarjeta-encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.tarjeta-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--texto);
  letter-spacing: -0.01em;
  /* punto morado decorativo */
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tarjeta-titulo::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-purple);
  flex-shrink: 0;
  opacity: 0.7;
}

.etiqueta-total {
  font-size: 0.75rem;
  color: var(--texto-muted);
  font-weight: 600;
  background: var(--bg-pagina);
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
}

/* ==============================================
   KPI CARDS (Dashboard)
============================================== */
.kpi-fila {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi {
  background: var(--bg-tarjeta);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--borde-glass);
  border-radius: var(--radio);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.9rem;
  color: var(--color-dark);
  position: relative;
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: all 0.2s ease;
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--sombra-premium);
  border-color: var(--color-primary);
}

.kpi-icono {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.kpi-valor {
  font-family: var(--fuente-titulo);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-dark);
}

.kpi-etiqueta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Variantes de color para KPIs */
.kpi-total .kpi-valor {
  color: var(--color-dark);
}

.kpi-exito .kpi-valor {
  color: var(--exito);
}

.kpi-aviso .kpi-valor {
  color: var(--aviso);
}

.kpi-error .kpi-valor {
  color: var(--error);
}

/* ==============================================
   GRILLA DE DOS COLUMNAS
============================================== */
.dos-columnas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.dos-columnas .tarjeta {
  margin-bottom: 0;
}

/* ==============================================
   BARRA DE PROGRESO (Dashboard desglose)
============================================== */
.barra-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.barra-fila {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.barra-fondo {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-pagina);
  overflow: hidden;
}

.barra-relleno {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ==============================================
   BARRA DE FILTROS Y BÚSQUEDA
 ============================================== */
.filtros-barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-tarjeta);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radio-sm);
  border: 1px solid var(--borde-glass);
}

.filtros-barra input[type="text"] {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1.5px solid var(--borde);
  background: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filtros-barra input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.15);
}

.filtros-controles {
  display: flex;
  gap: 0.75rem;
}

.filtros-controles select {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--borde);
  background: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--texto);
}

/* ==============================================
   FORMULARIO EN GRILLA
============================================== */
.form-grilla {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.campo-completo {
  grid-column: 1 / -1;
}

/* ==============================================
   PESTAÑAS (Tabs)
============================================== */
.pestanas {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.pestana {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radio-sm);
  border: 1.5px solid var(--borde);
  background: var(--bg-tarjeta);
  color: var(--texto-sec);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pestana.activa {
  background: var(--color-primary);
  color: var(--color-dark);
  border-color: var(--color-primary);
}

.pestana:hover:not(.activa) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.tab-contenido {
  display: none;
}

.tab-contenido.activo {
  display: block;
}

.badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.pestana:not(.activa) .badge {
  background: var(--color-primary);
  color: var(--color-dark);
}

/* ==============================================
   TABLAS
============================================== */
.tabla-contenedor {
  overflow-x: auto;
}

.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}

.tabla th {
  text-align: left;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--bg-pagina);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.02);
}

.tabla td {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  color: var(--texto);
  vertical-align: middle;
}

.tabla tr:last-child td {
  border-bottom: none;
}

.tabla tbody tr:hover td {
  background: rgba(250, 204, 21, 0.03);
}

.tabla-vacia {
  text-align: center;
  color: var(--texto-muted);
  padding: 2.5rem;
}

/* ==============================================
   BADGES DE ESTADO
============================================== */
.estado-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.estado-pendiente {
  background: #fef3c7;
  color: #92400e;
}

.estado-aprobado {
  background: #d1fae5;
  color: #065f46;
}

.estado-rechazado {
  background: #fee2e2;
  color: #991b1b;
}

/* ==============================================
   ACCIONES EN TABLA (Aprobaciones)
============================================== */
.acciones-grupo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rechazo-fila {
  display: flex;
  gap: 0.4rem;
}

.rechazo-fila input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--borde);
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: var(--fuente);
}

/* ==============================================
   BARRA DE FILTROS (Consolidados)
============================================== */
.filtros-barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filtros-controles {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.filtros-controles select,
.filtros-controles input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio-sm);
  font-size: 0.875rem;
  font-family: var(--fuente);
  background: var(--bg-tarjeta);
  color: var(--texto);
}

/* ==============================================
   PERFIL
============================================== */
.perfil-fila {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--borde);
  font-size: 0.9rem;
}

.perfil-fila:last-child {
  border-bottom: none;
}

.perfil-etiqueta {
  color: var(--texto-sec);
  font-weight: 600;
}

.perfil-valor {
  color: var(--texto);
  font-weight: 500;
}

/* ==============================================
   PUBLICACIONES (Noticias y Eventos)
============================================== */

.publicaciones-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.publicacion-card {
  background: var(--bg-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--sombra);
}

.publicacion-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.publicacion-tipo {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.tipo-noticia {
  background: #ede9fe;
  color: #7c3aed;
}

.tipo-evento {
  background: #fef3c7;
  color: #b45309;
}

.publicacion-fecha {
  font-size: 0.8rem;
  color: var(--texto-muted);
  margin-left: auto;
}

.publicacion-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.05rem;
  color: var(--texto);
  margin: 0 0 0.35rem;
}

.publicacion-cuerpo {
  font-size: 0.9rem;
  color: var(--texto-sec);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.publicacion-evento-fecha {
  font-size: 0.85rem;
  color: var(--magenta);
  font-weight: 600;
  margin: 0;
}

/* Badge roles en tabla usuarios */
.estado-badge.estado-owner {
  background: #fce7f3;
  color: #be185d;
}

.estado-badge.estado-admin {
  background: #ede9fe;
  color: #7c3aed;
}

.estado-badge.estado-lider {
  background: #dbeafe;
  color: #1d4ed8;
}

.estado-badge.estado-amigo {
  background: #dcfce7;
  color: #15803d;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}


/* ==============================================
   MAPA ELECTORAL
============================================== */
.mapa-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.mapa-contenedor {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 !important;
  overflow: visible;
  position: relative;
}

/* ── Buscador flotante sobre el mapa ── */
.mapa-buscador-wrap {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 280px;
  max-width: calc(100% - 24px);
}

.mapa-buscador-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mapa-buscador-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.25);
}

.mapa-buscador-input-wrap svg {
  color: var(--texto-muted);
  flex-shrink: 0;
}

#mapa-buscador {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.85rem;
  font-family: var(--fuente);
  color: var(--texto-pri);
  background: transparent;
  min-width: 0;
}

#mapa-buscador::placeholder {
  color: var(--texto-muted);
}

.mapa-buscador-limpiar {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-muted);
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.mapa-buscador-limpiar:hover {
  color: var(--texto-pri);
}

.mapa-buscador-lista {
  list-style: none;
  margin: 6px 0 0;
  padding: 0.35rem 0;
  background: #fff;
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
  max-height: 220px;
  overflow-y: auto;
}

.mapa-buscador-item {
  padding: 0.5rem 1rem;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.12s;
}

.mapa-buscador-item:hover,
.mapa-buscador-item.activo {
  background: rgba(250, 204, 21, 0.12);
}

.mapa-buscador-item .buscador-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

#mapa-leaflet {
  height: 520px;
  width: 100%;
  border-radius: var(--radio) var(--radio) 0 0;
  z-index: 0;
}

.mapa-leyenda-controles {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Transición suave al reaparecer los círculos tras el zoom */
#mapa-leaflet .leaflet-overlay-pane path {
  transition: opacity 0.25s ease, fill-opacity 0.25s ease;
  outline: none !important;
}

/* Quitar outline de foco en elementos del mapa */
#mapa-leaflet path:focus,
#mapa-leaflet .leaflet-interactive:focus {
  outline: none !important;
}

.mapa-leyenda {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
}

.mapa-leyenda-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mapa-leyenda-escala {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--texto-sec);
}

.mapa-leyenda-color {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-left: 0.5rem;
}

.mapa-panel {
  width: 300px;
  flex-shrink: 0;
  display: none;
  padding: 1.25rem;
  display: none;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

#mapa-panel-contenido {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  margin-top: 0.25rem;
}
#mapa-panel-contenido::-webkit-scrollbar { width: 4px; }
#mapa-panel-contenido::-webkit-scrollbar-track { background: transparent; }
#mapa-panel-contenido::-webkit-scrollbar-thumb { background: #fde68a; border-radius: 4px; }

.mapa-panel.visible {
  display: flex;
}

.mapa-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1.5px solid var(--borde);
}

.mapa-panel-header h3 {
  font-family: var(--fuente-titulo);
  font-size: 1.15rem;
  color: var(--texto);
  margin: 0;
}

.mapa-panel-cerrar {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--texto-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.mapa-panel-cerrar:hover {
  background: var(--borde);
  color: var(--texto);
}

.mapa-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--borde);
  font-size: 0.875rem;
}

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

.mapa-stat-label {
  color: var(--texto-sec);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mapa-stat-valor {
  font-weight: 700;
  color: var(--texto);
}

.mapa-stat-valor.aprobado {
  color: var(--exito);
}

.mapa-stat-valor.pendiente {
  color: var(--aviso);
}

.mapa-eventos-lista {
  margin-top: 1rem;
}

.mapa-eventos-titulo {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texto-muted);
  margin-bottom: 0.6rem;
}

.mapa-evento-item {
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: var(--radio-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.mapa-evento-item strong {
  display: block;
  color: var(--texto);
  margin-bottom: 0.15rem;
}

.mapa-evento-item span {
  color: var(--texto-muted);
}

.mapa-panel-seccion {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1.5px solid var(--borde);
}

.mapa-panel-seccion-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-muted);
  margin-bottom: 0.6rem;
}

/* Eliminar sombra cuadrada de marcadores Leaflet */
.leaflet-control-attribution {
  display: none !important;
}

.leaflet-marker-shadow {
  display: none !important;
}

.leaflet-marker-icon {
  background: none !important;
  border: none !important;
}

/* Popup de Leaflet personalizado */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: var(--sombra-premium) !important;
  font-family: var(--fuente) !important;
}

.leaflet-popup-content {
  font-size: 0.85rem !important;
  color: var(--texto) !important;
  margin: 0.75rem 1rem !important;
}

.mapa-popup-titulo {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.mapa-popup-fecha {
  color: var(--texto-muted);
  font-size: 0.78rem;
}

/* Dashboard — tarjetas de desglose */
.dash-tarjeta .tarjeta-encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dash-tarjeta-titulo-grupo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dash-tarjeta-icono {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-badge-total {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--texto-muted);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--borde);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  letter-spacing: 0.02em;
}

/* Barras de progreso rediseñadas */
.barra-item {
  margin-bottom: 1.1rem;
}

.barra-item:last-child {
  margin-bottom: 0;
}

.barra-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.barra-label-grupo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.barra-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.barra-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--texto-sec);
}

.barra-valores {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.barra-num {
  font-size: 0.95rem;
  font-weight: 700;
}

.barra-pct {
  font-size: 0.78rem;
  color: var(--texto-muted);
  font-weight: 400;
}

.barra-fondo {
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
}

.barra-relleno {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* KPIs compactos para el mapa */
.kpi-fila.kpi-compacto .kpi {
  padding: 0.85rem 1rem;
  gap: 0.7rem;
}

.kpi-fila.kpi-compacto .kpi-valor {
  font-size: 1.5rem;
}

.kpi-fila.kpi-compacto .kpi-icono {
  width: 32px;
  height: 32px;
}

/* Ondas de selección al hacer clic en municipio */
.mapa-seleccion {
  position: relative;
  width: 48px;
  height: 48px;
}

.mapa-seleccion-onda {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  animation: mapa-seleccion-pulse 1.4s ease-out infinite;
}

.mapa-seleccion-punto {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes mapa-seleccion-pulse {
  0% {
    transform: scale(0.3);
    opacity: 0.7;
  }

  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Ondas de actividad — suaves y lentas */
.mapa-onda-wrap {
  position: relative;
  border-radius: 50%;
  pointer-events: none;
}

.mapa-onda {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  animation: mapa-onda-pulse 3.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes mapa-onda-pulse {
  0%   { transform: scale(0.75); opacity: 0.28; }
  60%  { opacity: 0.08; }
  100% { transform: scale(2.1);  opacity: 0; }
}

/* Marcadores de eventos en mapa electoral */
.evento-pin-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.evento-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}
.evento-pin-onda {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  animation: mapa-onda-pulse 2s ease-out infinite;
}

.mapa-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(6px) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
  font-family: var(--fuente) !important;
  padding: 0.45rem 0.75rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
}

.mapa-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

.mapa-tooltip-inner {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.mapa-tooltip-nombre {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

#mapa-zoom-indicator {
  position: absolute;
  bottom: 28px;
  left: 10px;
  z-index: 800;
  background: rgba(15,23,42,0.82);
  backdrop-filter: blur(6px);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  pointer-events: none;
  letter-spacing: 0.03em;
}

#mapa-zoom-indicator span {
  color: #fff;
}

.mapa-tooltip-count {
  font-size: 0.7rem;
  color: #a5b4fc;
  font-weight: 500;
}

/* ── Marcadores de puestos de votación ── */
.puesto-marker {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79,70,229,0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.puesto-marker:hover {
  transform: scale(1.18);
  box-shadow: 0 4px 14px rgba(79,70,229,0.5);
}
.puesto-marker-badge {
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* ── Panel lateral de puesto de votación ── */
.puesto-panel-total {
  font-size: 0.78rem;
  color: var(--texto-sec);
  margin: 0.5rem 0 0.75rem;
}
.puesto-panel-total strong {
  color: #6366f1;
  font-size: 1.05rem;
}
.puesto-panel-total span {
  color: var(--texto-sec);
}
.puesto-panel-grupos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.puesto-panel-grupo {
  border: 1px solid #fde68a;
  border-radius: 10px;
}
.puesto-panel-ref-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  background: linear-gradient(90deg, #fef9c3 0%, #fefce8 100%);
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.puesto-panel-grupo.abierto .puesto-panel-ref-header {
  border-radius: 9px 9px 0 0;
  border-bottom: 1px solid #fde68a;
}
.puesto-panel-ref-header:hover { background: linear-gradient(90deg, #fde68a 0%, #fef9c3 100%); }
.puesto-panel-ref-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.puesto-panel-ref-nombre {
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.puesto-panel-ref-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: #78350f;
  background: #fde68a;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.puesto-panel-chevron {
  color: #d97706;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.puesto-panel-grupo.abierto .puesto-panel-chevron {
  transform: rotate(180deg);
}
.puesto-panel-grupo-lista {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0.25rem 0.4rem 0.4rem;
}
.puesto-panel-grupo.abierto .puesto-panel-grupo-lista {
  display: flex;
}
.puesto-panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.4rem 0 0.3rem;
}
.puesto-panel-tab {
  min-width: 26px;
  height: 26px;
  padding: 0 0.4rem;
  border-radius: 6px;
  border: 1px solid #fde68a;
  background: transparent;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.puesto-panel-tab:hover { background: #fef9c3; }
.puesto-panel-tab.activo {
  background: #f59e0b;
  border-color: #d97706;
  color: #fff;
}
.puesto-panel-lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
}
.puesto-panel-votante {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: var(--fondo-alt, #f8fafc);
  transition: background 0.15s;
}
.puesto-panel-votante:hover { background: #ede9fe; }
.puesto-panel-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.puesto-panel-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.puesto-panel-nombre {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.puesto-panel-doc {
  font-size: 0.7rem;
  color: var(--texto-sec);
}
.mapa-panel-vacio {
  font-size: 0.82rem;
  color: var(--texto-sec);
  text-align: center;
  margin-top: 1.5rem;
}

/* ==============================================
   TOPBAR DERECHA + MENÚ CONFIGURACIÓN
============================================== */
.topbar-derecha {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-config {
  position: relative;
  color: var(--texto-sec);
  transition: color 0.2s, background 0.2s;
}

.btn-config:hover,
.btn-config.activo {
  color: var(--texto);
  background: rgba(0, 0, 0, 0.05);
}

.config-menu-wrap {
  position: relative;
}

.config-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-sm);
  box-shadow: var(--sombra-premium);
  z-index: 200;
  overflow: hidden;
  animation: dropdown-in 0.15s ease;
}

.config-dropdown.abierto {
  display: block;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

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

.config-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--texto);
  text-decoration: none;
  transition: background 0.15s;
}

.config-item:hover {
  background: rgba(250, 204, 21, 0.08);
  color: var(--color-primary-dark);
}

.config-item svg {
  flex-shrink: 0;
  color: var(--texto-muted);
}

.config-item:hover svg {
  color: var(--color-primary-dark);
}

/* ==============================================
   FOOTER
============================================== */
.panel-footer {
  text-align: center;
  padding: 1.25rem 2rem;
  font-size: 0.78rem;
  color: var(--texto-muted);
  border-top: 1px solid var(--borde);
  margin-top: 2rem;
}

.panel-footer strong {
  color: var(--texto-sec);
  font-weight: 600;
}

/* KPI de 3 columnas (Solicitudes) */
.kpi-fila.kpi-3col {
  grid-template-columns: repeat(3, 1fr);
}

/* KPI de 4 columnas */
.kpi-fila.kpi-4col {
  grid-template-columns: repeat(4, 1fr);
}

/* KPI de 5 columnas (Dashboard principal) */
.kpi-fila.kpi-5col {
  grid-template-columns: repeat(5, 1fr);
}

/* ==============================================
   OVERLAY SIDEBAR MÓVIL
============================================== */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 149;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#sidebar-overlay.visible {
  display: block;
}

/* ==============================================
   RESPONSIVE — 900px (tablet landscape / mapa)
============================================== */
@media (max-width: 900px) {
  .mapa-layout {
    flex-direction: column;
  }

  .mapa-panel {
    width: 100%;
    max-height: 450px;
  }

  #mapa-panel-contenido {
    max-height: 360px;
  }
}

/* ==============================================
   RESPONSIVE — 768px (tablet / móvil)
============================================== */
@media (max-width: 768px) {

  /* Sidebar */
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.abierto {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.4);
  }

  /* Topbar */
  #topbar {
    left: 0;
    padding: 0 1rem;
  }

  #topbar-titulo {
    font-size: 0.9rem;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #btn-logout {
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
  }

  /* Área principal */
  #area-principal {
    margin-left: 0;
  }

  #contenido {
    padding: 1rem;
  }

  /* Tipografía de página */
  .pagina-titulo {
    font-size: 1.5rem;
  }

  /* KPIs — todas las variantes a 2 columnas en tablet */
  .kpi-fila,
  .kpi-fila.kpi-3col,
  .kpi-fila.kpi-4col,
  .kpi-fila.kpi-5col,
  .kpi-fila.kpi-compacto {
    grid-template-columns: 1fr 1fr;
  }

  .kpi {
    padding: 1rem;
  }

  .kpi-valor {
    font-size: 1.9rem;
  }

  .kpi-fila.kpi-compacto .kpi-valor {
    font-size: 1.5rem;
  }

  /* Grillas */
  .dos-columnas {
    grid-template-columns: 1fr;
  }

  .form-grilla {
    grid-template-columns: 1fr;
  }

  /* Filtros */
  .filtros-barra {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filtros-controles {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filtros-controles select,
  .filtros-controles input[type="text"],
  .filtros-controles input[type="date"],
  .filtros-controles button {
    width: 100%;
  }

  .filtros-barra input[type="text"] {
    width: 100%;
  }

  /* Pestañas */
  .pestanas {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .pestanas::-webkit-scrollbar {
    display: none;
  }

  .pestana {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* KPI 3 columnas → 2 columnas en móvil (igual que las demás) */
  .kpi-fila.kpi-3col {
    grid-template-columns: 1fr 1fr;
  }

  /* Tablas */
  .tabla-contenedor {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabla {
    font-size: 0.78rem;
    min-width: 480px;
  }

  .tabla thead th,
  .tabla tbody td {
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
  }

  /* Botones submit de formularios → full width */
  form>.btn,
  form>button[type="submit"],
  .tarjeta>form>.btn,
  .tarjeta>form>button[type="submit"] {
    width: 100%;
  }

  /* Input suelto en filtros-barra */
  .filtros-barra>input[type="text"],
  .filtros-barra>input[type="search"] {
    width: 100%;
  }

  /* Mapa */
  #mapa-leaflet {
    height: 360px;
    min-height: 300px;
  }

  .mapa-leyenda-escala {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  /* Dashboard tarjetas */
  .dash-tarjeta-titulo-grupo {
    gap: 0.4rem;
  }

  /* Encabezados con botones — evitar overflow */
  .tarjeta-encabezado {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  /* Controles de tabla (título + búsqueda) */
  .tabla-controles {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .tabla-controles input[type="text"],
  .tabla-controles input[type="search"] {
    width: 100%;
  }

  /* Split button Excel → ancho completo */
  .split-btn-container {
    width: 100%;
  }
  .container-btn-file {
    flex: 1;
    justify-content: center;
  }

  /* Modal crear evento — mapa más compacto en móvil */
  #modal-crear-evento .mapa-ubicacion-evento {
    height: 200px !important;
  }

  /* Publicaciones/Noticias */
  .publicacion-card {
    padding: 1rem;
  }

  /* Panel lateral del mapa en columna */
  .mapa-panel {
    max-height: 400px;
  }
  #mapa-panel-contenido {
    max-height: 300px;
  }
}

/* ==============================================
   RESPONSIVE — 480px (móvil pequeño)
============================================== */
@media (max-width: 480px) {
  #contenido {
    padding: 0.75rem;
  }

  /* KPIs — todas las variantes a 2 columnas en móvil pequeño */
  .kpi-fila,
  .kpi-fila.kpi-3col,
  .kpi-fila.kpi-4col,
  .kpi-fila.kpi-5col,
  .kpi-fila.kpi-compacto {
    grid-template-columns: 1fr 1fr;
  }

  .kpi {
    padding: 0.85rem 0.9rem;
    gap: 0.6rem;
  }

  .kpi-valor {
    font-size: 1.6rem;
  }

  .kpi-icono {
    width: 32px;
    height: 32px;
  }

  .kpi-etiqueta {
    font-size: 0.72rem;
  }

  .pagina-titulo {
    font-size: 1.3rem;
  }

  .tarjeta {
    padding: 1rem;
  }

  #mapa-leaflet {
    height: 280px;
    min-height: 260px;
  }

  .acciones-grupo {
    flex-direction: column;
    gap: 0.4rem;
  }

  /* Modal full-width en móvil pequeño */
  .modal-caja {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }
  .modal-overlay {
    padding: 0.5rem;
  }

  /* Panel mapa más compacto en 480px */
  .mapa-panel {
    max-height: 320px;
  }
  #mapa-panel-contenido {
    max-height: 240px;
  }

  /* Noticias/publicaciones */
  .publicacion-card {
    padding: 0.75rem 1rem;
  }

  /* Encabezados tarjeta en columna si hay botones */
  .tarjeta-encabezado {
    flex-direction: column;
    align-items: flex-start;
  }
  .tarjeta-encabezado .btn,
  .tarjeta-encabezado button {
    width: 100%;
  }

  /* Aprobaciones accordion padding */
  .apro-ref-card {
    padding: 0.75rem;
  }
}

/* ==============================================
   BOT�N EXCEL Y MODALES PREMIUM
============================================== */

.split-btn-container {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 10px 25px -5px rgba(250, 204, 21, 0.2);
  position: relative;
  background: var(--color-primary);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.split-btn-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(250, 204, 21, 0.3);
}

.container-btn-file {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  color: var(--color-dark);
  border: none;
  padding: 0.7rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 1;
  border-radius: 14px 0 0 14px;
  overflow: hidden;
}

.container-btn-file svg {
  margin-right: 0.65rem;
  flex-shrink: 0;
}

.btn-dropdown-toggle {
  background-color: transparent;
  color: var(--color-dark);
  border: none;
  padding: 0 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0 14px 14px 0;
  transition: background 0.2s;
}

.excel-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-tarjeta);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  box-shadow: var(--sombra-premium);
  border: 1px solid var(--borde-glass);
  width: 240px;
  display: none;
  z-index: 200;
  overflow: hidden;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.excel-dropdown-menu.visible {
  display: block;
}

.excel-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--texto);
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}

.excel-dropdown-item:hover {
  background: rgba(250, 204, 21, 0.1);
  color: var(--color-primary-dark);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-caja {
  background: var(--bg-tarjeta);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--borde-glass);
  border-radius: var(--radio);
  box-shadow: var(--sombra-premium);
  padding: 2.5rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-acciones {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.modal-cerrar {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--texto-muted);
}

.excel-zona {
  border: 2px dashed var(--borde);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.2);
}

.excel-zona:hover {
  border-color: var(--color-primary);
  background: rgba(250, 204, 21, 0.08);
}

.excel-link {
  color: var(--color-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

/* Botón verde Excel (uiverse) — versión standalone fuera del split */
.container-btn-file.standalone {
  background-color: #307750;
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 0.5em;
  box-shadow: 4px 8px 10px -3px rgba(0, 0, 0, 0.35);
  transition: all 250ms;
  overflow: hidden;
  gap: 0.65rem;
}

.container-btn-file.standalone::before {
  content: "";
  position: absolute;
  height: 100%;
  width: 0;
  border-radius: 0.5em;
  background-color: #469b61;
  z-index: -1;
  transition: all 350ms;
}

.container-btn-file.standalone:hover::before {
  width: 100%;
}

/* Encabezado sección con botón derecho */
.pagina-encabezado {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

/* Dropdown "Descargar formato" dentro del modal */
.excel-formato-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.excel-formato-label {
  font-size: 0.82rem;
  color: var(--texto-muted);
}

.excel-formato-dropdown-wrap {
  position: relative;
}

.btn-formato-excel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-formato-excel:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.excel-formato-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-tarjeta, #fff);
  border: 1px solid var(--borde-glass, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  min-width: 210px;
  z-index: 50;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

.excel-formato-opcion {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--texto);
  cursor: pointer;
  transition: background 0.15s;
}

.excel-formato-opcion:hover {
  background: #f0fdf4;
  color: #166534;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

/* ── GRÁFICO VOTANTES ── */
.grafico-filtro-barra {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.grafico-referido-filtro {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-pagina);
  border: 1.5px solid var(--borde);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  color: var(--texto-muted);
  transition: border-color 0.2s;
}

.grafico-referido-filtro:focus-within {
  border-color: var(--color-primary);
}

.grafico-referido-filtro select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--texto);
  cursor: pointer;
  max-width: 220px;
}

.graficos-doble {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .graficos-doble {
    grid-template-columns: 1fr;
  }
}

.grafico-bloque {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.grafico-subtitulo {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--texto-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.grafico-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  transition: height 0.3s ease;
}

.grafico-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── BUSCADOR + CONTROLES TABLA ── */
.tabla-controles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.buscador-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-pagina);
  border: 1.5px solid var(--borde);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  flex: 1;
  max-width: 420px;
  transition: border-color 0.2s;
}

.buscador-wrap:focus-within {
  border-color: var(--color-primary);
}

.buscador-wrap svg {
  color: var(--texto-muted);
  flex-shrink: 0;
}

.buscador-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  color: var(--texto);
  width: 100%;
}

.buscador-wrap input::placeholder {
  color: var(--texto-muted);
}

/* ── PAGINACIÓN ── */
.paginacion-wrap {
  margin-top: 1rem;
}

.paginacion {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.pag-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1.5px solid var(--borde);
  background: transparent;
  color: var(--texto);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pag-btn:hover:not([disabled]) {
  border-color: var(--color-primary);
  background: rgba(250, 204, 21, 0.08);
}

.pag-btn.activo {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-dark);
  font-weight: 700;
}

.pag-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.pag-ellipsis {
  color: var(--texto-muted);
  font-size: 0.9rem;
  padding: 0 0.2rem;
}

.pag-info {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--texto-muted);
}


/* ==============================================
   EVENTOS
============================================== */
.evento-card {
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: #fff;
  transition: box-shadow 0.15s;
}

.evento-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.evento-card:last-child {
  margin-bottom: 0;
}

.evento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.evento-nombre {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--color-dark);
}

.evento-municipio {
  font-size: 0.78rem;
  font-weight: 600;
  background: #fef9c3;
  color: #92400e;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.evento-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.evento-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--texto-muted);
}

.evento-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Multiselect */
.multiselect-wrap {
  position: relative;
}

.multiselect-display {
  min-height: 40px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  background: #fff;
  user-select: none;
  transition: border-color 0.15s;
}

.multiselect-display:focus,
.multiselect-display:focus-within {
  border-color: var(--color-primary);
  outline: none;
}

.multiselect-placeholder {
  color: var(--texto-muted);
  font-size: 0.875rem;
}

.multiselect-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--color-primary);
  color: var(--color-dark);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.multiselect-tag button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}

.multiselect-tag button:hover {
  opacity: 1;
}

.multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 200;
  max-height: 260px;
  overflow: hidden;
  flex-direction: column;
}

.multiselect-dropdown.abierto {
  display: flex;
}

.multiselect-search-wrap {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--borde);
}

.multiselect-search {
  width: 100%;
  border: 1px solid var(--borde);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  outline: none;
}

.multiselect-search:focus {
  border-color: var(--color-primary);
}

.multiselect-opciones {
  overflow-y: auto;
  padding: 0.25rem 0;
}

.multiselect-opcion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-dark);
  transition: background 0.1s;
}

.multiselect-opcion:hover {
  background: #f8fafc;
}

.multiselect-opcion input {
  accent-color: var(--color-primary);
  width: 15px;
  height: 15px;
}

/* Stats KPIs */
.stats-kpi {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  border-left: 4px solid var(--kpi-color, var(--color-primary));
}

.stats-kpi-val {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--kpi-color, var(--color-dark));
  line-height: 1;
}

.stats-kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--texto-muted);
  margin-top: 0.3rem;
}

/* Tabla asistentes */
.tabla-asistentes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.tabla-asistentes th {
  background: #f1f5f9;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-muted);
  position: sticky;
  top: 0;
}

.tabla-asistentes td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--color-dark);
}

.tabla-asistentes tr:last-child td {
  border-bottom: none;
}

.tabla-asistentes tr:hover td {
  background: #f8fafc;
}

.badge-si {
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.badge-no {
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Tooltip puestos de votación */
.mapa-tooltip-puesto {
  background: #1e293b !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.mapa-tooltip-puesto::before {
  display: none !important;
}

.mapa-puesto-tooltip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.85rem;
}

.mapa-puesto-tooltip strong {
  font-size: 0.82rem;
  color: #fff;
  font-weight: 700;
}

.mapa-puesto-tooltip span {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ── Dashboard dona municipios ── */
.dash-dona-card {
  margin-bottom: 1.5rem;
}

.dash-dona-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dash-dona-total-badge {
  background: #f1f5f9;
  color: var(--texto-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}

.dash-dona-body {
  width: 100%;
}

.dash-dona-wrap {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.dash-dona-centro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dash-dona-centro span:first-child {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--color-dark);
  line-height: 1;
}

.dash-dona-centro span:last-child {
  font-size: 0.72rem;
  color: var(--texto-muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-dona-leyenda {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-dona-leyenda-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.dash-dona-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-dona-leyenda-nombre {
  flex: 1;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-dona-leyenda-val {
  font-weight: 700;
  color: var(--color-dark);
  min-width: 28px;
  text-align: right;
}

.dash-dona-leyenda-pct {
  color: var(--texto-muted);
  min-width: 36px;
  text-align: right;
  font-size: 0.75rem;
}

/* ── Grid dona + calendario ── */
.dash-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dash-mid-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Calendario ── */
.dash-calendario-card {
  height: 100%;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cal-titulo {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-dark);
}

.cal-nav-btn {
  background: #f1f5f9;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.cal-nav-btn:hover {
  background: #e2e8f0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.5rem;
}

.cal-dia-header {
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--texto-muted);
  text-transform: uppercase;
  padding-bottom: 2px;
}

.cal-celda {
  height: 26px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.12s;
  position: relative;
  gap: 1px;
}

.cal-celda:hover:not(.cal-vacia) {
  background: #f1f5f9;
}

.cal-vacia {
  pointer-events: none;
}

.cal-num {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-dark);
  line-height: 1;
}

.cal-hoy {
  background: var(--color-primary) !important;
}

.cal-hoy .cal-num {
  font-weight: 800;
  color: var(--color-dark);
}

.cal-con-evento:not(.cal-hoy) {
  background: #eef2ff;
}

.cal-con-evento:not(.cal-hoy) .cal-num {
  color: #6366f1;
  font-weight: 700;
}

.cal-puntos {
  display: flex;
  gap: 1px;
}

.cal-punto {
  width: 3px;
  height: 3px;
  border-radius: 50%;
}

/* Lista próximos eventos — fila horizontal, máx 4 */
.cal-proximos {
  border-top: 1px solid #f1f5f9;
  padding-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.cal-proximo-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  min-width: 0;
}

.cal-proximo-fecha {
  width: 34px;
  height: 34px;
  background: #eef2ff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-proximo-dia {
  font-size: 0.85rem;
  font-weight: 800;
  color: #6366f1;
  line-height: 1;
}

.cal-proximo-mes {
  font-size: 0.55rem;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
}

.cal-proximo-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  width: 100%;
  min-width: 0;
}

.cal-proximo-nombre {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-proximo-meta {
  font-size: 0.65rem;
  color: var(--texto-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-proximo-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-estado-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: fit-content;
}
.cal-estado-activo  { background: #dcfce7; color: #16a34a; }
.cal-estado-proximo { background: #dbeafe; color: #2563eb; }
.cal-estado-fin     { background: #f1f5f9; color: #94a3b8; }

/* ── Ranking puestos de votación ── */
.ranking-puesto-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.ranking-puesto-item:last-child {
  border-bottom: none;
}

.ranking-puesto-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--texto-muted);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ranking-puesto-item:nth-child(1) .ranking-puesto-num {
  background: #fef9c3;
  color: #92400e;
}

.ranking-puesto-item:nth-child(2) .ranking-puesto-num {
  background: #f1f5f9;
  color: #475569;
}

.ranking-puesto-item:nth-child(3) .ranking-puesto-num {
  background: #fff7ed;
  color: #c2410c;
}

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

.ranking-puesto-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.ranking-puesto-nombre {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-puesto-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-dark);
  flex-shrink: 0;
}

.ranking-puesto-barra-bg {
  height: 5px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.ranking-puesto-barra-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Badges de estado de evento ── */
.evento-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.evento-badge.activo {
  background: #dcfce7;
  color: #15803d;
}

.evento-badge.finalizado,
.evento-badge.expirado {
  background: #f1f5f9;
  color: #64748b;
}

.evento-badge.proximo {
  background: #eff6ff;
  color: #2563eb;
}

.evento-card-finalizado {
  opacity: 0.72;
}

.evento-card-finalizado .evento-nombre {
  color: var(--texto-muted);
}

/* ── Override colores badge evento ── */
.evento-badge.agendado {
  background: #fef9c3;
  color: #854d0e;
}

.evento-badge.activo {
  background: #dcfce7;
  color: #15803d;
}

.evento-badge.finalizado,
.evento-badge.expirado {
  background: #f1f5f9;
  color: #64748b;
}

/* ── Mi Equipo acordeón ── */
.equipo-miembro {
  border-bottom: 1px solid #f1f5f9;
}

.equipo-miembro:last-child {
  border-bottom: none;
}

.equipo-miembro-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 8px;
}

.equipo-miembro-header:hover {
  background: #f8fafc;
}

.equipo-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

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

.equipo-nombre {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-dark);
}

.equipo-rol {
  font-size: 0.75rem;
  color: var(--texto-muted);
  text-transform: capitalize;
}

.equipo-stats {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.equipo-stat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.equipo-stat-badge.total {
  background: #f1f5f9;
  color: #475569;
}

.equipo-stat-badge.aprobado {
  background: #dcfce7;
  color: #15803d;
}

.equipo-stat-badge.pendiente {
  background: #fef9c3;
  color: #854d0e;
}

.equipo-chevron {
  flex-shrink: 0;
  color: var(--texto-muted);
  transition: transform 0.2s;
}

.equipo-votantes {
  padding: 0 1.25rem 1rem;
  border-top: 1px solid #f1f5f9;
}

/* ── Layout votantes: equipo izq + gráficos der ── */
.votantes-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}

.votantes-graficos-col {
  display: flex;
  flex-direction: column;
}

.votantes-graficos-col .grafico-bloque {
  padding: 1.25rem;
}

/* Botón descarga por miembro */
.equipo-btn-descargar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  margin-right: 0.25rem;
}

.equipo-btn-descargar:hover {
  border-color: #facc15;
  background: #fefce8;
  color: #854d0e;
}

/* Miembro activo */
.equipo-miembro-header.activo {
  background: #fefce8;
  border-radius: 8px;
}

.equipo-miembro-header.activo .equipo-nombre {
  color: var(--color-accent-dark, #854d0e);
}

@media (max-width: 900px) {
  .votantes-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Aprobaciones acordeón por referido ── */
.apro-acordeon-lista {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.apro-ref-card {
  border-radius: 12px;
  border: 1px solid var(--borde);
  background: var(--bg-tarjeta);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.apro-ref-card.abierto {
  border-color: rgba(124,58,237,0.3);
  box-shadow: 0 4px 16px rgba(124,58,237,0.08);
}

.apro-ref-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.apro-ref-header:hover {
  background: rgba(124,58,237,0.04);
}

.apro-ref-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(124,58,237,0.1);
  color: #7c3aed;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.apro-ref-card.abierto .apro-ref-avatar {
  background: rgba(124,58,237,0.18);
}

.apro-ref-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.apro-ref-nombre {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-dark);
}

.apro-ref-card.abierto .apro-ref-nombre {
  color: #7c3aed;
}

.apro-ref-sub {
  font-size: 0.75rem;
  color: var(--texto-muted);
}

.apro-ref-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.apro-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.apro-badge-pend {
  background: #fef9c3;
  color: #854d0e;
}

.apro-badge-rech {
  background: #fee2e2;
  color: #dc2626;
}

.apro-ref-chevron {
  color: var(--texto-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.apro-ref-card.abierto .apro-ref-chevron {
  transform: rotate(180deg);
  color: #7c3aed;
}

.apro-ref-body {
  border-top: 1px solid var(--borde);
  background: #fafafa;
}

.apro-ref-body .tabla-contenedor {
  padding: 0.75rem 1rem 1rem;
}

.apro-ref-body .tabla {
  font-size: 0.8rem;
}

/* ── Mapa picker ubicación evento ── */
.ubicacion-buscador-wrap {
  position: relative;
  margin-bottom: 0.6rem;
}
.ubicacion-buscador-wrap input {
  width: 100%;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  font-family: var(--fuente);
  transition: border-color 0.15s;
}
.ubicacion-buscador-wrap input:focus { border-color: var(--color-purple); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.ubicacion-sugerencias {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 3px;
  list-style: none;
}
.ubicacion-sugerencias li {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  line-height: 1.4;
}
.ubicacion-sugerencias li:last-child { border-bottom: none; }
.ubicacion-sugerencias li:hover { background: var(--color-purple-soft); }
/* ── Modal evento: layout base ── */
#modal-crear-evento .modal-caja {
  display: flex;
  flex-direction: column;
}
#modal-crear-evento .modal-mapa-col {
  padding: 0 1.5rem 0.5rem;
}
#modal-crear-evento .modal-form-col {
  padding: 0 1.5rem 1.5rem;
  overflow-y: auto;
}
.mapa-ubicacion-wrap {
  position: relative;
  margin-top: 0.4rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--borde);
}
.mapa-ubicacion-evento {
  width: 100%;
  height: 220px;
}

/* ── Estado expandido: mapa pantalla completa ── */
#modal-crear-evento.mapa-expandido .modal-mapa-col {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 0;
  background: #000;
}
#modal-crear-evento.mapa-expandido .mapa-ubicacion-wrap {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  border: none;
}
#modal-crear-evento.mapa-expandido .mapa-ubicacion-evento {
  height: 100%;
}
.mapa-fullscreen-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  color: #1e293b;
  transition: background 0.15s;
}
.mapa-fullscreen-btn:hover { background: #fff; }
.ubicacion-seleccionada-texto {
  font-size: 0.8rem;
  color: var(--color-purple);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Modal confirmar desactivar ── */
.modal-confirmar-caja {
  max-width: 340px;
  text-align: center;
  padding: 2rem 1.75rem;
}

.modal-confirmar-icono {
  width: 60px;
  height: 60px;
  background: #fff7ed;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.modal-confirmar-titulo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.modal-confirmar-texto {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-confirmar-btn-peligro {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.8rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.6rem;
  transition: background 0.15s;
}

.modal-confirmar-btn-peligro:hover {
  background: #dc2626;
}

.modal-confirmar-btn-cancelar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-confirmar-btn-cancelar:hover {
  background: #f8fafc;
}

/* ── Toggle activo/inactivo usuario ── */
.toggle-activo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-activo-btn.activo {
  background: #dcfce7;
  color: #166534;
}

.toggle-activo-btn.inactivo {
  background: #f1f5f9;
  color: #64748b;
}

.toggle-activo-btn:hover.activo {
  background: #bbf7d0;
}

.toggle-activo-btn:hover.inactivo {
  background: #e2e8f0;
}

.toggle-activo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.usuario-inactivo td {
  opacity: 0.5;
}

.usuario-inactivo td:last-child {
  opacity: 1;
}

/* ── Alerta duplicado cédula ── */
.alerta-duplicado-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.9;
  transition: opacity 0.15s, transform 0.15s;
}

.alerta-duplicado-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.duplicado-popover {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.75rem 1rem;
  min-width: 240px;
  max-width: 300px;
  display: none;
}

.dup-pop-titulo {
  font-size: 0.8rem;
  color: #92400e;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #fed7aa;
}

.dup-pop-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.dup-pop-item:last-child {
  border-bottom: none;
}

.dup-pop-nombre {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.dup-pop-ref {
  font-size: 0.78rem;
  color: #64748b;
}

.dup-pop-estado {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ── Toggle sin datos en mapa ── */
.mapa-toggle-sin-datos {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.mapa-toggle-sin-datos.activo {
  border-color: #facc15;
  background: #fefce8;
  color: #854d0e;
}

/* ── Modal exportar consolidado ── */
.export-seccion-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin: 1.1rem 0 0.6rem;
}

.export-radio-grupo {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.export-radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.export-radio-label:has(input:checked) {
  border-color: #facc15;
  background: #fefce8;
}

.export-radio-label input {
  accent-color: #facc15;
}

.export-cols-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 0.75rem;
}

.export-col-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.export-col-check input {
  accent-color: #facc15;
}

/* ==============================================
   RESPONSIVE COMPLEMENTARIO — 900px
============================================== */
@media (max-width: 900px) {
  /* Calendario: 4 eventos → 2 columnas */
  .cal-proximos {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Perfil grid → 1 columna */
  .perfil-grid {
    grid-template-columns: 1fr;
  }

  /* Modales: quitar padding excesivo */
  .modal-caja {
    padding: 1.75rem;
  }

  /* Leyenda del mapa: permitir wrap */
  .mapa-leyenda {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Botones toggle mapa: wrap */
  .mapa-leyenda > .mapa-toggle-sin-datos {
    margin-top: 0.25rem;
  }
}

/* ==============================================
   RESPONSIVE COMPLEMENTARIO — 768px
============================================== */
@media (max-width: 768px) {
  /* Calendario: 4 eventos → 2 columnas */
  .cal-proximos {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Modales: casi full width */
  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-caja {
    padding: 1.25rem;
    max-height: 95vh;
    border-radius: 12px;
  }

  /* Grilla exportar consolidado → 2 columnas */
  .export-cols-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mapa leyenda: column */
  .mapa-leyenda {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .mapa-leyenda-escala {
    flex-wrap: wrap;
  }

  /* Botones toggle mapa uno al lado del otro */
  .mapa-leyenda-controles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Aprobaciones acciones: column */
  .apro-acciones {
    flex-direction: column;
    gap: 0.35rem;
  }

  /* Buscador mapa: full width */
  .mapa-buscador-wrap {
    width: 100%;
    max-width: 100%;
  }

  /* KPI compacto → 2 columnas a 768px también */
  .kpi-fila.kpi-compacto {
    grid-template-columns: 1fr 1fr;
  }

  /* Perfil grid */
  .perfil-grid {
    grid-template-columns: 1fr;
  }

  /* Votantes lista equipo: ocultar columnas menos importantes */
  .equipo-btn-descargar {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
  }


  /* Buscador de equipo/votantes: full width */
  .buscador-wrap {
    max-width: 100%;
    flex: 1;
  }

  /* Pagina encabezado: apilar en móvil */
  .pagina-encabezado {
    flex-direction: column;
    align-items: flex-start;
  }
  .pagina-encabezado > div:last-child {
    width: 100%;
  }
  .pagina-encabezado > div:last-child .btn,
  .pagina-encabezado > div:last-child button {
    flex: 1;
  }

  /* Botones de acción en modales (divs inline flex) */
  .modal-acciones {
    flex-direction: column;
    gap: 0.5rem;
  }
  .modal-acciones .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==============================================
   RESPONSIVE COMPLEMENTARIO — 480px
============================================== */
@media (max-width: 480px) {
  /* Calendario: 4 eventos → 1 columna */
  .cal-proximos {
    grid-template-columns: 1fr;
  }

  /* Modales: full width sin margen */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-caja {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding: 1.25rem 1rem;
  }

  /* Grilla exportar → 1 columna */
  .export-cols-grid {
    grid-template-columns: 1fr;
  }

  /* Topbar: ocultar texto del usuario si hay poco espacio */
  .topbar-usuario-nombre {
    display: none;
  }

  /* Pestañas aprobaciones: scroll horizontal */
  .pestanas {
    gap: 0.25rem;
  }

  .pestana {
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
  }

  /* Acciones tabla: column */
  .acciones-grupo {
    align-items: stretch;
  }

  .acciones-grupo .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mapa leyenda: compactar */
  .mapa-leyenda-label {
    font-size: 0.7rem;
  }

  .mapa-toggle-sin-datos {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  /* Toggle usuario: solo punto sin texto */
  .toggle-activo-label {
    display: none;
  }

  /* Tabla: reducir min-width para no forzar scroll excesivo */
  .tabla {
    min-width: 360px;
  }

  .acciones-grupo {
    width: 100%;
  }

  /* Buscador: siempre full width */
  .buscador-wrap {
    max-width: 100%;
  }

  /* Pagina encabezado */
  .pagina-encabezado {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .pagina-encabezado > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
  .pagina-encabezado > div:last-child .btn,
  .pagina-encabezado > div:last-child button {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Modal crear evento: mapa más corto y form con scroll */
  #modal-crear-evento .mapa-ubicacion-evento {
    height: 160px !important;
  }
  #modal-crear-evento .modal-form-col {
    max-height: 320px;
    overflow-y: auto;
  }

  /* Modal botones acción: apilar */
  .modal-acciones {
    flex-direction: column;
    gap: 0.5rem;
  }
  .modal-acciones .btn {
    width: 100%;
    justify-content: center;
  }

  /* Split btn Excel: full width */
  .split-btn-container {
    width: 100%;
    border-radius: 10px;
  }
  .container-btn-file {
    border-radius: 10px 0 0 10px;
    flex: 1;
    justify-content: center;
  }

  /* Dona dashboard: reducir a 150px en móvil pequeño */
  .dona-wrap {
    width: 150px !important;
    height: 150px !important;
  }
}