/* Centralized SweetAlert2 customization for the whole app */

div:where(.swal2-icon) {
   margin: 2em auto 2em !important;
}

/* ── Popup container ───────────────────────────────────────────── */
.swal2-theme-popup {
   border-radius: 1rem !important;
   /* matches .modal-content */
   font-family: var(--bs-body-font-family) !important;
   font-size: 1rem !important;
   padding: 1.5rem !important;
   color: var(--bs-body-color, #0f172a) !important;
   background: var(--bs-body-bg, #ffffff) !important;
   border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

/* ── Title ─────────────────────────────────────────────────────── */
.swal2-theme-popup .swal2-title {
   font-size: 1.2rem !important;
   font-weight: 700 !important;
   color: var(--bs-body-color, #0f172a) !important;
   padding: 0 !important;
   margin-bottom: 0.5rem !important;
}

/* ── Body text ─────────────────────────────────────────────────── */
.swal2-theme-popup .swal2-html-container {
   font-size: 0.9375rem !important;
   line-height: 1.5 !important;
   color: var(--bs-secondary-color, #64748b) !important;
   margin: 0 !important;
   padding: 0 !important;
}

/* ── Dark sidebar theme overrides ──────────────────────────────── */
body.sidebar-theme-dark .swal2-theme-popup {
   background: #242a35 !important;
   color: #eef2f7 !important;
   border: 1px solid #3b4658 !important;
}

body.sidebar-theme-dark .swal2-theme-popup .swal2-title {
   color: #eef2f7 !important;
}

body.sidebar-theme-dark .swal2-theme-popup .swal2-html-container {
   color: #a8b8d0 !important;
}

/* ── Shared button base (matches Bootstrap .btn sizing) ────────── */
.swal2-theme-popup .swal2-confirm,
.swal2-theme-popup .swal2-cancel,
.swal2-theme-popup .swal2-deny {
   border-radius: 0.6rem !important;
   padding: .375rem .9rem !important;
   font-size: 1rem !important;
   font-weight: 500 !important;
   line-height: 1.5 !important;
   min-width: 80px;
   transition: filter .15s ease, background-color .15s ease, border-color .15s ease;
}

/* ── Confirm / Deny → accent fill ──────────────────────────────── */
.swal2-theme-popup .swal2-confirm,
.swal2-theme-popup .swal2-deny {
   background-color: var(--app-accent) !important;
   border: 1px solid var(--app-accent) !important;
   color: #fff !important;
}

.swal2-theme-popup .swal2-confirm:not(:disabled):hover,
.swal2-theme-popup .swal2-deny:not(:disabled):hover {
   background-color: var(--app-accent) !important;
   border-color: var(--app-accent) !important;
   filter: brightness(0.88);
}

.swal2-theme-popup .swal2-confirm:focus,
.swal2-theme-popup .swal2-deny:focus {
   box-shadow: 0 0 0 3px var(--app-accent-muted) !important;
}

/* ── Cancel → outline-secondary style ─────────────────────────── */
.swal2-theme-popup .swal2-cancel {
   background: transparent !important;
   color: var(--bs-body-color, #0f172a) !important;
   box-shadow: none !important;
}

.swal2-theme-popup .swal2-cancel:not(:disabled):hover {
   background: rgba(15, 23, 42, 0.04) !important;
   border-color: #adb5bd !important;
   color: var(--bs-body-color, #0f172a) !important;
}

.swal2-theme-popup .swal2-cancel:focus {
   box-shadow: 0 0 0 3px var(--app-accent-muted) !important;
   border-color: #adb5bd !important;
}

body.sidebar-theme-dark .swal2-theme-popup .swal2-cancel {
   border-color: #3b4658 !important;
   color: #eef2f7 !important;
}

body.sidebar-theme-dark .swal2-theme-popup .swal2-cancel:not(:disabled):hover {
   background: rgba(255, 255, 255, 0.06) !important;
   border-color: #56677e !important;
}

/* ── Actions row ───────────────────────────────────────────────── */
.swal2-theme-popup .swal2-actions {
   display: flex !important;
   justify-content: flex-end !important;
   margin-top: 1.25rem !important;
   padding: 0 !important;
   width: 100% !important;
}

.swal2-theme-popup .swal2-cancel {
   order: 0;
}

.swal2-theme-popup .swal2-confirm,
.swal2-theme-popup .swal2-deny {
   order: 1;
}

/* ── Planning-specific variant ─────────────────────────────────── */
.planning-swal-popup {
   border-radius: 0.6rem !important;
   font-family: var(--bs-body-font-family) !important;
}

body.sidebar-theme-dark .planning-swal-popup {
   background: #242a35 !important;
   color: #eef2f7 !important;
   border: 1px solid #3b4658 !important;
}

/* ── Stack above Bootstrap modals ──────────────────────────────── */
.swal2-container {
   z-index: 2100 !important;
}