/* Shared Bootstrap-inspired modal cards, using the current theme. */
:root{--modal-danger:#b42335;--modal-danger-bg:#c52d40;--modal-danger-text:#fff;--modal-primary:#087447;--modal-primary-text:#fff;--modal-shadow:0 24px 70px #0004}
html[data-theme=dark]{--modal-danger:#ff9ca7;--modal-danger-bg:#b83246;--modal-primary:#77e3ad;--modal-primary-text:#102918;color-scheme:dark}
html[data-theme=light]{color-scheme:light}
html[data-theme] .admin-body #logout{color:var(--aink)!important;background:transparent;border:1px solid var(--aline);white-space:nowrap}
html[data-theme] .admin-body #logout:hover{background:var(--abg);border-color:var(--accent);color:var(--accent)!important}
html[data-theme] .admin-body .small-btn.danger{color:var(--modal-danger)!important}
.admin-body dialog.modal-card{width:min(540px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:0;margin:auto;border-radius:14px;box-shadow:var(--modal-shadow);overflow:auto;overscroll-behavior:contain}
.admin-body dialog.modal-card::backdrop{background:rgba(5,12,22,.65);backdrop-filter:blur(3px)}
.modal-card .dialog-head{padding:18px 22px;border-bottom:1px solid var(--aline);margin:0;gap:16px;background:var(--asurface)}
.modal-card .dialog-head h2{font-size:19px;font-weight:700;line-height:1.4;color:var(--aink)}
.modal-card .dialog-head button{width:34px;height:34px;border-radius:8px;display:grid;place-items:center;line-height:1;color:var(--asub);background:var(--abg);border:1px solid var(--aline);flex-shrink:0}
.modal-card form{margin:0}.modal-card .modal-fields{padding:18px 22px;display:grid;gap:14px}.admin-body .modal-fields label{margin:0;font-weight:600;color:var(--aink)}
.modal-fields input:not([type=checkbox]),.modal-fields select,.modal-fields textarea{display:block;width:100%;margin-top:6px;min-height:42px;font:inherit;font-weight:400}.modal-fields textarea{min-height:100px;resize:vertical}.modal-fields input:focus,.modal-fields select:focus,.modal-fields textarea:focus{outline:0;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent)}
.modal-fields .check{padding:12px;border:1px solid var(--aline);border-radius:8px;background:var(--abg)}.modal-fields input[type=checkbox]{accent-color:var(--accent)}
.modal-card .modal-footer{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:14px 22px;border-top:1px solid var(--aline);background:var(--asurface)}
html[data-theme] .admin-body .modal-footer .btn.outline{color:var(--aink)!important;background:transparent;border:1px solid var(--aline)}
html[data-theme] .admin-body .modal-footer .btn:not(.outline){background:var(--modal-primary);color:var(--modal-primary-text)!important}
/* SweetAlert2: consistent header, body and footer, without default colored buttons. */
html[data-theme] .swal2-popup{--pop-surface:var(--dark);--pop-ink:var(--text);--pop-muted:var(--muted);--pop-line:var(--line);--pop-bg:var(--bg);background:var(--pop-surface)!important;color:var(--pop-ink)!important;border:1px solid var(--pop-line);border-radius:14px!important;padding:0;width:min(480px,100%);box-shadow:var(--modal-shadow);overflow:hidden;font-family:inherit}
html[data-theme] .admin-body .swal2-popup{--pop-surface:var(--asurface);--pop-ink:var(--aink);--pop-muted:var(--asub);--pop-line:var(--aline);--pop-bg:var(--abg)}
html[data-theme] .swal2-popup .swal2-title{color:var(--pop-ink);font-size:21px;font-weight:700;padding:12px 22px 0;margin:0;line-height:1.35}
html[data-theme] .swal2-popup .swal2-html-container{color:var(--pop-muted);font-size:15px;line-height:1.55;padding:10px 24px 22px;margin:0;overflow-wrap:anywhere}
html[data-theme] .swal2-popup .swal2-icon{margin:24px auto 0;scale:.85}
html[data-theme] .swal2-popup .swal2-actions{width:100%;margin:20px 0 0;padding:14px 20px;justify-content:flex-end;gap:8px;border-top:1px solid var(--pop-line);background:var(--pop-bg);box-sizing:border-box}
html[data-theme] .swal2-popup .swal2-styled{margin:0;padding:10px 16px;border-radius:8px;font:inherit;font-size:14px;font-weight:650;box-shadow:none}
html[data-theme] .swal2-popup .swal2-confirm{background:var(--modal-primary)!important;color:var(--modal-primary-text)!important;border:1px solid transparent}
html[data-theme] .swal2-popup .swal2-confirm.is-danger{background:var(--modal-danger-bg)!important;color:var(--modal-danger-text)!important}
html[data-theme] .swal2-popup .swal2-cancel{background:var(--pop-surface)!important;color:var(--pop-ink)!important;border:1px solid var(--pop-line)}
html[data-theme] .swal2-popup .swal2-close{color:var(--pop-muted)}
html[data-theme] .swal2-popup .swal2-styled:focus-visible{outline:3px solid var(--modal-primary);outline-offset:2px}
html[data-theme] .swal2-container.swal2-backdrop-show{background:rgba(5,12,22,.65);backdrop-filter:blur(3px)}
@media(max-width:480px){.modal-card .dialog-head,.modal-card .modal-fields,.modal-card .modal-footer{padding:14px 16px}.modal-card .modal-footer .btn{flex:1}.swal2-popup .swal2-actions .swal2-styled{flex:1}}
