/* **********************************************************************
    ELEMENTOS COMUNES
*********************************************************************** */

    :root {
        --primary: #0070f3; --success: #28a745; --danger: #ff0055; --warning: #ff9800;
        --admin-purple: #6200ea; --bg: #f4f6f9; --card-bg: #ffffff; --text: #333;
    }
    * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
    body { background: var(--bg); color: var(--text); max-width: 950px; margin: 0 auto; padding: 15px; }
    h1 { text-align: center; font-size: 1.5rem; margin: 15px 0; color: #111; }
    h2 { font-size: 1.1rem; border-bottom: 2px solid var(--primary); padding-bottom: 5px; margin-top: 0; color: #222; }
    h3 { font-size: 1rem; margin-top: 0; color: #333; }
    label { font-size: 0.8rem; font-weight: bold; color: #555; display: block; margin-bottom: 4px; }

    .card { background: var(--card-bg); padding: 15px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 15px; }
    input, select, textarea { width: 100%; padding: 10px; margin-bottom: 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; color: #333; }


    button { color: white; border: none; padding: 12px; border-radius: 6px; cursor: pointer; width: 100%;font-size: 0.95rem; font-weight: bold; transition: opacity 0.2s; display: block; }
    button:active { opacity: 0.8; }
    .btn-in { background: var(--primary); } .btn-out { background: var(--danger); } .btn-leave { background: var(--success); }
    .btn-save { background: var(--warning); width: 100%; padding: 10px; font-size: 0.9rem; }
    .btn-delete { background: #6c757d; width: 100%; padding: 10px; font-size: 0.9rem; }
    .btn-cancel-req { background: #512da8 !important; color: #ffffff !important; margin-top: 10px; font-size: 0.9rem; }
    .flex-buttons { display: flex; gap: 10px; width: 100%; }

    .row-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
    .row-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; align-items: center; }
    input.time-box { text-align: center; margin: 0; padding: 8px; }

    .list-item { background: #f8f9fa; border: 1px solid #eee; border-radius: 8px; padding: 12px; margin-bottom: 12px; position: relative; }
    .totals-box { background: #e7f3ff; padding: 10px; border-radius: 6px; font-weight: bold; text-align: center; margin-bottom: 10px; font-size: 0.9rem; color: #0056b3; }
    .badge { padding: 4px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: bold; text-transform: uppercase; display: inline-block; }
    .PENDIENTE { background: #ffeeba; color: #856404; } 
    .APROBADO { background: #c3e6cb; color: #155724; } 
    .RECHAZADO { background: #f5c6cb; color: #721c24; } 
    .SOLICITADA_CANCELACION { background: #e2d1f9; color: #4a148c; }
    .CANCELADO { background: #e2e3e5; color: #383d41; } 
    .VALIDADO { background: #bee5eb; color: #0c5460; }


/* **********************************************************************
    ELEMENTOS DE LOGIN
*********************************************************************** */
    
    .login-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: #f4f6f9; display: flex; justify-content: center; align-items: center;
        z-index: 1000; padding: 20px;
    }
    .login-box { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.08); width: 100%; max-width: 400px; }
    .login-link { color: var(--primary); text-align: center; display: block; font-size: 0.85rem; margin-top: 15px; font-weight: bold; text-decoration: none; cursor: pointer; }

    .login-header-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.login-app-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.login-app-title {
    text-align: center;
    border: none;
    margin: 0;
    color: #0070f3;
    font-size: 1.6rem;
    font-weight: 700;
}

.login-subtitle {
    text-align: center;
    border: none;
    margin-bottom: 20px;
}

.login-submit-btn {
    margin-top: 10px;
}

.login-recovery-container {
    text-align: center;
    margin-top: 15px;
}

.login-recovery-link {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s;
}

.login-recovery-link:hover {
    color: #0070f3;
}


/* **********************************************************************
    ELEMENTOS FICHAJES
*********************************************************************** */

    .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; text-align: center; }
    .calendar-day-head { font-weight: bold; font-size: 0.8rem; background: #eee; padding: 6px; border-radius: 4px; }
    .calendar-cell { padding: 10px 2px; border-radius: 6px; font-size: 0.9rem; font-weight: bold; min-height: 42px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #e2e3e5; color: #383d41; transition: background 0.2s; }
    .cell-exacto { background: var(--success) !important; color: white !important; }
    .cell-exceso { background: #6f42c1 !important; color: white !important; }
    .cell-defecto { background: var(--warning) !important; color: white !important; }
    .cell-descanso { background: #6c757d !important; color: white !important; }
    .cell-vacaciones { background: #0070f3 !important; color: white !important; }
    .cell-seleccionada { 
        font-size: 1.3rem !important; 
        border: 2px solid #000 !important; 
        box-shadow: 0 0 5px rgba(0,0,0,0.2);
    }



    .main-grid { 
        display: grid; 
        grid-template-columns: 1fr; 
        gap: 15px; 
    }

    @media (min-width: 768px) { 
        .main-grid { grid-template-columns: 1fr 1fr; } 
    }

/* =========================================================================
   MÓDULO DE SIMETRÍA EXCLUSIVO PARA EL TRABAJADOR (MÁX 600PX)
========================================================================= */

    /* El contenedor maestro del trabajador acotado y centrado */
    .panel-trabajador-contenedor {
        display: block !important;       
        width: 100% !important;
        max-width: 600px !important;    
        margin: 0 auto !important;      
    }

    /* Aplicamos los 600px a la botonera de las pestañas del usuario */
    .tabs-usuario-container {
        max-width: 600px !important;    
        margin: 0 auto 20px auto !important;  
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Aplicamos los 600px a las tarjetas internas cuando están dentro del trabajador */
    .panel-trabajador-contenedor .card,
    .seccion-usr-panel .card {
        max-width: 600px !important;    
        margin-left: auto !important;   
        margin-right: auto !important;  
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Asegurar herencia limpia */
    .seccion-usr-panel {
        width: 100% !important;
        display: block;
    }

    /* REGLAS DE ACOPLAMIENTO DE ICONOS BLANCOS PARA PANTALLA COMPARTIDA */
    /* =========================================================================
    MÓDULO DE LIMITACIÓN Y CENTRADO DEL PANEL DEL TRABAJADOR (FICHAS)
    ========================================================================= */

    .seccion-usr-panel {
        width: 100% !important;
        max-width: 800px !important;    /* Acota el ancho para que no se vea gigante */
        margin: 0 auto !important;      /* Centra el bloque de forma matemática en el monitor */
        box-sizing: border-box !important;
    }

    /* Optimización extra: Ajustar las cajas internas de las tarjetas */
    .seccion-usr-panel .card {
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 20px !important; /* Añade separación limpia entre tarjetas */
    }



div:has(> #boxCambiarClave),
body .card:has(#boxCambiarClave) {
    max-width: 600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* =========================================================================
   MÓDULO DE ACOPLAMIENTO TOASTR-STYLE PARA SWEETALERT2 (ALTA VISIBILIDAD)
========================================================================= */


.swal2-container {
    z-index: 100000 !important; /* 🚀 Supera el z-index: 99999 de tu barra móvil */
}

/* Forzamos a la tarjeta emergente blanca del modal a heredar y blindar su visibilidad */
.swal2-popup {
    z-index: 100001 !important;
}

    /* 1. Liberar los límites del contenedor maestro en la pantalla */
    body.swal2-toast-shown .swal2-container {
        width: auto !important; 
    }

    /* 2. Estructura general ensanchada del Toast (Tamaño mayor de 500px) */
    body .swal2-popup.swal2-toast {
        width: 500px !important;    
        max-width: 90vw !important;  
        padding: 1.5rem !important;  
        border-radius: 6px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
        align-items: center !important;
    }

    /* 3. Escalar los textos para que tengan una legibilidad impecable*/
    body .swal2-popup.swal2-toast .swal2-title {
        font-size: 1.3rem !important;
        font-weight: bold !important;
        color: #ffffff !important; /* Texto blanco puro corporativo */
        margin: 0 0 4px 0 !important;
    }

    body .swal2-popup.swal2-toast .swal2-html-container {
        font-size: 1.05rem !important;
        color: #ffffff !important; /* Texto blanco puro corporativo */
        padding: 0 !important;
    }

    /* 4. Escalar los iconos originales de SweetAlert */
    body .swal2-popup.swal2-toast .swal2-icon {
        width: 2.8rem !important;
        height: 2.8rem !important;
        min-width: 2.8rem !important;
        margin: 0 15px 0 0 !important;
    }

    /* Forzar que los vectores internos de los iconos sean siempre blancos */
    body .swal2-popup.swal2-toast .swal2-icon * {
        color: #ffffff !important;
        border-color: #ffffff !important;
    }

    /* =========================================================================
    Inyección de Colores Planos Originales de Toastr
    ========================================================================= */

    /* Verde Bosque Oficial Toastr (Éxito / Fichajes Correctos) */
    body .swal2-popup.swal2-toast.swal2-icon-success {
        background-color: #51A351 !important; 
        border: 1px solid #458B45 !important; /* Pequeño matiz de contorno profesional */
    }

    /* Rojo Carmín Oficial Toastr (Errores / Bloqueos de Concurrencia) */
    body .swal2-popup.swal2-toast.swal2-icon-error {
        background-color: #BD362F !important; 
        border: 1px solid #a32e28 !important;
    }

    /* Naranja Ámbar/Ocre Oficial Toastr (Campos vacíos / Advertencias de horas) */
    body .swal2-popup.swal2-toast.swal2-icon-warning {
        background-color: #F89406 !important; 
        border: 1px solid #df8505 !important; /* Elimina el naranja chillón por un tono ámbar elegante */
    }

    /* Azul Petróleo Oficial Toastr (Información de la Suite / Sincronización) */
    body .swal2-popup.swal2-toast.swal2-icon-info {
        background-color: #2F96B4 !important; 
        border: 1px solid #28829c !important;
    }


    /* 6. Estilizar la barra de tiempo inferior en blanco translúcido */
    .barra-progreso-blanca {
        background: rgba(255, 255, 255, 0.45) !important;
        height: 4px !important;
    }


/* =========================================================================
   SISTEMA DE MENÚ HÍBRIDO ADAPTATIVO CON IDENTIDAD EN DOS FILAS INTEGRADA
   (ESCRITORIO ARRIBA / MÓVIL EN CABECERA PANORÁMICA DE BORDE A BORDE)
   ========================================================================= */

    /* --- 1. CONFIGURACIÓN COMPORTAMIENTO POR DEFECTO: ESCRITORIO (PC) --- */
    .desktop-top-navbar {
        display: flex !important;
        justify-content: flex-start !important; /* Distribución secuencial de izquierda a derecha */
        align-items: center !important;
        background-color: #ffffff;
        padding: 0 25px;
        height: 60px;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02);
        position: sticky;
        top: 0;
        z-index: 1000;
        margin-bottom: 25px;
        gap: 25px; /* Espacio de cortesía entre el logotipo y las filas de texto */
    }

    .nav-logo {
        color: #111111;
        font-size: 1.05rem;
        flex-shrink: 0;
    }

    /* Forzamos a que el bloque del menú de la derecha se desplace al final absolute */
    .nav-links-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto !important; 
    }

    .top-nav-link {
        background: none;
        border: none;
        padding: 8px 16px;
        font-size: 0.9rem;
        font-weight: 600;
        color: #4a5568;
        cursor: pointer;
        border-radius: 4px;
        transition: all 0.15s ease-in-out;
    }

    .top-nav-link:hover {
        background-color: #edf2f7;
        color: #1a202c;
    }

    .top-nav-link.active {
        background-color: #6c757d; /* Gris corporativo plano mate de tu suite */
        color: #ffffff !important;
    }

    .mobile-bottom-nav {
        display: none;
    }

    .user-identity-banner {
        display: none !important;
    }

/* El bloque contenedor de los textos fuerza el apilamiento vertical (Tanto en PC como en Móvil) */
/* =========================================================================
   BLINDAJE DE FILAS VERTICALES: FUERZA EL APILAMIENTO EN PC Y MÓVIL
   ========================================================================= */

/* El bloque contenedor de los textos fuerza el apilamiento en dos filas superpuestas */
.identity-rows-wrapper {
    display: flex !important;
    /* CORRECCIÓN DEFINTIVA: Añadimos prioridad !important para romper el flex horizontal del padre en PC */
    flex-direction: column !important; 
    gap: 2px !important;
    text-align: left !important;
    overflow: hidden;
}


.row-user {
    /* CORRECCIÓN DEFINTIVA EN PC: Forzamos comportamiento de bloque para obligar al salto de línea */
    display: block !important; 
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #1a202c !important;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 1.2 !important;
}

.row-company {
    /* Forzamos comportamiento de bloque también en la segunda fila */
    display: block !important; 
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #4a5568 !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 1.2 !important;
}

/* =========================================================================
   INTERACCIONES ADICIONALES PARA EL BOTÓN DE SALIDA ROJO
   ========================================================================= */
.mobile-logout-trigger {
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.mobile-logout-trigger:hover {
    background-color: #a82b25 !important;
    transform: scale(1.02);
}


.mobile-logout-trigger {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(189, 54, 47, 0.25) !important;
    margin-left: 15px !important;
}

.mobile-logout-trigger svg {
    width: 26px !important;
    height: 26px !important;
}


/* =========================================================================
   🏢 CRÉDITOS E IDENTIDAD CORPORATIVA DE PIE DE PÁGINA
   ========================================================================= */
.metadata-system-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    align-self: center;
}

/* =========================================================================
   🎯 ARQUITECTURA NAVBAR TRILATERAL DE ALTA FIDELIDAD
   ========================================================================= */

.desktop-top-navbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 24px !important;
    height: 70px !important;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

/* 🏢 Bloque Izquierdo: Aloja el Logo y los Metadatos EJS alineados */
.nav-left-zone {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    justify-content: flex-start !important;
}

.nav-logo-container {
    display: flex;
    align-items: center;
}

.nav-app-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

/* Contenedor de texto del operario */
.nav-user-meta-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid #e2e8f0;
    padding-left: 14px;
}

.row-user {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
}

.row-company {
    font-size: 0.76rem;
    font-weight: 500;
    color: #64748b;
}

/* 🚀 Bloque Central: Concentra la botonera homogénea en el centro del monitor */
.nav-links-centered {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 24px !important;
}

.top-nav-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-width: 72px;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    color: #4a5568 !important;
    padding: 4px 6px !important;
}

.top-nav-link:hover {
    color: #0070f3 !important;
}

.top-nav-link.active {
    color: #0070f3 !important;
    border-bottom: 2px solid #0070f3 !important;
}

/* 🔒 Bloque Derecho: Empuja el botón de Salir al extremo derecho */
.nav-right-zone {
    flex: 1 !important;
    display: flex !important;
    justify-content: flex-end !important;
}

.pc-top-logout-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-decoration: none !important;
    color: #64748b !important;
    padding: 4px 8px !important;
}

.pc-top-logout-btn:hover {
    color: #ff0055 !important;
}

/* Unificación de dimensiones globales de Iconos y Textos */
.nav-btn-icon {
    font-size: 1.3rem !important;
    line-height: 1 !important;
}

.nav-btn-svg {
    height: 1.25rem !important;
    width: auto !important;
}

.nav-btn-text {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    line-height: 1 !important;
}

/* =========================================================================
   🚨 REFUERZO DE NAVBAR: DISEÑO BOTÓN DE LOGOUT ROJO DE JEFATURA
   ========================================================================= */

/* Botón Rojo de Cierre de Sesión para el panel de administración */
.pc-top-logout-btn-red {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #ffffff !important;
    background-color: #bd362f !important; /* Rojo corporativo */
    width: 42px !important;
    height: 42px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 6px rgba(189, 54, 47, 0.2) !important;
    transition: background-color 0.15s ease !important;
    flex-shrink: 0;
}

.pc-top-logout-btn-red:hover {
    background-color: #a82e28 !important; /* Tono oscuro al pasar el cursor */
}

.pc-top-logout-btn-red .nav-btn-svg {
    width: 20px !important;
    height: 20px !important;
}

/* 🔒 BOTONES DE LOGOUT GEOMÉTRICOS RÍGIDOS */
.logout-btn-base {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #ffffff !important;
    background-color: #BD362F !important;
    transition: background-color 0.15s ease, transform 0.1s ease !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.logout-btn-base:hover {
    background-color: #a82a25 !important;
}

.logout-btn-base:active {
    transform: scale(0.97) !important;
}

.pc-top-logout-btn {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 6px rgba(189, 54, 47, 0.2) !important;
    margin-left: 10px !important;
}

.pc-top-logout-btn svg {
    width: 20px !important;
    height: 20px !important;
}

/************************************************************************
    SOPORTE Y BLINDAJE PARA DISPOSITIVOS MÓVILES (MÁX. 768px)
************************************************************************/
@media screen and (max-width: 768px) {
    
    /* =========================================================================
       1. ELEMENTOS GENERALES Y CONFIGURACIÓN DEL BODY
       ========================================================================= */
    body {
        padding-top: 0 !important;
        padding-bottom: 85px !important;
        background-color: #f8f9fa;
    }

    .desktop-top-navbar {
        display: none !important;
    }

    .mobile-logout-trigger {
        padding: 4px !important;
    }

    /* =========================================================================
       2. BLINDAJE DE COMPRESIÓN VERTICAL: CENSO DE PERSONAL (#adminSeccionEmpleados)
       ========================================================================= */
    /* Forzamos a la rejilla interna del censo a romper el flujo horizontal */
    #adminSeccionEmpleados .main-grid {
        display: block !important; /* Destruye el Grid/Flex horizontal y apila en vertical */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Obligamos al contenedor del formulario a ceñirse estrictamente al ancho de la pantalla */
    #adminSeccionEmpleados .main-grid > div {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 20px !important; /* Añade un espacio elegante de separación con la tabla */
    }

    /* Blindamos los inputs para que ocupen el 100% del carril sin desbordar */
    #formEmpleadoMantenimiento input, 
    #formEmpleadoMantenimiento button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* =========================================================================
       3. BLINDAJE DE COMPRESIÓN VERTICAL: CONFIGURADOR DE BOLSAS (#adminSeccionBolsas)
       ========================================================================= */
    /* Forzamos a la rejilla interna de bolsas a romper el flujo horizontal */
    #adminSeccionBolsas .main-grid {
        display: block !important; /* Destruye el Grid/Flex horizontal y apila en vertical */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Obligamos al contenedor del formulario y la tabla a ceñirse al ancho real */
    #adminSeccionBolsas .main-grid > div {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 20px !important; /* Añade espacio elegante de separación vertical */
    }

    /* Blindamos los inputs y botones para que ocupen el 100% del carril sin desbordar */
    #formTipoAusenciaMantenimiento input,
    #formTipoAusenciaMantenimiento select,
    #formTipoAusenciaMantenimiento button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* =========================================================================
       4. CONMUTACIÓN DE IDENTIDAD: BANNER PANORÁMICO SUPERIOR
       ========================================================================= */
    /* Hacemos resucitar la Card panorámica dedicada arriba en el móvil */
    .user-identity-banner {
        display: block !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        margin: 0 0 15px 0 !important;
        
        /* BREAKOUT DE MÁRGENES DE SANGRADO (BLEED LAYOUT): Borra los márgenes de los lados */
        width: 100vw !important; 
        max-width: 100vw !important;
        margin-left: 50% !important;
        transform: translateX(-50%) !important; /* Centra la caja panorámica en el cristal */
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .identity-content {
        /* Activamos el CSS Grid de dos columnas que preparamos para clavar el botón a la derecha */
        display: grid !important;
        grid-template-columns: 1fr auto !important; 
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;   /* Cuadra las esquinas eliminando las curvas en el móvil */
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: 1px solid #afbdc9 !important;
        padding: 4px 10px !important; /* Relleno compacto ideal para smartphones */
        box-sizing: border-box !important;
        background-color: #ffffff;
    }

    /* Redimensionamos ligeramente las tipografías para que se lee de forma imponente */
    .row-user { font-size: 1.0rem !important; }
    .row-company { font-size: 0.8rem !important; }

    /* =========================================================================
       5. BARRA DE NAVEGACIÓN TÁCTIL INFERIOR (BOTTOM APP BAR)
       ========================================================================= */
    .mobile-bottom-nav {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50px;
        background-color: #ffffff;
        border-top: 1px solid #afbdc9 !important;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
        z-index: 99999;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #718096;
        cursor: pointer;
        width: 100%;
        height: 100%;
        gap: 4px;
        padding: 4px;
        transition: color 0.15s ease-in-out;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-item.active { color: #111111 !important; }
    .nav-item.active svg { stroke: #111111 !important; filter: drop-shadow(0px 1px 2px rgba(0,0,0,0.1)); }
    .nav-item.active span { color: #111111 !important; font-weight: 800 !important; }
}

/* =========================================================================
   📊 MAQUETACIÓN MATRIX: ACOPLAMIENTO DE COLORES DEL CUADRANTE DE ADMIN
   ========================================================================= */

/* Caja de leyenda cromática */
.calendar-legend-grid-box {
    margin-top: 15px;
    border-top: 1px dashed #ccc;
    padding-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: bold;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

/* Hacemos que cuando la celda tenga la clase dot de la leyenda, pinte su fondo entero */
.cell-cuadrante-base.dot-exacto     { background-color: var(--exacto-color, #10b981) !important; color: #ffffff !important; }
.cell-cuadrante-base.dot-exceso     { background-color: var(--exceso-color, #ff9f43) !important; color: #ffffff !important; }
.cell-cuadrante-base.dot-defecto    { background-color: var(--defecto-color, #0070f3) !important; color: #ffffff !important; }
.cell-cuadrante-base.dot-vacaciones { background-color: var(--vacaciones-color, #9b59b6) !important; color: #ffffff !important; }
.cell-cuadrante-base.dot-descanso   { background-color: var(--descanso-color, #f1f5f9) !important; color: #475569 !important; }


/* Puntos de color vinculados a las variables */
.dot-exacto { background: var(--success); }
.dot-exceso { background: #6f42c1; }
.dot-defecto { background: var(--warning); }
.dot-vacaciones { background: #0070f3; }
.dot-descanso { background: #6c757d; }

/* Controles superiores del almanaque */
.calendar-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.calendar-title-clean {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.calendar-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-nav-cal-arrow {
    width: auto !important;
    padding: 5px 12px !important;
    background: #6c757d !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
}

.label-mes-vista-anual {
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
    min-width: 110px;
    text-align: center;
    text-transform: uppercase;
}

/* =========================================================================
   🎯 ALINEACIÓN Y CENTRADO: NAVEGACIÓN DEL ALMANAQUE DE USUARIO
   ========================================================================= */
.calendar-header-flex-centered {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    margin-bottom: 8px;
}

.calendar-nav-wrapper-centered {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}