/**
 * 1. Nombre del archivo: style.css
 * 2. Ubicacion: assets/css/
 * 3. Descripcion: Hoja de estilos global para Mayaland Express (Genesis Light Style).
 */

:root {
    --mayaland-dark: #0f172a;
    --navbar-height: 72px;
    --genesis-blue: #00d4ff;

    /* VARIABLES DINÁMICAS DEL TEMA */
    --azul-mayaland: #003366;
    --modal-bg-color: #f1f5f9; /* Gris claro por defecto (Slate 100) */
}

/* --- Limpieza Global de Scrollbars y Enlaces --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a {
    text-decoration: none !important;
    transition: all 0.3s ease;
}

body {
    background: url('../img/FondoGris.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem; /* Letra ligeramente más pequeña */
}

/* Reset de contenedor para fluidez total */
body > .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================
   ESTILOS DE MODALS (GLOBAL Y DINÁMICO)
   ========================================================== */
.modal-content {
    background-color: var(--modal-bg-color) !important;
}
/* Forzamos transparencia solo en cuerpos y pies, dejando libre al header dinámico */
.modal-content .bg-white,
.modal-content .bg-light,
.modal-body,
.modal-footer {
    background-color: transparent !important;
}

/* ==========================================================
   ESTILOS DEL HEADER Y NAVEGACIÓN
   ========================================================== */

.bg-mayaland-navbar {
    background-color: var(--mayaland-dark) !important;
    min-height: var(--navbar-height);
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-icon-link {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-icon-link:hover {
    color: var(--genesis-blue) !important;
    background: rgba(255, 255, 255, 0.05);
}

.user-badge-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px 12px 4px 6px;
}

.role-indicator {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

/* ==========================================================
   COMPONENTES Y ESTRUCTURA GENERAL
   ========================================================== */

.main-content {
    padding: 2rem 1.5rem;
    margin-top: 0;
    min-height: calc(100vh - var(--navbar-height));
}

.section-title {
    font-size: 0.80rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 2.5px;
    padding: 30px 15px 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.section-title::after {
    content: "";
    flex-grow: 1;
    height: 1.5px;
    background: linear-gradient(90deg, #cbd5e1 0%, #e2e8f0 50%, rgba(241, 245, 249, 0) 100%);
    opacity: 0.5;
}

.card-custom { border-radius: 15px; overflow: hidden; border: none; }
.card-info-part { background-color: #faf8f5; }
.card-action-part { background-color: #f1f5f9; }

/* ==========================================================
   ESTILOS ESPECÍFICOS PARA LOGIN (Staff Access)
   ========================================================== */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4)),
                url('../img/FondoGris.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow-y: auto;
}

.login-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    background: transparent;
}

.login-side-info {
    background-color: var(--azul-mayaland);
    color: white;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.login-side-form {
    background-color: white;
    padding: 45px;
    position: relative;
}

.btn-ingresar {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 14px;
    border: none;
    background: var(--azul-mayaland);
    color: white;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-ingresar:hover {
    background: var(--genesis-blue);
    color: var(--mayaland-dark);
    transform: translateY(-2px);
}

.back-link-genesis {
    font-size: 0.70rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.back-link-genesis:hover {
    color: var(--genesis-blue);
    transform: translateX(-5px);
}

/* ==========================================================
   ESTILOS ESPECÍFICOS PARA EL INDEX
   ========================================================== */

.index-body {
    height: 100vh;
    overflow: hidden;
}

.hero-section {
    position: relative;
    background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)),
                url('../img/Gemini_Generated_Image_y03puoy03puoy03p.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.staff-access-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.brand-logo-main {
    max-height: 150px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.5));
}

.btn-staff-overlay {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
}

.btn-staff-overlay:hover {
    background: white;
    color: var(--mayaland-dark);
}

.input-track-custom {
    border-radius: 5px 0 0 5px !important;
    border: none;
    padding: 15px 25px;
}

.btn-track-custom {
    border-radius: 0 5px 5px 0 !important;
    background-color: var(--azul-mayaland);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    letter-spacing: 1px;
    color: white;
}

.footer-index {
    position: absolute;
    bottom: 20px;
    width: 100%;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.65rem;
    text-align: center;
    z-index: 5;
}

/* ==========================================================
   ESQUEMA DE TRACKING - LINEA DE TIEMPO
   ========================================================== */

.timeline-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    position: relative;
}

/* Conector vertical entre iconos */
.step-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 21px;
    top: 45px;
    width: 2px;
    height: calc(100% - 25px);
    background: rgba(148, 163, 184, 0.3);
    z-index: 1;
}

/* Estilo Base del Icono */
.step-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #cbd5e1;
    z-index: 2;
    color: #64748b;
    position: relative;
    font-size: 1.2rem;
}

.step-content {
    flex: 1;
}

.status-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- ESTADO: ACTUAL (Pulse + Detail Card) --- */
.step-item.current .step-icon {
    background-color: var(--genesis-blue);
    color: var(--mayaland-dark);
    border-color: var(--genesis-blue);
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.6);
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.current-details-card {
    display: flex;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 18px;
    margin-top: 12px;
    border-left: 4px solid var(--genesis-blue);
    gap: 15px;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.details-image {
    width: 130px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.details-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.details-text p {
    color: white;
    font-size: 0.8rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

/* --- ESTADO: PASADO (Velo Gris) --- */
.step-item.past {
    filter: grayscale(1);
    opacity: 0.6;
}

.step-item.past .step-icon {
    background-color: #f1f5f9;
}

/* --- ESTADO: FUTURO (Visibilidad Mejorada) --- */
.step-item.future {
    opacity: 0.85;
}

.step-item.future .step-icon {
    background-color: #fff;
    border: 2px solid #e2e8f0;
    color: #cbd5e1;
}

.step-item.future .status-name {
    font-weight: 500;
    color: #475364;
}

/* ==========================================================
   RESPONSIVIDAD (MEDIA QUERIES)
   ========================================================== */

@media (max-width: 788px) {
    .brand-logo-main { max-height: 100px; }
    .display-4 { font-size: 1.8rem !important; }
    .current-details-card { flex-direction: column; text-align: center; }
    .details-image { width: 100%; height: 120px; }
}

@media (max-width: 576px) {
    .index-body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .hero-section {
        height: auto;
        min-height: 100vh;
        padding: 100px 0 80px 0;
    }
    .hero-section form { flex-direction: column; }
    .input-track-custom { border-radius: 8px !important; margin-bottom: 10px; text-align: center; }
    .btn-track-custom { border-radius: 8px !important; width: 100%; padding: 15px; }

    .footer-index {
        position: relative;
        bottom: 0;
        margin-top: auto;
        padding-top: 40px;
    }
}

/* FILAS ANULADAS */
.row-anulada {
    background-color: #f1f3f5 !important;
    color: #adb5bd;
}

.row-anulada select,
.row-anulada .btn {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forzar que el número de guía no se parta en dos líneas */
td[data-label="Guía"] span {
    white-space: nowrap;
}

/* ==========================================================================
   ESTILOS PREMIUM GENESIS LIGHT - MODULO INTAKE / CAJAS
   ========================================================================== */
.icon-light-grey { color: #cbd5e1 !important; }
.form-label-custom {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
.client-data-box {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}
.read-only-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
}
.input-read-only {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    padding: 0 !important;
    font-size: 0.9rem;
    cursor: default;
}
.input-read-only:focus {
    outline: none !important;
    box-shadow: none !important;
}
.section-container {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- Estilos para Selector de Banderas (Intake) --- */
.btn-check:checked + .flag-selector-label {
    /* Color principal de la agencia muy atenuado al 10% */
    background-color: rgba(13, 110, 253, 0.1) !important;
    border-color: var(--azul-mayaland, #0d6efd) !important;
    border-width: 2px !important;
}

@supports (--custom: property) {
    .btn-check:checked + .flag-selector-label {
        background-color: color-mix(in srgb, var(--azul-mayaland, #0d6efd) 10%, transparent) !important;
    }
}

.btn-check:checked + .flag-selector-label span {
    /* Gris muy oscuro/pizarra para asegurar lectura perfecta siempre */
    color: #334155 !important;
    font-weight: 800 !important; /* Lo hacemos un poco más gordito para que resalte */
}

/* Transición suave para la imagen */
.flag-selector-label img {
    transition: transform 0.2s ease-in-out;
}

/* Efecto de elevación al seleccionar */
.btn-check:checked + .flag-selector-label img {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.btn-pais-destino + label:hover img {
    transform: scale(1.1);
}
/* ========================================== */
/* SIDEBAR Y LAYOUT FLEXBOX GLOBAL            */
/* ========================================== */

.layout-wrapper {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.sidebar-dark {
    width: 70px;
    background-color: #2c3e50;
    transition: width 0.3s ease;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 100;
    margin: 0;
}

.sidebar-dark.expanded {
    width: 250px;
}

.sidebar-menu { list-style: none; padding: 0; margin: 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-link:hover, .accordion-item.active > .sidebar-link {
    background-color: #34495e;
    color: white;
}

.sidebar-dark i {
    color: #95a5a6;
    font-size: 1.25rem;
    min-width: 35px;
    text-align: center;
}

.sidebar-dark .text-label {
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 10px;
    color: #ecf0f1;
}

.sidebar-dark.expanded .text-label { opacity: 1; }

.sidebar-toggle {
    padding: 15px;
    cursor: pointer;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-toggle:hover { background-color: #34495e; }

.accordion-body {
    display: none;
    list-style: none;
    padding-left: 0;
    background-color: #1a252f;
    margin: 0;
}

/* Ajuste visual para los sub-íconos */
.accordion-body li a {
    color: #95a5a6;
    padding: 12px 15px 12px 25px;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.accordion-body li a i {
    font-size: 1rem;
    min-width: 25px;
}

.accordion-body li a:hover {
    color: #ffffff;
    padding-left: 30px;
}

.accordion-item.active .accordion-body { display: block; }

.layout-main-content {
    flex-grow: 1;
    width: calc(100% - 70px);
    transition: width 0.3s ease;
}
/* =========================================
   ESTILOS PARA TABLAS RESPONSIVAS (REPORTES)
   ========================================= */
.row-anulada { background-color: #f1f3f5 !important; opacity: 0.8; }
.row-anulada td { color: #adb5bd !important; }
.row-anulada select, .row-anulada .btn-group a { pointer-events: none; cursor: not-allowed; opacity: 0.6; }

@media (max-width: 991.98px) {
    .responsive-table-mobile thead { display: none; }
    .responsive-table-mobile tbody, .responsive-table-mobile tr, .responsive-table-mobile td { display: block; width: 100%; }
    .responsive-table-mobile tr { margin-bottom: 1.5rem; border: 1px solid #e2e8f0; border-radius: 12px; background-color: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.05); padding: 1rem; }
    .responsive-table-mobile td { display: flex; flex-direction: column; align-items: flex-start !important; text-align: left !important; padding: 0.6rem 0 !important; border-bottom: 1px solid #f1f5f9; }
    .responsive-table-mobile td:last-child { border-bottom: none; padding-bottom: 0 !important; }
    .responsive-table-mobile td::before { content: attr(data-label); font-weight: 800; color: #64748b; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 4px; display: block; }
    /* Ajuste especial para la fila del Checkbox en móvil */
    .responsive-table-mobile td.td-checkbox { flex-direction: row !important; justify-content: space-between !important; align-items: center !important; background-color: #f8f9fa; padding: 0.5rem !important; border-radius: 8px; margin-bottom: 10px; }
    .responsive-table-mobile td.td-checkbox::before { margin-bottom: 0; }
    .responsive-table-mobile td > div { width: 100%; text-align: left !important; justify-content: flex-start !important; }
    .responsive-table-mobile select { width: 100% !important; }
    .responsive-table-mobile .btn-group { display: flex; width: 100%; gap: 8px; }
    .responsive-table-mobile .btn-group > * { flex: 1; border-radius: 6px !important; justify-content: center; }
}
/* ==========================================================
   AJUSTE DE TAMAÑO PARA TABLA DE RADIOGRAFÍA DE TRANSACCIÓN
   ========================================================== */
#modalDetalleGuia .table td {
    font-size: 0.85rem !important; /* Equivale a ~12px. Báscalo a 0.70rem si lo quieres más pequeño */
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

/* Ajustar el tamaño de los iconos dentro de la tabla para que no se vean desproporcionados */
#modalDetalleGuia .table td i {
    font-size: 0.95rem !important; 
}
#modalDetalleGuia .table td:last-child {
    font-variant: small-caps !important;
    text-transform: lowercase !important; /* Fuerza el efecto en todas las letras */
    font-size: 0.80rem !important; 
    font-weight: 700;
}