/* Los diálogos de SweetAlert2 con el tema de Nexus (7-oct-2026).

   SweetAlert pinta su ventana siempre blanca y no sabe del tema de la app: con el tema oscuro puesto, cada
   confirmación, cada «Elegí el motivo» y cada aviso salía como un cuadro blanco encandilando sobre la
   pantalla oscura. Hasta ahora sólo Vínculo de depósitos lo arreglaba (vinculo-depositos.css), para sus
   modales y nada más.

   Va como hoja global, cargada por _Layout, y no repetida en cada pantalla: así alcanza a todos los
   diálogos de Nexus —los que ya existen y los que se escriban— sin tocarlos uno por uno. El tema claro es el
   de SweetAlert por defecto y no se toca.

   Los colores salen de los tokens de app.css (--bg-white, --text-primary…), que ya cambian con
   data-bs-theme; los valores de respaldo son los mismos del tema oscuro. */

[data-bs-theme="dark"] .swal2-popup {
    background: var(--bg-white, #1e1e1e);
    color: var(--text-primary, #f5f5f5);
    border: 1px solid var(--border-color, rgba(255, 255, 255, .15));
    color-scheme: dark;   /* barras de desplazamiento y controles nativos oscuros */
}
[data-bs-theme="dark"] .swal2-title { color: var(--text-primary, #f5f5f5); }
[data-bs-theme="dark"] .swal2-html-container { color: var(--text-secondary, #d4d4d8); }
[data-bs-theme="dark"] .swal2-close { color: var(--text-secondary, #a1a1aa); }
[data-bs-theme="dark"] .swal2-close:hover { color: var(--text-primary, #f5f5f5); }
[data-bs-theme="dark"] .swal2-footer { border-top-color: var(--border-color, rgba(255, 255, 255, .15)); color: var(--text-secondary, #a1a1aa); }

/* Controles de adentro: los de SweetAlert y los de Bootstrap que casi todas las pantallas meten en html:. */
[data-bs-theme="dark"] .swal2-input,
[data-bs-theme="dark"] .swal2-textarea,
[data-bs-theme="dark"] .swal2-select,
[data-bs-theme="dark"] .swal2-popup .form-control,
[data-bs-theme="dark"] .swal2-popup .form-select,
[data-bs-theme="dark"] .swal2-popup select,
[data-bs-theme="dark"] .swal2-popup textarea,
[data-bs-theme="dark"] .swal2-popup input:not([type="checkbox"]):not([type="radio"]) {
    background-color: #2a2e33;
    color: var(--text-primary, #f5f5f5);
    border-color: rgba(255, 255, 255, .18);
}
[data-bs-theme="dark"] .swal2-popup option { background: #2a2e33; color: var(--text-primary, #f5f5f5); }
[data-bs-theme="dark"] .swal2-input::placeholder,
[data-bs-theme="dark"] .swal2-textarea::placeholder,
[data-bs-theme="dark"] .swal2-popup .form-control::placeholder,
[data-bs-theme="dark"] .swal2-popup textarea::placeholder { color: #8b8f96; opacity: 1; }
[data-bs-theme="dark"] .swal2-input:focus,
[data-bs-theme="dark"] .swal2-textarea:focus,
[data-bs-theme="dark"] .swal2-popup .form-control:focus,
[data-bs-theme="dark"] .swal2-popup .form-select:focus,
[data-bs-theme="dark"] .swal2-popup textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .25);
}

[data-bs-theme="dark"] .swal2-validation-message { background: #2a2e33; color: #fca5a5; }
[data-bs-theme="dark"] .swal2-popup .form-text,
[data-bs-theme="dark"] .swal2-popup .text-muted { color: var(--text-secondary, #bdbdbd) !important; }
[data-bs-theme="dark"] .swal2-popup .small { color: inherit; }
[data-bs-theme="dark"] .swal2-popup .swal2-checkbox,
[data-bs-theme="dark"] .swal2-popup .swal2-radio,
[data-bs-theme="dark"] .swal2-popup label { color: var(--text-primary, #f5f5f5); }

/* El ícono de «éxito»: SweetAlert le pone cuñas blancas fijas para simular la rotación del círculo. */
[data-bs-theme="dark"] .swal2-popup .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
[data-bs-theme="dark"] .swal2-popup .swal2-icon.swal2-success .swal2-success-fix {
    background: var(--bg-white, #1e1e1e);
}

/* Los avisos de adentro: app.css los deja con su fondo claro, que en la ventana oscura encandila. */
[data-bs-theme="dark"] .swal2-popup .alert-warning {
    background: rgba(250, 204, 21, .08);
    border-color: rgba(250, 204, 21, .35);
    color: #fcd34d;
}
[data-bs-theme="dark"] .swal2-popup .alert-info {
    background: rgba(56, 189, 248, .08);
    border-color: rgba(56, 189, 248, .35);
    color: #7dd3fc;
}
[data-bs-theme="dark"] .swal2-popup .alert-danger {
    background: rgba(248, 113, 113, .08);
    border-color: rgba(248, 113, 113, .38);
    color: #fca5a5;
}
[data-bs-theme="dark"] .swal2-popup .alert-success {
    background: rgba(74, 222, 128, .08);
    border-color: rgba(74, 222, 128, .35);
    color: #86efac;
}

/* Los botones de SweetAlert ya traen su color; sólo el «Cancelar» gris necesita contraste. */
[data-bs-theme="dark"] .swal2-popup .swal2-cancel:not([style*="background-color"]) { background-color: #4b5563; }
