/* =====================================================================
   WAYGO GPS - Hoja de estilos global
   Se carga despues de Bootstrap 5.3 (system/addons/add_js.php).
   Reorganizada el 2026-11-18. Regla: los valores visuales se conservan
   exactamente; cualquier ajuste de diseno se hace aqui, no en la vista.

   INDICE
     1. Tokens (variables)          7. Tablas
     2. Base                        8. Eventos y alertas
     3. Estructura y mapa           9. Barras de progreso
     4. Tipografia                 10. Chatbot
     5. Bloques y tarjetas         11. Animaciones
     6. Etiquetas e indicadores    12. Separadores
                                   13. Utilidades wg-*
                                   14. Estilos por modulo

   Convenciones
     - Clases propias nuevas: prefijo wg- y nombre en espanol (wg-text-azul).
     - Colores: siempre con variable --wg-*; no escribir hexadecimales en vistas.
     - Primero usar utilidades de Bootstrap (mb-2, text-center, fw-bold...);
       crear una clase aqui solo si Bootstrap no la tiene.
     - Nada de style="..." en vistas, salvo valores calculados en PHP/JS o
       display:none que el JavaScript alterna.
   ===================================================================== */


/* 1. TOKENS ============================================================ */
:root {
  /* Inter servida localmente (system/plugins/inter-5.3.0/inter.css) */
  --wg-fuente: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Bootstrap usa la fuente y el azul corporativos */
  --bs-body-font-family: var(--wg-fuente);
  --bs-font-sans-serif: var(--wg-fuente);
  --bs-primary: #06c;
  --bs-primary-rgb: 0, 102, 204;
  --bs-link-color: #06c;
  --bs-link-color-rgb: 0, 102, 204;
  --bs-link-hover-color: #0052a3;
  --bs-link-hover-color-rgb: 0, 82, 163;

  /* Layout */
  --wg-lateral-fondo: #16181d;
  --wg-lateral-fondo-2: #1f2229;
  --wg-lateral-texto: #aeb4be;
  --wg-lateral-texto-fuerte: #f3f4f6;
  --wg-lateral-borde: #2a2e36;
  --wg-lateral-ancho: 260px;
  --wg-lateral-mini: 72px;
  --wg-superior-alto: 64px;
  --wg-azul-suave: rgb(0 102 204 / 10%);
  --wg-borde-claro: #e5e7eb;
  --wg-fondo-main: #f3f4f6;

  /* Marca y estados */
  --wg-azul: #06c;
  --wg-azul-oscuro: #215c98;
  --wg-azul-intenso: #0056ff;
  --wg-azul-seleccion: #187ee3;
  --wg-azul-seleccion-borde: #0c5eaf;
  --wg-rojo: #f00;
  --wg-verde: #449c28;
  --wg-verde-claro: #46e797;
  --wg-verde-oliva: #3b6100;
  --wg-arena: #a2854e;

  /* Neutros */
  --wg-blanco: #fff;
  --wg-negro: #000;
  --wg-humo: #f1f1f1;
  --wg-gris-claro: #aaa;
  --wg-gris-medio: #9f9f9f;
  --wg-gris: #999;
  --wg-gris-oscuro: #666;
  --wg-gris-texto: #878787;
  --wg-fondo-app: #dedede;
  --wg-borde: #d9d9d9;
  --wg-oscuro: #212529;

  /* Semaforo de eventos */
  --wg-evento-warning: #f9b65d;
  --wg-evento-danger: #c9595d;
  --wg-evento-info: #9ab9c9;
  --wg-evento-success: #56c188;
}


/* 2. BASE ============================================================== */
body {
  background: var(--wg-fondo-app);
  font-family: var(--wg-fuente);
  font-size: 14px;
  font-variant-numeric: tabular-nums; /* numeros de ancho fijo: columnas de km, importes y horas alineadas */
}

/* Boton primario con el azul corporativo */
.btn-primary {
  --bs-btn-bg: #06c;
  --bs-btn-border-color: #06c;
  --bs-btn-hover-bg: #0057ad;
  --bs-btn-hover-border-color: #0052a3;
  --bs-btn-active-bg: #0052a3;
  --bs-btn-active-border-color: #004c99;
  --bs-btn-disabled-bg: #06c;
  --bs-btn-disabled-border-color: #06c;
}


/* Compatibilidad Bootstrap 5.1 -> 5.3: en 5.3 las tablas pasaron a fondo blanco y
   texto negro. Se conserva el aspecto de 5.1. Excluye las variantes de color. */
.table:not(.table-primary):not(.table-secondary):not(.table-success):not(.table-info):not(.table-warning):not(.table-danger):not(.table-light):not(.table-dark) {
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
}


/* Todo elemento con clic muestra la mano (antes se declaraba vista por vista). */
[onclick] {
  cursor: pointer;
}


/* Responsivo (celular y tablet vertical): evitar scroll horizontal de la pagina.
   - .row dentro de contenedores sin relleno: su margen negativo sobresale 12 px
     (zona vacia); se recorta.
   - Tablas de DataTables sin scrollX: se desplazan dentro de su propia celda.
   Solo bajo 768 px: en escritorio no cambia nada. */
@media (max-width: 767.98px) {
  .container-fluid.p-0,
  .container-fluid.px-0,
  .container-fluid.p-1,
  .container-fluid.p-2,
  .dataTables_wrapper {
    overflow-x: clip;
  }

  .dataTables_wrapper .dt-row > [class*="col-"] {
    overflow-x: auto;
  }

  .wg-vista-linea-tiempo .resumen {
    flex-wrap: wrap;
    justify-content: flex-start !important;
    margin-top: .5rem;
  }
}

/* Paginacion de DataTables: pasa a otra linea si no cabe (sin efecto si cabe). */
.dataTables_wrapper .pagination {
  flex-wrap: wrap;
}


/* 3. ESTRUCTURA Y MAPA ================================================= */
.mapalayer {
  width: 100%;
  height: 93vh;
}

/* Barra de navegacion inferior centrada */
.nav_center {
  position: fixed;
  bottom: 5px;
  left: 0;
  right: 0;
  width: 373px;
  height: 77px;
  margin: auto;
  background: var(--wg-oscuro);
  border-radius: 10px;
}

/* Boton flotante de seleccion de unidades sobre el mapa */
.seleccionunidadesmapa {
  position: absolute;
  z-index: 1001;
  width: 33px;
  height: 33px;
  margin-top: 11px;
  margin-left: 48px;
  padding: 7px;
  background: var(--wg-blanco);
  color: var(--wg-negro);
  border: 2px solid var(--wg-negro);
  border-radius: 5px;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
}

/* Cuadro de confirmacion global (plataform.confirmacion_*) */
.box_confirm {
  display: none;
  position: fixed;
  z-index: 10000000000;
  top: 50%;
  left: 50%;
  width: 350px;
  height: 200px;
  padding: 15px;
  transform: translate(-50%, -50%);
  background: var(--wg-blanco);
  color: #000000;
  border-radius: 6px;
  box-shadow: 0px 0px 429px 270px rgba(0, 0, 0, 0.53);
}


/* 4. TIPOGRAFIA ======================================================== */
.titulo {
  font-size: 1.5em;
  font-weight: bold;
}

.titulo_xxl {
  font-size: 2.5em;
  font-weight: bold;
}

/* Texto de ayuda / etiqueta secundaria */
.lbltxt {
  font-size: 12px;
  color: var(--wg-gris-texto);
}

.lbl2 {
  font-size: 12px;
}


/* 5. BLOQUES Y TARJETAS ================================================ */
.bloque2 {
  background: var(--wg-blanco);
  border-radius: 30px;
}

.bloque3 {
  border-bottom: 1px solid var(--wg-borde);
  padding: 1em;
}

.bloque3-seleccion {
  cursor: pointer;
}

.bloque3-seleccion:hover {
  background: #e8ebef;
}

.bloque4 {
  border-top: 1px solid var(--wg-borde);
  padding: 0.5em;
}

/* Bloque oscuro de indicador */
.bloque5 {
  min-width: 100px;
  max-width: 180px;
  height: 96px;
  padding: 10px;
  background: #565656;
  color: rgb(255 255 255 / 70%);
  border-radius: 4px;
  font-size: 0.8em;
  box-shadow: 0px 0px 10px 1px rgb(0 0 0 / 20%);
}

.bloque5-light {
  width: 100%;
  margin: 4px;
  padding: 10px;
  background: #efefef;
  color: rgb(0 0 0 / 70%);
  border-radius: 8px;
  font-size: 0.8em;
  box-shadow: 0px 0px 30px 0px rgb(50 50 50 / 20%);
}

.bloque5-light-options {
  min-width: 100px;
  max-width: 180px;
  height: 96px;
  padding: 10px;
  color: rgb(0 0 0 / 70%);
  border: 1px solid #cbcbcb;
  border-radius: 4px;
  font-size: 0.8em;
  cursor: pointer;
}

.bloque5-light-options:hover {
  background: #dee3e8;
}

.bloque_titulo {
  padding: 15px;
  border-bottom: 2px solid #f0f1f1;
  font-size: 17px;
  color: var(--wg-negro);
}

/* Tarjeta seleccionable (tipos de unidad) */
.bloque_tipo_auto {
  background: var(--wg-blanco);
  border: 1px solid #c9c9c9;
  border-radius: 6px;
}

.bloque_tipo_auto:hover {
  background: var(--wg-humo);
}

.bloque_tipo_auto_active {
  border: 4px solid #0d6efd;
}

/* Boton grande tipo bloque */
.bloque_btn-light {
  width: 150px;
  height: 125px;
  padding: 27px 0 0 0;
  background: linear-gradient(180deg, #e1e1e1, #b1b1b1);
  color: #3b3b3b;
  border-radius: 6px;
  font-size: 1em;
  text-align: center;
  cursor: pointer;
}

.bloque_btn-light:hover {
  background: linear-gradient(180deg, #e1e1e1, #999);
}


/* 6. ETIQUETAS E INDICADORES =========================================== */
.etiqueta {
  width: auto;
  padding: 2px 5px;
  background: var(--wg-negro);
  color: var(--wg-blanco);
  border-radius: 6px;
  font-size: 0.8em;
}

.etiquetain {
  float: left;
  width: auto;
  margin: 1px;
  padding: 1px 4px;
  color: var(--wg-gris-oscuro);
  border: 1px solid #818181;
  border-radius: 6px;
  font-size: 0.8em;
}

.pin {
  float: right;
  width: 20px;
  height: 20px;
  margin: 1px;
  padding: 3px;
  background: #f7f7f7;
  color: var(--wg-gris);
  border-radius: 5px;
  font-size: 14px;
  text-align: center;
}

/* Marcadores de inicio/fin en el mapa */
.inifin_mapa {
  padding: 2px 7px;
  background: #8ba4bd;
  color: var(--wg-blanco);
  border-radius: 50%;
  font-size: 10px;
}

.circulo_velocidad {
  font-weight: bold;
  color: var(--wg-gris-oscuro);
}

/* Burbuja de horario sobre la linea de tiempo */
.dothorarios {
  position: absolute;
  width: 100px;
  margin-top: 4px;
  margin-left: -15px;
  padding: 2px;
  background: #525252;
  color: var(--wg-blanco);
  border-radius: 9px;
  font-size: 0.8em;
  text-align: center;
}

.TooltipClass {
  background: var(--wg-blanco);
  color: var(--wg-azul);
  border: 1px solid var(--wg-blanco);
  border-radius: 4px;
  font-size: 1.5em;
  font-weight: bold;
}

/* Elemento seleccionado (resalta en azul) */
.margenazul {
  border: 2px solid var(--wg-azul-seleccion-borde) !important;
  background: var(--wg-azul-seleccion) !important;
  color: var(--wg-blanco) !important;
}


/* 7. TABLAS ============================================================ */
.td_cabecera {
  padding: 5px;
  background: #3c4246;
  color: var(--wg-blanco);
  border: 1px solid #707070;
  font-size: 12px;
  text-align: center;
}

.td_cuerpo {
  padding: 4px;
  background: var(--wg-blanco);
  color: var(--wg-negro);
  border: 1px solid #dfdfdf;
  font-size: 12px;
  text-align: center;
}


/* 8. EVENTOS Y ALERTAS ================================================= */
/* Se arman en unidades_transporte.js como 'evento-bloqueactive-' + tipo */
.evento-bloqueactive-warning { border-bottom: 10px solid var(--wg-evento-warning) !important; }
.evento-bloqueactive-danger  { border-bottom: 10px solid var(--wg-evento-danger) !important; }
.evento-bloqueactive-error   { border-bottom: 10px solid var(--wg-evento-danger) !important; }
.evento-bloqueactive-info    { border-bottom: 10px solid var(--wg-evento-info) !important; }
.evento-bloqueactive-success { border-bottom: 10px solid var(--wg-evento-success) !important; }


/* 9. BARRAS DE PROGRESO ================================================ */
.bar_padre {
  width: 100%;
  height: 25px;
  background: linear-gradient( 0 ,#d3d3d3,#c1c1c1); /* tal cual el original (angulo sin unidad) */
  border-radius: 3px;
}

/* El ancho lo fija el JS */
.bar_hijo {
  width: 0%;
  height: 25px;
  background: linear-gradient( 0 ,#000000,#6e6e6e); /* tal cual el original */
  border-radius: 3px;
}


/* 10. CHATBOT ========================================================== */
.chatbot_in {
  width: fit-content;
  max-width: 50%;
  height: auto;
  margin: 2px;
  padding: 9px;
  background: linear-gradient(133deg, #9d58df, #6456d7);
  color: var(--wg-blanco);
  border: 1px solid var(--wg-blanco);
  border-radius: 14px;
  font-size: 0.95em;
}

.chatbot_name {
  font-size: 1em;
  color: #a0c5fd;
}


/* 11. ANIMACIONES ====================================================== */
.animacion:hover {
  background: var(--wg-negro);
}

/* Parpadeo de alerta */
.animacion2 {
  transition: all 1s linear;
  animation-name: wg-parpadeo;
  animation-duration: 1s;
  animation-iteration-count: infinite;
}

@keyframes wg-parpadeo {
  50% { opacity: 0.4; }
}


/* 12. SEPARADORES ====================================================== */
.divider:after,
.divider:before {
  content: "";
  flex: 1;
  height: 1px;
  background: #eee;
}

.line {
  width: 100%;
  height: 1px;
  margin: 40px 0;
  border-bottom: 1px dashed #ddd;
}


/* 13. UTILIDADES wg-* ================================================== */
/* Van despues de los componentes para ganar a igual especificidad. */
/* --- Generado por estilos_a_clases.py: equivalencias exactas de estilos en linea --- */

/* Tamanos de letra (em = relativo al padre, igual que el estilo en linea original) */
.wg-fs-50 { font-size: 0.5em !important; }
.wg-fs-60 { font-size: 0.6em !important; }
.wg-fs-70 { font-size: 0.7em !important; }
.wg-fs-75 { font-size: 0.75em !important; }
.wg-fs-80 { font-size: 0.8em !important; }
.wg-fs-85 { font-size: 0.85em !important; }
.wg-fs-90 { font-size: 0.9em !important; }
.wg-fs-95 { font-size: 0.95em !important; }
.wg-fs-100 { font-size: 1em !important; }
.wg-fs-110 { font-size: 1.1em !important; }
.wg-fs-120 { font-size: 1.2em !important; }
.wg-fs-130 { font-size: 1.3em !important; }
.wg-fs-140 { font-size: 1.4em !important; }
.wg-fs-150 { font-size: 1.5em !important; }
.wg-fs-160 { font-size: 1.6em !important; }
.wg-fs-180 { font-size: 1.8em !important; }
.wg-fs-190 { font-size: 1.9em !important; }
.wg-fs-200 { font-size: 2em !important; }
.wg-fs-2rem { font-size: 2rem !important; }
.wg-fs-210 { font-size: 2.1em !important; }
.wg-fs-230 { font-size: 2.3em !important; }
.wg-fs-250 { font-size: 2.5em !important; }
.wg-fs-300 { font-size: 3em !important; }
.wg-fs-350 { font-size: 3.5em !important; }
.wg-fs-400 { font-size: 4em !important; }
.wg-fs-11px { font-size: 11px !important; }
.wg-fs-12px { font-size: 12px !important; }
.wg-fs-13px { font-size: 13px !important; }
.wg-fs-14px { font-size: 14px !important; }
.wg-fs-16px { font-size: 16px !important; }
.wg-fs-17px { font-size: 17px !important; }
.wg-fs-18px { font-size: 18px !important; }
.wg-fs-20px { font-size: 20px !important; }
.wg-fs-22px { font-size: 22px !important; }
.wg-fs-25px { font-size: 25px !important; }
.wg-fs-30px { font-size: 30px !important; }
.wg-fs-35px { font-size: 35px !important; }

/* Cursor */
.wg-pointer { cursor: pointer !important; }

/* Colores de texto y fondo (sin !important: el JS los cambia con .css()) */
.wg-bg-arena.wg-bg-arena { background: var(--wg-arena); }
.wg-bg-azul.wg-bg-azul { background: var(--wg-azul); }
.wg-bg-azul-intenso.wg-bg-azul-intenso { background: var(--wg-azul-intenso); }
.wg-bg-blanco.wg-bg-blanco { background: var(--wg-blanco); }
.wg-bg-humo.wg-bg-humo { background: var(--wg-humo); }
.wg-bg-rojo.wg-bg-rojo { background: var(--wg-rojo); }
.wg-bg-verde.wg-bg-verde { background: var(--wg-verde); }
.wg-bg-verde-oliva.wg-bg-verde-oliva { background: var(--wg-verde-oliva); }
.wg-text-azul.wg-text-azul { color: var(--wg-azul); }
.wg-text-azul-oscuro.wg-text-azul-oscuro { color: var(--wg-azul-oscuro); }
.wg-text-blanco.wg-text-blanco { color: var(--wg-blanco); }
.wg-text-gris.wg-text-gris { color: var(--wg-gris); }
.wg-text-gris-claro.wg-text-gris-claro { color: var(--wg-gris-claro); }
.wg-text-gris-medio.wg-text-gris-medio { color: var(--wg-gris-medio); }
.wg-text-gris-oscuro.wg-text-gris-oscuro { color: var(--wg-gris-oscuro); }
.wg-text-humo.wg-text-humo { color: var(--wg-humo); }
.wg-text-negro.wg-text-negro { color: var(--wg-negro); }
.wg-text-rojo.wg-text-rojo { color: var(--wg-rojo); }
.wg-text-verde.wg-text-verde { color: var(--wg-verde-claro); }

/* Reemplazo exacto del atributo HTML obsoleto align= (centra tambien bloques hijos) */
.wg-align-center { text-align: center; text-align: -webkit-center; text-align: -moz-center; }
.wg-align-right  { text-align: right; text-align: -webkit-right; text-align: -moz-right; }
.wg-align-left   { text-align: left; text-align: -webkit-left; text-align: -moz-left; }


/* 14. ESTILOS POR MODULO =============================================== */
/* Reglas que venian en <style> dentro de cada vista. Van encapsuladas (por id de
   tabla o por la clase raiz wg-vista-*) para no afectar al resto de la app. */

/* --- Clientes - censo (clientes_senso_lista_dump.php) --- */
#listarservicios_trab tbody tr {
  cursor: pointer;
}

/* --- Capacitaciones - detalle de operadores --- */
/* Antes era .dt-buttons global: ocultaba los botones de TODAS las tablas mientras la vista estaba abierta */
#tablaExportExcel_wrapper .dt-buttons {
  display: none;
}

/* --- Capacitaciones - lista --- */
#listaCapacitaciones_wrapper div.dataTables_scrollBody {
  border-left: 0 !important;
}

/* --- Gastos - listas --- */
:is(#tabla_gastos_mtto_wrapper, #tabla_gastos_operadores_wrapper) div.dataTables_filter,
:is(#tabla_gastos_mtto_wrapper, #tabla_gastos_operadores_wrapper) div.dt-buttons {
  display: inline-block;
  vertical-align: middle;
  margin-bottom: 10px;
}

:is(#tabla_gastos_mtto_wrapper, #tabla_gastos_operadores_wrapper) div.dt-buttons {
  margin-right: 20px;
}

/* --- Operadores - nomina por periodo --- */
#listarnominapop_wrapper .dt-buttons .btn {
  margin-right: 5px;
}

#listarnominapop_wrapper .dataTables_filter {
  margin-bottom: 0 !important;
}

.filtrosearch {
  text-align: right;
}

/* --- Operadores - cumpleanos --- */
.cumple-hoy {
  background-color: #d4edda !important;
}

.cumple-hoy td {
  font-weight: bold;
}

/* --- Operadores - bajas --- */
#listarbajas_wrapper {
  overflow-x: hidden;
}

/* --- Departamentos - incidentes --- */
#incidentes tr.fila {
  border-bottom: 1px solid #e4e4e4;
}

/* --- Unidades - lista --- */
/* Antes redefinia .etiqueta en toda la app mientras la vista estaba abierta */
#listarounidades .etiqueta {
  display: inline-block;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
}

#listarounidades tbody tr {
  cursor: pointer;
}

/* --- Combustible - reporte de rendimientos --- */
.wg-vista-rendimientos .ev-badge {
  display: inline-block;
  min-width: 70px;
  padding: 4px 6px;
  border-radius: 6px;
  font-weight: 500;
}
.wg-vista-rendimientos .dot {
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  margin-right:5px;
}

/* --- Servicios - linea de tiempo --- */
/* Antes cambiaba :root, * y body de toda la app; el fondo de body se descarta. */
.wg-vista-linea-tiempo {
  --ancho-intervalo: 60px;
  /* Cada 30 minutos */
        --ancho-info: 205px;
}
.wg-vista-linea-tiempo, .wg-vista-linea-tiempo * {
  box-sizing: border-box;
}
.wg-vista-linea-tiempo {
  color: #1e293b;
}
.wg-vista-linea-tiempo .encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0px;
  margin-bottom: 14px;
}
.wg-vista-linea-tiempo .titulo h2 {
  font-size: 21px;
  margin: 0 0 5px;
  font-weight: 650;
}
.wg-vista-linea-tiempo .titulo p {
  color: #64748b;
  margin: 0;
  font-size: 12px;
}
.wg-vista-linea-tiempo .resumen {
  display: flex;
  gap: 4px;
}
.wg-vista-linea-tiempo .resumen-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 9px 13px;
  border-radius: 8px;
  color: #64748b;
  font-size: 11px;
}
.wg-vista-linea-tiempo .resumen-item strong {
  color: #0f172a;
  font-size: 12px;
  margin-right: 2px;
}
.wg-vista-linea-tiempo .panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.wg-vista-linea-tiempo .scroll-area {
  width: 100%;
  height: min(68vh, 680px);
  min-height: 300px;
  overflow: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  -webkit-overflow-scrolling: touch;
}
.wg-vista-linea-tiempo .scroll-area::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
.wg-vista-linea-tiempo .scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
.wg-vista-linea-tiempo .scroll-area::-webkit-scrollbar-track {
  background: #f8fafc;
}
.wg-vista-linea-tiempo .tabla {
  width: max-content;
  min-width: 100%;
}
.wg-vista-linea-tiempo .eje {
  display: grid;
  grid-template-columns: var(--ancho-info) max-content;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.wg-vista-linea-tiempo .eje-info {
  padding: 12px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  color: #64748b;
  border-right: 1px solid #e2e8f0;
  position: sticky;
  left: 0;
  z-index: 12;
  background: #f8fafc;
  width: var(--ancho-info);
}
.wg-vista-linea-tiempo .eje-tiempo {
  height: 42px;
  position: relative;
  width: var(--ancho-timeline);
  min-width: var(--ancho-timeline);
}
.wg-vista-linea-tiempo .marca {
  position: absolute;
  height: 100%;
  top: 0;
  border-left: 1px solid #e2e8f0;
}
.wg-vista-linea-tiempo .marca span {
  position: absolute;
  left: 5px;
  top: 14px;
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
}
.wg-vista-linea-tiempo .fila {
  display: grid;
  grid-template-columns: var(--ancho-info) max-content;
  border-bottom: 1px solid #edf1f5;
}
.wg-vista-linea-tiempo .fila:last-child {
  border-bottom: 0;
}
.wg-vista-linea-tiempo .info {
  padding: 12px;
  border-right: 1px solid #edf1f5;
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff;
  align-self: stretch;
  width: var(--ancho-info);
}
.wg-vista-linea-tiempo .fila:hover .info {
  background: #f8fbff;
}
.wg-vista-linea-tiempo .unidad {
  font-weight: 700;
  color: #1d4ed8;
  font-size: 13px;
  margin-bottom: 5px;
}
.wg-vista-linea-tiempo .placas {
  font-size: 10px;
  color: #334155;
  background: #f1f5f9;
  display: inline-block;
  border-radius: 4px;
  padding: 3px 5px;
  margin-bottom: 5px;
}
.wg-vista-linea-tiempo .marca-unidad {
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}
.wg-vista-linea-tiempo .cantidad {
  color: #64748b;
  font-size: 10px;
  margin-top: 7px;
}
.wg-vista-linea-tiempo /* Cada servicio ocupa una sublínea compacta */
    .timeline {
  position: relative;
  padding: 0;
  min-width: 0;
  width: var(--ancho-timeline);
  min-width: var(--ancho-timeline);
  background: #fff;
}
.wg-vista-linea-tiempo .linea-guia {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #e8edf3;
  pointer-events: none;
}
.wg-vista-linea-tiempo .servicio {
  position: relative;
  height: 48px;
  border-bottom: 1px solid #f1f5f9;
}
.wg-vista-linea-tiempo .servicio:last-child {
  border-bottom: 0;
}
.wg-vista-linea-tiempo .nombre-servicio {
  position: absolute;
  top: 3px;
  left: 5px;
  right: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 10px;
  z-index: 3;
  pointer-events: none;
}
.wg-vista-linea-tiempo .pista {
  position: absolute;
  top: 29px;
  left: 0;
  right: 0;
  height: 2px;
  background: #edf1f5;
}
.wg-vista-linea-tiempo .barra {
  position: absolute;
  top: 25px;
  height: 10px;
  min-width: 3px;
  border-radius: 6px;
  z-index: 2;
}
.wg-vista-linea-tiempo .barra-programada {
  background: #bfdbfe;
  border: 1px solid #93c5fd;
}
.wg-vista-linea-tiempo .evento {
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  z-index: 4;
  line-height: 1;
  white-space: nowrap;
  font-size: 9px;
  color: #64748b;
}
.wg-vista-linea-tiempo .evento .hora {
  display: inline-block;
  padding: 3px 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #334155;
  font-weight: 700;
}
.wg-vista-linea-tiempo .evento.inicio {
  transform: translateX(0);
}
.wg-vista-linea-tiempo .evento.fin {
  transform: translateX(-100%);
}
.wg-vista-linea-tiempo .pie {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 11px 14px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 10px;
}
.wg-vista-linea-tiempo .leyenda-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wg-vista-linea-tiempo .muestra {
  width: 17px;
  height: 7px;
  display: inline-block;
  border-radius: 5px;
  background: #bfdbfe;
  border: 1px solid #93c5fd;
}
.wg-vista-linea-tiempo .muestra-inicio,
.wg-vista-linea-tiempo .muestra-fin {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
}
.wg-vista-linea-tiempo .muestra-inicio {
  background: #2563eb;
}
.wg-vista-linea-tiempo .muestra-fin {
  background: #64748b;
}
.wg-vista-linea-tiempo .sin-datos {
  padding: 30px;
  text-align: center;
  color: #64748b;
}
@media (max-width: 600px) {
.wg-vista-linea-tiempo {
  padding: 8px;
}
.wg-vista-linea-tiempo .titulo h2 {
  font-size: 18px;
}
.wg-vista-linea-tiempo .scroll-area {
  height: 65vh;
  min-height: 280px;
}
}

/* --- Login (login.php, public/login/views/login_escoger_cuenta.php) ---------
   < 576 px  : pantalla completa blanca, sin imagen (no se descarga).
   576-991 px: tarjeta centrada sobre la fotografia.
   >= 992 px : panel lateral + fotografia con lema.
   La capa es fija y con scroll propio: <html> tiene overflow:hidden. */
.wg-login {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  overflow-y: auto;
  background: var(--wg-blanco);
  color: var(--wg-oscuro);
}

.wg-login__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  padding: 2.5rem 1.25rem 1rem;
  background: var(--wg-blanco);
}

.wg-login__contenido {
  width: 100%;
  max-width: 380px;
  margin: auto;
}

.wg-login__logo {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto 2rem;
}

.wg-login__titulo {
  margin-bottom: .5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.wg-login__ayuda {
  margin-bottom: 1.5rem;
  color: var(--wg-gris-texto);
  font-size: .875rem;
  line-height: 1.5;
}

.wg-login__boton {
  padding-top: .75rem;
  padding-bottom: .75rem;
  font-weight: 500;
}

/* Tarjeta de la cuenta elegida (paso 2) */
.wg-login__cuenta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding: .75rem;
  background: #f6f7f9;
  border-radius: 12px;
}

.wg-login__avatar img {
  display: block;
  width: 44px !important;
  height: 44px;
  object-fit: cover;
  border-radius: 50% !important;
}

.wg-login__cuenta-texto {
  flex: 1;
  min-width: 0;
}

.wg-login__nombre {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-login__instancia {
  overflow: hidden;
  color: var(--wg-gris-texto);
  font-size: .8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Boton solo-icono con area tactil de 44 px */
.wg-login__icono-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--wg-gris-oscuro);
  border: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

.wg-login__icono-boton:hover,
.wg-login__icono-boton:focus-visible {
  background: rgb(0 0 0 / 6%);
  color: var(--wg-oscuro);
}

/* Campo de contrasena con boton "ver" dentro */
.wg-login__pass {
  position: relative;
  margin-bottom: 1rem;
}

.wg-login__pass .form-control {
  padding-right: 3.25rem;
}

.wg-login__ver {
  position: absolute;
  top: 50%;
  right: .35rem;
  transform: translateY(-50%);
}

.wg-login__olvide {
  display: block;
  margin: .75rem auto 0;
  font-size: .875rem;
}

/* Paso "Recuperar contraseña" */
.wg-login__titulo--chico { margin-top: 1rem; font-size: 1.25rem; }
.wg-login__aviso { margin-bottom: 1rem; padding: .75rem .875rem; border-radius: 8px; font-size: .875rem; line-height: 1.45; }
.wg-login__aviso--ok { background: #ecfdf5; color: #047857; }
.wg-login__aviso--error { background: #fef2f2; color: #b91c1c; }

/* Lista para elegir cuenta (un correo con acceso a varias empresas) */
.wg-login__cuentas:empty {
  display: none;
}

.wg-login__cuentas .list-group-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  text-align: left;
}

.wg-login__mini {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

.wg-login__registro {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2.5rem;
  color: var(--wg-gris-texto);
  font-size: .875rem;
}

.wg-login__pie {
  margin-top: 2rem;
  color: var(--wg-gris-texto);
  font-size: .75rem;
  text-align: center;
}

.wg-login__imagen {
  display: none;
}

/* Tablet y celular horizontal: tarjeta sobre la fotografia */
@media (min-width: 576px) {
  .wg-login {
    padding: 1.5rem;
    background: #1d2b3a url("../images/login_fondo_1100.jpg") center / cover no-repeat;
  }

  .wg-login__panel {
    width: 100%;
    max-width: 440px;
    min-height: 0;
    margin: auto;
    padding: 2.5rem 2.5rem 1.25rem;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgb(0 0 0 / 35%);
  }

  .wg-login__contenido {
    margin: 0 auto;
  }
}

/* Escritorio: panel lateral + fotografia */
@media (min-width: 992px) {
  .wg-login {
    padding: 0;
    background: var(--wg-blanco);
  }

  .wg-login__panel {
    flex: 0 0 auto;
    width: 40%;
    min-width: 440px;
    max-width: 600px;
    min-height: 100%;
    margin: 0;
    padding: 3rem 3rem 1.5rem;
    border-radius: 0;
    box-shadow: none;
  }

  .wg-login__contenido {
    margin: auto;
  }

  .wg-login__imagen {
    position: relative;
    display: flex;
    flex: 1;
    align-items: flex-end;
    padding: 3rem;
    background: #1d2b3a url("../images/login_fondo_1600.jpg") center / cover no-repeat;
  }

  .wg-login__imagen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(0 0 0 / 0%) 45%, rgb(0 0 0 / 65%) 100%);
  }

  .wg-login__lema {
    position: relative;
    max-width: 520px;
    color: var(--wg-blanco);
  }

  .wg-login__lema strong {
    display: block;
    margin-bottom: .35rem;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
  }

  .wg-login__lema span {
    font-size: 1.05rem;
    opacity: .9;
  }
}

/* Pantallas grandes (2K/4K): mas aire y tipografia proporcional */
@media (min-width: 1800px) {
  .wg-login__contenido {
    max-width: 420px;
  }

  .wg-login__logo {
    width: 180px;
  }

  .wg-login__lema strong {
    font-size: 2.5rem;
  }
}

/* Celular horizontal / poca altura: compactar */
@media (max-height: 520px) {
  .wg-login__logo {
    margin-bottom: 1rem;
  }

  .wg-login__registro,
  .wg-login__pie {
    margin-top: 1rem;
  }
}

/* --- Layout de la aplicacion (plataform_dashboard.php + controller/layout.js) ------
   Barra lateral oscura colapsable, barra superior blanca y main con los tableros.
   z-index por debajo de los modales del sistema (modal.css usa 1002) y de los avisos. */
.wg-app {
  min-height: 100vh;
  background: var(--wg-fondo-main);
  color: #111827;
}

/* Barra lateral */
.wg-lateral {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 990;
  display: flex;
  flex-direction: column;
  width: var(--wg-lateral-ancho);
  background: var(--wg-lateral-fondo);
  color: var(--wg-lateral-texto);
  transition: width .2s ease, transform .25s ease;
}

.wg-lateral__marca {
  display: flex;
  align-items: center;
  gap: .5rem;
  height: var(--wg-superior-alto);
  padding: 0 .75rem 0 1.25rem;
  border-bottom: 1px solid var(--wg-lateral-borde);
}

.wg-lateral__logo { height: 34px; width: auto; }
/* Provisional: logo de WayGo en blanco por filtro, hasta tener el logo oficial blanco
   (logo_blanco.png es de otra marca). */
.wg-lateral__logo--blanco { filter: brightness(0) invert(1); }
.wg-lateral__logo-mini { display: none; height: 28px; width: auto; }

.wg-icono-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 10px;
  font-size: 1.15rem;
}

.wg-icono-boton:hover,
.wg-icono-boton:focus-visible {
  background: var(--wg-lateral-fondo-2);
  color: var(--wg-lateral-texto-fuerte);
}

.wg-nav {
  flex: 1;
  overflow-y: auto;
  padding: .75rem .625rem;
  scrollbar-width: thin;
  scrollbar-color: #3a3f49 transparent;
}

.wg-nav__titulo {
  margin: 1rem .75rem .375rem;
  color: #6b7280;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wg-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wg-nav__enlace {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 40px;
  padding: .5rem .75rem;
  background: transparent;
  color: var(--wg-lateral-texto);
  border: 0;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.wg-nav__enlace i { flex: 0 0 22px; font-size: 1.1rem; text-align: center; }
.wg-nav__enlace span { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.wg-nav__enlace:hover,
.wg-nav__enlace:focus-visible {
  background: var(--wg-lateral-fondo-2);
  color: var(--wg-lateral-texto-fuerte);
}

.wg-nav__enlace.activo {
  background: rgb(0 102 204 / 22%);
  color: #fff;
}

.wg-nav__enlace.activo::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -10px;
  width: 3px;
  background: var(--wg-azul);
  border-radius: 0 3px 3px 0;
}

.wg-nav__flecha { flex: 0 0 auto !important; font-size: .75rem !important; transition: transform .2s; }
.wg-nav__enlace[aria-expanded="true"] .wg-nav__flecha { transform: rotate(90deg); }

.wg-nav ul.wg-nav__sub { padding: .125rem 0 .375rem 2.375rem; }
.wg-nav__sub .wg-nav__enlace { min-height: 34px; padding: .375rem .75rem; font-size: .8125rem; font-weight: 400; }

/* Bolita para contraer/expandir: sutil, sobre el borde derecho a la altura del logo */
.wg-colapsar {
  position: absolute;
  top: calc(var(--wg-superior-alto) / 2 - 12px);
  right: -12px;
  z-index: 2;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #fff;
  color: #6b7280;
  border: 1px solid var(--wg-borde-claro);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(17 24 39 / 12%);
  font-size: .7rem;
  transition: color .15s, border-color .15s, box-shadow .15s;
}

.wg-colapsar:hover,
.wg-colapsar:focus-visible {
  color: var(--wg-azul);
  border-color: var(--wg-azul);
  box-shadow: 0 2px 8px rgb(0 102 204 / 25%);
}

.wg-colapsar i { transition: transform .2s; }
body.wg-colapsada .wg-colapsar i { transform: rotate(180deg); }

/* Pie: huesped (instancia) + manual + acerca de */
.wg-lateral__pie { padding: .75rem .625rem 1rem; border-top: 1px solid var(--wg-lateral-borde); }

.wg-instancia {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .5rem .75rem;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 10px;
  text-align: left;
}

.wg-instancia--boton:hover,
.wg-instancia--boton[aria-expanded="true"] { background: var(--wg-lateral-fondo-2); }

/* contain: cada huesped trae su logo, de cualquier proporcion */
.wg-instancia img { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; object-fit: cover; background: transparent; border-radius: 8px; }
.wg-instancia__texto { flex: 1; min-width: 0; }
.wg-instancia__nombre { overflow: hidden; color: var(--wg-lateral-texto-fuerte); font-size: .8125rem; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.wg-instancia__folio { color: #6b7280; font-size: .75rem; white-space: nowrap; }
.wg-instancia__icono { color: #6b7280; }
.wg-instancia__menu { width: calc(var(--wg-lateral-ancho) - 1.25rem); max-height: 60vh; overflow-y: auto; }
.wg-instancia__menu .dropdown-item.active { background: var(--wg-azul-suave); color: var(--wg-azul); }

.wg-lateral__separador { margin: .5rem .75rem; border-color: var(--wg-lateral-borde); opacity: 1; }
.wg-lateral__pie .wg-nav__enlace { min-height: 34px; font-size: .8125rem; font-weight: 400; }

/* Contraida (escritorio): solo iconos */
body.wg-colapsada .wg-lateral { width: var(--wg-lateral-mini); }
body.wg-colapsada .wg-lateral :is(.wg-lateral__logo, .wg-nav__enlace span, .wg-nav__flecha, .wg-nav__titulo, .wg-instancia__texto, .wg-instancia__icono, .wg-nav__sub) { display: none !important; }
body.wg-colapsada .wg-lateral__logo-mini { display: block; }
body.wg-colapsada .wg-lateral__marca { justify-content: center; padding: 0 .5rem; }
body.wg-colapsada .wg-nav__enlace { justify-content: center; padding: .5rem; }
body.wg-colapsada .wg-instancia { justify-content: center; padding: .5rem 0; }

/* Barra superior */
.wg-contenido {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  margin-left: var(--wg-lateral-ancho);
  transition: margin-left .2s ease;
}

body.wg-colapsada .wg-contenido { margin-left: var(--wg-lateral-mini); }

.wg-superior {
  position: relative;
  z-index: 980;
  display: flex;
  flex: 0 0 var(--wg-superior-alto);
  align-items: center;
  gap: .75rem;
  padding: 0 1.5rem;
  background: var(--wg-blanco);
  border-bottom: 1px solid var(--wg-borde-claro);
}

.wg-superior .wg-icono-boton { margin-left: 0; color: #4b5563; }
.wg-superior .wg-icono-boton:hover { background: var(--wg-fondo-main); color: #111827; }
.wg-superior__logo { height: 28px; width: auto; }

.wg-busqueda { position: relative; }

/* Campo de busqueda: nace del boton y se despliega hacia la izquierda */
.wg-buscador {
  position: absolute;
  top: calc(50% - 21px);
  right: 0;
  z-index: 2;
  flex-wrap: nowrap;
  width: 42px;
  height: 42px;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--wg-borde-claro);
  opacity: 0;
  pointer-events: none;
  transition: width .3s cubic-bezier(.2, .8, .3, 1), opacity .18s ease, box-shadow .3s ease;
}

.wg-busqueda.abierta .wg-buscador {
  width: min(560px, calc(100vw - var(--wg-lateral-ancho) - 220px));
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 0 0 1px var(--wg-azul), 0 10px 30px rgb(17 24 39 / 14%);
}

body.wg-colapsada .wg-busqueda.abierta .wg-buscador { width: min(560px, calc(100vw - var(--wg-lateral-mini) - 220px)); }

.wg-busqueda.abierta .wg-busqueda__boton { opacity: 0; }

.wg-buscador .form-control,
.wg-buscador .btn,
.wg-buscador .input-group-text { height: 42px; background: transparent; border: 0; box-shadow: none; }
.wg-buscador .input-group-text { padding-right: .25rem; color: var(--wg-azul); }
.wg-buscador .form-control { min-width: 0; font-size: .9375rem; }
.wg-buscador .form-control::-webkit-search-cancel-button { display: none; }
.wg-buscador .dropdown-toggle { border-left: 1px solid var(--wg-borde-claro); border-radius: 0; color: #4b5563; font-size: .8125rem; white-space: nowrap; }
.wg-buscador__cerrar { color: #6b7280; }
.wg-buscador__cerrar:hover { color: #111827; }

/* Al abrir, el contenido aparece un instante despues que la caja */
.wg-buscador > * { opacity: 0; transition: opacity .15s ease; }
.wg-busqueda.abierta .wg-buscador > * { opacity: 1; transition-delay: .12s; }

.wg-superior__derecha { display: flex; align-items: center; gap: .25rem; margin-left: auto; }

.wg-usuario {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .25rem .5rem .25rem .25rem;
  background: transparent;
  border: 0;
  border-radius: 12px;
  text-align: left;
}

.wg-usuario:hover,
.wg-usuario[aria-expanded="true"] { background: var(--wg-fondo-main); }
.wg-usuario img { width: 38px; height: 38px; object-fit: cover; border-radius: 50%; }
.wg-usuario__texto { max-width: 220px; }
.wg-usuario__nombre { display: block; overflow: hidden; color: #111827; font-size: .8125rem; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.wg-usuario__correo { display: block; overflow: hidden; color: #6b7280; font-size: .75rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

.wg-superior .dropdown-menu,
.wg-lateral .dropdown-menu { border-color: var(--wg-borde-claro); border-radius: 12px; box-shadow: 0 12px 32px rgb(17 24 39 / 12%); font-size: .875rem; }
.wg-superior .dropdown-item,
.wg-lateral .dropdown-item { padding: .5rem 1rem; }
.wg-superior .dropdown-item i,
.wg-lateral .dropdown-item i { width: 1.25rem; }

/* Main: aqui se cargan los tableros (scroll propio; <html> tiene overflow:hidden) */
.wg-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Armazon minimo (clientes y app SOS): sin barra lateral */
.wg-app--minimo .wg-contenido { margin-left: 0; }

/* 992-1199 px: contraida por defecto y se expande al pasar el cursor */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .wg-lateral { width: var(--wg-lateral-mini); }
  .wg-contenido { margin-left: var(--wg-lateral-mini); }
  .wg-lateral:not(:hover) :is(.wg-lateral__logo, .wg-nav__enlace span, .wg-nav__flecha, .wg-nav__titulo, .wg-instancia__texto, .wg-instancia__icono, .wg-nav__sub) { display: none !important; }
  .wg-lateral:not(:hover) .wg-lateral__logo-mini { display: block; }
  .wg-lateral:not(:hover) .wg-lateral__marca { justify-content: center; padding: 0 .5rem; }
  .wg-lateral:not(:hover) .wg-nav__enlace { justify-content: center; padding: .5rem; }
  .wg-lateral:not(:hover) .wg-instancia { justify-content: center; padding: .5rem 0; }
  .wg-lateral:hover { width: var(--wg-lateral-ancho); box-shadow: 8px 0 30px rgb(0 0 0 / 25%); }
}

/* < 992 px: panel que entra desde la izquierda */
@media (max-width: 991.98px) {
  .wg-lateral { width: min(84vw, 300px) !important; transform: translateX(-100%); }
  body.wg-menu-abierto .wg-lateral { transform: none; box-shadow: 12px 0 40px rgb(0 0 0 / 35%); }
  body.wg-colapsada .wg-lateral :is(.wg-lateral__logo, .wg-nav__enlace span, .wg-nav__flecha, .wg-nav__titulo, .wg-instancia__texto, .wg-instancia__icono) { display: revert !important; }
  body.wg-colapsada .wg-lateral .wg-nav__sub:not(.show) { display: none !important; }
  body.wg-colapsada .wg-lateral .wg-nav__sub.show { display: block !important; }
  body.wg-colapsada .wg-lateral__logo-mini { display: none; }
  body.wg-colapsada .wg-nav__enlace { justify-content: flex-start; padding: .5rem .75rem; }
  .wg-contenido,
  body.wg-colapsada .wg-contenido { margin-left: 0; }
  .wg-velo { position: fixed; inset: 0; z-index: 985; background: rgb(15 17 21 / 45%); opacity: 0; visibility: hidden; transition: opacity .2s; }
  body.wg-menu-abierto .wg-velo { opacity: 1; visibility: visible; }
  .wg-superior { gap: .25rem; padding: 0 .75rem; }
}

/* Pantallas angostas: el buscador baja como una franja bajo la barra superior */
@media (max-width: 767.98px) {
  .wg-busqueda { position: static; }
  .wg-buscador {
    position: fixed;
    top: var(--wg-superior-alto);
    right: 0;
    left: 0;
    width: auto;
    height: 58px;
    padding: 8px .75rem;
    border-radius: 0;
    box-shadow: 0 1px 0 var(--wg-borde-claro);
    transform: translateY(-12px);
    transition: transform .25s cubic-bezier(.2, .8, .3, 1), opacity .18s ease;
  }
  .wg-busqueda.abierta .wg-buscador,
  body.wg-colapsada .wg-busqueda.abierta .wg-buscador {
    width: auto;
    transform: none;
    box-shadow: 0 8px 24px rgb(17 24 39 / 12%);
  }
  .wg-busqueda.abierta .wg-busqueda__boton { opacity: 1; color: var(--wg-azul); }
  .wg-buscador .form-control,
  .wg-buscador .btn,
  .wg-buscador .input-group-text { height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .wg-buscador,
  .wg-buscador > * { transition: none; }
}

/* --- Tablero de inicio (plataform_tablero_inicio.php) ---------------------------
   Estado de la flota -> alertas de hoy -> accesos rapidos -> licencias.
   Los mosaicos con data-wg-resaltar reciben .activa cuando su contador es > 0. */
.wg-inicio {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  color: #111827;
}

.wg-inicio__encabezado {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.wg-inicio__titulo { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.015em; }
.wg-inicio__fecha { margin: .125rem 0 0; color: #6b7280; font-size: .875rem; }

.wg-inicio__seccion {
  margin: 0 0 .75rem;
  color: #6b7280;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Resumen: estado de la flota (ancho) + SOS */
.wg-inicio__resumen {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.wg-flota {
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid var(--wg-borde-claro);
  border-radius: 14px;
}

.wg-flota__cabecera { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.wg-flota__ver { padding: 0; font-size: .8125rem; text-decoration: none; }
.wg-flota__ver i { font-size: .7rem; }

.wg-flota__porcentaje { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-bottom: .875rem; }
.wg-flota__pct { color: #9ca3af; font-size: 2.75rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.wg-flota__pct.bien { color: #16a34a; }
.wg-flota__pct.regular { color: #d97706; }
.wg-flota__pct.mal { color: #dc2626; }
.wg-flota__pct-texto { color: #6b7280; font-size: .875rem; }
.wg-flota__pct-texto strong { color: #111827; }

.wg-flota__barra {
  display: flex;
  height: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #f3f4f6;
  border-radius: 999px;
}

.wg-flota__seg { height: 100%; transition: width .6s cubic-bezier(.2, .8, .3, 1); }
.wg-flota__seg + .wg-flota__seg { box-shadow: -2px 0 0 #fff; }
.wg-flota__seg--verde { background: #22c55e; }
.wg-flota__seg--amarillo { background: #f59e0b; }
.wg-flota__seg--gris { background: #9ca3af; }

.wg-flota__leyenda { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }

.wg-flota__estado {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "punto num" "punto etq";
  align-items: center;
  column-gap: .625rem;
  padding: .5rem .75rem;
  background: #f9fafb;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  transition: background .15s, border-color .15s;
}

.wg-flota__estado:hover,
.wg-flota__estado:focus-visible { background: #f3f4f6; border-color: var(--wg-borde-claro); }
.wg-flota__punto { grid-area: punto; align-self: start; width: 10px; height: 10px; margin-top: .45rem; border-radius: 50%; }
.wg-flota__punto--verde { background: #22c55e; }
.wg-flota__punto--amarillo { background: #f59e0b; }
.wg-flota__punto--gris { background: #9ca3af; }
.wg-flota__num { grid-area: num; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.wg-flota__etq { grid-area: etq; color: #6b7280; font-size: .75rem; }
.wg-kpi__nota { grid-area: nota; margin-top: .5rem; color: #9ca3af; font-size: .75rem; }

.wg-kpi {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "valor icono" "etiqueta icono" "nota nota";
  align-content: center;
  align-items: center;
  padding: 1.25rem;
  background: #fff;
  color: inherit;
  border: 1px solid var(--wg-borde-claro);
  border-radius: 14px;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.wg-kpi:hover,
.wg-kpi:focus-visible { border-color: #cbd5e1; box-shadow: 0 6px 20px rgb(17 24 39 / 8%); transform: translateY(-1px); }
.wg-kpi__valor { grid-area: valor; font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.wg-kpi__etiqueta { grid-area: etiqueta; margin-top: .25rem; color: #6b7280; font-size: .8125rem; }

.wg-kpi__icono {
  grid-area: icono;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.25rem;
}

.wg-kpi--verde .wg-kpi__icono { background: #dcfce7; color: #15803d; }
.wg-kpi--amarillo .wg-kpi__icono { background: #fef3c7; color: #b45309; }
.wg-kpi--gris .wg-kpi__icono { background: #f3f4f6; color: #4b5563; }
.wg-kpi--rojo .wg-kpi__icono { background: #f3f4f6; color: #6b7280; }
.wg-kpi--rojo.activa { background: #fef2f2; border-color: #fecaca; }
.wg-kpi--rojo.activa .wg-kpi__icono { background: #fee2e2; color: #dc2626; }
.wg-kpi--rojo.activa .wg-kpi__valor { color: #dc2626; }

/* Tarjetas */
.wg-tarjeta-inicio {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--wg-borde-claro);
  border-radius: 14px;
}

.wg-tarjeta-inicio__cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1rem;
}

.wg-tarjeta-inicio__titulo { margin: 0; font-size: 1rem; font-weight: 600; }
.wg-tarjeta-inicio__titulo i { margin-right: .375rem; color: var(--wg-azul); }
.wg-tarjeta-inicio__nota { color: #9ca3af; font-size: .75rem; }

/* Alertas de hoy */
.wg-alertas {
  display: grid;
  grid-template-columns: 3fr 4fr 3fr;
  gap: 1.5rem;
}

.wg-alertas__titulo { margin: 0 0 .5rem; color: #6b7280; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.wg-alertas__lista { display: flex; flex-direction: column; gap: .5rem; }

.wg-alerta {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .625rem .75rem;
  background: #f9fafb;
  color: #374151;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  transition: background .15s, border-color .15s;
}

.wg-alerta:hover,
.wg-alerta:focus-visible { background: #f3f4f6; border-color: var(--wg-borde-claro); }

.wg-alerta__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  height: 34px;
  background: #fff;
  color: #9ca3af;
  border-radius: 9px;
  font-size: 1rem;
}

.wg-alerta__texto { flex: 1; min-width: 0; font-size: .8125rem; font-weight: 500; }
.wg-alerta__valor { color: #9ca3af; font-size: 1.125rem; font-weight: 700; }

.wg-alerta.activa { background: #fff; border-color: var(--wg-borde-claro); }
.wg-alerta--rojo.activa .wg-alerta__icono { background: #fee2e2; color: #dc2626; }
.wg-alerta--rojo.activa .wg-alerta__valor { color: #dc2626; }
.wg-alerta--naranja.activa .wg-alerta__icono { background: #fef3c7; color: #d97706; }
.wg-alerta--naranja.activa .wg-alerta__valor { color: #b45309; }
.wg-alerta--azul.activa .wg-alerta__icono { background: var(--wg-azul-suave); color: var(--wg-azul); }
.wg-alerta--azul.activa .wg-alerta__valor { color: var(--wg-azul); }

/* Accesos rapidos */
.wg-inicio__columnas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.5rem;
  align-items: start;
}

.wg-accesos { display: flex; flex-direction: column; }

.wg-acceso {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .625rem .5rem;
  background: transparent;
  color: inherit;
  border: 0;
  border-top: 1px solid #f3f4f6;
  border-radius: 0;
  text-align: left;
  transition: background .15s;
}

.wg-acceso:first-child { border-top: 0; }
.wg-acceso:hover,
.wg-acceso:focus-visible { background: #f9fafb; border-radius: 8px; }

.wg-acceso__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  height: 34px;
  background: var(--wg-azul-suave);
  color: var(--wg-azul);
  border-radius: 9px;
}

.wg-acceso__texto { flex: 1; min-width: 0; }
.wg-acceso__nombre { display: block; font-size: .875rem; font-weight: 500; }
.wg-acceso__desc { display: block; overflow: hidden; color: #6b7280; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.wg-acceso__flecha { color: #d1d5db; font-size: .75rem; }
.wg-acceso:hover .wg-acceso__flecha { color: var(--wg-azul); }

.wg-inicio__semaforo { max-height: 360px; overflow: auto; }

/* Adaptativo */
@media (max-width: 1199.98px) {
  .wg-inicio__resumen { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .wg-alertas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .wg-inicio__resumen { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

@media (max-width: 991.98px) {
  .wg-inicio__columnas { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
  .wg-inicio { padding: 1rem; }
  .wg-flota { padding: 1rem; }
  .wg-flota__pct { font-size: 2.25rem; }
  .wg-flota__leyenda { grid-template-columns: minmax(0, 1fr); }
  .wg-flota__estado { grid-template-columns: auto auto 1fr; grid-template-areas: "punto num etq"; column-gap: .5rem; }
  .wg-flota__punto { align-self: center; margin-top: 0; }
  .wg-kpi { padding: 1rem; }
  .wg-alertas { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wg-flota__seg { transition: none; }
  .wg-kpi { transition: none; }
}

/* --- Configuracion del sistema (configuraciones_nuevo.php) ----------------------- */
.wg-cfg__sobretitulo { color: #6b7280; font-size: .75rem; font-weight: 500; }
.wg-cfg__titulo { color: #111827; font-size: 1.375rem; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
.wg-cfg__subtitulo { color: #6b7280; font-size: .8125rem; font-weight: 400; }

.wg-cfg { padding: 1rem 1.5rem 1.5rem; }

.wg-cfg__tarjeta {
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--wg-borde-claro);
  border-radius: 14px;
}

.wg-cfg__cabecera { display: flex; align-items: flex-start; gap: .875rem; margin-bottom: 1rem; }

.wg-cfg__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  height: 40px;
  background: var(--wg-azul-suave);
  color: var(--wg-azul);
  border-radius: 10px;
  font-size: 1.125rem;
}

.wg-cfg__seccion { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; font-weight: 600; }
.wg-cfg__desc { margin: .125rem 0 0; color: #6b7280; font-size: .8125rem; }

.wg-cfg__chip {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .125rem .5rem;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1.6;
}

.wg-cfg__chip-punto { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.wg-cfg__chip--ok { background: #dcfce7; color: #15803d; }
.wg-cfg__chip--error { background: #fee2e2; color: #b91c1c; }
.wg-cfg__chip--neutro { background: #f3f4f6; color: #6b7280; }

.wg-cfg__datos { margin: 0 0 .75rem; }
.wg-cfg__datos > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding: .625rem 0; border-bottom: 1px solid #f3f4f6; }
.wg-cfg__datos dt { color: #6b7280; font-size: .8125rem; font-weight: 500; }
.wg-cfg__datos dd { margin: 0; color: #111827; font-size: .875rem; text-align: right; }

.wg-cfg__aviso { margin-bottom: 1rem; padding: .5rem .75rem; border-radius: 8px; font-size: .875rem; }
.wg-cfg__aviso--ok { background: #ecfdf5; color: #047857; }
.wg-cfg__aviso--error { background: #fef2f2; color: #b91c1c; word-break: break-word; }

.wg-cfg__opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }

.wg-cfg__opcion {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  margin: 0;
  padding: .875rem 1rem;
  border: 1px solid var(--wg-borde-claro);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.wg-cfg__opcion:hover { border-color: #cbd5e1; }
.wg-cfg__opcion.activa { border-color: var(--wg-azul); box-shadow: 0 0 0 3px var(--wg-azul-suave); }
.wg-cfg__opciones.falta .wg-cfg__opcion { border-color: #dc2626; }
.wg-cfg__opcion input { flex: 0 0 auto; margin-top: .2rem; accent-color: var(--wg-azul); }
.wg-cfg__opcion strong { font-size: .9375rem; }
.wg-cfg__opcion small { display: block; margin-top: .125rem; color: #6b7280; font-size: .8125rem; }

.wg-cfg__panel { margin-bottom: .5rem; }

.wg-cfg__pasos {
  margin: 0 0 .75rem;
  padding: .75rem 1rem .75rem 2rem;
  background: #f9fafb;
  color: #374151;
  border-radius: 10px;
  font-size: .8125rem;
  line-height: 1.7;
}

.wg-cfg__nota { margin: .75rem 0; color: #6b7280; font-size: .8125rem; }
.wg-cfg__acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.wg-cfg__acciones .btn { font-weight: 500; }

.wg-cfg__guardado { margin-left: .25rem; color: #15803d; font-size: .75em; }
.wg-cfg .form-floating > .form-control,
.wg-cfg .form-floating > .form-select { border-color: var(--wg-borde-claro); }

/* Secciones plegables (acordeón) */
.wg-cfg__barra { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.wg-cfg__barra-texto { color: #6b7280; font-size: .8125rem; }
.wg-cfg__barra .btn { padding-right: 0; text-decoration: none; font-weight: 500; }
.wg-cfg .wg-cfg__tarjeta { margin-bottom: .625rem; padding: 0; transition: box-shadow .15s, border-color .15s; }
.wg-cfg .wg-cfg__tarjeta.abierta { border-color: #dbe3ee; box-shadow: 0 4px 14px rgb(17 24 39 / 6%); }
.wg-cfg__h { margin: 0; font-size: inherit; font-weight: inherit; }
.wg-cfg__toggle {
  display: flex;
  align-items: center;
  gap: .875rem;
  width: 100%;
  padding: .875rem 1.125rem;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.wg-cfg__toggle:hover { background: #f9fafb; }
.wg-cfg__toggle:focus-visible { outline: 2px solid var(--wg-azul); outline-offset: -2px; }
.wg-cfg__tarjeta.abierta .wg-cfg__toggle { border-radius: 14px 14px 0 0; }
.wg-cfg__textos { display: block; flex: 1 1 auto; min-width: 0; }
.wg-cfg__textos .wg-cfg__desc { display: block; }
.wg-cfg__resumen { display: block; overflow: hidden; margin-top: .125rem; color: #4b5563; font-size: .8125rem; text-overflow: ellipsis; white-space: nowrap; }
.wg-cfg__toggle[aria-expanded="false"] .wg-cfg__desc { display: none; }
.wg-cfg__toggle[aria-expanded="true"] .wg-cfg__resumen { display: none; }
.wg-cfg__flecha { flex: 0 0 auto; color: #9ca3af; font-size: .875rem; transition: transform .2s; }
.wg-cfg__toggle[aria-expanded="true"] .wg-cfg__flecha { transform: rotate(180deg); }
.wg-cfg__cuerpo { padding: 1rem 1.125rem 1.125rem; border-top: 1px solid #f1f3f5; }

.wg-cfg__columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }

.wg-cfg__fila { padding: .875rem 0; border-top: 1px solid #f3f4f6; }
.wg-cfg__fila:first-of-type { padding-top: 0; border-top: 0; }
.wg-cfg__fila-nombre { display: flex; align-items: center; margin-bottom: .5rem; color: #374151; font-size: .875rem; font-weight: 600; }

@media (max-width: 767.98px) {
  .wg-cfg { padding: .75rem 1rem 1rem; }
  .wg-cfg__opciones,
  .wg-cfg__columnas { grid-template-columns: minmax(0, 1fr); }
  .wg-cfg__datos dd { text-align: left; }
  .wg-cfg__barra-texto { display: none; }
  .wg-cfg__barra { justify-content: flex-end; }
  .wg-cfg__toggle { padding: .75rem .875rem; }
  .wg-cfg__cuerpo { padding: .875rem; }
}
