.modal {
    z-index: 2100;
}

body:has(.wdk-table.fullscreen) .modal {
    z-index: 999999999 !important;
}

.modal-backdrop {
    z-index: 2099;
}

.modal-content {
    max-height: calc(100vh - 60px);
    border-radius: var(--radius-large);
    box-shadow: 10px 10px 20px rgba(0, 0, 0, .5);
}

.modal .modal-body {
    padding: 16px 24px;
    background-color: var(--modal-drawer-body-background-color);
}

.modal-body-overflow {
    max-height: calc(100vh - 194px);
    overflow: hidden auto;
}

.modal .modal-body {
    scrollbar-width: thin !important;
}

.modal .modal-body * strong {
    font-weight: bold !important;
}

.modal .modal-body::-webkit-scrollbar-track {
    background-color: var(--white-02) !important;
    -webkit-box-shadow: inset 0 0 6px var(--white-02) !important;
    box-shadow: inset 0 0 6px var(--white-02) !important;
}

.modal .modal-body::-webkit-scrollbar {
    background-color: var(--white-02) !important;
    width: 5px !important;
    height: 5px;
}

.modal .modal-body::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb-base-custom-color) !important;
    border-radius: 10px;
}

.modal .modal-header {
    min-height: 56px;
    padding: 16px 24px;
    background-color: var(--modal-drawer-header-footer-background-color);
    border-radius: 16px 16px 0px 0px;
    border-bottom: none;
}

.modal .modal-title {
    font-size: 1rem;
    color: var(--modal-drawer-header-title-color);
}

.modal .modal-footer {
    padding: 16px;
    border-radius: 0px 0px 16px 16px;
    background-color: var(--modal-drawer-header-footer-background-color);
    border-top: none;
}

/*--------------------------------------------------------
Mobile
---------------------------------------------------------*/

@media (max-width: 576px) {
    .modal-body-overflow {
        max-height: 100%;
        overflow: auto;
    }

    .modal .modal-body {
        overflow: auto;
    }

    .modal .modal-dialog {
        display: block;
    }

    .modal .modal-dialog .modal-content {
        position: fixed;
        display: flex;
        flex-direction: column;
        top: 0;
        left: 0;
        height: 101%;
        width: 101%;
        max-width: 520px;
        background-color: var(--white-01);
        max-height: initial;
        margin: -2px 0 0 -1px;
        border-radius: 0;
        box-shadow: 0 2px 6px #777;
        transition: 0.4s;
        overflow: auto;
        z-index: 7014;
    }

    .modal .modal-dialog .modal-content .modal-header {
        border-radius: 0;
    }

    .modal .modal-dialog .modal-content form {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .modal .modal-dialog .modal-content form .modal-body,
    .modal .modal-dialog .modal-content .modal-body {
        position: relative;
        height: initial;
        flex-grow: 1;
        padding: 1.5rem;
        overflow: hidden auto;
    }

    .modal .modal-dialog .modal-content form .modal-footer,
    .modal .modal-dialog .modal-content .modal-footer {
        display: flex;
        position: relative;
        justify-content: flex-end;
        padding: 16px;
        border-radius: 0;
    }
}

/*--------------------------------------------------------
Fixes
---------------------------------------------------------*/

/* Code duplicate on top of this style sheet. Delete if no UI crash  */
.modal {
    z-index: 10002 !important;
}

.modal-backdrop {
    z-index: 10001 !important;
}

/* Modal avatar upload */
.modal-avatar-upload ~ .modal-body {
    padding: 0 !important;
    background-color: var(--background);
}

.modal-avatar-upload ~ .modal-body iframe {
    height: 400px !important;
    min-width: 99%;
}

.modal-avatar-upload ~ .modal-body iframe body {
    background-color: white !important;
}

.modal-avatar-upload ~ .modal-body .wdk-layout-content {
    padding: 0 !important;
}

.modal-avatar-upload ~ .modal-body iframe body .wdk-layout-content center img {
    max-height: 400px !important;
}
/* END - Modal avatar upload */

/* Modal MustRead */
.jumbotron.minimalist {
    padding: 12px 24px;
    font-size: 14px;
}

@media (max-width: 576px) {
    .jumbotron.minimalist {
        padding: 12px;
    }
    .jumbotron.minimalist .wdk-title {
        overflow-wrap: anywhere;
    }
}
/* END - Modal MustRead */
