/* Rescue-wide row and bulk deletion controls. */
body.change-list #result_list .jm-row-delete-heading,
body.change-list #result_list .jm-row-delete-cell {
    box-sizing: border-box;
    min-width: 70px;
    padding-left: 8px;
    padding-right: 8px;
    text-align: center;
    width: 70px;
}

.jm-row-delete-button,
.jm-bulk-delete-button {
    align-items: center;
    appearance: none;
    border: 1px solid #b83b3b;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.jm-row-delete-button {
    background: color-mix(in srgb, #b83b3b 10%, transparent);
    color: #a52e2e;
    height: 38px;
    margin: 0 auto;
    padding: 0;
    width: 38px;
}

.jm-row-delete-button:hover,
.jm-row-delete-button:focus-visible,
.jm-bulk-delete-button:hover,
.jm-bulk-delete-button:focus-visible {
    background: #a52e2e;
    box-shadow: 0 5px 16px rgba(118, 22, 22, .25);
    color: #ffffff;
    outline: 2px solid #e0ad31;
    outline-offset: 2px;
    transform: translateY(-1px);
}

.jm-row-delete-button svg,
.jm-bulk-delete-button svg,
.jm-admin-delete-modal__confirm svg,
.jm-admin-delete-modal__icon svg {
    height: 18px;
    pointer-events: none;
    width: 18px;
}

.jm-bulk-delete-button {
    background: #fff4f2;
    color: #9d2929;
    gap: 7px;
    margin-left: 8px;
    min-height: 36px;
    padding: 7px 13px;
}

.jm-admin-delete-modal[hidden] {
    display: none;
}

.jm-admin-delete-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 22px;
    position: fixed;
    z-index: 10000;
}

.jm-admin-delete-modal__backdrop {
    background: rgba(5, 16, 29, .72);
    inset: 0;
    position: absolute;
}

.jm-admin-delete-modal__dialog {
    background: var(--body-bg, #ffffff);
    border: 1px solid var(--hairline-color, #d6d6d6);
    border-radius: 20px;
    box-shadow: 0 28px 78px rgba(0, 0, 0, .34);
    box-sizing: border-box;
    color: var(--body-fg, #222222);
    max-width: 520px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.jm-admin-delete-modal__header {
    align-items: center;
    background: linear-gradient(135deg, #fff5f2, #ffffff);
    border-bottom: 1px solid #f0ceca;
    display: flex;
    gap: 14px;
    padding: 21px 23px 18px;
}

.jm-admin-delete-modal__icon {
    align-items: center;
    background: #a52e2e;
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.jm-admin-delete-modal__eyebrow {
    color: #8b4540;
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .09em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.jm-admin-delete-modal__header h2 {
    color: var(--body-fg, #222222);
    font-size: 21px;
    line-height: 1.2;
    margin: 0;
}

.jm-admin-delete-modal__body {
    padding: 21px 23px;
}

.jm-admin-delete-modal__body p {
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

.jm-admin-delete-modal__item {
    color: var(--body-fg, #222222);
    display: block;
    font-size: 16px;
    font-weight: 800;
    margin: 8px 0 13px;
    overflow-wrap: anywhere;
}

.jm-admin-delete-modal__warning {
    color: var(--body-quiet-color, #666666);
    font-size: 12px !important;
}

.jm-admin-delete-modal__actions {
    align-items: center;
    background: color-mix(in srgb, var(--body-bg, #ffffff) 94%, var(--body-fg, #222222));
    border-top: 1px solid var(--hairline-color, #d6d6d6);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 23px;
}

.jm-admin-delete-modal__actions button {
    align-items: center;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    gap: 7px;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
}

.jm-admin-delete-modal__cancel {
    background: var(--body-bg, #ffffff);
    border: 1px solid var(--border-color, #cccccc);
    color: var(--body-fg, #222222);
}

.jm-admin-delete-modal__confirm {
    background: #a52e2e;
    border: 1px solid #8e2525;
    color: #ffffff;
}

body.jm-admin-delete-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .jm-bulk-delete-button {
        margin: 8px 0 0;
        width: 100%;
    }

    .jm-admin-delete-modal {
        padding: 14px;
    }

    .jm-admin-delete-modal__actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .jm-admin-delete-modal__actions button {
        width: 100%;
    }
}

/* BEGIN HIDE NATIVE BULK ACTION UI */
/*
 * Keep Django's selection checkboxes and delete action available so
 * the custom top and row trash buttons continue to work. Hide only
 * Django's native Action dropdown, Run button, and selected counter.
 */
#changelist-form .actions label,
#changelist-form .actions select[name="action"],
#changelist-form .actions button[type="submit"]:not(.jm-bulk-delete-button),
#changelist-form .actions input[type="submit"],
#changelist-form .actions .action-counter {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

#changelist-form .actions {
    align-items: center;
    display: flex !important;
    min-height: 44px;
}

#changelist-form .actions .jm-bulk-delete-button {
    margin-left: 0;
}
/* END HIDE NATIVE BULK ACTION UI */
