/* assets/css/modules/impresion.css - v1.12 */

#impresion-v112-root .print-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0;
}

/* LA TARJETA (Simulación en pantalla 1:1) */
#impresion-v112-root .customer-card {
    width: 140mm;
    height: 110mm;
    background: #fdfaf0; /* COLOR CREMA PARA CONFIRMAR RECARGA */
    border: 1px solid #c5bfae;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    color: #333;
}

/* Lado Izquierdo (Mantenemos como referencia visual en pantalla) */
#impresion-v112-root .card-left-panel {
    width: 62mm;
    background-color: #6a9c3b;
    color: white;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

#impresion-v112-root .schedule-block { margin-bottom: 1.2rem; }
#impresion-v112-root .schedule-header { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; margin-bottom: 0.2rem; }
#impresion-v112-root .schedule-time { font-size: 1.1rem; font-weight: 800; }

/* Lado Derecho (Alineación millimétrica con la tarjeta física) */
#impresion-v112-root .card-right-panel {
    flex-grow: 1;
    /* AJUSTE PARA PANTALLA: 10mm desde el borde superior de la tarjeta */
    padding-top: 10mm; 
    /* El panel izquierdo mide 62mm. Para llegar a 72mm de la izquierda total, sumamos 10mm */
    padding-left: 10mm; 
    padding-right: 5mm;
    display: flex;
    flex-direction: column;
    background: transparent;
}

#impresion-v112-root .card-field {
    height: 11.5mm; /* Los 8 campos en 110mm */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin: 0;
    border: none;
}

#impresion-v112-root .field-label {
    font-size: 0.6rem;
    color: #948e7d;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1;
}

#impresion-v112-root .field-value {
    font-size: 13pt;
    font-weight: 800;
    color: #000;
    line-height: 1.1;
    text-transform: uppercase;
    min-height: 1.2rem;
}

/* ==========================================================================
   SUPER-OVERRIDE DE IMPRESIÓN (IGNORA TODO EXCEPTO EL CONTENEDOR V112)
   ========================================================================== */
@media print {
    @page {
        size: 140mm 110mm !important;
        margin: 0 !important;
    }

    /* OCULTAR TODO EL LAYOUT DE LA APP */
    #app-layout, .sidebar, .header, .footer, .btn-print-wrapper, .module-title-discrete {
        display: none !important;
        visibility: hidden !important;
    }

    /* EXCEPCIÓN: Mostrar específicamente los contenedores de reporte cuando estén activos */
    .report-header-print, 
    #rack-grid-container,
    #grid-notas,
    #caja-web-interactive-view .report-header-print,
    .print-content {
        display: block !important;
        visibility: visible !important;
    }

    /* Asegurar que el rack se vea en grid también aquí como respaldo */
    #rack-grid-container {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    /* FORZAMOS QUE EL CONTENEDOR SEA ABSOLUTO PARA ANULAR print.css */
    #impresion-content.tab-pane.active {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 140mm !important;
        padding: 0 !important;
        margin: 0 !important;
        visibility: visible !important;
    }

    /* OCULTAR ELEMENTOS QUE NO SON DATOS (Titulos, etc) */
    .module-title-discrete, .module-toolbar, .no-print, .field-label, .card-left-panel {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #impresion-v112-root .customer-card {
        width: 140mm !important;
        height: 110mm !important;
        display: block !important;
        position: relative !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    #impresion-v112-root .card-right-panel {
        width: 140mm !important;
        height: 110mm !important;
        position: relative !important;
        background: transparent !important;
        padding-top: 10mm !important; /* COORDENADA Y: 10mm desde arriba */
        padding-left: 72mm !important; /* COORDENADA X: 72mm desde la izquierda total */
        padding-right: 5mm !important;
        box-sizing: border-box !important;
    }

    #impresion-v112-root .card-field {
        height: 11.5mm !important; /* SALTO DE LÍNEA: 11.5mm */
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    #impresion-v112-root .field-value {
        font-size: 13pt !important;
        color: #000 !important;
        font-weight: 800 !important;
        line-height: 11.5mm !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
    }
}
