/* ============================================================
   SMARTNEXO ERP - Sistema visual único y reutilizable para
   confirmaciones y alertas simples (SweetAlert2).

   Se carga UNA sola vez (vistas/plantilla.php) después de Bootstrap,
   AdminLTE, SweetAlert2 y tema-global-azul.css, para poder ganarle a
   ".swal2-styled.swal2-confirm { background-color: var(--color-primario)
   !important; }" (esa regla vive en tema-global-azul.css y por defecto
   pinta TODOS los botones de confirmación de SweetAlert2 del sistema de
   azul - por eso los selectores de botón de aquí abajo usan 3 clases,
   no 2, para ganar ese empate de especificidad de forma confiable sin
   depender del orden de carga).

   Uso: agregar customClass:{popup:'smartnexo-confirm', confirmButton:
   'smartnexo-btn-danger', cancelButton:'smartnexo-btn-cancel', ...} en
   cada Swal.fire(). No se edita ningún archivo de SweetAlert2/Bootstrap/
   AdminLTE, esto es 100% adicional.

   NO usar para modales con formularios, tablas, PDFs, XML/CDR, mapas,
   imágenes o más de 3 campos - esos mantienen su propio tamaño.
   ============================================================ */

/* ============ VENTANA DE CONFIRMACIÓN COMPACTA ============ */
.smartnexo-confirm {
    width: 390px !important;
    max-width: calc(100vw - 28px) !important;
    padding: 22px !important;
    border: 1px solid #dfe6f1 !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #17213a !important;
    box-shadow: 0 24px 65px rgba(8, 16, 47, 0.20) !important;
}

.smartnexo-confirm .swal2-title {
    margin: 0 !important;
    padding: 0 !important;
    color: #17213a !important;
    font-size: 18px !important;
    font-weight: 750 !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

.smartnexo-confirm .swal2-html-container {
    margin: 12px 0 0 !important;
    padding: 0 !important;
    color: #5f6d85 !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    text-align: left !important;
}

.smartnexo-confirm .swal2-actions {
    width: 100% !important;
    margin: 20px 0 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.smartnexo-confirm .swal2-close {
    color: #9aa8be !important;
    font-size: 22px !important;
}

.smartnexo-confirm .swal2-close:hover {
    color: #526079 !important;
}

/* No usar el ícono gigante por defecto de SweetAlert2 en confirmaciones
   compactas - se oculta y se reemplaza por HTML propio (.smartnexo-alert-*
   dentro del html/htmlContainer de cada Swal.fire). */
.smartnexo-confirm .swal2-icon {
    display: none !important;
}

/* ============ OVERLAY ============ */
.swal2-container.smartnexo-overlay {
    background: rgba(8, 16, 47, 0.38) !important;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

/* ============ ÍCONO PERSONALIZADO (HTML propio, círculo 42px) ============ */
.smartnexo-alert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 24px;
}

.smartnexo-alert-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 19px;
}

.smartnexo-icon-success {
    color: #16a36a;
    background: #ecfdf3;
}

.smartnexo-icon-danger {
    color: #dc3545;
    background: #fff1f2;
}

.smartnexo-icon-warning {
    color: #c47b00;
    background: #fff8e6;
}

.smartnexo-icon-info {
    color: #0253e1;
    background: #edf5ff;
}

.smartnexo-alert-title {
    margin: 0;
    font-size: 18px;
    font-weight: 750;
    color: #17213a;
    line-height: 1.3;
}

.smartnexo-alert-desc {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #5f6d85;
    text-align: left;
}

/* ============ BOTONES ============ */
.smartnexo-confirm .swal2-styled.smartnexo-btn {
    min-height: 40px !important;
    padding: 0 17px !important;
    margin: 0 !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-cancel {
    color: #526079 !important;
    background: #ffffff !important;
    border: 1px solid #cfd8e6 !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-cancel:hover {
    background: #f7f9fc !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-success {
    color: #ffffff !important;
    background: #16a36a !important;
    border: 1px solid #16a36a !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-success:hover {
    background: #128a58 !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-danger {
    color: #ffffff !important;
    background: #dc3545 !important;
    border: 1px solid #dc3545 !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-danger:hover {
    background: #c8303f !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0253e1, #003fbb) !important;
    border: 1px solid #0253e1 !important;
}

.smartnexo-confirm .swal2-styled.smartnexo-btn-primary:hover {
    filter: brightness(1.06);
}

/* ============ TOASTS (resultado de una operación) ============
   Reemplazan el Swal.fire centrado con botón "OK" de siempre. Mismo
   tamaño/posición para los 4 tipos, solo cambia el color según el
   resultado (regla semántica obligatoria). */
.smartnexo-toast {
    width: 350px !important;
    max-width: calc(100vw - 28px) !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38) !important;
    color: #ffffff !important;
}

.smartnexo-toast .swal2-title {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-align: left !important;
}

.smartnexo-toast .swal2-html-container {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    text-align: left !important;
}

.smartnexo-toast .swal2-close {
    color: #ffffff !important;
    opacity: 0.85 !important;
}

.smartnexo-toast .swal2-close:hover {
    opacity: 1 !important;
}

/* Éxito: verde esmeralda */
.smartnexo-toast-success {
    background: linear-gradient(135deg, #087a55, #0c9b68) !important;
    border: 1px solid rgba(70, 223, 158, 0.35) !important;
}

.smartnexo-toast-success .swal2-timer-progress-bar {
    background: #7CF5C4 !important;
}

.smartnexo-toast-success .swal2-success-ring {
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.smartnexo-toast-success .swal2-success-line-tip,
.smartnexo-toast-success .swal2-success-line-long {
    background-color: #e9fff5 !important;
}

/* Rechazo / eliminación: rojo */
.smartnexo-toast-danger {
    background: linear-gradient(135deg, #b42335, #dc3545) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.smartnexo-toast-danger .swal2-timer-progress-bar {
    background: #ffffff !important;
}

/* Error: rojo oscuro (más oscuro que "rechazo" para diferenciarse -
   duración mínima recomendada 6s se controla desde el JS de cada Swal) */
.smartnexo-toast-error {
    background: linear-gradient(135deg, #7a1626, #8f1f2e) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.smartnexo-toast-error .swal2-timer-progress-bar {
    background: #ffb3ba !important;
}

/* Información: azul eléctrico */
.smartnexo-toast-info {
    background: linear-gradient(135deg, #0253e1, #003fbb) !important;
    border: 1px solid rgba(114, 168, 255, 0.4) !important;
}

.smartnexo-toast-info .swal2-timer-progress-bar {
    background: #a9c8ff !important;
}

/* Advertencia: amarillo oscuro */
.smartnexo-toast-warning {
    background: linear-gradient(135deg, #9a6700, #c47b00) !important;
    border: 1px solid rgba(255, 214, 130, 0.4) !important;
}

.smartnexo-toast-warning .swal2-timer-progress-bar {
    background: #ffe4a8 !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
    .smartnexo-confirm {
        width: calc(100vw - 28px) !important;
        padding: 20px !important;
    }

    .smartnexo-confirm .swal2-actions {
        flex-direction: column-reverse !important;
    }

    .smartnexo-confirm .swal2-actions button {
        width: 100% !important;
    }

    .smartnexo-toast {
        width: calc(100vw - 28px) !important;
        margin: 14px !important;
    }
}
