/* ===============================
   MODAL FULLSCREEN CUSTOM - WORKING
   =============================== */

/* MODAL BASE */
.modal.modal-fullscreen-custom {
    position: fixed;
    inset: 0;
    z-index: 1055 !important;
}

/* BACKDROP NORMAL */
.modal-backdrop {
    z-index: 1050 !important;
}

/* DIALOG CENTER */
.modal-dialog.modal-fullscreen-custom {
    width: 98%;
    max-width: 98%;
    margin: 20px auto;
    pointer-events: auto;
}

/* CONTENT */
.modal-fullscreen-custom .modal-content {
    height: calc(100vh - 20px);
    /* FIX tinggi */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* BODY SCROLL */
.modal.modal-fullscreen-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1055 !important;
    overflow-y: auto;
    /* INI KUNCI */
}

.modal-dialog.modal-fullscreen-custom {
    pointer-events: auto;
}

.modal-fullscreen-custom .modal-body {
    flex: 1;
    overflow-y: auto;
}

/* PASTIKAN MODAL PALING ATAS & INTERAKTIF */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* INI KUNCI: paksa semua isi modal bisa diklik */
.modal * {
    pointer-events: auto !important;
}

/* DATA TABLE JANGAN NGAMBIL LAYER */
.dataTables_wrapper {
    position: relative !important;
    z-index: 1 !important;
}

/* HEADER */
.modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

/* FOOTER */
.modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}

/* MOBILE FIX */
@media (max-width: 768px) {

    .modal-dialog.modal-fullscreen-custom {
        margin: 93px 5px 5px 5px;
        /* kasih jarak dari atas, kiri, bawah, kanan */
    }

    .modal-fullscreen-custom .modal-content {
        height: calc(100vh - 80px);
        /* bukan max-height */
        border-radius: 8px;
    }

    .modal-fullscreen-custom .modal-body {
        overflow-y: auto;
        padding-bottom: 60px;
        /* biar tidak ketutup bawah */
    }
}