:root {
  --azul-oscuro: #1E40AF;
  --azul: #2563EB;
  --celeste: #38BDF8;
  --celeste-claro: #E0F2FE;
  --fondo: #F0F9FF;
  --texto: #1E293B;
  --texto-suave: #64748B;
  --borde: #BAE6FD;
  --blanco: #FFFFFF;
  --verde-1: #A7F3D0;
  --verde-2: #6EE7B7;
  --verde-3: #34D399;
  --verde-4: #059669;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--fondo) 0%, #E0F2FE 100%);
  color: var(--texto);
  min-height: 100vh;
}

.contenedor {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 20px;
}

.contenedor-ancho {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.tarjeta {
  background: var(--blanco);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
  border: 1px solid var(--borde);
}

.marca {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.marca img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.marca-texto {
  font-size: 22px;
  font-weight: 700;
  color: var(--azul-oscuro);
}

.marca-sub {
  text-align: center;
  color: var(--texto-suave);
  font-size: 14px;
  margin-top: -20px;
  margin-bottom: 24px;
}

h1, h2, h3 {
  color: var(--azul-oscuro);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
  margin-bottom: 6px;
  margin-top: 16px;
}

input[type=text], input[type=email], input[type=password], select {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--borde);
  background: var(--fondo);
  font-size: 15px;
  color: var(--texto);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  background: var(--blanco);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--texto-suave);
  line-height: 1.4;
}

.checkbox-row input { margin-top: 3px; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--azul) 0%, var(--celeste) 100%);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
  text-align: center;
  text-decoration: none;
}

.btn:hover { box-shadow: 0 6px 18px rgba(37, 99, 235, .28); transform: translateY(-1px); }

.btn-secundario {
  background: var(--blanco);
  color: var(--azul);
  border: 1.5px solid var(--azul);
}

.error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.ok {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---------- Tracking de estaciones ---------- */
.tracking {
  display: flex;
  align-items: center;
  margin: 36px 0 8px;
}

.estacion {
  flex: 1;
  text-align: center;
  position: relative;
}

.estacion-punto {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: #E2E8F0;
  color: #94A3B8;
  border: 3px solid var(--blanco);
  box-shadow: 0 0 0 2px #E2E8F0;
  position: relative;
  z-index: 2;
}

.estacion-punto img {
  width: 18px;
  height: 18px;
  opacity: .55;
}

.estacion.activa .estacion-punto img {
  opacity: 1;
  filter: brightness(0) invert(1);
}

.estacion.activa .estacion-punto {
  color: white;
  box-shadow: 0 0 0 2px currentColor;
}

.estacion.pulso .estacion-punto {
  animation: pulso-estacion 1.8s infinite;
}

@keyframes pulso-estacion {
  0%, 100% { box-shadow: 0 0 0 2px currentColor; }
  50% { box-shadow: 0 0 0 7px rgba(5, 150, 105, .18); }
}

/* ---------- Panel de mensaje por estación ---------- */
.status-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 16px;
  padding: 18px;
  margin: 22px 0;
  background: linear-gradient(135deg, #F8FBFF, #EDF5FF);
}

.status-panel.exito {
  background: linear-gradient(135deg, #F6FFF9, #EAF9EF);
}

.status-panel-icono {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blanco);
  border: 2px solid rgba(37, 99, 235, .3);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .12);
}

.status-panel-icono img {
  width: 24px;
  height: 24px;
  filter: invert(35%) sepia(90%) saturate(1500%) hue-rotate(200deg);
}

.status-panel.exito .status-panel-icono {
  border-color: rgba(5, 150, 105, .3);
}

.status-panel.exito .status-panel-icono img {
  filter: invert(40%) sepia(60%) saturate(900%) hue-rotate(110deg);
}

.status-panel-titulo {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--azul-oscuro);
}

.status-panel.exito .status-panel-titulo {
  color: var(--verde-4);
}

.status-panel-copy {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #33415C;
}

.estacion-linea {
  position: absolute;
  top: 20px;
  left: -50%;
  width: 100%;
  height: 4px;
  background: #E2E8F0;
  z-index: 1;
}

.estacion:first-child .estacion-linea { display: none; }

.estacion-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-suave);
  padding: 0 4px;
  min-height: 2.6em;
  line-height: 1.3em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.estacion.activa .estacion-label { color: var(--texto); }

.estado-actual-box {
  text-align: center;
  margin: 28px 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--celeste-claro);
}

.progreso-flecha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
}

.progreso-flecha span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--texto-suave);
}

.progreso-flecha-barra {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #E2E8F0;
  overflow: hidden;
}

.progreso-flecha-relleno {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--celeste) 0%, var(--azul) 100%);
  transition: width .3s ease;
}

.estado-actual-box .etiqueta {
  font-size: 13px;
  color: var(--texto-suave);
  margin-bottom: 4px;
}

.estado-actual-box .valor {
  font-size: 20px;
  font-weight: 700;
  color: var(--azul-oscuro);
}

table.admin {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}

table.admin th {
  text-align: left;
  padding: 10px 12px;
  background: var(--celeste-claro);
  color: var(--azul-oscuro);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

table.admin td {
  padding: 10px 12px;
  border-bottom: 1px solid #F1F5F9;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--borde);
}

.topbar-user {
  font-size: 13px;
  color: var(--texto-suave);
}

.nav-admin a {
  color: var(--azul);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-right: 18px;
}

.nav-admin a:hover { text-decoration: underline; }

.rol-tag {
  display: inline-block;
  background: var(--azul);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}
