/* ==========================================================
   COMPONENTES GLOBALES
========================================================== */


/* ==========================================================
   TOAST / NOTIFICACIONES
========================================================== */

.toast-notification {
    position: fixed;

    top: 24px;
    left: 50%;

    z-index: 99999;

    width: calc(100% - 32px);
    max-width: 390px;
    min-height: 66px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 12px 16px;

    background: #ffffff;

    border-radius: 12px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.18);

    transform:
        translate(-50%, -120px);

    opacity: 0;

    pointer-events: none;

    transition:
        transform 0.35s ease,
        opacity 0.35s ease;
}


/* ==========================================================
   MOSTRAR
========================================================== */

.toast-notification.show {
    transform:
        translate(-50%, 0);

    opacity: 1;
}


/* ==========================================================
   ICONO
========================================================== */

.toast-icon {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 20px;
}


/* ==========================================================
   CONTENIDO
========================================================== */

.toast-content {
    flex: 1;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}


/* ==========================================================
   ÉXITO
========================================================== */

.toast-success {
    border: 2px solid #2f9e57;

    color: #383d63;
}


.toast-success .toast-icon {
    background:
        rgba(47, 158, 87, 0.14);

    color: #2f9e57;
}


/* ==========================================================
   ERROR
========================================================== */

.toast-error {
    border: 2px solid #dc3545;

    color: #9f1c28;
}


.toast-error .toast-icon {
    background:
        rgba(220, 53, 69, 0.12);

    color: #dc3545;
}


/* ==========================================================
   ADVERTENCIA
========================================================== */

.toast-warning {
    border: 2px solid #fd9743;

    color: #383d63;
}


.toast-warning .toast-icon {
    background:
        rgba(253, 151, 67, 0.16);

    color: #fd9743;
}


/* ==========================================================
   INFORMACIÓN
========================================================== */

.toast-info {
    border: 2px solid #383d63;

    color: #383d63;
}


.toast-info .toast-icon {
    background:
        rgba(56, 61, 99, 0.12);

    color: #383d63;
}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 480px) {

    .toast-notification {
        top: 15px;

        width: calc(100% - 24px);
        min-height: 60px;

        padding: 10px 13px;
    }


    .toast-icon {
        width: 36px;
        height: 36px;

        flex-basis: 36px;

        font-size: 18px;
    }


    .toast-content {
        font-size: 12px;
    }

}


/* ==========================================================
   CONFIRMACIÓN GLOBAL
========================================================== */

.confirm-overlay {
    position: fixed;
    inset: 0;

    z-index: 100000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(20, 23, 38, 0.48);
    backdrop-filter: blur(2px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}


.confirm-modal {
    width: 100%;
    max-width: 430px;

    display: flex;
    align-items: flex-start;
    gap: 16px;

    padding: 24px;

    background: #ffffff;

    border-radius: 14px;

    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.20);

    transform: translateY(12px) scale(0.98);

    transition:
        transform 0.2s ease;
}


.confirm-overlay.show .confirm-modal {
    transform: translateY(0) scale(1);
}


/* ==========================================================
   ICONO
========================================================== */

.confirm-icon {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    font-size: 21px;
}


.confirm-warning .confirm-icon {
    color: #d97706;
    background: rgba(253, 151, 67, 0.15);
}


.confirm-success .confirm-icon {
    color: #2f9e57;
    background: rgba(47, 158, 87, 0.14);
}


.confirm-danger .confirm-icon {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
}


.confirm-info .confirm-icon {
    color: #383d63;
    background: rgba(56, 61, 99, 0.12);
}


/* ==========================================================
   CONTENIDO
========================================================== */

.confirm-body {
    flex: 1;
    min-width: 0;
}


.confirm-title {
    margin: 0 0 7px;

    color: #383d63;

    font-size: 16px;
    font-weight: 700;
}


.confirm-message.confirm-lista {
    margin-bottom: 8px;
    padding-left: 20px;
    list-style: disc;
}

.confirm-message {
    margin: 0;

    color: #666b7c;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* ==========================================================
   BOTONES
========================================================== */

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;

    margin-top: 22px;
}


.confirm-button {
    min-width: 92px;
    height: 38px;

    padding: 0 16px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}


.confirm-button:active {
    transform: scale(0.97);
}


.confirm-button-cancel {
    border: 1px solid #dfe1e8;

    background: #ffffff;
    color: #666b7c;
}


.confirm-button-cancel:hover {
    background: #f5f6f8;
    color: #383d63;
}


.confirm-button-accept {
    border: 1px solid #383d63;

    background: #383d63;
    color: #ffffff;
}


.confirm-button-accept:hover {
    background: #2e324f;
}


/* DESACTIVAR */

.confirm-warning .confirm-button-accept {
    border-color: #fd9743;
    background: #fd9743;
}


.confirm-warning .confirm-button-accept:hover {
    border-color: #ef8733;
    background: #ef8733;
}


/* ACTIVAR */

.confirm-success .confirm-button-accept {
    border-color: #2f9e57;
    background: #2f9e57;
}


.confirm-success .confirm-button-accept:hover {
    border-color: #27884b;
    background: #27884b;
}

/* =========================================================
    BLOQUEAR SCROLL CUANDO HAY CONFIRMACIÓN ABIERTA
========================================================= */

body.confirm-open {
    overflow: hidden;
}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 480px) {

    .confirm-modal {
        max-width: 100%;

        padding: 20px;

        gap: 13px;
    }


    .confirm-icon {
        width: 40px;
        height: 40px;

        flex-basis: 40px;

        font-size: 18px;
    }


    .confirm-actions {
        flex-direction: column-reverse;
    }


    .confirm-button {
        width: 100%;
    }
}
/* Indicadores de generación de documentos */
.documento-carga-logo {
    display: block;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    object-fit: contain;
    animation: documentoCargaGirar 1.2s linear infinite;
}

@keyframes documentoCargaGirar {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .documento-carga-logo { animation: none; }
}
