/* ===================== BASE ===================== */

body {
  font-family: Inter, Arial, sans-serif;
  padding: 18px;
  background:#f0f9fd;
  color:#111;
  margin: 0;
}

h1 {
  font-size: 36px;
  margin-bottom: 12px;
  color: #000079;
}

.small {
  font-size:12px;
  color:#666;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: #555;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #dfe6f0;
  border-top: 4px solid #39579e;
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

/* ===================== SKELETON LOADING (Monitor) ===================== */
.loading-screen.skeleton {
  display: block;
  padding: 0;
  align-items: stretch;
}

.skeleton-block {
  background: linear-gradient(90deg, #e2e6ec 25%, #eef1f5 37%, #e2e6ec 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 10px;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.skeleton-card {
  flex: 1 1 150px;
  height: 66px;
}

.skeleton-mass-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 15px;
}

.skeleton-btn {
  flex: 1;
  max-width: 220px;
  height: 40px;
  border-radius: 30px;
}

/* Tabla (escritorio): las filas comparten fondo gris de 1px como separador,
   igual que el border-bottom real de la tabla. */
.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #e6e9ee;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.skeleton-row {
  height: 46px;
  border-radius: 0;
}

/* Tarjetas móviles: ocultas por defecto, se muestran por debajo de 768px */
.skeleton-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.skeleton-mobile-card {
  height: 150px;
}

@media (max-width: 768px) {
  .skeleton-table { display: none; }
  .skeleton-mobile-cards { display: flex; }
}

/* ===================== CONTROLES ===================== */

#controls {
  margin-bottom:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}

.controls-left {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
}

.controls-right {
  display:flex;
  align-items:center;
  gap:8px;
}

#controls label {
  border-radius:12px;
  padding:4px 8px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

#pondFilter {
  padding: 6px 12px;
  font-size:14px;
  border-radius: 8px;
  border: 1px solid #f2f1f8;
  background-color: #f2f0eb;
  cursor: pointer;
  transition: all 0.5s;
  box-shadow: 0 1px 4px #0000005d;
  width: 200px;
}

    
#pondFilter:hover {
  border: 1px solid #9e9e9eaa;
  background-color: #f2f0eb;
}
/* ===================== search bar ===================== */

.uid-search {
  padding: 6px 8px;
  font-size:14px;
}

.uid-search input {
  padding: 6px 12px;
  font-size:14px;
  border-radius: 8px;
  border: 1px solid #f2f1f8;
  background-color: #f2f0eb;
  box-shadow: 0 1px 4px #0000005d;
  transition: all 0.5s;
  width: 50%;
}


.uid-no-encontrado {
  color: #b02a2a;
  font-size: 13px;
  margin-top: 6px;
}


/* ===================== BOTONES ===================== */

.btn-allshutdown, .btn-allstart {
    padding: 8px 18px;
    border-radius: 30px;
    border: #8c8e92;
    background-color: #616161;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: bold;
  }

  .btn-allshutdown:hover, .btn-allstart:hover { 
    background-color:#333333; 
    box-shadow:0 2px 6px rgba(0,0,0,0.3); 
}

.hist-btn, .action-btn-stop, .action-btn-start {
  padding:6px 12px;
  border-radius:10px;
  cursor:pointer;
  transition: all 0.3s ease;
  margin:2px;border:none;
  width:60px;display:inline;
  align-items:center;
  justify-content:center;
  gap:6px; 
  font-weight:600;
}

.hist-btn { 
  background-color:#4169E1; 
  color:white; 
}

.hist-btn:hover { 
  background-color:#3653c0; 
  box-shadow:0 2px 6px rgba(0,0,0,0.3);
}

.action-btn-stop,.action-btn-start { 
  background:#8b8878; 
  color:white; 
}
.action-btn-stop:hover, .action-btn-start:hover { 
  background:#7a7567; 
  box-shadow:0 2px 6px rgba(0,0,0,0.3); 
}

#apagarTodosBtn:disabled {
  filter: grayscale(100%);
}


/* =================== INDICADORES =================== */

.ind {
  flex-direction: row;
  gap: 2px;
  font-size: 18px;
}

/* ================ TOGGLE COLUMNAS ================== */
#toggleColumns {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background-color: #00796b;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 1000;  
}

#toggleColumns:hover {
  background:#015b51;
}

/* ===================== MODAL ===================== */
.modal-content {
  background:#fff;
  width:50%;
  max-height:70%;
  border-radius:10px;
  padding:16px;
  position: relative;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  container-type: inline-size; /* el tamaño de letra del historial se calcula en base a este ancho */

  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.65) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);

  animation: modalContentExpand 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalContentExpand {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes modalContentShrink {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.85); }
}

/* .closing lo agrega modal-anim.js justo antes de ocultar el modal, para
   reproducir la animación inversa a la de apertura. */
.modal-hist.closing .modal-content {
  animation: modalContentShrink 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .modal-content { animation: none; }
}

.modal-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}

.modal-body {
  flex:1;
  min-height:0; /* para que el overflow funcione correctamente en flexbox */
  overflow-y:auto;
  font-family:monospace;
  white-space:pre-wrap;
  font-size: clamp(11px, 2.6cqw, 16px); /* se ajusta solo al ancho real del modal */
  line-height:1.4;
}

.modal-chart {
  height: 180px;
  flex-shrink: 0;
  margin-bottom: 10px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 12px;
  color: #444;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.chart-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ===================== PESTAÑAS DEL MODAL ===================== */
.modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: 2px solid #dfe6f0;
  flex-shrink: 0;
}

.modal-tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.modal-tab-btn:hover { color: #000079; }

.modal-tab-btn.active {
  color: #000079;
  border-bottom: 3px solid #39579e;
}

.modal-tab-content { display: none; flex-direction: column; min-height: 0;}
.modal-tab-content.active { display: flex; flex: 1; min-height: 0; }

/* ===================== MAPA GPS (dentro del modal) ===================== */
#gpsMapContainer {
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e6e9ee;
}

#gpsMap {
  width: 100%;
  height: 100%;
}

.modal-hist {
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  /*background:rgba(0,0,0,0.5);*/
  z-index:1300;
  justify-content:center;
  align-items:center;

  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);

  animation: modalOverlayFade 0.2s ease;
}

/* Modal abierto: la página de atrás no se desplaza (lo pone modal-anim.js) */
html.modal-abierto,
html.modal-abierto body { overflow: hidden; }
/* El scroll dentro del modal no pasa a la página al llegar al final.
   Solo en los contenedores que desplazan: puesto en todos los hijos
   (.modal-hist *) Chrome dejaba de desplazar el modal con rueda, barra y
   dedo (probado en Chromium, escritorio y táctil). Un cuerpo con scroll
   que no sea .modal-body necesita su propia regla (ver kpi.html). */
.modal-content,
.modal-body { overscroll-behavior: contain; }

@keyframes modalOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalOverlayFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.modal-hist.closing {
  animation: modalOverlayFadeOut 0.2s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .modal-hist { animation: none; }
  .modal-hist.closing { animation: none; }
}
/* ===================== CARDS ===================== */
.cards-container {
  display:flex;
  gap:12px;
  margin-bottom:15px;
  flex-wrap:wrap;
}

.card {
  flex:1 1 150px;
  background:#e9e9e9;
  color:#333;
  padding:12px 20px;
  border-radius:10px;
  border: 1px solid #cfe4f5;
  font-weight:600;
  text-align:left;
  cursor:pointer;
  transition: all 0.3s ease;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:left;
  opacity:0.6;
}

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

.card-number {
  font-size:28px;
  font-weight:700;
}

.card-text { 
  font-size:14px; 
  margin-bottom:6px; 
}

.online-card { background:#e0f7ea; color:#0b7; }
.offline-card { background:#ffe0e0; color:#d33; }
.low-battery-card,
.SCC-err-card { background:#fff4e0; color:#f57c00; }
.all-card { background:#e0e0e0; color:#111; }

/* ================= BOTONES DE ACCIÓN MASIVA ================= */
.mass-actions {
  display:flex;
  gap:12px;
  justify-content:center;
  margin-bottom:15px;
}

.mass-actions .btn-allshutdown,
.mass-actions .btn-allstart {
  width:auto;
  flex:1;
  max-width:220px;
}

/* ===================== TABLA ===================== */
#table-container {
  position: relative;
  max-width: 100%;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid #e6e9ee;
  padding:10px;
  text-align:center;
  font-size: 14px;
}

tr:nth-child(even) { 
  background:#fbfdff; 
}

th {
  background:#e9e9e9;
  font-weight:600;
}

.ok { 
  color:#0b7; 
  font-weight:700; 
}

.bad { 
  color:#d33; 
  font-weight:700; 
}

/* ===================== ÚLTIMA ACTUALIZACIÓN ===================== */
.last-update {
  background:#e2e0fa;
  color:#003779;
  padding:10px;
  border-radius:8px;
  font-weight:600;
  margin-bottom:10px;
  text-align:center;
}

/* ===================== POSICION DE ICONOS ===================== */
.ico {
  height:20px; 
  width:20px; 
  vertical-align:middle; 
  margin-right:8px;
}

/* == ICONO PRINCIPAL == */
.ico-main {
  height:100px; 
  width:100px;
  vertical-align:middle; 
  margin-right:8px;
}

/* == ICONO DE SALIDA == */
.ico-modal {
  height:24px; 
  width:24px; 
  cursor:pointer;
} 

/* =========================== RSSI ============================ */
.rssi-bars { 
  display:flex; 
  justify-content:center; 
  align-items:flex-end; 
  height:16px; 
  gap:2px; 
}

.rssi-bar { 
  width:4px; 
  background:#ccc; 
  border-radius:2px; 
  transition: background 0.3s, height 0.3s; 
}

.rssi-bar.active { 
  background:#4CAF50; 
  height:100%; 
}

.rssi-bar.mid { 
  background:#FFEB3B; 
  height:60%; 
}

.rssi-bar.warn { 
  background:#FF9800; 
  height:40%; 
}

.rssi-bar.bad { 
  background:#F44336; 
  height:20%; 
}

/* ===================== SCROLL TO TOP BUTTON ===================== */
#scrollTopBtn {
  /* misma forma que el de la app de actas: círculo con flecha de línea, sombra suave y entra deslizando */
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #39579e;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(40, 48, 72, .28);
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 1000;
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .2s, transform .2s, background .2s;
}

#scrollTopBtn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#scrollTopBtn.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#scrollTopBtn:hover {
  background: #2b437d;
}

#scrollTopBtn.visible:active {
  transform: scale(0.92);
}

/* ===================== ESTADO (PILL) ===================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 50px;
  border: 1px solid #ccc;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}
.status-pill.online  { background: #eff3ed; }
.status-pill.offline { background: #e9e3e3; }

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

.status-pill.online .status-dot { background: #0b7; }
.status-pill.offline .status-dot { background: #d33; }

/* ===================== TOAST DE COMANDOS ===================== */
.cmd-toast {
  position: fixed;
  top: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  max-width: 320px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10001; /* por encima de #offline-banner (10000): si no, el aviso
                     de "sin conexión" tapaba el toast de confirmación */
  transform: translateX(150%);
  opacity: 0;
  pointer-events: none;
  gap: 10px;
}

.cmd-toast.show {
  animation: cmd-toast-in-out 3.4s ease forwards;
  pointer-events: auto;
}

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

.cmd-toast.ok .cmd-toast-dot { background: #0b7; }
.cmd-toast.error .cmd-toast-dot { background: #d33; }

.cmd-toast-texto {
  font-size: 14px;
  color: #333;
}

@keyframes cmd-toast-in-out {
  0%   { transform: translateX(150%); opacity: 0; }
  8%   { transform: translateX(0);    opacity: 1; }
  85%  { transform: translateX(0);    opacity: 1; }
  100% { transform: translateX(150%); opacity: 0; }
}

/* ===================== Tabs del modal (íconos) ===================== */
.modal-tab-btn .tab-ico {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
}

/* ===================== Registro como tarjetas ===================== */
.registro-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
  /* Aísla la lista: al animarse la altura del modal (cambio de pestaña) el
     navegador no vuelve a calcular ni pintar cada tarjeta en cada cuadro. */
  contain: content;
}

.registro-card {
  background: #f8f9fb;
  border: 1px solid #e6e9ee;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  contain: content;
}

.registro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.registro-card-hora {
  font-weight: 600;
  color: #222;
}

.registro-badge-tipo {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.registro-badge-tipo.tipo-A { background:#fce4e4; color:#b71c1c; }
.registro-badge-tipo.tipo-M { background:#e3ecfb; color:#1a3f8f; }
.registro-badge-tipo.tipo-C { background:#f1e3fb; color:#5c1d8f; }
.registro-badge-tipo.tipo-otro { background:#eef0f3; color:#555; }

.registro-card-detalle {
  color: #666;
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.registro-card-detalle span.source-LW { color: olive; font-weight: 700; }
.registro-card-detalle span.source-W { color: teal; font-weight: 700; }

.btn-ver-mas {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #dfe6f0;
  background: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #39579e;
}

.btn-ver-mas:hover { background: #e9e9e9; }
.btn-ver-mas[disabled] { display: none; }


.registro-badge-source {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.registro-badge-source.source-LW { background:#e3ecfb; color:#1a3f8f; }
.registro-badge-source.source-W  { background:#dcf3ee; color:#00594a; }
.registro-badge-source.source-otro { background:#eef0f3; color:#555; }
/* ============ BARRA DE NAVEGACIÓN DE ANDROID ============ */
/* Con viewport-fit=cover (meta viewport) Chrome dibuja la página detrás de
   la barra de navegación del sistema y expone su alto en
   env(safe-area-inset-bottom). Rellenamos esa franja con el mismo color que
   la barra de estado (theme-color) y subimos lo que va fijo abajo para que
   no quede tapado. Donde no hay inset, env() vale 0 y nada cambia.
   "html body" para ganarle a los #bottom-bar inline de cada plantilla. */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: env(safe-area-inset-bottom, 0px);
  background: #00084d;
  z-index: 1199;
  pointer-events: none;
}

@media (max-width: 768px) {
  html body #bottom-bar { bottom: env(safe-area-inset-bottom, 0px); }
  html body #main-content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  html body #scrollTopBtn { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  html body #toggleColumns { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

/* ============ TOAST: RESPUESTA A COMANDOS (static/js/user-menu.js) ============ */
.cmdres-toasts {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 10001;   /* igual que .cmd-toast: por encima de #offline-banner */
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 330px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.cmdres-toast {
  --cmdres-color: #0b7;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 10px 12px 16px;
  background: #fff;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  box-shadow: inset 4px 0 0 var(--cmdres-color), 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  animation: cmdres-in .35s ease;
  transition: opacity .3s ease, transform .3s ease;
}
.cmdres-toast.aviso { --cmdres-color: #f59e0b; }
.cmdres-toast.falla { --cmdres-color: #d33; }
.cmdres-toast.saliendo { opacity: 0; transform: translateX(40px); }
.cmdres-toast { touch-action: pan-y; user-select: none; }   /* el gesto horizontal lo maneja JS (deslizar para cerrar) */
.cmdres-toast.arrastrando { transition: none; cursor: grabbing; }
.cmdres-ico { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.cmdres-texto { flex: 1; min-width: 0; }
.cmdres-etq { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #64748b; }
.cmdres-titulo { font-size: 14px; font-weight: 700; color: #111; margin-top: 2px; }
.cmdres-det { font-size: 13px; color: #333; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cmdres-mas { font-size: 12px; color: #64748b; margin-top: 4px; }
.cmdres-cerrar {
  flex: none; border: 0; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: #64748b; padding: 0 4px;
}
.cmdres-cerrar:hover { color: #111; }
@keyframes cmdres-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}
html.night .cmdres-toast { background: #151c2e; border-color: #2c3550; }
html.night .cmdres-toast.ok { --cmdres-color: #4ade80; }
html.night .cmdres-toast.aviso { --cmdres-color: #fbbf24; }
html.night .cmdres-toast.falla { --cmdres-color: #f87171; }
html.night .cmdres-titulo { color: #e6e8ef; }
html.night .cmdres-det { color: #b9c2dc; }
html.night .cmdres-etq, html.night .cmdres-mas, html.night .cmdres-cerrar { color: #8a97ad; }
html.night .cmdres-cerrar:hover { color: #e6e8ef; }
@media (max-width: 768px) {
  .cmdres-toasts { top: 12px; left: 16px; right: 16px; width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cmdres-toast { animation: none; transition: opacity .3s ease; }
  .cmdres-toast.saliendo { transform: none; }
}

/* ===================== BOTÓN DE PING (Monitor LW; enviarPing en index.html) ===================== */
.estado-celda { display: inline-flex; align-items: center; gap: 6px; }
.ping-btn-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; min-width: 0; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.ping-btn-mini:hover { background: rgba(20, 184, 166, .15); transform: scale(1.08); }
.ping-btn-mini img { width: 20px; height: 20px; }
.ping-btn.enviando img { animation: ping-giro 1s linear infinite; }
.ping-btn.btn-bloqueado { opacity: .4; cursor: not-allowed; }
@keyframes ping-giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ping-btn.enviando img { animation: none; opacity: .5; }
}
.btn-pingoffline.enviando img { animation: ping-giro 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .btn-pingoffline.enviando img { animation: none; opacity: .5; } }

/* ===================== MODAL APAGADORES · pestaña Información ===================== */
.eq-info { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.eq-info-cargando { font-size: 13px; opacity: .7; padding: 12px 0; }
.eq-info-bloque { background: #f5f7fb; border: 1px solid #e3e8f2; border-radius: 12px; padding: 10px 14px; }
.eq-info-bloque h4 {
  margin: 0 0 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #64748b;
}
.eq-info-fila { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid #e8ecf4; font-size: 13px; }
.eq-info-bloque h4 + .eq-info-fila, .eq-info-texto + .eq-info-fila { border-top: 0; }
.eq-info-lbl { color: #64748b; flex: none; }
.eq-info-val { color: #111; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.eq-info-val small { font-weight: 500; color: #64748b; }
.eq-info-val code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.eq-info-texto { margin: 2px 0 6px; font-size: 14px; font-weight: 600; color: #1b2559; }
.eq-ok { color: #15803d; }
.eq-mal { color: #b91c1c; }
html.night .eq-info-bloque { background: #151c2e; border-color: #2c3550; }
html.night .eq-info-fila { border-top-color: #232a3d; }
html.night .eq-info-lbl, html.night .eq-info-bloque h4, html.night .eq-info-val small { color: #8a97ad; }
html.night .eq-info-val { color: #e6e8ef; }
html.night .eq-info-texto { color: #cdd6ff; }
html.night .eq-ok { color: #4ade80; }
html.night .eq-mal { color: #f87171; }
/* Selector de tipo de equipo dentro de la ficha (solo administradores) */
.eq-info-tipo { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0; }
.eq-info-verificado { width: 16px; height: 16px; vertical-align: -3px; margin-left: 4px; }
.eq-info-nota { display: block; margin-top: 4px; font-weight: 500; font-size: 11px; color: #64748b; text-align: right; }
html.night .eq-info-nota { color: #8a97ad; }

/* ============ Mapa GPS de la piscina: cuadro con la lista de equipos, abajo a la izquierda (gps-pond-lista.js) ============ */
.leaflet-control.gps-lista {
  width: 150px; background: rgba(255, 255, 255, .95); border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.gps-lista-cab {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 10px;
  border: 0; border-bottom: 1px solid #e3e8f2; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 700; color: #1b2559; text-align: left;
}
.gps-lista-n { font-weight: 700; font-size: 11px; padding: 0 6px; border-radius: 999px; background: #e7ecf7; color: #39579e; }
/* Anclado abajo a la izquierda: plegado la flecha apunta hacia arriba (se abre hacia arriba) */
.gps-lista-flecha { margin-left: auto; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease; }
.gps-lista.plegado .gps-lista-flecha { transform: rotate(-135deg); margin-top: 4px; }
.gps-lista.plegado .gps-lista-cab { border-bottom: 0; }
.gps-lista.plegado .gps-lista-items { display: none; }
.gps-lista-items { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 3px 0; }
.gps-lista-item {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 10px;
  border: 0; background: transparent; cursor: pointer; font-size: 12px; color: #111; text-align: left;
}
.gps-lista-item:hover { background: #eef2fa; }
.gps-lista-item.activo { background: #dfe7fb; font-weight: 700; }
.gps-lista-item small { margin-left: auto; font-size: 11px; color: #64748b; }
.gps-lista-ico { width: 18px; height: 18px; flex: none; }
.gps-lista-punto { width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: #eb6834; flex: none; }
html.night .leaflet-control.gps-lista { background: rgba(21, 28, 46, .95); }
html.night .gps-lista-cab { color: #cdd6ff; border-bottom-color: #2c3550; }
html.night .gps-lista-n { background: #262f4a; color: #cdd6ff; }
html.night .gps-lista-item { color: #e6e8ef; }
html.night .gps-lista-item:hover { background: #222b45; }
html.night .gps-lista-item.activo { background: #2c3a66; }
html.night .gps-lista-item small { color: #8a97ad; }
@media (max-width: 768px) {
  .leaflet-control.gps-lista { width: 130px; }
  .gps-lista-items { max-height: 180px; }
}
.gps-lista-sep {
  margin-top: 3px; padding: 6px 10px 3px; border-top: 1px solid #e3e8f2;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #94a3b8;
}
.gps-lista-item.sin-gps { cursor: default; color: #94a3b8; }
.gps-lista-item.sin-gps:hover { background: transparent; }
.gps-lista-item.sin-gps .gps-lista-punto { background: #cbd5e1; }
html.night .gps-lista-sep { border-top-color: #2c3550; color: #6b7490; }
html.night .gps-lista-item.sin-gps { color: #6b7490; }
html.night .gps-lista-item.sin-gps .gps-lista-punto { background: #3a4460; }

/* ===== Batería junto al voltaje (sensores y apagadores: tabla, tarjetas y ficha) ===== */
.bat-voltaje { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bat-svg { flex: none; color: #64748b; }
html.night .bat-svg { color: #94a3b8; }
.bat-ok .bat-carga { fill: #16a34a; }
.bat-media .bat-carga { fill: #d97706; }
.bat-baja .bat-carga { fill: #dc2626; }
.bat-baja { color: #dc2626; }
html.night .bat-ok .bat-carga { fill: #4ade80; }
html.night .bat-media .bat-carga { fill: #fbbf24; }
html.night .bat-baja .bat-carga, html.night .bat-baja { fill: #f87171; color: #f87171; }
