/* --- REGLAS DE IMPRESIÓN (CTRL+P FIX v6.0 - Failsafe mejorado) --- */
@media print {
    /* Ocultar TODO, excepto los contenedores esenciales del diálogo de MudBlazor */
    
    /* 1. Ocultamos el cuerpo y sus hijos que NO SON el overlay de MudBlazor */
    /* El selector :not() asegura que la ventana de diálogo quede intacta */
    body > *:not(.mud-overlay) {
        visibility: hidden !important;
        display: none !important; 
    }
    
    /* 2. Hacemos visible y forzamos el formato estrecho (80mm) en el contenedor de MudBlazor */
    .mud-overlay, .mud-dialog, .mud-dialog-container {
        visibility: visible !important;
        display: block !important;
        background: white !important; /* Asegurar fondo blanco */
        z-index: 99999 !important; 
        
        /* Forzamos el ancho de un recibo. Esto corrige el escalado excesivo. */
        width: 80mm !important;
        height: auto !important; /* Dejar que la altura fluya */
        
        position: fixed !important; 
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. Hacemos visible el iframe y su contenido (el PDF) */
    #voucherPdfFrame, #voucherPdfFrame * {
        visibility: visible !important;
        display: block !important;
        
        /* El iframe ocupa el 100% del contenedor estrecho de 80mm */
        width: 100% !important; 
        height: auto !important;
        z-index: 100000 !important; 
        position: static !important; 
        margin: 0 !important;
        padding: 0 !important;
    }
}