
        /* ============================================================ */
        /* ESTILOS GENERALES */
        /* ============================================================ */
        body {
            font-family: 'Montserrat', sans-serif;
            background-color: #F7F6FB;
            /* Fondo general de la página */
        }

        #app {
            background-color: #F7F6FB;
            /* Asegurar fondo en el contenedor principal */
        }

        /* ============================================================ */
        /* HEADER */
        /* ============================================================ */
        .header-top {
            background-color: #6990D3;
            /* Color de respaldo */
            background: -moz-linear-gradient(left, #6990D3 0%, #6990D3 100%);
            /* Firefox */
            background: -webkit-linear-gradient(left, #6990D3 0%, #6990D3 100%);
            /* Chrome, Safari, Opera */
            background: linear-gradient(to right, #6990D3 0%, #6990D3 100%);
            /* Estándar */
            background-repeat: no-repeat;
            background-size: cover;
        }

        .header-footer {
            background-color: #6990D3;
            /* Color de respaldo */

        }

        header {
            flex: 0 0 auto;
            width: 100%;
        }

        /* Logo en el header */
        .logo-icon img {
            max-height: 50px;
            object-fit: contain;
        }

        /* ============================================================ */
        /* DROPDOWNS DEL HEADER */
        /* ============================================================ */

        /* Flechas blancas en todos los dropdowns del header */
        .header-top .dropdown-toggle::after {
            border-top-color: #ffffff !important;
        }

        /* Quitar subrayado de todos los enlaces dropdown */
        .header-top .dropdown-toggle {
            text-decoration: none !important;
        }

        .header-top .dropdown-toggle:hover,
        .header-top .dropdown-toggle:focus {
            text-decoration: none !important;
        }

        /* ============================================================ */
        /* DROPDOWN DE IDIOMA */
        /* ============================================================ */
        .language-dropdown .dropdown-menu {
            min-width: auto;
            width: auto;
        }

        .language-dropdown img.flag {
            width: 1.2em;
            height: auto;
        }

        .language-dropdown .dropdown-item {
            padding: .25rem .75rem;
        }

        /* Item activo en el dropdown de idioma */
        .language-dropdown .dropdown-item.active {
            background-color: #0d6efd;
            color: white;
        }

        /* ============================================================ */
        /* BOTONES PERSONALIZADOS */
        /* ============================================================ */

        /* Botón con fondo blanco sólido */
        .btn-white {
            display: inline-block;
            padding: 0.5rem 1rem;
            font-size: 1rem;
            line-height: 1.5;
            color: #000;
            background-color: #ffffff;
            border: 1px solid #ffffff;
            border-radius: 0.25rem;
            text-decoration: none;
            cursor: pointer;
            transition: background-color 0.2s, color 0.2s;
        }

        .btn-white:hover,
        .btn-white:focus {
            background-color: #f2f2f2;
            color: #000;
        }

        /* Botón outline blanco */
        .btn-outline-white {
            display: inline-block;
            padding: 0.5rem 1rem;
            font-size: 1rem;
            line-height: 1.5;
            color: #ffffff;
            background-color: transparent;
            border: 1px solid #ffffff;
            border-radius: 0.25rem;
            text-decoration: none;
            cursor: pointer;
            transition: background-color 0.2s, color 0.2s;
        }

        .btn-outline-white:hover,
        .btn-outline-white:focus {
            background-color: #ffffff;
            color: #000;
        }

        /* ============================================================ */
        /* LAYOUT PRINCIPAL */
        /* ============================================================ */
        .section {
            height: 90vh;
            overflow: hidden;
        }

        .row.g-1 {
            height: 100%;
        }

        .col {
            height: 100%;
        }

        .card {
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .card-body {
            flex: 1;
            overflow-y: auto;
        }

        #map {
            height: 100%;
        }

        /* Contenedor principal que ocupa el resto del espacio */
        .main-container {
            flex: 1 1 auto;
            overflow: hidden;
            display: flex;
        }

        /* ============================================================ */
        /* CONTENEDORES LATERALES */
        /* ============================================================ */

        /* Contenedor del roadbook (30% de ancho) */
        #roadbook-container {
            width: 30%;
            height: 100vh;
            overflow-y: auto;
            background: rgba(255, 255, 255, 0.95);
            padding: 1em;
            box-shadow: -3px 0 5px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            position: relative;
        }

        /* Contenedor de iconos (15% de ancho) */
        #icon-container {
            width: 15%;
            height: 100vh;
            overflow-y: auto;
            background: rgba(255, 255, 255, 0.95);
            padding: 1em;
            box-shadow: -3px 0 5px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            position: relative;
        }

        /* ============================================================ */
        /* TABLAS DEL ROADBOOK */
        /* ============================================================ */
        th,
        td {
            text-align: center;
            font-size: 0.9em;
            vertical-align: middle;
            padding: 0;
        }

        /* Columna de kilómetros con texto grande y bold */
        td.kilometros,
        th.kilometros {
            font-weight: bold;
            text-align: center;
            font-size: 1.8em;
        }

        /* Celda de iconos */
        td.icono {
            align-items: center;
            justify-content: center;
            height: 100px;
        }

        td.icono img {
            width: 75px;
            height: 75px;
            object-fit: contain;
        }

        /* Celda de notas */
        td.nota {
            align-items: center;
            justify-content: center;
        }

        /* ============================================================ */
        /* ICONOS Y DRAG & DROP */
        /* ============================================================ */
        .btn-descargar {
            margin-top: 1em;
        }

        /* Caja de iconos fija en la parte inferior */
        .icon-box {
            position: sticky;
            bottom: 0;
            background: rgba(255, 255, 255, 0.95);
            padding-top: 1em;
            border-top: 1px solid #ddd;
        }

        .icon-box img {
            margin: 4px;
            width: 3rem;
            height: 3rem;
            cursor: grab;
        }

        /* Elementos resaltados durante drag */
        .highlight {
            border: 2px dashed #007bff;
        }

        /* Áreas donde se puede soltar (droppable) */
        .droppable.highlight {
            background-color: rgba(255, 255, 0, 0.3);
            transition: background-color 0.3s;
        }

        .visual-drop.highlight {
            background-color: rgba(255, 255, 0, 0.3);
            transition: background-color 0.3s;
        }

        .visual-drop {
            width: 40px;
            height: 40px;
            border: 1px dashed #888;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .visual-drop img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* ============================================================ */
        /* POPUPS DE LEAFLET (MAPA) */
        /* ============================================================ */

        /* Contenedor del popup */
        .leaflet-popup-content-wrapper {
            border-radius: 0.75rem;
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
            padding: 0;
        }

        .leaflet-popup-tip {
            background: #fff;
        }

        .leaflet-popup-content {
            margin: 0;
            padding: 0;
        }

        /* Ocultar contenedor de rutas de Leaflet */
        .leaflet-routing-container {
            display: none !important;
        }

        /* Card dentro del popup */
        .popup-card {
            min-width: 200px;
        }

        .popup-card .card-header {
            background-color: #0d6efd;
            color: #fff;
            font-weight: 500;
        }

        .popup-card .btn-group .btn {
            flex: 1;
        }

        /* Botón de cerrar popup con filtro blanco */
        .leaflet-popup-close-button {
            filter: brightness(0) invert(1);
            transform: translateY(2.2rem) !important;
        }

        /* ============================================================ */
        /* POPUP AZUL PERSONALIZADO */
        /* ============================================================ */

        /* Contenedor del popup azul con borde blanco */
        .leaflet-popup.popup-azul .leaflet-popup-content-wrapper {
            background: #007bff;
            border: 2px solid white;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 8px 12px;
            box-shadow: none;
            border-radius: 4px;
        }

        /* Asegurar que la X de cerrar y el número sean blancos */
        .leaflet-popup.popup-azul .leaflet-popup-close-button,
        .leaflet-popup.popup-azul .mi-numero {
            color: white !important;
        }

        /* Estilo del número dentro del popup */
        .mi-numero {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.2rem;
            font-weight: bold;
            background: transparent;
            padding: 0;
            color: white;
            display: inline-block;
        }

        /* ============================================================ */
        /* NAVBAR
        /* ============================================================ */
        .main-navbar .container {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* ============================================================ */
        /* Centrado de altura de Iconos
        /* ============================================================ */
        .bi {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            vertical-align: middle;
        }

        /* ============================================================ */
        /* Tablas Responsive para evitar scroll en desplegables
        /* ============================================================ */
        .table-responsive {
            overflow: visible !important;
        }


        /* ================================
   HEADER RESPONSIVE (MÓVIL)
   ================================ */
        @media (max-width: 768px) {

            /* Permite que el header haga salto de línea */
            .header-top .container {
                flex-wrap: wrap !important;
                gap: .5rem;
            }

            /* Logo arriba y a la izquierda */
            .header-top .logo-icon {
                flex: 1 1 auto;
            }

            /* Parte derecha: que pueda bajar de línea */
            .header-top-right {
                flex: 1 1 100%;
                flex-wrap: wrap !important;
                justify-content: flex-end !important;
                gap: .5rem;
            }

            /* Botones más compactos */
            .header-top-right .btn {
                padding: .35rem .55rem !important;
                font-size: .9rem !important;
                white-space: nowrap;
            }

            /* En móvil: oculta textos dentro de los botones y deja solo iconos */
            .header-top-right a.btn span {
                display: none !important;
            }

            /* Ajuste de iconos */
            .header-top-right a.btn i {
                margin: 0 !important;
                font-size: 1.1rem;
            }

            /* Dropdown usuario: compactar (ocultar textos del nombre/rol si ocupa mucho) */
            #topbarUserDropdown h6,
            #topbarUserDropdown small {
                display: none !important;
            }

            /* Bandera/idioma: un pelín más compacto */
            .language-dropdown .flag {
                width: 1.1em;
            }
        }

        /* Extra para pantallas muy pequeñas */
        @media (max-width: 420px) {
            .logo-icon img {
                max-height: 42px;
            }

            .header-top-right .btn {
                padding: .3rem .45rem !important;
            }
        }




        /* Caja del icono */
        .wp-icon {
            position: relative;
            width: 26px;
            height: 40px;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }

        /* Numero centrado */
        .wp-icon .wp-num {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -95%);
            /* ajusta fino si lo quieres más arriba/abajo */
            color: #000;
            font-weight: 900;
            font-size: 12px;
            line-height: 1;
            text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
            pointer-events: none;
        }


        tr.rb-hidden {
            opacity: 0.35;
            filter: grayscale(30%);
        }

        tr.rb-hidden canvas {
            pointer-events: none;
            /* opcional: evita editar mientras esté oculta */
        }
        
        
        

/* ROADBOOK DESIGN */
        
/* FIX Fabric: el canvas debe respetar su tamaño */
.canvas-frame canvas{
  width: 150px !important;
  height: 100px !important;
  display:block;
}

/* y para el de notas */
.note-cell .canvas-frame canvas{
  width: 150px !important;
  height: 100px !important;
  display:block;
}
        
        
.roadbook-row td{
  background:#fff;
  border-top: 1px solid rgba(0,0,0,.06);
  vertical-align: top;
}

.roadbook-row:hover td{
  background: #fbfbfc;
}

/* Columna KM */
.km-cell{
  position:relative;
  cursor:pointer;
  min-width: 110px;
}

.km-total{
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color:#0f172a;
}

.km-partial{
  margin-top: 6px;
  font-size: .9rem;
  font-weight: 600;
  color:#64748b;
}

/* Badge número paso */
.badge-step{
  position:absolute;
  bottom:10px;
  right:10px;
  padding: 3px 8px;
  border-radius: 5px;
  background:#0f172a;
  color:#fff;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
  pointer-events:none;
}

/* Celda canvas */

.canvas-frame{
  height: 108px;
  max-width: 150px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(2,6,23,.08);
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
  display: flex;
  justify-content: center;
  align-items: center;
}





/*MENU MOBIL*/

@media (max-width: 991.98px){

  /* Header: centra y separa */
  .header-top .container{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap: 12px !important;
  }

  /* Logo: elimina baseline y centra */
  .logo-icon{
    display:flex !important;
    align-items:center !important;
    flex: 0 0 auto;
  }
  .logo-icon img{
    height: 36px !important;
    width: auto !important;
    display:block !important;
  }

  /* Bloque móvil: separación real y alineación */
  .mobile-actions{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap: 10px !important;          /* <-- separación */
    margin-left:auto !important;
  }

  /* Quita márgenes que meten algunos temas a .dropdown */
  .mobile-actions .dropdown{
    margin: 0 !important;
  }

  /* Botones: misma caja */
  .mobile-actions .btn{
    width: 46px !important;
    height: 40px !important;
    padding: 0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius: 12px !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  /* Quitar caret del dropdown (el triangulito) */
  .mobile-actions .dropdown-toggle::after{
    display:none !important;
  }

  /* Botón idioma un poco más ancho */
  .mobile-actions .lang-btn{
    width:auto !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }
}



