* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100vh; background: #f4f6f8; overflow-x: hidden; }
header { position: sticky; top: 0; background: #111827; color: white; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 1000; }
header h1 { font-size: 1.05rem; font-weight: 700; }
.tabs { display: flex; background: #1f2937; border-radius: 8px; padding: 2px; }
.tab-btn { background: transparent; color: #9ca3af; border: none; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.tab-btn.activo { background: #2563eb; color: white; }
#map { height: 300px; width: 100%; z-index: 1; background: #e5e7eb; flex-shrink: 0; }
.panel { flex: 1; background: white; border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 16px 16px 40px 16px; box-shadow: 0 -4px 15px rgba(0,0,0,0.1); z-index: 10; margin-top: -16px; width: 100%; }
.panel h2 { font-size: 0.95rem; color: #111827; margin-bottom: 10px; }
.card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; margin-bottom: 14px; background: #fff; width: 100%; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-weight: 700; color: #111827; font-size: 0.95rem; }
.card-desc { font-size: 0.8rem; color: #4b5563; margin: 6px 0; line-height: 1.4; }
.ficha-legal { background: #f8fafc; border: 1px solid #cbd5e1; border-left: 4px solid #2563eb; border-radius: 8px; padding: 10px; margin: 8px 0; font-size: 0.82rem; color: #1e293b; }
.ficha-legal strong { color: #0f172a; }
.badge { display: inline-block; background: #dbeafe; color: #1d4ed8; font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.badge-verde { background: #d1fae5; color: #065f46; }
.badge-rojo { background: #fee2e2; color: #991b1b; }
.badge-curso { background: #fef3c7; color: #92400e; }
.input-group { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; width: 100%; }
input, select { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.9rem; background: #fff; }
.btn { width: 100%; background: #2563eb; color: white; border: none; padding: 11px; border-radius: 8px; font-weight: 600; margin-top: 8px; cursor: pointer; font-size: 0.9rem; }
.btn-verde { background: #2563eb; }
.btn-rojo { background: #dc2626; }
.btn-sec { background: #f3f4f6; color: #374151; margin-top: 6px; }
.flecha-ruta { color: white; font-size: 13px; font-weight: bold; text-shadow: 0 0 3px rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; pointer-events: none; width: 16px; height: 16px; }
.gps-pin { font-size: 22px; text-align: center; line-height: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.pasajeros-lista { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e5e7eb; font-size: 0.85rem; color: #374151; line-height: 1.5; }

/* Estilos para pantalla En Camino */
.en-curso-banner { background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%); color: white; padding: 14px; border-radius: 14px; margin-bottom: 14px; box-shadow: 0 4px 12px rgba(30,58,138,0.28); }
.en-curso-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pulso-vivo { display: inline-flex; align-items: center; gap: 6px; background: #10b981; color: #fff; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.caja-blanca-legal { background: #ffffff; color: #0f172a; border-radius: 10px; padding: 12px; margin-top: 8px; font-size: 0.85rem; line-height: 1.5; }
.parada-bajada { background: #fef3c7; color: #92400e; padding: 6px 10px; border-radius: 8px; margin-top: 6px; font-size: 0.82rem; font-weight: 600; }

/* Alerta emergente de solicitud de parada para el conductor */
.alerta-parada-box { background: #fef2f2; border: 3px solid #ef4444; border-radius: 14px; padding: 14px; margin-bottom: 14px; box-shadow: 0 6px 20px rgba(239,68,68,0.35); animation: latido 1.5s infinite; }
@keyframes latido { 0% { transform: scale(1); } 50% { transform: scale(1.015); } 100% { transform: scale(1); } }

select#select-ruta-conductor { font-size: 0.92rem; padding: 12px; border: 2px solid #2563eb; background-color: #f8fafc; color: #0f172a; font-weight: 600; white-space: normal; }

.ruta-opcion { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid #d1d5db; border-radius: 10px; background: #ffffff; cursor: pointer; margin-bottom: 6px; transition: all 0.15s; }
.ruta-opcion.seleccionada { border-color: #2563eb; background: #eff6ff; }
.ruta-opcion-texto { font-size: 0.88rem; font-weight: 700; color: #111827; line-height: 1.3; }

.ruta-opcion { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid #d1d5db; border-radius: 10px; background: #ffffff; cursor: pointer; margin-bottom: 8px; }
.ruta-opcion.seleccionada { border-color: #2563eb; background: #eff6ff; }
.ruta-opcion-texto { font-size: 0.88rem; font-weight: 700; color: #111827; line-height: 1.3; }

#map.modo-navegacion { height: 32vh !important; transition: height 0.3s ease; }
.gps-navegacion { font-size: 26px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5)); transform: scale(1.15); }

.manija-panel { width: 100%; padding: 8px 0 12px 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; background: #ffffff; border-bottom: 1px solid #f1f5f9; }
.manija-barra { width: 48px; height: 6px; background: #94a3b8; border-radius: 99px; margin-bottom: 4px; }
.manija-texto { font-size: 0.72rem; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; }
.panel.minimizado { height: 52px !important; min-height: 52px !important; max-height: 52px !important; overflow: hidden !important; padding-top: 2px !important; padding-bottom: 0 !important; }
#map.mapa-gigante { height: 82vh !important; }

.panel.minimizado {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  flex: none !important;
  z-index: 1000 !important;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15) !important;
  padding: 0 !important;
}
.panel.minimizado .manija-panel { padding: 6px 0 !important; }
#map.mapa-gigante { height: calc(100vh - 98px) !important; flex: none !important; }
