/* ============================================================
   CENSO VETERINARIO – EASUR – Tarija, Bolivia
   styles.css – Hoja de estilos principal
   ============================================================ */

/* Variables de colores institucionales */
:root {
  /* Colores principales */
  --verde:        #2e7d32;
  --verde-claro:  #43a047;
  --verde-suave:  #e8f5e9;
  --verde-medio:  #c8e6c9;
  --azul:         #1565c0;
  --azul-claro:   #e3f2fd;
  --rojo:         #c62828;
  --rojo-claro:   #ffebee;
  --naranja:      #e65100;
  --naranja-claro:#fff3e0;
  --morado:       #6a1b9a;
  --morado-claro: #f3e5f5;
  --gris:         #6b7280;
  --gris-claro:   #f3f4f6;
  --gris-borde:   #e5e7eb;
  --blanco:       #ffffff;

  /* Superficies (Material 3 inspired) */
  --surface:        #ffffff;
  --surface-2:      #f9fafb;
  --surface-3:      #f3f4f6;
  --on-surface:     #111827;
  --on-surface-dim: #6b7280;

  /* Sombras */
  --sombra:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --sombra-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --sombra-lg: 0 10px 25px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.06);

  /* Espaciado */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* Radio de borde */
  --radio:    14px;
  --radio-sm: 8px;
  --radio-lg: 20px;

  /* Tipografía */
  --fuente: 'Inter', system-ui, -apple-system, sans-serif;

  /* Transición */
  --transicion: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--fuente);
  background: #f0f2f5;
  color: var(--on-surface);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.oculto { display: none !important; }
button { font-family: var(--fuente); cursor: pointer; }
input, select, textarea { font-family: var(--fuente); }

/* ============================================================
   LOGIN
   ============================================================ */
#pantalla-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1b5e20 0%, #2e7d32 40%, #1565c0 100%);
  padding: 20px;
}
.login-page {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.login-header-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px 20px;
  width: 100%;
  backdrop-filter: blur(4px);
}
.login-logo-img {
  height: 80px;
  width: 80px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.login-header-texto {
  flex: 1;
  text-align: center;
  color: white;
}
.login-inst {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}
.login-titulo  { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.login-subtitulo  { font-size: 13px; opacity: 0.9; }
.login-subtitulo2 { font-size: 11px; opacity: 0.75; margin-top: 2px; }
.login-card {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
/* ── Gato animado – login ────────────────────────────────── */
.login-mascota-svg {
  display: block;
  margin: 0 auto 10px;
  text-align: center;
}
.login-mascota-svg svg {
  width: 90px;
  height: auto;
  display: block;
  margin: 0 auto;
  animation: catFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px rgba(51,58,78,.22));
  overflow: visible;
}
@keyframes catFloat {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-7px); }
}
.login-card-titulo {
  font-size: 18px;
  color: var(--verde);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
}
.login-footer { color: rgba(255,255,255,0.6); font-size: 11px; text-align: center; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  background: var(--verde);
  color: white;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.header-centro { grid-column: 2; text-align: center; }
.header-titulo { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.header-subtitulo { display: block; font-size: 11px; opacity: 0.75; font-weight: 400; letter-spacing: 0.2px; }
.header-usuario {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  grid-column: 3;
  justify-self: end;
}
#nombre-usuario { font-size: 11px; opacity: 0.8; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-rol {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-rol-admin         { background: #ffd600; color: #1a1200; }
.badge-rol-censador      { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.35); }
.badge-rol-investigador  { background: #7c3aed; color: white; }
.btn-salir {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transicion);
  touch-action: manipulation;
}
.btn-salir:hover { background: rgba(255,255,255,0.28); }

/* Mensaje de bienvenida */
.bienvenida-banner {
  background: var(--verde-suave);
  color: var(--verde);
  padding: 8px 16px;
  font-size: 12.5px;
  text-align: center;
  font-weight: 500;
  border-bottom: 1px solid var(--verde-medio);
  letter-spacing: 0.1px;
}

/* ============================================================
   TABS (pestañas)
   ============================================================ */
.tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--gris-borde);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 60px;
  z-index: 900;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1;
  min-width: 68px;
  padding: 10px 6px;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--gris);
  white-space: nowrap;
  transition: var(--transicion);
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.1px;
}
.tab.activo {
  color: var(--verde);
  border-bottom-color: var(--verde);
  background: var(--verde-suave);
}
.tab:hover:not(.activo) { background: var(--surface-3); color: var(--verde); }

/* Tab admin dorado */
.tab-admin { color: #92700a !important; }
.tab-admin.activo {
  color: #6b5200 !important;
  border-bottom-color: #f59f00 !important;
  background: #fffbeb !important;
}

/* Badge de notificación en tab */
.tab-badge {
  position: absolute;
  top: 5px;
  right: 6px;
  background: var(--rojo);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  min-width: 16px;
  text-align: center;
}
.tab-alerta        { color: var(--rojo) !important; }
.tab-alerta.activo {
  color: var(--rojo) !important;
  border-bottom-color: var(--rojo) !important;
  background: var(--rojo-claro) !important;
}

/* ============================================================
   NAVEGACIÓN MOBILE – barra superior mejorada
   ============================================================ */
@media(max-width: 640px) {
  .tabs {
    top: 60px;
    padding: 0 2px;
  }
  .tab {
    flex-direction: column;
    gap: 2px;
    padding: 7px 4px 6px;
    font-size: 10px;
    min-width: 54px;
  }
  .tab .fas { font-size: 16px; }
  .tab-contenido { padding-bottom: var(--sp-5); }
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.tab-contenido {
  padding: var(--sp-4);
  max-width: 880px;
  margin: 0 auto;
}

/* Alerta de rabia */
.alerta-rabia {
  background: var(--rojo);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pulso 1.5s infinite;
}
@keyframes pulso {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.8; }
}

/* ============================================================
   FORMULARIO
   ============================================================ */
.formulario-card {
  background: var(--surface);
  border-radius: var(--radio);
  padding: var(--sp-5);
  box-shadow: var(--sombra);
  border: 1px solid var(--gris-borde);
  animation: fadeInUp 0.25s ease;
}
.formulario-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--verde);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--verde-suave);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.titulo-alerta { color: var(--rojo) !important; border-bottom-color: var(--rojo-claro) !important; }
.form-descripcion {
  font-size: 13px;
  color: var(--gris);
  margin: -12px 0 16px;
  line-height: 1.5;
}
.alerta-desc {
  background: var(--rojo-claro);
  color: var(--rojo);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 4px solid var(--rojo);
}
.seccion-form {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--gris-borde);
}
.seccion-form:last-of-type { border-bottom: none; }
.seccion-form h3 {
  font-size: 12px;
  color: var(--verde);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: var(--sp-4);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.seccion-form h3 .fas {
  width: 24px;
  height: 24px;
  background: var(--verde-suave);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.fila-campos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media(max-width: 480px) { .fila-campos { grid-template-columns: 1fr; } }
.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: var(--sp-3); }
.campo label { font-size: 12.5px; font-weight: 600; color: #374151; letter-spacing: 0.1px; }
.campo input,
.campo select,
.campo textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 14.5px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  color: var(--on-surface);
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--verde-claro);
  box-shadow: 0 0 0 3px rgba(67,160,71,0.12);
}
.campo input:hover,
.campo select:hover,
.campo textarea:hover {
  border-color: #9ca3af;
}
.campo textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* GPS */
.gps-fila { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gps-fila input {
  flex: 1;
  min-width: 90px;
  padding: 11px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: #fafafa;
}
.btn-gps {
  padding: 11px 14px;
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  transition: var(--transicion);
}
.btn-gps:hover { background: #0d47a1; }
.gps-estado { font-size: 12px; color: var(--gris); margin-top: 4px; }

/* Intervenciones Si/No */
.intervenciones-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media(max-width: 400px) { .intervenciones-grid { grid-template-columns: 1fr; } }
.intervencion-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fafafa;
}
.intervencion-item label {
  font-size: 13px;
  color: var(--gris);
  font-weight: 600;
}
.select-si-no {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1.5px solid #e0e0e0;
  font-size: 14px;
  font-family: var(--fuente);
  background: white;
  color: #212121;
  cursor: pointer;
  transition: var(--transicion);
}
.select-si-no:focus { border-color: var(--verde); outline: none; }
.select-si-no option[value="si"] { color: var(--verde); font-weight: 600; }
.select-si-no option[value="no"] { color: var(--rojo); }

/* Botones */
.botones-form { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.btn-primario {
  flex: 1;
  padding: 13px 20px;
  background: var(--verde);
  color: white;
  border: none;
  border-radius: var(--radio-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transicion);
  min-width: 140px;
  letter-spacing: 0.1px;
  touch-action: manipulation;
  box-shadow: 0 2px 6px rgba(46,125,50,0.25);
}
.btn-primario:hover { background: #236b28; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,125,50,0.35); }
.btn-primario:active { transform: translateY(0); box-shadow: none; }
.btn-secundario {
  padding: 14px 20px;
  background: var(--gris-claro);
  color: var(--gris);
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  transition: var(--transicion);
}
.btn-secundario:hover { background: #e0e0e0; }
.btn-azul  { background: var(--azul) !important; color: white !important; }
.btn-azul:hover { background: #0d47a1 !important; }
.btn-rojo  { background: var(--rojo) !important; color: white !important; }
.btn-rojo:hover { background: #8b0000 !important; }
.btn-naranja { background: var(--naranja) !important; color: white !important; }
.btn-naranja:hover { background: #bf360c !important; }

.form-mensaje { text-align: center; font-size: 14px; margin-top: 12px; min-height: 20px; font-weight: 500; }
.form-mensaje.exito { color: var(--verde); }
.form-mensaje.error { color: var(--rojo); }
.error-msg { color: var(--rojo); font-size: 13px; margin-top: 8px; min-height: 18px; text-align: center; }

/* Foto */
.foto-estado-info {
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 10px;
  background: var(--verde-suave);
  border-radius: 6px;
  color: var(--verde);
  display: none;
}
.foto-estado-info.visible { display: block; }
.foto-opciones { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-foto {
  flex: 1;
  min-width: 130px;
  padding: 13px 14px;
  background: var(--azul-claro);
  color: var(--azul);
  border: 2px dashed var(--azul);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: var(--transicion);
}
.btn-foto:hover { background: var(--azul); color: white; }
.btn-foto-rojo {
  background: var(--rojo-claro) !important;
  color: var(--rojo) !important;
  border-color: var(--rojo) !important;
}
.btn-foto-rojo:hover { background: var(--rojo) !important; color: white !important; }
.foto-preview-contenedor { position: relative; display: inline-block; margin-top: 10px; width: 100%; }
.foto-preview-img {
  width: 100%;
  max-width: 300px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  display: block;
}
.btn-quitar-foto {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}

/* Barra de progreso de compresión */
.foto-progreso { margin-top: 8px; display: none; }
.foto-progreso.visible { display: block; }
.foto-progreso-barra {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}
.foto-progreso-fill {
  height: 100%;
  background: var(--verde-claro);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ============================================================
   MAPA
   ============================================================ */
.mapa-controles {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}
/* Wrapper con fade-out derecho para indicar scroll horizontal */
.mapa-datos-wrapper {
  position: relative;
  margin-bottom: 10px;
}
.mapa-datos-wrapper::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  background: linear-gradient(to right, transparent, white 90%);
  pointer-events: none;
}
/* Fila de botones de datos: scroll horizontal en mobile */
.mapa-controles-datos {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.mapa-controles-datos::-webkit-scrollbar { display: none; }
.mapa-controles-datos .mapa-seccion-label { flex-shrink: 0; }
.mapa-filtro-row { margin-bottom: 8px; }
.mapa-seccion-label {
  font-size: 11px;
  color: var(--gris);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-right: 2px;
  white-space: nowrap;
}
.btn-mapa-ctrl {
  padding: 7px 13px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  background: white;
  font-size: 12px;
  transition: var(--transicion);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-mapa-ctrl.activo { background: var(--verde); color: white; border-color: var(--verde); }
.btn-mapa-ctrl:hover:not(.activo) { background: var(--verde-suave); border-color: var(--verde-claro); }
.filtro-mapa {
  padding: 7px 13px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 12px;
  background: white;
}
#mapa {
  width: 100%;
  height: 430px;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  border: 1px solid #e0e0e0;
}
.mapa-nota { font-size: 12px; color: var(--gris); margin-top: 8px; text-align: center; }
.mapa-divider { width: 1px; height: 24px; background: #e0e0e0; margin: 0 4px; }

/* Popup del mapa */
.leaflet-popup-content { font-family: var(--fuente); font-size: 13px; line-height: 1.6; min-width: 200px; }
.popup-titulo       { font-weight: 700; font-size: 15px; color: var(--verde); margin-bottom: 6px; }
.popup-titulo-rojo  { font-weight: 700; font-size: 15px; color: var(--rojo); margin-bottom: 6px; }
.popup-fila         { margin-bottom: 3px; }
.popup-fila strong  { color: #424242; }
.popup-foto         { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; margin-top: 6px; display: block; }
.popup-btn-ficha {
  display: block;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--verde);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
  text-align: center;
}

/* Popup del dueño: cabecera de alerta cuando tiene >5 caninos */
.popup-foco-alerta {
  background: var(--rojo-claro);
  color: var(--rojo);
  border-left: 3px solid var(--rojo);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px 0 6px;
}
.popup-foco-alerta .fas { margin-right: 4px; }

/* Lista de animales del dueño dentro del popup */
.popup-animales-titulo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gris);
  font-weight: 700;
  margin: 8px 0 4px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}
.popup-animales-lista {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 180px;
  overflow-y: auto;
}
.popup-animal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f4f4f4;
  font-size: 12px;
}
.popup-animal-item:last-child { border-bottom: none; }
.popup-animal-info { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-animal-id   { color: var(--gris); font-size: 10px; }
.popup-animal-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.popup-animal-meta .fas { font-size: 11px; }
.popup-btn-mini {
  background: var(--verde-suave);
  color: var(--verde);
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transicion);
}
.popup-btn-mini:hover { background: var(--verde); color: white; }

/* ============================================================
   LISTADO
   ============================================================ */
.listado-controles {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.listado-controles h2 { font-size: 20px; color: var(--verde); }
/* Wrapper del buscador con icono posicionado */
.buscador-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.buscador-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gris);
  pointer-events: none;
  font-size: 14px;
}
.buscador-wrapper .buscador-listado {
  padding-left: 38px;
  width: 100%;
}

.buscador-listado {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 14px;
}
.buscador-listado:focus { outline: none; border-color: var(--verde-claro); box-shadow: 0 0 0 3px rgba(76,175,80,0.15); }
.filtros-listado { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtros-listado select {
  padding: 8px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

/* Cards de animales — mismo formato que solicitudes/reportes */
.animal-card {
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--sombra);
  border-left: 4px solid var(--verde-claro);
  animation: fadeInUp 0.25s ease;
  transition: box-shadow 0.18s, transform 0.18s;
}
.animal-card:hover { box-shadow: var(--sombra-md); transform: translateY(-1px); }
.animal-card.felino { border-left-color: #fb923c; }

/* Pill con el ID del animal dentro del titulo */
.animal-id {
  display: inline-block;
  font-size: 11px;
  background: var(--verde-suave);
  color: var(--verde);
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0 4px;
  vertical-align: middle;
}
.animal-id.felino-id { background: #fff7ed; color: #c2410c; }

/* Foto lateral en cards (compartida con solicitudes/reportes) */
.animal-foto {
  float: right;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radio-sm);
  margin: 0 0 var(--sp-2) var(--sp-3);
  border: 1px solid var(--gris-borde);
  flex-shrink: 0;
}

.animal-observaciones {
  font-size: 13px;
  color: #4b5563;
  background: var(--surface-2);
  border-radius: var(--radio-sm);
  padding: var(--sp-2) var(--sp-3);
  margin: 8px 0;
  border-left: 3px solid var(--gris-borde);
  line-height: 1.5;
  clear: both;
}

.animal-badges { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0; clear: both; }
.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-vacunado      { background: #dbeafe; color: #1d4ed8; }
.badge-esterilizado  { background: #f3e8ff; color: #7e22ce; }
.badge-desparasitado { background: var(--verde-suave); color: var(--verde); }
.badge-pendiente     { background: #fff7ed; color: #c2410c; }
.badge-piloto        { background: var(--verde-suave); color: var(--verde); }
.badge-nuevo         { background: #fdf2f8; color: #9d174d; }
.badge-sino-si       { background: #dcfce7; color: #15803d; }
.badge-sino-no       { background: var(--surface-3); color: #9ca3af; }

/* Botones de acción en cards (animales, solicitudes y reportes) */
.btn-ficha, .btn-editar, .btn-eliminar {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 6px;
  font-size: 12px;
  transition: var(--transicion);
  padding: 4px 12px;
  cursor: pointer;
  margin-top: 8px;
}
.btn-ficha    { background: none; border: 1px solid #c5cae9; color: var(--azul); }
.btn-ficha:hover, .btn-ficha:active { background: var(--azul-claro); }
.btn-editar   { background: none; border: 1px solid #c8e6c9; color: var(--verde); }
.btn-editar:hover, .btn-editar:active { background: var(--verde-suave); }
.btn-eliminar { background: none; border: 1px solid #ffcdd2; color: var(--rojo); }
.btn-eliminar:hover, .btn-eliminar:active { background: var(--rojo-claro); }

/* Paginación */
.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.paginacion-info { font-size: 13px; color: var(--gris); text-align: center; }
.btn-pag {
  padding: 7px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  transition: var(--transicion);
}
.btn-pag:hover:not(:disabled) { background: var(--verde-suave); border-color: var(--verde-claro); color: var(--verde); }
.btn-pag:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-pag.activo-pag { background: var(--verde); color: white; border-color: var(--verde); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-card {
  background: white;
  border-radius: var(--radio);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--sombra);
  border-left: 4px solid #e0e0e0;
}
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.h-24 { height: 24px; }
.skeleton-line.h-100 { height: 100px; }

/* ============================================================
   ESTADÍSTICAS
   ============================================================ */
.stats-inst-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border-radius: var(--radio);
  padding: 16px;
  box-shadow: var(--sombra);
  margin-bottom: 16px;
}
.stats-inst-header > div { flex: 1; text-align: center; }
.stats-titulo    { font-size: 18px; font-weight: 700; color: var(--verde); }
.stats-subtitulo { font-size: 13px; color: var(--gris); margin-top: 2px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media(max-width: 480px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface);
  border-radius: var(--radio);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--sombra);
  border: 1px solid var(--gris-borde);
  transition: var(--transicion);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sombra-md); }
.stat-icono {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 2px;
}
.stat-total         { border-top: 3px solid var(--verde); }
.stat-total         .stat-icono { background: var(--verde-suave); color: var(--verde); }
.stat-caninos       { border-top: 3px solid var(--azul); }
.stat-caninos       .stat-icono { background: var(--azul-claro); color: var(--azul); }
.stat-felinos       { border-top: 3px solid #f97316; }
.stat-felinos       .stat-icono { background: #fff7ed; color: #c2410c; }
.stat-vacunados     { border-top: 3px solid #7c3aed; }
.stat-vacunados     .stat-icono { background: #f5f3ff; color: #7c3aed; }
.stat-esterilizados { border-top: 3px solid #0891b2; }
.stat-esterilizados .stat-icono { background: #ecfeff; color: #0891b2; }
.stat-desparasitados{ border-top: 3px solid var(--verde); }
.stat-desparasitados .stat-icono { background: var(--verde-suave); color: var(--verde); }
.stat-pendientes    { border-top: 3px solid var(--naranja); }
.stat-pendientes    .stat-icono { background: #fff7ed; color: var(--naranja); }
.stat-solicitudes   { border-top: 3px solid var(--morado); }
.stat-solicitudes   .stat-icono { background: var(--morado-claro); color: var(--morado); }
.stat-reportes      { border-top: 3px solid var(--rojo); }
.stat-reportes      .stat-icono { background: var(--rojo-claro); color: var(--rojo); }
.stat-numero  { font-size: 30px; font-weight: 800; color: var(--on-surface); line-height: 1; letter-spacing: -1px; }
.stat-label   { font-size: 11.5px; color: var(--on-surface-dim); font-weight: 500; line-height: 1.3; }
.stat-sublabel{ font-size: 11px; color: var(--gris); margin-top: 3px; line-height: 1.4; }

/* Cobertura con barras de progreso CSS */
.stats-fila-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media(max-width: 560px) { .stats-fila-2 { grid-template-columns: 1fr; } }
.stats-detalle {
  background: white;
  border-radius: var(--radio);
  padding: 18px;
  box-shadow: var(--sombra);
}
.stats-detalle h3 { font-size: 15px; color: var(--verde); margin-bottom: 14px; font-weight: 600; }
.origen-fila {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}
.origen-count { font-weight: 700; font-size: 18px; color: var(--verde); }

/* Barra de progreso de cobertura */
.cobertura-item { margin-bottom: 14px; }
.cobertura-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
  color: #424242;
}
.cobertura-pct { font-weight: 700; color: var(--verde); }
.barra-cobertura { height: 10px; background: #e0e0e0; border-radius: 5px; overflow: hidden; }
.barra-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s ease;
}
.barra-verde   { background: linear-gradient(90deg, var(--verde), var(--verde-claro)); }
.barra-azul    { background: linear-gradient(90deg, var(--azul), #42a5f5); }
.barra-morado  { background: linear-gradient(90deg, var(--morado), #ab47bc); }
.barra-naranja { background: linear-gradient(90deg, var(--naranja), #ff8f00); }

/* Resumen ejecutivo (impresión) */
.btn-imprimir {
  padding: 10px 20px;
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transicion);
}
.btn-imprimir:hover { background: #0d47a1; }
@media print {
  .tabs, .header, .btn-imprimir, .btn-eliminar, .animal-acciones { display: none !important; }
  .tab-contenido { padding: 0; max-width: 100%; }
  .stat-card, .stats-detalle { box-shadow: none; border: 1px solid #e0e0e0; }
  body { background: white; }
}

/* ============================================================
   SOLICITUDES Y REPORTES
   ============================================================ */
.solicitud-card {
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--sombra);
  border-left: 4px solid var(--morado);
  animation: fadeInUp 0.3s ease;
}
.reporte-card {
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--sombra);
  border-left: 4px solid var(--rojo);
  animation: fadeInUp 0.3s ease;
}
.card-titulo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.badge-estado-pendiente { background: var(--morado-claro); color: var(--morado); font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.badge-estado-atendido  { background: var(--verde-suave); color: var(--verde);   font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.badge-estado-activo    { background: var(--rojo-claro);  color: var(--rojo);    font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.card-datos { font-size: 13px; color: #424242; line-height: 1.7; clear: both; }
.card-datos .sep { color: #cbd5e1; margin: 0 4px; font-weight: 400; }
.btn-atender {
  background: none;
  border: 1px solid #c8e6c9;
  color: var(--verde);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
  margin-right: 6px;
  transition: var(--transicion);
}
.btn-atender:hover { background: var(--verde-suave); }
.btn-eliminar-card {
  background: none;
  border: 1px solid #ffcdd2;
  color: var(--rojo);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
  cursor: pointer;
  transition: var(--transicion);
}
.btn-eliminar-card:hover { background: var(--rojo-claro); }
.card-acciones { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ============================================================
   PANEL DE ADMINISTRACIÓN
   ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media(max-width: 600px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-card {
  background: white;
  border-radius: var(--radio);
  padding: 20px;
  box-shadow: var(--sombra);
}
.admin-card h3 {
  font-size: 15px;
  color: var(--verde);
  margin-bottom: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--verde-suave);
}
.admin-stat-grande { font-size: 40px; font-weight: 700; color: var(--verde); line-height: 1; }
.admin-stat-label  { font-size: 13px; color: var(--gris); margin-top: 4px; }
.admin-stat-fila   { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.admin-stat-num    { font-weight: 700; font-size: 20px; color: var(--verde); }

/* Botones de exportación */
.btns-export { display: flex; flex-direction: column; gap: 10px; }
.btn-export {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--verde-suave);
  color: var(--verde);
  border: 2px solid var(--verde-claro);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transicion);
  text-align: left;
}
.btn-export:hover { background: var(--verde); color: white; }
.btn-export-azul { background: var(--azul-claro); color: var(--azul); border-color: var(--azul); }
.btn-export-azul:hover { background: var(--azul); color: white; }
.btn-export-morado { background: var(--morado-claro); color: var(--morado); border-color: var(--morado); }
.btn-export-morado:hover { background: var(--morado); color: white; }
.btn-export-verde { background: var(--verde-suave); color: var(--verde); border-color: var(--verde-claro); }
.btn-export-verde:hover { background: var(--verde); color: white; }
.btn-export-naranja { background: var(--naranja-claro); color: var(--naranja); border-color: var(--naranja); }
.btn-export-naranja:hover { background: var(--naranja); color: white; }

/* Tabla de usuarios */
.tabla-usuarios { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tabla-usuarios th {
  background: var(--verde-suave);
  color: var(--verde);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--verde-claro);
}
.tabla-usuarios td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
.tabla-usuarios tr:hover td { background: #fafafa; }
.badge-rol-tabla-admin         { background: #ffd600; color: #212121; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.badge-rol-tabla-censador      { background: var(--azul-claro); color: var(--azul); font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.badge-rol-tabla-investigador  { background: #ede9fe; color: #7c3aed; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.rol-select-mini { font-size: 12px; padding: 4px 6px; border: 1px solid #e0e0e0; border-radius: 6px; background: white; cursor: pointer; width: 100%; }

/* Botón de restablecer contraseña en tabla de usuarios */
.btn-resetpass {
  padding: 4px 10px;
  background: #fff3e0;
  border: 1.5px solid #fb8c00;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #e65100;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--fuente);
  white-space: nowrap;
  transition: var(--transicion);
}
.btn-resetpass:hover { background: #fb8c00; color: white; }

/* Marcador de foco de abandono (DivIcon Leaflet) */
.foco-abandono-div { background: transparent !important; border: none !important; }
.foco-abandono-ring {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.15);
  border: 3px solid #dc2626;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: focoPulso 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(220,38,38,0.4);
}
.foco-abandono-ring .foco-ico { font-size: 12px; color: #dc2626; line-height: 1; }
.foco-abandono-count {
  font-size: 14px;
  font-weight: 800;
  color: #dc2626;
  line-height: 1;
  font-family: var(--fuente);
}
@keyframes focoPulso {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(220,38,38,0.4); }
  50%       { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(220,38,38,0);   }
}

/* Card de estadísticas para animales en abandono */
.stat-abandono { background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%); border: 1px solid #fb923c; }
.stat-abandono .stat-icono { background: rgba(234,88,12,0.1); color: #ea580c; }
.stat-abandono .stat-numero { color: #c2410c; }
.stat-abandono .stat-label  { color: #9a3412; }

/* Formulario de asignación de roles */
.rol-form-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.rol-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--fuente);
}
.rol-input:focus { border-color: var(--verde); outline: none; }
.rol-select-field {
  padding: 9px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--fuente);
  background: white;
  cursor: pointer;
}
.btn-asignar-rol {
  padding: 9px 18px;
  background: var(--verde);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fuente);
  transition: var(--transicion);
}
.btn-asignar-rol:hover { background: #1b5e20; }
.btn-cambiar-rol {
  padding: 4px 10px;
  background: none;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gris);
  font-family: var(--fuente);
  transition: var(--transicion);
  white-space: nowrap;
}
.btn-cambiar-rol:hover { background: var(--azul-claro); border-color: var(--azul); color: var(--azul); }

/* ============================================================
   MODAL (ficha completa / editar)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-contenido {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease;
}
.modal-header {
  background: var(--verde);
  color: white;
  padding: 16px 20px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.modal-body { padding: 20px; }
.ficha-seccion { margin-bottom: 18px; }
.ficha-seccion h4 {
  font-size: 12px;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ficha-dato { font-size: 14px; color: #424242; }
.ficha-dato span { display: block; font-size: 11px; color: var(--gris); margin-bottom: 1px; }
.ficha-foto-grande {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  margin-bottom: 12px;
}

/* ──────────────────────────────────────────────────────────────
   Switcher de formularios en tab Registrar
   ────────────────────────────────────────────────────────────── */
.registro-switcher {
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
}
.btn-reg-tipo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 24px;
  border: 2px solid #e0e0e0;
  background: white;
  color: var(--gris);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transicion);
  font-family: var(--fuente);
  text-align: center;
  white-space: nowrap;
  min-width: 0;
}
.btn-reg-tipo:hover {
  border-color: var(--verde-claro);
  background: var(--verde-suave);
  color: var(--verde);
}
.btn-reg-tipo.activo {
  background: var(--verde);
  color: white;
  border-color: var(--verde);
}
#btn-reg-esteril.activo  { background: var(--morado); border-color: var(--morado); }
#btn-reg-esteril:hover   { border-color: var(--morado); color: var(--morado); background: #f3e5f5; }
#btn-reg-reporte.activo  { background: var(--rojo); border-color: var(--rojo); }
#btn-reg-reporte:hover   { border-color: var(--rojo); color: var(--rojo); background: #fff0f0; }
@media(max-width:420px) {
  .btn-reg-tipo { font-size: 11px; padding: 9px 6px; gap: 4px; }
  .btn-reg-tipo .fas { font-size: 13px; }
  .registro-switcher { gap: 5px; padding: 10px 10px 2px; }
}

/* ──────────────────────────────────────────────────────────────
   Sub-tabs dentro del tab Listado
   ────────────────────────────────────────────────────────────── */
/* Sublista del Listado — comparte clases btn-reg-tipo + registro-switcher
   con el switcher de Registro → herencia automática del mismo diseño.
   Variantes de color: Solicitudes (morado), Reportes (rojo). */
#btn-sublista-solicitudes.activo {
  color: var(--morado);
}
#btn-sublista-solicitudes:not(.activo):hover {
  color: var(--morado);
}
#btn-sublista-reportes.activo {
  color: var(--rojo);
}
#btn-sublista-reportes:not(.activo):hover {
  color: var(--rojo);
}
/* Y el mismo trato para los del registro switcher (esteril, reporte) —
   ya estaba en el bloque original, lo mantenemos por compatibilidad. */

/* Toggle Todos / Mis registros — dentro de filtros-listado */
.toggle-listado {
  padding: 8px 13px;
  border-radius: 20px;
  border: 1.5px solid #e0e0e0;
  background: white;
  color: var(--gris);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transicion);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-family: var(--fuente);
}
.toggle-listado:hover { border-color: var(--verde-claro); background: var(--verde-suave); color: var(--verde); }
.toggle-listado.activo { background: var(--verde); color: white; border-color: var(--verde); }

/* Estadísticas — fila de 3 columnas */
.stats-fila-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media(max-width: 680px) { .stats-fila-3 { grid-template-columns: 1fr 1fr; } }
@media(max-width: 400px) { .stats-fila-3 { grid-template-columns: 1fr; } }

/* Gráfico de curvas */
.stats-chart-cont {
  background: white;
  border-radius: var(--radio);
  padding: 16px;
  box-shadow: var(--sombra);
  margin-bottom: 16px;
}
.stats-chart-cont h3 {
  font-size: 15px;
  font-weight: 700;
  color: #424242;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-chart-cont canvas {
  height: 260px !important;
  width: 100% !important;
}

/* Formulario de edición dentro del modal */
.modal-editar .campo input,
.modal-editar .campo select,
.modal-editar .campo textarea {
  font-size: 14px;
  padding: 9px 12px;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp  { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes popIn    { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   FONT AWESOME — ajustes de alineación y tamaño
   ============================================================ */
.fas, .far, .fab {
  vertical-align: middle;
  line-height: 1;
}

/* Iconos en pestañas — un poco más pequeños que el texto */
.tab .fas { font-size: 12px; margin-right: 3px; }

/* Iconos en botones primarios y secundarios */
.btn-primario .fas,
.btn-secundario .fas,
.btn-export .fas,
.btn-gps .fas,
.btn-foto .fas,
.btn-atender .fas,
.btn-ficha .fas,
.btn-editar .fas,
.btn-eliminar .fas,
.btn-imprimir .fas { margin-right: 5px; }

/* Iconos en encabezados de sección (h3 del formulario) */
.seccion-form h3 .fas,
.admin-card h3 .fas,
.stats-detalle h3 .fas { margin-right: 6px; color: inherit; opacity: 0.8; }

/* Iconos en badges de intervención */
.badge .fas { font-size: 10px; margin-right: 3px; }

/* Iconos en filas de datos origen/cobertura */
.origen-fila .fas,
.cobertura-label .fas { margin-right: 5px; opacity: 0.75; }

/* Icono de paw en login */
.login-paw .fas { font-size: 36px; color: var(--verde); }

/* Iconos en popup del mapa */
.popup-titulo .fas,
.popup-titulo-rojo .fas { margin-right: 4px; }

/* Iconos en botones de modal */
.modal-close .fas { font-size: 16px; }

/* Tab con icono + texto — separación visual */
.tab { display: flex; align-items: center; justify-content: center; gap: 4px; }
@media(max-width: 540px) { .tab { gap: 2px; flex-direction: column; font-size: 10px; } }
@media(max-width: 540px) { .tab .fas { font-size: 14px; margin-right: 0; } }

/* ============================================================
   SPLASH / LOADING SCREEN
   ============================================================ */
/* Animaciones usadas por el splash (inline styles las referencian por nombre) */
@keyframes cargaPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.06); opacity: 0.85; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: #1a2e1a;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -3px 16px rgba(0,0,0,0.35);
  animation: slideUpBanner 0.35s ease;
}
@keyframes slideUpBanner {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.pwa-banner-icono img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.pwa-banner-texto {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pwa-banner-texto strong { font-size: 13px; color: #fff; }
.pwa-banner-texto span   { font-size: 11px; color: rgba(255,255,255,0.65); }
.pwa-btn-instalar {
  flex-shrink: 0;
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pwa-btn-instalar:active { opacity: 0.8; }
.pwa-btn-cerrar {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 18px;
  padding: 4px 6px;
  cursor: pointer;
}

/* ============================================================
   BOTÓN WHATSAPP – LOGIN
   ============================================================ */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.2px;
}
.btn-whatsapp:hover { background: #1fba59; transform: translateY(-1px); }
.btn-whatsapp:active { transform: translateY(0); }
.btn-whatsapp .fab { font-size: 16px; }

/* ============================================================
   TOGGLE ABANDONO – FORMULARIO
   ============================================================ */
.campo-abandono-toggle {
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.abandono-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.abandono-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #f59e0b;
  cursor: pointer;
}
.abandono-check-texto {
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
}
.abandono-check-texto .fas { margin-right: 5px; }

/* ============================================================
   BADGE ABANDONO – LISTADO
   ============================================================ */
.badge-abandono {
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid #fcd34d;
  white-space: nowrap;
}
.badge-abandono .fas { margin-right: 3px; font-size: 10px; }

/* ============================================================
   CONTROL CAPAS BASE DENTRO DEL MAPA (Leaflet)
   ============================================================ */
.ctrl-capas-base {
  display: flex;
  flex-direction: column;
  margin-top: 8px !important;
  border-radius: 4px;
  overflow: hidden;
}
.ctrl-capa-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  line-height: 1;
}
.ctrl-capa-btn:hover { background: #f0f0f0; color: var(--verde); }
.ctrl-capa-btn.activo { background: var(--verde) !important; color: white !important; }
.ctrl-capa-btn + .ctrl-capa-btn { border-top: 1px solid #ccc; }

/* ============================================================
   PANEL DE USUARIO (Mi Cuenta)
   ============================================================ */
.perfil-info-card {
  background: linear-gradient(135deg, var(--verde) 0%, #43a047 100%);
  padding: 20px;
  border-radius: var(--radio);
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}
.perfil-usuario-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.perfil-avatar-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  flex-shrink: 0;
}
.perfil-usuario-info { display: flex; flex-direction: column; gap: 8px; }
.perfil-email-display {
  font-size: 14px;
  font-weight: 600;
  color: white;
  word-break: break-all;
}

/* ============================================================
   RESPONSIVE GENERAL
   ============================================================ */
@media(max-width: 480px) {
  .tabs .tab  { min-width: 56px; font-size: 10px; padding: 9px 4px; }
  .stat-numero{ font-size: 28px; }
  .admin-stat-grande { font-size: 32px; }
  .mapa-seccion-label { font-size: 10px; }
  /* Botones de datos: texto + icono siempre visibles, scroll horizontal indica más */
  .btn-mapa-ctrl { font-size: 11px; padding: 6px 10px; }
}

/* ============================================================
   MODAL PRESENTACIÓN / BIENVENIDA EASUR
   ============================================================ */
.splash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.splash-overlay.oculto { display: none; }
.splash-card {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  animation: splashEntrada 0.45s cubic-bezier(0.34,1.4,0.64,1) both;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
@keyframes splashEntrada {
  from { transform: scale(0.88) translateY(24px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
.splash-header {
  background: linear-gradient(150deg, #1b5e20 0%, #2e7d32 55%, #388e3c 100%);
  padding: 28px 24px 32px;
  text-align: center;
  color: white;
  position: relative;
}
.splash-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: white;
  border-radius: 22px 22px 0 0;
}
.splash-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 14px;
}
.splash-brand-logo {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255,255,255,0.92);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  flex-shrink: 0;
  padding: 4px;
}
.splash-brand-text { text-align: left; }
.splash-brand-nombre {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2.5px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.splash-brand-sub {
  font-size: 10px;
  opacity: 0.82;
  margin-top: 4px;
  line-height: 1.35;
  max-width: 190px;
}
.splash-titulo {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.95;
  letter-spacing: 0.3px;
}
.splash-lugar  { font-size: 12px; opacity: 0.72; margin-bottom: 8px; }
.splash-lema   { font-size: 11px; opacity: 0.78; font-style: italic; font-weight: 500; }
.splash-body   { padding: 24px 22px 22px; }
.splash-seccion-titulo {
  font-size: 11.5px;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.splash-grid-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.splash-feat {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f1f8e9;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 11.5px;
  color: #333;
  line-height: 1.4;
}
.splash-feat i { color: #2e7d32; font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.splash-alianza-card {
  background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
  border: 1.5px solid #a5d6a7;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 16px;
}
.splash-alianza-chip {
  display: inline-block;
  background: #2e7d32;
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.splash-alianza-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.splash-alianza-logo-placeholder {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2e7d32, #43a047);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  box-shadow: 0 4px 14px rgba(46,125,50,0.3);
}
.splash-alianza-logo-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  border: 2px solid #a5d6a7;
  box-shadow: 0 4px 14px rgba(46,125,50,0.2);
  padding: 4px;
}
.splash-alianza-nombre { font-size: 13.5px; font-weight: 700; color: #1b5e20; margin-bottom: 3px; }
.splash-alianza-carrera { font-size: 12px; color: #2e7d32; font-weight: 500; }
.splash-gracias-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff3f3;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #ffcdd2;
}
.splash-heart { font-size: 22px; color: #e53935; flex-shrink: 0; animation: heartbeat 1.4s ease-in-out infinite; }
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  14%     { transform: scale(1.3); }
  28%     { transform: scale(1); }
  42%     { transform: scale(1.18); }
}
.splash-gracias-msg strong { display: block; font-size: 13px; color: #c62828; margin-bottom: 2px; }
.splash-gracias-msg span   { font-size: 11.5px; color: #888; }
.splash-cta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.splash-cta:hover  { background: linear-gradient(135deg, #1b5e20, #2e7d32); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(46,125,50,0.4); }
.splash-cta:active { transform: translateY(0); }
@media(max-width: 500px) {
  .splash-grid-features { grid-template-columns: 1fr; }
  .splash-brand-nombre  { font-size: 22px; }
  .splash-titulo        { font-size: 17px; }
  .splash-header        { padding: 22px 16px 30px; }
  .splash-body          { padding: 20px 16px 18px; }
}

/* ============================================================
   PERDIDOS — botón toggle y tarjetas
   ============================================================ */
.btn-perdido-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
  margin-bottom: 4px;
}
.btn-perdido-toggle:hover { background: linear-gradient(135deg, #c2410c, #ea580c); transform: translateY(-1px); }
.btn-perdido-toggle:active { transform: translateY(0); }

.perdido-card {
  display: flex;
  gap: 12px;
  background: white;
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(234,88,12,0.08);
  transition: box-shadow 0.2s;
}
.perdido-card:hover { box-shadow: 0 4px 16px rgba(234,88,12,0.14); }
.abandono-card {
  border-color: #fde68a;
  box-shadow: 0 2px 8px rgba(180,83,9,0.08);
}
.abandono-card:hover { box-shadow: 0 4px 16px rgba(180,83,9,0.14); }
.perdido-encontrado {
  opacity: 0.62;
  border-color: #d1fae5;
}

.perdido-card-foto {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.perdido-card-foto-placeholder {
  width: 84px;
  height: 84px;
  background: #fef3c7;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #f59e0b;
}
.abandono-card .perdido-card-foto-placeholder {
  background: #fef9c3;
  color: #b45309;
}

.perdido-card-body { flex: 1; min-width: 0; }

.perdido-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.perdido-card-nombre {
  font-weight: 700;
  font-size: 15px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perdido-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
}
.perdido-card-desc {
  font-size: 12px;
  color: #666;
  font-style: italic;
  margin-bottom: 6px;
  line-height: 1.45;
}
.perdido-card-contacto {
  font-size: 12px;
  color: #374151;
  font-weight: 600;
  margin-bottom: 8px;
}

.perdido-card-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-buscando {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-encontrado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-abandono {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-card-accion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-encontrado {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.btn-encontrado:hover { background: #a7f3d0; }
.btn-azul {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.btn-azul:hover { background: #bfdbfe; }

.btn-foto-naranja {
  background: linear-gradient(135deg, #ea580c, #f97316) !important;
}
.btn-foto-naranja:hover { background: linear-gradient(135deg, #c2410c, #ea580c) !important; }

.btn-naranja {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-naranja:hover { background: linear-gradient(135deg, #c2410c, #ea580c); }

@media(max-width: 480px) {
  .perdido-card-foto,
  .perdido-card-foto-placeholder { width: 68px; height: 68px; font-size: 22px; }
  .perdido-card-nombre { font-size: 13px; }
}

/* ── Presencia de usuarios en tiempo real ── */
.badge-activos {
  display: inline-block;
  background: #22c55e;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}
.lista-presencia {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 10px;
}
.presencia-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.2s;
}
.presencia-activo  { background: #f0fdf4; border: 1px solid #bbf7d0; }
.presencia-inactivo{ background: #f9fafb; border: 1px solid #e5e7eb; opacity: 0.7; }
.presencia-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-verde {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
  animation: pulsoVerde 2s infinite;
}
.dot-gris { background: #9ca3af; }
@keyframes pulsoVerde {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0.08); }
}
.presencia-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.presencia-email {
  font-weight: 600;
  color: #1f2937;
  font-size: 13px;
  word-break: break-all;
}
.presencia-tiempo {
  font-size: 11px;
  color: var(--gris);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Panel lateral foco del mapa ── */
.mapa-wrapper {
  position: relative;
  overflow: hidden;
}
.mapa-wrapper #mapa { width: 100%; }

.panel-foco-mapa {
  position: absolute;
  top: 0; right: 0;
  width: 300px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.28s ease;
  border-left: 3px solid #e53935;
}
.panel-foco-mapa.oculto {
  transform: translateX(105%);
  pointer-events: none;
}
.panel-foco-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fff3f3;
  border-bottom: 1px solid #fecaca;
  font-weight: 700;
  font-size: 14px;
  color: #c62828;
  flex-shrink: 0;
}
.panel-foco-cerrar {
  background: none;
  border: none;
  color: #9e9e9e;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.panel-foco-cerrar:hover { background: #f0f0f0; color: #424242; }
.panel-foco-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  font-size: 13px;
}
.panel-foco-fila {
  display: flex;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
  line-height: 1.4;
}
.panel-foco-fila strong { min-width: 70px; color: #424242; }
.panel-foco-lista {
  list-style: none;
  padding: 0; margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel-foco-animal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
@media(max-width: 600px) {
  .panel-foco-mapa { width: 100%; border-left: none; border-top: 3px solid #e53935; }
}

/* ── Tab Comunidad ── */
.comunidad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.comunidad-header h2 { margin: 0; }
.btn-com-agregar {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-com-agregar:hover { opacity: 0.9; }
.com-seccion { margin-bottom: 28px; }
.com-seccion-titulo {
  font-size: 15px;
  font-weight: 700;
  padding: 10px 0 10px;
  border-bottom: 2px solid;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.com-titulo-aliado     { color: #1565c0; border-color: #bbdefb; }
.com-titulo-colaborador{ color: #6a1b9a; border-color: #e1bee7; }
.com-titulo-voluntario { color: #c62828; border-color: #ffcdd2; }
.com-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.com-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s;
}
.com-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.13); }
.com-card-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  align-self: flex-start;
}
.com-avatar-aliado      { background: #dbeafe; color: #1565c0; }
.com-avatar-colaborador { background: #ede9fe; color: #6a1b9a; }
.com-avatar-voluntario  { background: #fce4ec; color: #c62828; }
.com-card-nombre {
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
  line-height: 1.3;
}
.com-card-cargo {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}
.com-card-desc {
  font-size: 12px;
  color: #374151;
  line-height: 1.5;
  flex: 1;
}
.com-card-contacto {
  font-size: 12px;
  color: #2e7d32;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.com-card-acciones {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.com-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
}
.com-badge-aliado      { background: #dbeafe; color: #1565c0; }
.com-badge-colaborador { background: #ede9fe; color: #6a1b9a; }
.com-badge-voluntario  { background: #fce4ec; color: #c62828; }
.com-skeleton {
  height: 140px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 12px;
}
.com-vacio {
  grid-column: 1/-1;
  text-align: center;
  padding: 24px;
  color: var(--gris);
  font-size: 13px;
}
.com-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media(max-width: 560px) { .com-form-grid { grid-template-columns: 1fr; } }
@media(max-width: 480px) { .com-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════
   COMUNIDAD – Info del Sistema + Aliados Estáticos
   ══════════════════════════════════════════════════════════════ */
.com-sistema-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border-left: 5px solid var(--verde);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 12px 16px 0;
}
.com-sistema-logo {
  font-size: 48px;
  color: var(--verde);
  flex-shrink: 0;
  line-height: 1;
}
.com-sistema-logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
}
.com-sistema-nombre {
  font-size: 20px;
  font-weight: 700;
  color: var(--verde);
  margin: 0 0 6px;
}
.com-sistema-org {
  font-size: 13px;
  color: #555;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.com-sistema-org .fas { color: var(--verde-claro); }
.com-sistema-mision {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 10px 0 12px;
}
.com-sistema-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.com-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: white;
  border: 1.5px solid var(--verde-claro);
  color: var(--verde);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}
@media(max-width: 520px) {
  .com-sistema-card { flex-direction: column; gap: 12px; margin: 10px 10px 0; padding: 16px; }
  .com-sistema-logo { font-size: 36px; }
}

.com-aliados-estaticos {
  padding: 18px 16px 6px;
}
.com-aliados-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--verde);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.com-aliados-titulo .fas { color: #f9a825; }
.com-aliados-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.com-aliado-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.com-aliado-icono {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.com-aliado-datos { display: flex; flex-direction: column; min-width: 0; }
.com-aliado-datos strong { font-size: 13px; font-weight: 700; color: #333; }
.com-aliado-datos span { font-size: 11px; color: #777; line-height: 1.4; margin-top: 2px; }
@media(max-width: 500px) { .com-aliados-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════
   CHAT GLOBAL
   ══════════════════════════════════════════════════════════════ */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  max-height: 780px;
  background: #f5f5f5;
  border-radius: 16px;
  overflow: hidden;
  margin: 12px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.chat-encabezado {
  background: white;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}
.chat-titulo {
  font-size: 17px;
  font-weight: 700;
  color: var(--verde);
  margin: 0 0 2px;
}
.chat-subtitulo {
  font-size: 12px;
  color: var(--gris);
  margin: 0;
}
.chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-cargando {
  text-align: center;
  color: var(--gris);
  font-size: 13px;
  padding: 30px 0;
}
.chat-vacio {
  text-align: center;
  color: var(--gris);
  font-size: 14px;
  padding: 40px 20px;
  line-height: 1.8;
}
.chat-vacio .fas { font-size: 32px; display: block; margin-bottom: 8px; opacity: .4; }
.chat-mensaje {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 78%;
}
.chat-propio {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.chat-rol-admin { background: #7a5f00; }
.chat-rol-inv   { background: #1565c0; }
.chat-rol-cens  { background: var(--verde); }
.chat-burbuja {
  background: white;
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  max-width: 100%;
}
.chat-propio .chat-burbuja {
  background: var(--verde);
  border-radius: 14px 14px 4px 14px;
}
.chat-propio .chat-texto { color: white; }
.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.chat-autor { font-size: 12px; font-weight: 700; color: #333; }
.chat-propio .chat-autor { color: rgba(255,255,255,.9); }
.chat-rol-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  color: white;
}
.chat-hora { font-size: 10px; color: #aaa; margin-left: auto; }
.chat-propio .chat-hora { color: rgba(255,255,255,.7); }
.chat-texto { font-size: 14px; color: #333; line-height: 1.5; word-break: break-word; }
.chat-del-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
  transition: color .2s;
}
.chat-del-btn:hover { color: var(--rojo); }
.chat-input-area {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  background: white;
  border-top: 1px solid #e8e8e8;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--fuente);
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 120px;
  transition: border-color .2s;
}
.chat-input:focus { border-color: var(--verde); }
.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--verde);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transicion);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--verde-oscuro, #1b5e20); transform: scale(1.05); }
@media(max-width: 500px) {
  .chat-wrapper { margin: 8px 8px; height: calc(100vh - 110px); }
  .chat-mensaje { max-width: 90%; }
}
