/* --- Estilos de Impresión --- */
@media print {
    /* Ocultar todo por defecto */
    body * {
        visibility: hidden;
    }

    /* Hacer visible solo el contenido del reporte y sus padres */
    #caja-reporte-modal, #caja-reporte-modal * {
        visibility: visible;
    }

    /* Asegurarse de que el modal ocupe toda la página */
    #caja-reporte-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        box-shadow: none;
        border: none;
    }

    #caja-reporte-modal .modal-content {
        box-shadow: none;
        border: 1px solid #ccc;
        margin: 0;
        padding: 0;
    }

    /* Ocultar botones y elementos no deseados en la impresión */
    #caja-reporte-modal .modal-header .close,
    #caja-reporte-modal .modal-footer {
        display: none;
    }

    /* Resetear colores y fuentes para una impresión estándar */
    body {
        background: #fff !important;
    }

    #caja-reporte-body, #caja-reporte-body * {
        color: #000 !important;
        background: #fff !important;
    }

    #caja-reporte-body h2, #caja-reporte-body h4 {
        border-bottom: 2px solid #000;
    }

    /* Estilos específicos para tickets de clientes */
    .ticket-print, .ticket-print * {
        visibility: visible !important;
    }

    .ticket-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 58mm;
        font-family: 'Courier New', monospace;
        font-size: 10px;
        line-height: 1.2;
        color: #000 !important;
        background: #fff !important;
        margin: 0;
        padding: 5mm;
    }

    .ticket-print table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9px;
    }

    .ticket-print th,
    .ticket-print td {
        padding: 1mm;
        text-align: left;
        border: none;
        font-size: 9px;
    }

    .ticket-print .text-right {
        text-align: right !important;
    }

    .ticket-print .text-center {
        text-align: center !important;
    }

    .ticket-print hr {
        border: none;
        border-top: 1px solid #000;
        margin: 2mm 0;
    }
}

