/* ==========================================================================
   Estilos Generales
   ========================================================================== */
html { font-size: 14px; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #f5f5f5;
}

/* ==========================================================================
   OVERLAY DE DESCARGA PDF
   ========================================================================== */
@keyframes dv-spin { to { transform: rotate(360deg); } }
@-webkit-keyframes dv-spin { to { -webkit-transform: rotate(360deg); } }

.dv-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    z-index: 9999; overflow: hidden;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b3a5c 50%, #022dacff 100%);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif; box-sizing: border-box;
}

.dv-overlay__content { text-align: center; padding: 5vw; max-width: 480px; width: 92%; box-sizing: border-box; }
.dv-overlay__logo-wrap { margin-bottom: 5vw; }
.dv-overlay__logo { max-height: 50px; max-width: 60%; opacity: 0.9; }

.dv-overlay__spinner {
    width: 56px; height: 56px; min-width: 56px;
    border: 5px solid rgba(255, 255, 255, 0.15); border-top-color: #4fc3f7; border-radius: 50%;
    animation: dv-spin 0.9s linear infinite; margin: 0 auto 20px auto; flex-shrink: 0;
}

.dv-overlay__title { color: #ffffff; font-size: clamp(16px, 5vw, 22px); font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.dv-overlay__subtitle { color: rgba(255, 255, 255, 0.65); font-size: clamp(13px, 3.5vw, 15px); margin: 0; line-height: 1.5; }
.dv-overlay__subtitle--mb { color: rgba(255, 255, 255, 0.65); font-size: clamp(13px, 3.5vw, 15px); margin-bottom: 20px; line-height: 1.5; }
.dv-overlay__hint { color: rgba(255, 255, 255, 0.4); font-size: clamp(12px, 3vw, 13px); margin-bottom: 4px; }

.dv-overlay__icon-wrap {
    width: 64px; height: 64px; min-width: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto;
}
.dv-overlay__icon-wrap--success { background: rgba(129, 199, 132, 0.15); border: 2px solid #81c784; }
.dv-overlay__icon-wrap--error { background: rgba(239, 83, 80, 0.15); border: 2px solid #ef5350; }
.dv-overlay__icon--success { font-size: 28px; color: #81c784; }
.dv-overlay__icon--error { font-size: 28px; color: #ef5350; }

.dv-overlay__error-msg { color: rgba(255, 255, 255, 0.65); font-size: clamp(12px, 3.5vw, 15px); margin-bottom: 4px; line-height: 1.5; word-break: break-word; }

.dv-overlay__btn-retry {
    margin-top: 10px; background: rgba(79, 195, 247, 0.15); border: 1px solid rgba(79, 195, 247, 0.4);
    color: #4fc3f7; padding: 14px 28px; border-radius: 10px; cursor: pointer;
    font-size: clamp(13px, 3.5vw, 15px); min-height: 48px; width: 100%; max-width: 280px;
}
.dv-overlay__btn-retry:hover { background: rgba(79, 195, 247, 0.28); outline: none; }

/* ==========================================================================
   CONFIGURACIONES EXCLUSIVAS DE IMPRESIÓN FÍSICA
   ========================================================================== */
@media print {
    body {
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ocultar elementos UI durante la impresión */
    .noPrint, .d-print-none, .dv-overlay, .badge {
        display: none !important;
    }

    .container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Forzar al contenedor de factura a mantener su integridad y su formato 1000px */
    .factura-seniat {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 1000px !important;
        max-width: 1000px !important;
        min-width: 1000px !important;
        page-break-inside: avoid;
    }

    /* Forzar formato en Landscape al abrir la ventana de impresión del navegador */
    @page {
        size: landscape;
        margin: 0.5cm;
    }
}