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

:root {
  --primario: #6EB4D9;
  --primario-hover: #4A96BB;
  --primario-claro: #EAF5FB;
  --verde: #057a55;
  --verde-claro: #d5f0e4;
  --amarillo: #c27803;
  --amarillo-claro: #fdf6b2;
  --rojo: #c81e1e;
  --rojo-claro: #fde8e8;
  --gris-claro: #f9fafb;
  --gris-borde: #C8E5F5;
  --gris-texto: #6B94AA;
  --texto: #1A3D52;
  --topbar-h: 56px;
  --radio: 14px;
  --sombra: 0 2px 12px rgba(26,61,82,0.10);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F0F8FC;
  color: var(--texto);
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  html { background: #1A4A68; }
  body {
    max-width: 540px;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(26,61,82,.4);
  }
}

@media (min-width: 900px) {
  body { max-width: 580px; }
  .hero { padding: 48px 32px 40px; }
  .card { padding: 28px 32px; }
}

/* ===== PANTALLAS ===== */
.pantalla {
  display: none;
  min-height: 100vh;
}

.pantalla.activa {
  display: block;
}

/* ===== HERO (inicio) ===== */
.hero {
  background: linear-gradient(160deg, #3D8FAD 0%, #6EB4D9 100%);
  color: white;
  text-align: center;
  padding: 40px 24px 32px;
}

.hero-icon {
  font-size: 56px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: block;
  margin: 0 auto;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.subtitulo {
  font-size: 15px;
  opacity: 0.85;
  margin-top: 4px;
}

.fecha-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  margin-top: 14px;
  backdrop-filter: blur(4px);
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--gris-borde);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--sombra);
}

.btn-back {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--primario);
  padding: 6px 10px 6px 0;
  line-height: 1;
}

.paso-badge {
  background: var(--primario-claro);
  color: var(--primario);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

/* ===== BARRA DE PROGRESO ===== */
.progreso-bar {
  height: 4px;
  background: var(--gris-borde);
}

.progreso-fill {
  height: 100%;
  background: linear-gradient(90deg, #3D8FAD, var(--primario));
  transition: width 0.4s ease;
}

/* ===== CONTENIDO ===== */
.contenido {
  padding: 16px;
  padding-bottom: 40px;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radio);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
  border: 1px solid var(--gris-borde);
}

.card-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gris-borde);
}

/* ===== CAMPOS ===== */
.campo {
  margin-bottom: 18px;
}

.campo:last-child {
  margin-bottom: 0;
}

.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gris-texto);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--primario);
  font-size: 18px;
}

select, input[type="number"], textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gris-borde);
  border-radius: 10px;
  font-size: 16px;
  color: var(--texto);
  background: white;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== RADIO GROUPS ===== */
.campo-radio {
  margin-bottom: 20px;
}

.campo-radio:last-child {
  margin-bottom: 0;
}

.label-radio {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gris-texto);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-group-2 {
  grid-template-columns: repeat(2, 1fr);
}

.radio-opcion {
  position: relative;
  cursor: pointer;
}

.radio-opcion input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-opcion span:not(.radio-icono) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border: 2px solid var(--gris-borde);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: all 0.18s;
  background: white;
  min-height: 62px;
}

.radio-opcion .radio-icono {
  font-size: 20px;
  display: block;
}

.radio-opcion:not(.radio-icono-wrap) span:not(.radio-icono) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.radio-opcion input:checked + .radio-icono + span {
  border-color: transparent;
  font-weight: 700;
}

.bueno input:checked + .radio-icono + span,
.bueno input:checked ~ span:last-child {
  background: var(--verde-claro);
  border-color: var(--verde);
  color: var(--verde);
}

.regular input:checked + .radio-icono + span,
.regular input:checked ~ span:last-child {
  background: var(--amarillo-claro);
  border-color: var(--amarillo);
  color: var(--amarillo);
}

.malo input:checked + .radio-icono + span,
.malo input:checked ~ span:last-child {
  background: var(--rojo-claro);
  border-color: var(--rojo);
  color: var(--rojo);
}

/* Selector visual combinado */
.radio-opcion {
  display: flex;
  flex-direction: column;
}

.radio-opcion label-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mejor enfoque: wrapper visual */
.radio-opcion > span.radio-icono,
.radio-opcion > span:not(.radio-icono) {
  pointer-events: none;
}

.radio-opcion {
  border: 2px solid var(--gris-borde);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  background: white;
  transition: all 0.18s;
  min-height: 66px;
  user-select: none;
}

.radio-opcion:has(input:checked) {
  font-weight: 700;
}

.bueno:has(input:checked) {
  background: var(--verde-claro);
  border-color: var(--verde);
  color: var(--verde);
}

.regular:has(input:checked) {
  background: var(--amarillo-claro);
  border-color: var(--amarillo);
  color: var(--amarillo);
}

.malo:has(input:checked) {
  background: var(--rojo-claro);
  border-color: var(--rojo);
  color: var(--rojo);
}

/* ===== GRID DE FOTOS ===== */
.info-fotos {
  font-size: 14px;
  color: var(--gris-texto);
  text-align: center;
  padding: 4px 0;
}

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

.foto-item {
  position: relative;
}

.foto-preview {
  aspect-ratio: 4/3;
  border-radius: 12px;
  border: 2px dashed var(--gris-borde);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.foto-preview:active {
  transform: scale(0.97);
}

.foto-preview.tiene-foto {
  border: 2px solid var(--verde);
}

.foto-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
}

.foto-emoji {
  font-size: 28px;
}

.foto-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto);
  text-align: center;
}

.foto-sub {
  font-size: 10px;
  color: var(--gris-texto);
  text-align: center;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.foto-ok {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  background: var(--verde);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.input-file {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.contador-fotos {
  text-align: center;
  font-size: 14px;
  color: var(--gris-texto);
  margin-bottom: 16px;
  font-weight: 500;
}

#num-fotos {
  font-size: 22px;
  font-weight: 800;
  color: var(--primario);
}

/* ===== BOTONES ===== */
.btn-primario {
  width: 100%;
  padding: 16px;
  background: var(--primario);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 8px;
}

.btn-primario:active {
  transform: scale(0.98);
  background: var(--primario-hover);
}

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

.btn-secundario {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--primario);
  border: 2px solid var(--primario);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.btn-secundario:active {
  background: var(--primario-claro);
}

/* ===== PANTALLA INICIO - card ===== */
#pantalla-inicio .card {
  margin: -12px 16px 0;
  border-radius: var(--radio);
}

/* ===== ÉXITO ===== */
.exito-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.exito-icono {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.exito-container h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--verde);
  margin-bottom: 10px;
}

.exito-container p {
  color: var(--gris-texto);
  font-size: 15px;
  margin-bottom: 20px;
}

.exito-detalle {
  background: var(--verde-claro);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--verde);
  font-weight: 500;
  line-height: 1.8;
}

/* ===== HISTORIAL ===== */
.registro-card {
  background: white;
  border-radius: var(--radio);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--sombra);
  border: 1px solid var(--gris-borde);
}

.registro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.registro-chofer {
  font-weight: 700;
  font-size: 15px;
}

.registro-hora {
  font-size: 12px;
  color: var(--gris-texto);
}

.registro-patente {
  display: inline-block;
  background: var(--primario-claro);
  color: var(--primario);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.registro-fotos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.registro-foto-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gris-borde);
}

.badge-estado {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  margin: 2px;
}

.badge-bueno, .badge-normal, .badge-funcionando, .badge-funciona, .badge-sin {
  background: var(--verde-claro);
  color: var(--verde);
}

.badge-regular, .badge-bajo {
  background: var(--amarillo-claro);
  color: var(--amarillo);
}

.badge-malo, .badge-critico, .badge-con, .badge-no {
  background: var(--rojo-claro);
  color: var(--rojo);
}

.fecha-grupo {
  font-size: 13px;
  font-weight: 700;
  color: var(--gris-texto);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

/* ===== OVERLAY DE CARGA ===== */
.overlay-carga {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  color: white;
  gap: 16px;
  font-size: 16px;
  font-weight: 600;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== UTILES ===== */
.oculto {
  display: none !important;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--gris-texto);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1f2937;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  transition: transform 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--rojo);
}

/* ===== TOAST ERROR (nuevo sistema) ===== */
.toast-error {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--rojo);
  color: white;
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  transition: transform 0.3s ease;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 16px rgba(200,30,30,0.4);
}

.toast-error.visible {
  transform: translateX(-50%) translateY(0);
}

/* ===== LOGIN - secciones ===== */
.info-crear {
  font-size: 13px;
  color: var(--gris-texto);
  background: var(--amarillo-claro);
  border: 1px solid var(--amarillo);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}

input[type="password"] {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gris-borde);
  border-radius: 10px;
  font-size: 16px;
  color: var(--texto);
  background: white;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

/* ===== HISTORIAL CHOFER ===== */
.hist-fecha {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gris-texto);
  letter-spacing: 0.5px;
  padding: 16px 0 6px;
}

.hist-card {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--sombra);
  border: 1px solid var(--gris-borde);
}

.hist-encabezado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.hist-patente {
  font-weight: 800;
  font-size: 15px;
  color: var(--primario);
  letter-spacing: 1px;
  background: var(--primario-claro);
  padding: 2px 10px;
  border-radius: 6px;
}

.hist-km {
  font-size: 13px;
  color: var(--gris-texto);
  font-weight: 500;
}

.hist-estados {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
}

.badge-ok {
  background: var(--verde-claro);
  color: var(--verde);
}

.badge-regular {
  background: var(--amarillo-claro);
  color: var(--amarillo);
}

.badge-malo {
  background: var(--rojo-claro);
  color: var(--rojo);
}

.sin-datos {
  text-align: center;
  padding: 40px 20px;
  color: var(--gris-texto);
  font-size: 15px;
}

/* ===== BIENVENIDA (pantalla vehículo) ===== */
#nombre-bienvenida {
  font-size: 15px;
  font-weight: 600;
  color: var(--texto);
}

/* ===== RECUPERAR CONTRASEÑA ===== */
.btn-recuperar {
  width: 100%;
  background: none;
  border: none;
  color: var(--primario);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 0 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.8;
}
.btn-recuperar:active { opacity: 1; }

.btn-recuperar-enviar {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--primario);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-recuperar-enviar:disabled { opacity: 0.6; cursor: default; }

.recuperar-box {
  background: var(--primario-claro);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
  text-align: center;
}

.recuperar-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.recuperar-texto {
  font-size: 14px;
  color: var(--texto);
  margin-bottom: 6px;
  line-height: 1.4;
}

.recuperar-pasos {
  font-size: 12px;
  color: var(--gris-texto);
  line-height: 1.4;
}

/* ===== PANTALLA TIPO ===== */
.tipo-contenido {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tipo-pregunta {
  font-size: 17px;
  font-weight: 600;
  color: var(--gris-texto);
  text-align: center;
  margin-bottom: 24px;
}

.tipo-opciones {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.tipo-card {
  width: 100%;
  background: white;
  border: 2px solid var(--gris-borde);
  border-radius: 16px;
  padding: 24px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 0.2s;
  box-shadow: var(--sombra);
  -webkit-tap-highlight-color: transparent;
}

.tipo-card:active {
  transform: scale(0.97);
}

.tipo-card:hover {
  border-color: var(--primario);
  box-shadow: 0 4px 20px rgba(26,86,219,0.15);
}

.tipo-card-mant:hover {
  border-color: var(--verde);
  box-shadow: 0 4px 20px rgba(5,122,85,0.15);
}

.tipo-icono {
  font-size: 44px;
  line-height: 1;
}

.tipo-nombre {
  font-size: 18px;
  font-weight: 700;
  color: var(--texto);
}

.tipo-desc {
  font-size: 13px;
  color: var(--gris-texto);
  line-height: 1.4;
}

.tipo-realizado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  letter-spacing: 0.03em;
}

.tipo-card-done {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
}

.tipo-card-mant-done {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
}

.tipo-msg {
  background: #fff7ed;
  color: #9a3412;
  border: 1.5px solid #fdba74;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  text-align: center;
  animation: bounce 0.25s ease;
}

/* ===== TIPO CARD CARGA ===== */
.tipo-card-carga:not(.tipo-card-locked):hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 20px rgba(245,158,11,0.18);
}

.tipo-card-locked {
  opacity: 0.55;
  cursor: not-allowed !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.tipo-card-locked:active {
  transform: none !important;
}

.tipo-carga-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
}

.tipo-carga-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #fcd34d;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
}

/* ===== PANTALLA CARGA DIARIA ===== */
.btn-topbar-icon {
  background: transparent;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  opacity: 0.85;
  transition: opacity .15s, background .15s;
}
.btn-topbar-icon:hover { opacity: 1; background: rgba(255,255,255,0.15); }

.carga-resumen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
}
.carga-resumen:has(.carga-stat:nth-child(3):last-child) {
  grid-template-columns: repeat(3, 1fr);
}

.carga-stat {
  background: white;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.carga-stat-total { border-color: #e2e8f0; }
.carga-stat-ok    { border-color: #86efac; background: #f0fdf4; }
.carga-stat-pend  { border-color: #fcd34d; background: #fffbeb; }
.carga-stat-fail  { border-color: #fca5a5; background: #fff1f2; }

.carga-stat-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--primario);
}
.carga-stat-ok  .carga-stat-num { color: #16a34a; }
.carga-stat-pend .carga-stat-num { color: #d97706; }
.carga-stat-fail .carga-stat-num { color: #dc2626; }

.carga-stat-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gris-texto);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* === Tarjeta total del día === */
.carga-total-card {
  background: linear-gradient(135deg, #3D8FAD 0%, #6EB4D9 100%);
  border-radius: 16px;
  margin: 12px 12px 8px;
  padding: 18px 16px;
  color: white;
}

.carga-total-titulo {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.carga-total-sub {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.75;
}

/* === Lista de productos === */
.prod-lista {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.prod-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.carga-total-card .prod-fila:last-child { border-bottom: none; }

.prod-nombre {
  font-size: 14px;
  font-weight: 500;
}

.prod-qty {
  font-size: 20px;
  font-weight: 800;
  min-width: 40px;
  text-align: right;
}

/* === Tarjeta por vehículo === */
.carga-grupo-card {
  background: white;
  border-radius: 14px;
  margin: 0 12px 10px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
}

.carga-grupo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--gris-borde);
  padding: 12px 14px;
}

.carga-grupo-patente {
  background: #1A4A68;
  color: white;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.carga-grupo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.carga-grupo-modelo {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carga-grupo-meta {
  font-size: 11px;
  color: var(--gris-texto);
}

.carga-grupo-card .prod-lista {
  padding: 4px 14px 8px;
}

.carga-grupo-card .prod-fila {
  border-bottom-color: var(--gris-borde);
}

.carga-grupo-card .prod-nombre {
  font-size: 13px;
  color: var(--texto);
}

.carga-grupo-card .prod-qty {
  font-size: 18px;
  color: var(--primario);
}

.carga-aviso {
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  padding: 6px 14px;
  border-top: 1px solid #fcd34d;
}

.carga-vacio {
  text-align: center;
  padding: 60px 24px;
  color: var(--gris-texto);
  font-size: 14px;
}

.carga-error {
  text-align: center;
  padding: 50px 24px;
  color: var(--texto);
}
.carga-error-icono { font-size: 44px; margin-bottom: 12px; }
.carga-error-detalle {
  font-size: 12px;
  color: var(--gris-texto);
  margin: 6px 0 20px;
}

/* ===== MANTENIMIENTO ===== */
.mant-instruccion {
  font-size: 13px;
  color: var(--gris-texto);
  margin-bottom: 16px;
  font-style: italic;
}

.mant-categoria {
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gris-borde);
  margin-bottom: 16px;
}

.mant-categoria-last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.mant-cat-titulo {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primario);
  margin-bottom: 10px;
}

.mant-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.mant-check:active {
  background: var(--primario-claro);
}

.mant-check:has(input:checked) {
  background: var(--primario-claro);
}

.mant-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: var(--primario);
  cursor: pointer;
}

.mant-check span {
  font-size: 14px;
  color: var(--texto);
  font-weight: 400;
}

.mant-check:has(input:checked) span {
  font-weight: 600;
  color: var(--primario);
}

.mant-realizado-opciones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mant-realizado-opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--gris-borde);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.mant-realizado-opcion:has(input:checked) {
  border-color: var(--primario);
  background: var(--primario-claro);
}

.mant-realizado-opcion input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primario);
}

.mant-realizado-opcion span {
  font-size: 14px;
  font-weight: 500;
}

.mant-opcional {
  font-size: 12px;
  font-weight: 400;
  color: var(--gris-texto);
}

.mant-foto-hint {
  font-size: 12px;
  color: var(--gris-texto);
  margin-bottom: 14px;
}

.mant-fotos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mant-foto-slot {
  position: relative;
}

.mant-foto-area {
  aspect-ratio: 3/4;
  border-radius: 10px;
  border: 2px dashed var(--gris-borde);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--gris-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.mant-foto-area:active {
  transform: scale(0.96);
}

.mant-foto-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--gris-texto);
  font-size: 11px;
  text-align: center;
}

.mant-foto-plus {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--gris-borde);
}

.btn-mant-enviar {
  background: var(--verde);
}

.btn-mant-enviar:active {
  background: #046c4e;
}

/* ===== DESKTOP: LOGIN PANTALLA COMPLETA (≥ 960px) ===== */
.login-titulo { display: none; }
.login-tagline { display: none; }

@media (min-width: 960px) {
  html:has(#pantalla-inicio.activa) {
    background: linear-gradient(160deg, #3D8FAD 0%, #6EB4D9 100%);
  }
  body:has(#pantalla-inicio.activa) {
    max-width: 100% !important;
    box-shadow: none !important;
    background: transparent !important;
    margin: 0 !important;
  }
  #pantalla-inicio.activa {
    display: grid !important;
    grid-template-columns: 500px 1fr;
    min-height: 100vh;
  }
  #pantalla-inicio .hero {
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100vh;
    padding: 80px 72px;
    gap: 12px;
    border-radius: 0;
  }
  #pantalla-inicio .hero .hero-icon {
    margin-bottom: 8px;
  }
  #pantalla-inicio .hero .hero-logo {
    width: 120px;
    height: 120px;
    border-radius: 28px;
  }
  #pantalla-inicio .hero h1 {
    font-size: 44px;
    margin-top: 8px;
  }
  #pantalla-inicio .hero .login-tagline {
    display: block;
    font-size: 17px;
    opacity: 0.85;
    font-weight: 500;
    margin: 0;
  }
  #pantalla-inicio .hero .fecha-badge {
    font-size: 14px;
    padding: 7px 20px;
    margin-top: 20px;
  }
  #pantalla-inicio .card {
    order: 1;
    margin: 0 !important;
    border-radius: 0 !important;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    padding: 60px 52px !important;
    box-shadow: -16px 0 48px rgba(26,61,82,0.18) !important;
    border: none !important;
    background: #fff !important;
  }
  .login-titulo {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: var(--texto);
    letter-spacing: -0.5px;
    margin-bottom: 28px;
  }
}

/* ===== BARRA CUMPLEAÑOS ===== */
.cumple-aviso {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 6px 16px;
  flex-wrap: wrap;
  min-height: 34px;
}
.cumple-label {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  white-space: nowrap;
  margin-right: 4px;
  flex-shrink: 0;
}
.cumple-sep { color: #d1d5db; margin: 0 8px; font-size: 12px; }
.cumple-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cumple-pastel { font-size: 14px; }
.cumple-nombre {
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
}
.cumple-fecha {
  font-size: 12px;
  color: #b45309;
}
.cumple-badge {
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.cumple-badge-hoy  { background: #dc2626; color: #fff; }
.cumple-badge-pronto { background: #f59e0b; color: #fff; }
.cumple-badge-dias { background: #f3f4f6; color: #6b7280; }

/* ===== BANNER CONTRASEÑA FORZADA ===== */
.banner-forzado {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 2px solid #f59e0b;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ===== MI CUENTA ===== */
.mc-perfil-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px !important;
}
.mc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primario-claro);
  border: 2px solid var(--primario);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.mc-info {
  flex: 1;
  min-width: 0;
}
.mc-nombre {
  font-size: 17px;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-rol-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primario-claro);
  color: var(--primario-hover);
}
.mc-rol-badge.mc-rol-supervisor,
.mc-rol-badge.mc-rol-administrador {
  background: #e0e7ff;
  color: #3730a3;
}
.mc-rol-badge.mc-rol-chofer,
.mc-rol-badge.mc-rol-peoneta {
  background: var(--verde-claro);
  color: var(--verde);
}

/* Info BUK */
.mc-buk-loading, .mc-buk-unavail {
  font-size: 13px;
  color: var(--gris-texto);
  text-align: center;
  padding: 12px 0;
}
.mc-buk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.mc-buk-item {
  background: var(--gris-claro);
  border-radius: 8px;
  padding: 10px 12px;
}
.mc-buk-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #9ca3af;
  margin-bottom: 3px;
}
.mc-buk-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
  word-break: break-word;
}
.mc-cumple-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.mc-buk-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mc-buk-stat {
  background: var(--gris-claro);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.mc-buk-stat-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 3px;
}
.mc-buk-stat-lbl {
  font-size: 10px;
  color: var(--gris-texto);
  font-weight: 600;
  line-height: 1.2;
}

/* Header contraseña */
.mc-pwd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.mc-pwd-toggle-btn {
  background: var(--primario);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.mc-pwd-toggle-btn:hover { background: var(--primario-hover); }

/* Campo contraseña con ojo */
.mc-pwd-campo { margin-bottom: 14px; }
.mc-pwd-wrap {
  position: relative;
}
.mc-pwd-wrap input {
  width: 100%;
  padding-right: 42px;
}
.mc-pwd-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gris-texto);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.mc-pwd-eye svg { width: 18px; height: 18px; }
.mc-pwd-eye:hover { color: var(--primario); }
.mc-pwd-eye.mc-pwd-eye-on { color: var(--primario); }

/* Stats Mi Cuenta */
.mc-stats-periodo {
  font-size: 12px;
  color: var(--gris-texto);
  margin-bottom: 14px;
  text-align: center;
}
.mc-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.mc-stat-item {
  background: var(--gris-claro);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.mc-stat-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.mc-stat-lbl {
  font-size: 11px;
  color: var(--gris-texto);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mc-stats-dias {
  text-align: center;
  font-size: 13px;
  color: var(--gris-texto);
}

/* ===== TARJETA DESCARGA (menú principal) ===== */
.tipo-card-descarga { border-top: 4px solid #059669; }
.tipo-card-descarga-done { border-top-color: #059669; background: #f0fdf4; }

/* ===== HUB DESCARGA ===== */
.desc-hub-view { padding-top: 0; }

.desc-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #0f3f5c 0%, #0891b2 100%);
  color: #fff;
  padding: 20px 20px 18px;
  margin-bottom: 16px;
}
.desc-banner-icon { font-size: 32px; line-height: 1; }
.desc-banner-titulo { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.desc-banner-fecha { font-size: 11px; opacity: 0.7; margin-top: 1px; text-transform: capitalize; }
.desc-banner-sub { font-size: 12px; opacity: 0.82; margin-top: 3px; }

/* Selector de fecha */
.desc-fecha-selector {
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
}
.desc-fecha-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: border-color .15s, background .15s, color .15s;
}
.desc-fecha-btn-activo {
  border-color: var(--primario);
  background: #EAF5FB;
  color: var(--primario);
}

/* Tarjeta de ruta */
.desc-ruta-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 14px;
  padding: 16px 14px 16px 16px;
  margin: 0 16px 10px;
  box-shadow: 0 2px 8px rgba(8,145,178,.1);
  cursor: pointer;
  border-left: 4px solid var(--primario);
  transition: box-shadow .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.desc-ruta-card:active { transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.desc-ruta-hecha { border-left-color: #059669; background: #f0fdf4; }

.desc-ruta-num {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--primario);
  color: #fff;
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.desc-ruta-num-hecha { background: #059669; }

.desc-ruta-info { flex: 1; min-width: 0; }
.desc-ruta-titulo { font-size: 15px; font-weight: 700; color: #1A3D52; }
.desc-ruta-sub { font-size: 12px; color: #64748b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.desc-ruta-estado { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.desc-badge-pend {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
  background: #fef3c7; color: #92400e;
}
.desc-badge-hecha {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
  background: #dcfce7; color: #166534;
}
.desc-chevron { font-size: 20px; color: #94a3b8; font-weight: 300; margin-top: -2px; }

.desc-hub-empty { text-align: center; padding: 40px 20px; color: #64748b; font-size: 14px; }

/* Contexto de ruta en el formulario */
.desc-ruta-ctx {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f3f5c 0%, #0891b2 100%);
  border-radius: 0;
}
.desc-ruta-ctx-inner { display: flex; align-items: center; gap: 12px; }
.desc-ruta-ctx-num {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.5);
  color: #fff; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.desc-ruta-ctx-label { font-size: 15px; font-weight: 700; color: #fff; }
.desc-ruta-ctx-veh { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 2px; }

.desc-opcional { font-size: 12px; font-weight: 400; color: #94a3b8; }

/* Vista detalle de descarga ya registrada */
.desc-detalle-hora {
  font-size: 12px; color: #059669; font-weight: 600;
  background: #dcfce7; display: inline-block;
  padding: 2px 10px; border-radius: 20px; margin-bottom: 4px;
}
.desc-detalle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid #f1f5f9;
}
.desc-detalle-row:last-child { border-bottom: none; }
.desc-detalle-lbl { font-size: 13px; color: #64748b; }
.desc-detalle-val { font-size: 17px; font-weight: 800; color: #1A3D52; }

.desc-modificar-btn {
  display: block; width: 100%;
  padding: 14px;
  background: #fff; color: var(--primario);
  border: 2px solid var(--primario); border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 4px;
  transition: background .15s, color .15s;
}
.desc-modificar-btn:active { background: var(--primario); color: #fff; }

/* Stepper de envases */
.desc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.desc-label {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
  flex: 1;
  padding-right: 10px;
  line-height: 1.3;
}
.desc-stepper { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.desc-step-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primario);
  background: #fff; color: var(--primario);
  font-size: 22px; font-weight: 700; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background .1s, color .1s;
}
.desc-step-btn:active { background: var(--primario); color: #fff; }
.desc-step-val {
  width: 54px; text-align: center;
  font-size: 17px; font-weight: 700;
  border: 2px solid #e2e8f0; border-radius: 8px;
  padding: 5px 4px; color: #1A3D52;
  -moz-appearance: textfield;
}
.desc-step-val::-webkit-outer-spin-button,
.desc-step-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== MODAL CONTRASEÑA FORZADA ===== */
.mf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mf-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
.mf-icon { font-size: 38px; text-align: center; margin-bottom: 10px; }
.mf-titulo {
  font-size: 20px;
  font-weight: 700;
  color: #1A3D52;
  text-align: center;
  margin: 0 0 8px;
}
.mf-desc {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.5;
}
.mf-campo { margin-bottom: 14px; }
.mf-campo label { font-size: 13px; font-weight: 600; color: #334155; display: block; margin-bottom: 4px; }
.mf-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  text-align: center;
  display: none;
}
.mf-btn { width: 100%; margin-top: 4px; }
