/* AcuaMonitor — Supervisor v2 — mobile-first PWA */

:root {
  --azul:    #0077b6;
  --azul-cl: #1e88e5;
  --azul-os: #020d1f;
  --agua:    #00b4d8;
  --agua-cl: #48cae4;
  --cian:    #00b0ff;
  --cian-cl: #40c4ff;
  --fondo:   #010d1e;
  --card:    rgba(2, 18, 46, 0.80);
  --borde:   rgba(0,180,216,0.12);
  --texto:   #e8f4fd;
  --texto-2: #7ecfea;
  --verde:   #00e676;
  --ambar:   #ffd740;
  --rojo:    #ff5252;
  --purpura: #ce93d8;

  --grad-p:  linear-gradient(135deg, #1e88e5 0%, #00b4d8 100%);
  --grad-v:  linear-gradient(135deg, #1b5e20 0%, #00695c 100%);
  --grad-r:  linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
  --sombra:  0 8px 32px rgba(0,0,0,.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== FONDO ANIMADO ===== */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(170deg, #010d1e 0%, #021628 40%, #031e3a 70%, #010d1e 100%);
  color: var(--texto);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Aurora del océano */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 100vw; height: 100vw;
  max-width: 560px; max-height: 560px;
  background: radial-gradient(ellipse, rgba(0,119,182,0.22) 0%, rgba(0,180,216,0.08) 45%, transparent 70%);
  top: -25%; left: -22%;
  animation: aurora1 20s ease-in-out infinite alternate;
}

body::after {
  width: 80vw; height: 80vw;
  max-width: 460px; max-height: 460px;
  background: radial-gradient(ellipse, rgba(0,64,128,0.20) 0%, rgba(0,119,182,0.07) 45%, transparent 70%);
  bottom: -18%; right: -18%;
  animation: aurora2 16s ease-in-out infinite alternate;
}

@keyframes aurora1 {
  0%   { transform: translate(0,0)       scale(1)    rotate(0deg); }
  100% { transform: translate(45px,30px) scale(1.28) rotate(10deg); }
}
@keyframes aurora2 {
  0%   { transform: translate(0,0)        scale(1)    rotate(0deg); }
  100% { transform: translate(-38px,-28px) scale(1.22) rotate(-8deg); }
}

/* ===== PARTÍCULAS, BURBUJAS Y ONDAS ===== */

.particulas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Burbujas que suben — efecto agua real */
.burbuja {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(72,202,228,0.55), rgba(0,119,182,0.06));
  border: 1px solid rgba(72,202,228,0.22);
  animation: subirBurbuja ease-in-out infinite;
}

@keyframes subirBurbuja {
  0%   { transform: translateY(0)      translateX(0);    opacity: 0;   }
  6%   { opacity: 0.65; }
  85%  { opacity: 0.28; }
  100% { transform: translateY(-110vh) translateX(12px); opacity: 0;   }
}

/* Anillos de ondulación (como piedra en el agua) */
.anillo {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,180,216,0.18);
  animation: expandirAnillo ease-out infinite;
}

@keyframes expandirAnillo {
  0%   { transform: scale(0.3); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0;   }
}

/* Rayo de luz refractada (efecto cáustica de agua) */
.luz-agua {
  position: fixed;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(0,200,228,0.028) 50%, transparent 100%);
  transform: skewX(-12deg);
  animation: rayoAgua 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes rayoAgua {
  0%   { left: -60%; opacity: 0;   }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 160%; opacity: 0;   }
}

/* Ondas del fondo — 5 capas */
.ondas-fondo {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.onda-fondo {
  position: absolute;
  bottom: 0; left: -50%;
  width: 200%; height: 100%;
  border-radius: 43%;
  background: rgba(0,119,182,0.09);
  animation: girarOnda 14s linear infinite;
}

.onda-fondo:nth-child(2) {
  background: rgba(0,180,216,0.06);
  animation-duration: 20s;
  animation-direction: reverse;
  border-radius: 47%;
}

.onda-fondo:nth-child(3) {
  background: rgba(0,77,141,0.07);
  animation-duration: 29s;
  border-radius: 40%;
}

.onda-fondo:nth-child(4) {
  background: rgba(72,202,228,0.04);
  animation-duration: 37s;
  animation-direction: reverse;
  border-radius: 45%;
}

.onda-fondo:nth-child(5) {
  background: rgba(0,200,220,0.03);
  animation-duration: 46s;
  border-radius: 38%;
}

@keyframes girarOnda {
  0%   { transform: rotate(0deg)   translateY(22px); }
  100% { transform: rotate(360deg) translateY(22px); }
}

/* ===== BANNERS ===== */

.offline-banner,
.sync-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  text-align: center;
  font-size: .82rem;
  padding: 6px 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.offline-banner { background: #b71c1c; color: #fff; }
.sync-banner    { background: var(--azul); color: #fff; }

body.tiene-banner .sup-header { top: 30px; }
body.tiene-banner .sup-main   { padding-top: calc(56px + 30px); }

/* ===== HEADER ===== */

.sup-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(90deg, #010e22 0%, #021a38 50%, #010e22 100%);
  border-bottom: 1px solid rgba(0,180,216,0.2);
  box-shadow:
    0 2px 24px rgba(0,0,0,.65),
    0 1px 0 rgba(0,180,216,0.15),
    inset 0 -1px 0 rgba(0,180,216,0.08);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.sup-logo svg { width: 32px; height: 32px; flex-shrink: 0; }

.sup-header-info { flex: 1; min-width: 0; }
.sup-titulo {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.1;
}
.sup-subtitulo {
  display: block;
  font-size: .75rem;
  color: var(--cian);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .8;
}

.sup-header-acciones { display: flex; gap: 4px; }

.btn-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  text-decoration: none;
  font-size: 1.1rem;
  transition: background .15s, box-shadow .15s;
}
.btn-header-link:hover { background: rgba(0,176,255,.15); box-shadow: 0 0 10px rgba(0,176,255,.2); }

.sup-logout {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  color: var(--texto-2);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.sup-logout:hover { background: rgba(255,82,82,.2); color: #ef9a9a; }

/* ===== MAIN ===== */

.sup-main {
  padding-top: 56px;
  padding-bottom: 64px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== VISTAS ===== */

.vista { display: none; padding: 16px 16px 24px; }
.vista.activa {
  display: block;
  animation: slideUp .22s ease both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ===== VISTA INICIO ===== */

.inicio-saludo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.inicio-titulo { font-size: 1.1rem; font-weight: 700; color: var(--texto); }
.inicio-nombre { font-size: .85rem; color: var(--cian); margin-top: 2px; opacity: .9; }

.inicio-conexion {
  font-size: .75rem;
  color: var(--texto-2);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-verde { background: var(--verde); box-shadow: 0 0 6px var(--verde); }
.dot-rojo  { background: var(--rojo);  box-shadow: 0 0 6px var(--rojo); }

.inicio-online-links {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.inicio-online-links.oculto { display: none; }

.inicio-link-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: var(--grad-p);
  border-radius: 12px;
  color: var(--texto);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,176,255,.4), inset 0 1px 0 rgba(255,255,255,.18);
  transition: box-shadow .2s, transform .15s;
}
.inicio-link-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  pointer-events: none;
}
.inicio-link-btn:hover::before { left: 130%; }
.inicio-link-btn:hover {
  box-shadow: 0 8px 26px rgba(0,176,255,.6), inset 0 1px 0 rgba(255,255,255,.18);
  transform: translateY(-1px);
}

#inicio-resumen { margin-bottom: 14px; }

.res-wrap {
  background: linear-gradient(135deg, rgba(1,14,38,0.88) 0%, rgba(2,22,52,0.82) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0,180,216,0.13);
  border-top: 1px solid rgba(0,180,216,0.3);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,0.04);
}
.res-stat {
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(21,101,192,.2);
  color: var(--texto-2);
}
.res-stat.alerta { background: rgba(183,28,28,.3); color: #ef9a9a; }

.res-font-card {
  background: linear-gradient(135deg, rgba(1,14,38,0.88) 0%, rgba(2,22,52,0.82) 100%);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0,180,216,0.12);
  border-left: 2px solid rgba(0,180,216,0.4);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  box-shadow: 0 3px 14px rgba(0,0,0,.45);
}
.res-font-nombre { font-size: .85rem; font-weight: 600; color: var(--texto); }
.res-font-stats  { display: flex; gap: 6px; flex-wrap: wrap; }

.inicio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.inicio-card {
  background: linear-gradient(150deg, rgba(1,14,38,0.92) 0%, rgba(2,22,52,0.86) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,180,216,0.14);
  border-top: 2px solid rgba(0,180,216,0.5);
  border-radius: 18px;
  padding: 20px 12px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: border-color .25s, transform .18s, box-shadow .25s;
  box-shadow:
    0 8px 32px rgba(0,0,0,.6),
    0 0 0 1px rgba(255,255,255,0.03),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
/* línea de brillo superior */
.inicio-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,200,228,0.65), transparent);
}
.inicio-card:hover {
  border-color: rgba(0,180,216,0.5);
  box-shadow:
    0 12px 40px rgba(0,119,182,0.3),
    0 0 0 1px rgba(0,180,216,0.12),
    inset 0 1px 0 rgba(255,255,255,0.08);
  transform: translateY(-3px);
}
.inicio-card:active { transform: scale(.95); }

.inicio-card-badge {
  position: absolute;
  top: 9px; right: 9px;
  background: var(--rojo);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 0 8px rgba(255,82,82,.4);
}
.inicio-card-badge.invisible { visibility: hidden; }
.inicio-card-ico   { font-size: 2rem; margin: 4px 0; }
.inicio-card-label { font-size: .88rem; font-weight: 700; color: var(--texto); }
.inicio-card-sub   { font-size: .7rem; color: var(--texto-2); }

/* ===== HEADERS DE VISTAS ===== */

.vista-seccion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.vista-seccion-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--texto); }

.vista-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.vista-header h2 { font-size: 1rem; font-weight: 700; color: var(--texto); }

.btn-volver {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--cian);
  font-size: 1.2rem;
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-volver:hover { background: rgba(0,176,255,.12); }

/* ===== FILTROS ===== */

.filtros-barra {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filtros-barra select,
.filtros-barra input[type="date"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: rgba(12,30,62,0.8);
  border: 1px solid var(--borde);
  border-radius: 10px;
  color: var(--texto);
  font-size: .82rem;
  backdrop-filter: blur(6px);
  transition: border-color .15s;
}
.filtros-barra select:focus,
.filtros-barra input:focus { outline: none; border-color: var(--cian); }

/* ===== LISTAS ===== */

.resultados-lista { display: flex; flex-direction: column; gap: 10px; }

.lista-vacia {
  text-align: center;
  padding: 32px 16px;
  color: var(--texto-2);
  font-size: .88rem;
  opacity: .75;
  line-height: 1.5;
}

.cargando {
  text-align: center;
  padding: 24px;
  color: var(--texto-2);
  opacity: .6;
  font-size: .85rem;
}

/* ===== ORDEN CARD ===== */

.orden-item {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.orden-item:hover {
  border-color: rgba(0,176,255,0.35);
  box-shadow: 0 4px 18px rgba(0,176,255,.12);
  transform: translateY(-1px);
}

.orden-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
}
.orden-item-cod    { font-size: .7rem; color: var(--cian); font-family: monospace; opacity: .8; }
.orden-item-titulo { font-size: .9rem; font-weight: 600; color: var(--texto); margin-bottom: 6px; line-height: 1.3; }
.orden-item-meta   { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.orden-item-font   { font-size: .76rem; color: var(--texto-2); }

/* ===== ORD INFO CARD ===== */

.ord-info-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-left: 3px solid var(--cian);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.ord-info-titulo { font-size: 1rem; font-weight: 700; color: var(--texto); margin-bottom: 8px; line-height: 1.3; }
.ord-info-meta   { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ord-info-desc   { font-size: .82rem; color: var(--texto-2); margin-top: 8px; line-height: 1.4; }

/* ===== ACTIVIDAD CARD ===== */

.act-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 12px 14px;
}
.act-card-top   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.act-card-quien { font-size: .85rem; font-weight: 600; color: var(--texto); }
.act-card-ts    { font-size: .72rem; color: var(--texto-2); }
.act-card-body  { font-size: .83rem; color: var(--texto-2); line-height: 1.4; margin-top: 4px; }
.act-card-gps   { font-size: .72rem; color: var(--texto-2); margin-top: 4px; opacity: .7; }
.act-card-foto  { margin-top: 8px; }
.act-card-foto img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; }

/* ===== PREDIO CARD ===== */

.pred-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.pred-card:hover {
  border-color: rgba(0,176,255,0.35);
  box-shadow: 0 4px 16px rgba(0,176,255,.1);
  transform: translateY(-1px);
}
.pred-card-nombre { font-size: .92rem; font-weight: 600; color: var(--texto); margin-bottom: 6px; }
.pred-card-meta   { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .78rem; color: var(--texto-2); }
.pred-card-hint   { font-size: .72rem; color: var(--cian); margin-top: 6px; }

/* ===== VISITA CARD ===== */

.visita-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 12px 14px;
}
.visita-card-top  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.visita-card-tipo { font-size: .85rem; font-weight: 600; color: var(--texto); }
.visita-card-ts   { font-size: .72rem; color: var(--texto-2); }
.visita-card-body { font-size: .82rem; color: var(--texto-2); line-height: 1.4; margin-top: 4px; }
.visita-card-gps  { font-size: .72rem; color: var(--texto-2); margin-top: 4px; opacity: .7; }

/* ===== VIABILIDAD CARD ===== */

.viab-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.viab-card:hover {
  border-color: rgba(0,176,255,0.35);
  box-shadow: 0 4px 18px rgba(0,176,255,.12);
  transform: translateY(-1px);
}
.viab-card-top    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 8px; }
.viab-card-nombre { font-size: .92rem; font-weight: 600; color: var(--texto); line-height: 1.2; }
.viab-card-meta   { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: var(--texto-2); margin-bottom: 4px; }
.viab-card-obs    { font-size: .8rem; color: var(--texto-2); margin-top: 4px; line-height: 1.4; }

/* ===== DERECHO DE PETICIÓN CARD ===== */

.der-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.der-card:hover {
  border-color: rgba(0,176,255,0.3);
  box-shadow: 0 4px 18px rgba(0,176,255,.1);
  transform: translateY(-1px);
}
.der-vencido {
  border-color: rgba(183,28,28,.45) !important;
  background: rgba(183,28,28,.06);
}

.der-card-top    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 8px; }
.der-card-num    { display: block; font-size: .7rem; color: var(--cian); font-family: monospace; margin-bottom: 2px; opacity: .8; }
.der-card-nombre { font-size: .9rem; font-weight: 600; color: var(--texto); line-height: 1.2; }
.der-card-desc   { font-size: .82rem; color: var(--texto-2); line-height: 1.4; margin-bottom: 6px; }
.der-card-fechas { display: flex; gap: 14px; font-size: .76rem; color: var(--texto-2); flex-wrap: wrap; }
.fecha-vencida   { color: var(--rojo); font-weight: 600; }

/* ===== BADGES ===== */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge-pend    { background: rgba(255,152,0,.18);    color: #ffb74d; }
.badge-proc    { background: rgba(0,176,255,.15);    color: #40c4ff; }
.badge-comp    { background: rgba(0,230,118,.15);    color: #69f0ae; }
.badge-urg     { background: rgba(255,82,82,.2);     color: #ff8a80; box-shadow: 0 0 8px rgba(255,82,82,.25); }
.badge-alta    { background: rgba(255,152,0,.18);    color: #ffb74d; }
.badge-tipo    { background: rgba(255,255,255,.07);  color: var(--texto-2); }
.badge-offline { background: rgba(255,82,82,.18);    color: #ff8a80; font-size: .65rem; }
.badge-dano    { background: rgba(183,28,28,.25);    color: #ef9a9a; box-shadow: 0 0 6px rgba(183,28,28,.2); }
.badge-nuevo   { background: rgba(156,39,176,.2);    color: #ce93d8; }

/* ===== BOTÓN NUEVA VISITA ===== */

.btn-nueva-visita {
  background: var(--grad-p);
  border: none;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(0,176,255,.4), inset 0 1px 0 rgba(255,255,255,.2);
  transition: box-shadow .2s, transform .15s;
}
.btn-nueva-visita::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  pointer-events: none;
}
.btn-nueva-visita:hover::before { left: 130%; }
.btn-nueva-visita:hover {
  box-shadow: 0 6px 22px rgba(0,176,255,.6), inset 0 1px 0 rgba(255,255,255,.2);
  transform: translateY(-1px);
}

/* ===== FORMULARIOS ===== */

.sup-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .82rem; color: var(--cian); font-weight: 600; opacity: .85; }
.form-group textarea,
.form-group select {
  background: rgba(12,30,62,0.85);
  border: 1px solid var(--borde);
  border-radius: 12px;
  color: var(--texto);
  padding: 11px 13px;
  font-size: .9rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
  backdrop-filter: blur(6px);
}
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--cian);
  box-shadow: 0 0 0 3px rgba(0,176,255,.12);
}
.form-group select option { background: #0d1e3a; }

/* ===== GPS ===== */

.gps-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12,30,62,0.8);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(6px);
}
.gps-estado { flex: 1; font-size: .82rem; color: var(--texto-2); display: flex; align-items: center; gap: 6px; }
.gps-punto  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.gps-punto.inactivo { background: #445; }
.gps-punto.activo   { background: var(--verde); box-shadow: 0 0 7px var(--verde); }
.gps-punto.cargando { background: var(--ambar); animation: parpadear .8s infinite; }

@keyframes parpadear {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.btn-gps {
  background: rgba(0,176,255,.15);
  border: 1px solid rgba(0,176,255,.3);
  color: var(--cian);
  font-size: .8rem;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s;
  font-family: inherit;
}
.btn-gps:hover { background: rgba(0,176,255,.28); }

/* ===== FOTO ===== */

.foto-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12,30,62,0.7);
  border: 1px dashed rgba(0,176,255,.3);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--texto-2);
  font-size: .85rem;
  transition: border-color .2s, background .2s;
}
.foto-label:hover { border-color: var(--cian); background: rgba(0,176,255,.05); }
.foto-label svg   { width: 22px; height: 22px; flex-shrink: 0; color: var(--cian); }

.foto-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 8px;
}

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

.btn-guardar {
  background: var(--grad-p);
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 15px;
  border-radius: 14px;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 22px rgba(0,176,255,.45), inset 0 1px 0 rgba(255,255,255,.22);
  transition: box-shadow .2s, transform .15s;
  letter-spacing: .04em;
}
.btn-guardar::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
  pointer-events: none;
}
.btn-guardar:hover::before { left: 130%; }
.btn-guardar:hover {
  box-shadow: 0 10px 34px rgba(0,176,255,.62), inset 0 1px 0 rgba(255,255,255,.22);
  transform: translateY(-2px);
}
.btn-guardar:active  { transform: scale(.97); }
.btn-guardar:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-completar       { background: var(--grad-v); box-shadow: 0 4px 16px rgba(0,105,92,.35); }
.btn-completar:hover { box-shadow: 0 7px 24px rgba(0,105,92,.5); }

/* ===== MENSAJE FORMULARIO ===== */

.form-msg {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: .85rem;
  text-align: center;
  line-height: 1.4;
  font-weight: 500;
}
.form-msg.exito { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.3); color: #69f0ae; }
.form-msg.error { background: rgba(255,82,82,.12);  border: 1px solid rgba(255,82,82,.3);  color: #ff8a80; }

/* ===== NAV INFERIOR ===== */

.sup-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(1,10,26,0.96) 0%, rgba(1,8,20,0.99) 100%);
  border-top: 1px solid rgba(0,180,216,.18);
  box-shadow: 0 -4px 24px rgba(0,0,0,.6), inset 0 1px 0 rgba(0,180,216,0.1);
  display: flex;
  z-index: 100;
  backdrop-filter: blur(18px);
}
.sup-nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: rgba(144,202,249,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 0;
  transition: color .2s;
  position: relative;
}
.sup-nav-btn.activo { color: var(--cian); }
.sup-nav-btn.activo::after {
  content: '';
  position: absolute;
  top: 6px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cian);
  box-shadow: 0 0 8px var(--cian);
}
.sup-nav-btn:hover  { color: var(--texto); }
.nav-ico   { font-size: 1.3rem; line-height: 1; }
.nav-label { font-size: .64rem; font-weight: 500; }

/* ===== ONLINE CARDS (Dashboard / Mapa) ===== */

.online-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.online-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 10px;
  background: var(--grad-p);
  border-radius: 16px;
  color: var(--texto);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 14px rgba(2,136,209,.3);
  transition: box-shadow .2s, transform .15s;
}
.online-card:hover  {
  box-shadow: 0 6px 22px rgba(2,136,209,.5);
  transform: translateY(-2px);
}
.online-card:active { transform: scale(.95); }

.online-card-ico   { font-size: 2rem; line-height: 1; }
.online-card-label { font-size: .92rem; font-weight: 700; margin-top: 2px; }
.online-card-sub   { font-size: .7rem; color: rgba(255,255,255,.7); }

/* Aviso offline */
.offline-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(183,28,28,.12);
  border: 1px solid rgba(183,28,28,.3);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: .82rem;
  color: #ef9a9a;
  margin-bottom: 16px;
}

/* Título de resumen */
.resumen-titulo {
  font-size: .78rem;
  color: var(--cian);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  margin-top: 4px;
  opacity: .8;
}

/* ===== SUBTABS ===== */

.subtabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  background: rgba(12,30,62,0.7);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 4px;
  backdrop-filter: blur(8px);
}

.subtab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(144,202,249,.6);
  font-size: .82rem;
  font-weight: 500;
  padding: 9px 6px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.subtab.activo {
  background: var(--grad-p);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(2,136,209,.3);
}

/* ===== FILTROS INLINE ===== */

.filtros-inline select {
  padding: 6px 10px;
  background: rgba(12,30,62,0.85);
  border: 1px solid var(--borde);
  border-radius: 8px;
  color: var(--texto);
  font-size: .78rem;
  backdrop-filter: blur(6px);
}
.filtros-inline select:focus { outline: none; border-color: var(--cian); }
.filtros-inline select option { background: #0d1e3a; }

/* ===== MIS PENDIENTES ===== */

.pend-seccion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  margin-top: 6px;
}
.pend-seccion-header h2 { font-size: 1rem; font-weight: 700; color: var(--texto); }

.pend-filtro-sel {
  padding: 5px 9px;
  background: rgba(12,30,62,0.85);
  border: 1px solid var(--borde);
  border-radius: 8px;
  color: var(--texto);
  font-size: .76rem;
  backdrop-filter: blur(6px);
}
.pend-filtro-sel:focus { outline: none; border-color: var(--cian); }
.pend-filtro-sel option { background: #0d1e3a; }

/* ===== VIABILIDADES: búsqueda + zonas ===== */

.viab-buscador-barra { align-items: center; }
.viab-buscador { flex: 1; min-width: 0; }

.btn-zona-toggle {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0,180,216,0.4);
  background: rgba(0,119,182,0.15);
  color: var(--agua);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  backdrop-filter: blur(6px);
}
.btn-zona-toggle.activo {
  background: var(--grad-p);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(0,176,255,.35);
}

.zona-grupo { margin-bottom: 4px; }
.zona-mpio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(0,119,182,0.22), rgba(0,119,182,0.05));
  border-left: 3px solid var(--agua);
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
  cursor: pointer;
}
.zona-mpio-nombre { font-weight: 700; color: var(--agua-cl); font-size: .88rem; }
.zona-mpio-count  { font-size: .72rem; color: var(--texto-2); }
.zona-mpio-dist   { font-size: .72rem; color: var(--cian); margin-left: auto; }
.zona-vereda-header {
  font-size: .76rem;
  color: var(--texto-2);
  padding: 3px 10px;
  margin: 6px 0 4px;
  border-left: 2px solid rgba(0,180,216,0.25);
}
.zona-dane-badge {
  display: inline-block;
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0,180,216,0.12);
  color: var(--agua);
  border: 1px solid rgba(0,180,216,0.2);
  margin-left: 4px;
  vertical-align: middle;
}

/* ===== MAPA VIABILIDADES ===== */

.mapa-viab-contenedor {
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,180,216,0.25);
  margin-bottom: 12px;
}
.mapa-viab-controles {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 8px;
  flex-wrap: wrap;
}
.mapa-viab-info {
  font-size: .74rem;
  color: var(--texto-2);
  flex: 1;
}
.leaflet-popup-content-wrapper {
  background: #02122e !important;
  color: #e8f4fd !important;
  border: 1px solid rgba(0,180,216,0.3) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: #02122e !important; }
.leaflet-popup-content { margin: 10px 14px !important; }
.mapa-popup-titulo {
  font-weight: 700;
  color: var(--agua-cl);
  font-size: .85rem;
  margin-bottom: 4px;
}
.mapa-popup-lista {
  font-size: .75rem;
  color: var(--texto-2);
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.6;
}
.mapa-popup-lista div { border-bottom: 1px solid rgba(0,180,216,0.1); padding: 2px 0; }
.mapa-popup-aprox {
  font-size: .68rem;
  color: var(--ambar);
  margin-top: 4px;
}

/* ===== VERIFICACIÓN ===== */

.ver-card {
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.ver-font {
  font-weight: 700;
  color: var(--agua-cl);
  font-size: .85rem;
}

.ver-fecha {
  font-size: .75rem;
  color: var(--texto-2);
}

.ver-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ver-titulo {
  font-size: .92rem;
  font-weight: 600;
  color: var(--texto);
}

.ver-sub {
  font-size: .78rem;
  color: var(--texto-2);
}

.ver-resolucion {
  font-size: .82rem;
  color: #b3e5fc;
  font-style: italic;
  background: rgba(0,180,216,.06);
  border-left: 3px solid var(--cian);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin: 2px 0;
}

.ver-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.ver-coord {
  font-size: .75rem;
  color: var(--texto-2);
  font-family: monospace;
}

.ver-sin-gps {
  color: rgba(255,255,255,.3);
}

.ver-mapa-link {
  font-size: .78rem;
  color: var(--cian-cl);
  text-decoration: none;
}

.ver-foto-wrap {
  margin-top: 4px;
  border-radius: 8px;
  overflow: hidden;
  max-height: 220px;
  cursor: pointer;
}

.ver-foto-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: opacity .2s;
}

.ver-foto-thumb:hover {
  opacity: .85;
}

/* ===== LIGHTBOX ===== */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.activo {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}

.lightbox-cerrar {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.btn-icon-sm {
  background: rgba(0,180,216,.15);
  border: 1px solid var(--borde);
  color: var(--cian-cl);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s;
}

.btn-icon-sm:hover { background: rgba(0,180,216,.25); }

/* ===== RESPONSIVE ===== */

@media (min-width: 640px) {
  .online-cards { grid-template-columns: repeat(2, 1fr); }
}
