/* =========================================
    1. ESTILOS BASE Y CONTENEDORES
   ========================================= */

.card { 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    border-radius: 10px; 
}

#logArea { 
    max-height: 400px; 
    overflow-y: auto; 
    font-size: 0.9em; 
    display: none; 
}

/* =========================================
    2. ESTRUCTURA DE LA MODAL (ODOO LUXOR)
   ========================================= */

.modal-odoo {
    display: none; /* Se activa vía JS con .fadeIn() */
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px); /* Efecto de desenfoque elegante */
    align-items: center;
    justify-content: center;
}

.modal-content-odoo {
    background-color: #f4f7f6;
    margin: auto;
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    animation: zoomInOdoo 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    
    /* CONFIGURACIÓN MAXIMIZADA (POR DEFECTO) */
    width: 95%;
    max-width: 1400px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease; /* Transición suave para el redimensionado */
}

/* ESTADO MINIMIZADO (Se activa con la clase .is-minimized) */
.modal-content-odoo.is-minimized {
    width: 95%;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
}

/* CUERPO CON SCROLL INTERNO */
/* Mantiene la cabecera y el footer fijos mientras la tabla se desplaza */
.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

@keyframes zoomInOdoo {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* =========================================
   CONTROLES DE MODAL (LIMPIEZA TOTAL)
   ========================================= */

.modal-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex !important; /* Forza el alineamiento horizontal */
    gap: 10px !important;    /* Espacio real entre círculos */
    align-items: center;
    z-index: 9999;
}

/* Estilo unificado para los botones circulares */
.modal-control-btn {
    /* Reset de estilos de botón */
    appearance: none;
    border: none;
    outline: none;
    margin: 0;
    padding: 0;
    
    /* Diseño circular */
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative !important; /* Importante: quita el absolute heredado */
    top: 0 !important;
    right: 0 !important;
}

.modal-control-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.1);
}

.modal-control-btn.btn-close:hover {
    background-color: #e74c3c !important; /* Rojo al cerrar */
}

/* Iconos dentro del botón */
.modal-control-btn i {
    font-size: 14px !important;
    line-height: 1 !important;
    pointer-events: none;
}

/* ELIMINAR RASTROS DE CLASES VIEJAS (Para evitar duplicados visuales) */
.close-modal-odoo, .minimize-modal-odoo {
    display: none !important;
    visibility: hidden !important;
}
/* =========================================
    4. DISEÑO INTERNO (REPORTE LUXOR)
   ========================================= */

.reporte-header {
    background-color: #71639e !important; /* Morado Luxor */
    color: #ffffff !important;
    padding: 20px !important;
    text-align: center !important;
    flex-shrink: 0; /* Evita que la cabecera se deforme */
}

.reporte-header-title {
    font-weight: 800 !important; 
    font-size: 20px !important;
    text-transform: uppercase !important; 
    margin-bottom: 5px !important;
    letter-spacing: 1px;
}

.reporte-table { 
    width: 100% !important; 
    border-collapse: collapse !important; 
}

.reporte-table th { 
    background: #f1f3f5 !important; 
    color: #555 !important; 
    font-size: 11px !important; 
    padding: 12px 10px !important; 
    text-transform: uppercase !important; 
    border-bottom: 2px solid #ddd;
    position: sticky; /* Cabecera de tabla fija al hacer scroll */
    top: 0;
    z-index: 2;
}

.reporte-table td { 
    padding: 10px 10px !important; 
    font-size: 13px !important; 
    color: #333 !important;
    border-bottom: 1px solid #eee !important; 
}

/* Tarjetas de Totales (PZS / LBS) */
.reporte-card {
    transition: transform 0.2s;
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    border: 1px solid #eee;
}

.reporte-card:hover {
    transform: translateY(-2px);
}

/* =========================================
   AJUSTES RESPONSIVOS (MÓVIL)
   ========================================= */

/* Esta regla se aplica solo si la pantalla mide 600px o menos */
@media (max-width: 600px) {
    
    .reporte-header {
        /* Redefinimos el padding solo para móvil.
           Le damos mucho espacio a la derecha (110px) para que el texto
           no toque los botones absolutos.
           Orden: Arriba | Derecha | Abajo | Izquierda
        */
        padding: 20px 110px 20px 20px !important;
        
        /* OPCIONAL: A veces en móvil se ve mejor alineado a la izquierda
           si el título es muy largo y se parte en varias líneas.
           Si prefieres mantenerlo centrado, borra la línea de abajo. */
        /* text-align: left !important; */
    }

    /* Ajuste pequeño para que el subtítulo (destino) tampoco se pegue */
    .reporte-header-stats {
        margin-right: -10px; /* Compensa un poco si es necesario */
        word-wrap: break-word; /* Asegura que si la lista de ubicaciones es eterna, baje de línea */
    }

    /* Reducir un poco el tamaño de la fuente del título en móvil */
    .reporte-header-title {
        font-size: 18px !important;
    }
}
/* =========================================
   5. NUEVOS ESTILOS: MODO DIVISIÓN
   ========================================= */

/* Personalización del Switch Luxor */
.custom-switch-luxor .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.custom-switch-luxor .form-check-input:checked {
    background-color: #71639e;
    border-color: #71639e;
}

.custom-switch-luxor .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(113, 99, 158, 0.25);
}

/* Clases para Filas y Badges de Estado */
.row-salida {
    background-color: rgba(220, 53, 69, 0.05) !important;
}

.row-entrada {
    background-color: rgba(40, 167, 69, 0.05) !important;
}

.badge-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.status-ok { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-info { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }

/* Animación para el icono de error en confirmación */
.text-danger-custom { color: #dc3545 !important; }