/* =====================================================================
   VENTANAS (modales) CON LA IMAGEN DE MARCA — todas las apps y SISU
   ---------------------------------------------------------------------
   Colores de SISU › Apariencia (variables --primary-*, --font-brand de
   theme.css / Apariencia::cabecera). Va sin #mainWrapper porque los
   modales se mueven al <body> para quedar por encima de la barra.
   Cubre los dos patrones que hay en las vistas:
     - Bootstrap: .modal-header / .modal-body / .modal-footer
     - Argon (SAT y demás MesaAyuda): .modal-body.p-0 > .card con
       .card-header bg-secondary / .card-body / .card-footer
   ===================================================================== */

body .modal .modal-content {
    border: 0 !important;
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(15, 40, 80, .22) !important;
    font-family: var(--font-brand, 'Poppins', 'Segoe UI', Arial, sans-serif);
    border-top: 5px solid var(--primary-800, #0a64a8) !important;
}

/* Encabezado: blanco, título sobrio, línea fina */
body .modal .modal-header,
body .modal .modal-body > .card > .card-header {
    background: #fff !important;
    color: #1f2937 !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 16px 22px !important;
    border-radius: 0 !important;
}
body .modal .modal-header .modal-title,
body .modal .modal-body > .card > .card-header h1,
body .modal .modal-body > .card > .card-header h2,
body .modal .modal-body > .card > .card-header h3,
body .modal .modal-body > .card > .card-header h4,
body .modal .modal-body > .card > .card-header h5,
body .modal .modal-body > .card > .card-header h6 {
    color: #1f2937 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    border: 0 !important;
    padding: 0 !important;
}
body .modal .modal-body > .card > .card-header .row { margin: 0; }
body .modal .modal-body > .card > .card-header .col-2 { display: flex; justify-content: flex-end; padding-right: 0; }
body .modal .btn-close { opacity: .55; box-shadow: none !important; }
body .modal .btn-close:hover { opacity: .9; }

/* La tarjeta interna (Argon) sin borde propio */
body .modal .modal-body.p-0 > .card { border: 0 !important; box-shadow: none !important; margin: 0 !important; border-radius: 0 !important; }
body .modal .modal-body > .card > .card-body { padding: 20px 22px !important; }

/* Cuerpo: etiquetas y campos como el resto del sistema */
body .modal .modal-body { color: #1f2937; }
body .modal .modal-body label,
body .modal .modal-body .form-control-label,
body .modal .modal-body .form-col-form-label {
    color: #4b5563 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
}
body .modal .modal-body .form-check-label,
body .modal .modal-body .form-check label { font-weight: 400 !important; font-size: 13px !important; }
body .modal .modal-body .form-control,
body .modal .modal-body .form-select,
body .modal .modal-body select {
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    color: #1f2937;
    box-shadow: none !important;
}
body .modal .modal-body .form-control:focus,
body .modal .modal-body .form-select:focus,
body .modal .modal-body select:focus {
    border-color: var(--primary-500, #2b9be8) !important;
    box-shadow: 0 0 0 3px var(--primary-100, #dbeefc) !important;
}
body .modal .modal-body .form-group { margin-bottom: 14px; }

/* Pie: acciones a la derecha, fondo suave */
body .modal .modal-footer,
body .modal .modal-body > .card > .card-footer {
    background: #f8fafc !important;
    border: 0 !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 12px 22px !important;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-radius: 0 !important;
}
body .modal .modal-footer .btn,
body .modal .card-footer .btn {
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 7px 18px !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
/* Acción principal (Guardar, Aplicar, Aceptar…): color principal de la marca */
body .modal .modal-footer .btn-primary,
body .modal .modal-footer .btn-success,
body .modal .card-footer .btn-primary,
body .modal .card-footer .btn-success {
    background: var(--primary-800, #0a64a8) !important;
    border: 1px solid var(--primary-800, #0a64a8) !important;
    color: #fff !important;
}
body .modal .modal-footer .btn-primary:hover,
body .modal .modal-footer .btn-success:hover,
body .modal .card-footer .btn-primary:hover,
body .modal .card-footer .btn-success:hover { background: var(--primary-900, #084c80) !important; border-color: var(--primary-900, #084c80) !important; }
/* Cerrar / Cancelar (lo que solo cierra la ventana): botón neutro */
body .modal .modal-footer [data-bs-dismiss="modal"],
body .modal .modal-footer [data-dismiss="modal"],
body .modal .modal-footer .btn-secondary,
body .modal .card-footer [data-bs-dismiss="modal"],
body .modal .card-footer [data-dismiss="modal"],
body .modal .card-footer .btn-secondary {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #4b5563 !important;
}
body .modal .modal-footer [data-bs-dismiss="modal"]:hover,
body .modal .modal-footer [data-dismiss="modal"]:hover,
body .modal .modal-footer .btn-secondary:hover,
body .modal .card-footer [data-bs-dismiss="modal"]:hover,
body .modal .card-footer [data-dismiss="modal"]:hover,
body .modal .card-footer .btn-secondary:hover { background: #f5f7fa !important; color: #1f2937 !important; }
/* Acciones destructivas que no son "cerrar" (Eliminar, Rechazar…): rojo de la marca */
body .modal .modal-footer .btn-danger:not([data-bs-dismiss]):not([data-dismiss]),
body .modal .card-footer .btn-danger:not([data-bs-dismiss]):not([data-dismiss]) {
    background: #b91c1c !important;
    border: 1px solid #b91c1c !important;
    color: #fff !important;
}

/* La ventana empieza debajo de la barra superior (si no, la franja de color se confunde con ella) */
body .modal .modal-dialog:not(.modal-dialog-centered) { margin-top: 76px; }

/* Fondo oscuro detrás de la ventana */
.modal-backdrop.show { opacity: .45 !important; }

/* ═══════════════════════════════════════════
   CONFIRMACIONES SweetAlert2 (SAT y demás MesaAyuda: "¿Está seguro de borrar?")
   Mismo criterio que las ventanas: acción con el color principal, NO neutro.
═══════════════════════════════════════════ */
body .swal2-popup {
    border-radius: 14px !important;
    border-top: 5px solid var(--primary-800, #0a64a8) !important;
    padding: 26px 24px 22px !important;
    font-family: var(--font-brand, 'Poppins', 'Segoe UI', Arial, sans-serif) !important;
    box-shadow: 0 18px 48px rgba(15, 40, 80, .22) !important;
}
body .swal2-popup .swal2-title { color: #1f2937 !important; font-size: 19px !important; font-weight: 600 !important; }
body .swal2-popup .swal2-content { color: #4b5563 !important; font-size: 14px !important; }
body .swal2-popup .swal2-icon.swal2-warning { border-color: #f59e0b !important; color: #f59e0b !important; }
body .swal2-popup .swal2-actions { gap: 10px; margin-top: 18px !important; }
body .swal2-popup .swal2-actions button.swal2-confirm,
body .swal2-popup .swal2-actions button.swal2-cancel {
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    padding: 8px 26px !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    min-width: 96px;
}
body .swal2-popup .swal2-actions button.swal2-confirm {
    background: var(--primary-800, #0a64a8) !important;
    border: 1px solid var(--primary-800, #0a64a8) !important;
    color: #fff !important;
}
body .swal2-popup .swal2-actions button.swal2-confirm:hover { background: var(--primary-900, #084c80) !important; }
body .swal2-popup .swal2-actions button.swal2-cancel {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #4b5563 !important;
}
body .swal2-popup .swal2-actions button.swal2-cancel:hover { background: #f5f7fa !important; color: #1f2937 !important; }
body .swal2-container.swal2-backdrop-show, body .swal2-container.swal2-shown { background: rgba(15, 23, 42, .45) !important; }
