/* Wrapper harus bisa scroll */
.fi-ta-content {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

/* Sticky header */
.fi-ta-table thead tr {
    position: sticky;
    top: 0;
    z-index: 10; 
    background: white;
}

/* Sticky kolom kiri (No SPDD) */
.sticky-col {
    position: sticky;
    width: 60px;
    left: 0;
    z-index: 5; 
    /*background: white;*/
}

.sticky-col-2 {
    position: sticky !important;
    left: 60px;
    z-index: 5;
    background-color: white;
}

tr:nth-child(even) .sticky-col-2 {
    background-color: #fafafa;
}

.fi-ta-table thead tr th.sticky-col,
.fi-ta-table thead tr th.sticky-col-2 {
    z-index: 60;
}

.dark .sticky-col-2 {
    background-color: #18181b;
}
.dark tr:nth-child(odd) .sticky-col-2 {
    background-color: #18181b; 
}

.dark tr:nth-child(even) .sticky-col-2 {
    background-color: #242427;
}

.dark .fi-fo-table-repeater thead th {
    background-color: #18181b !important; /* abu gelap */
    color: #f3f4f6 !important;            /* teks terang */
}
.dark .aw-table-repeater-container th {
    background-color: #18181b !important; /* Warna abu gelap */
    color: #f3f4f6 !important;           /* Warna teks terang */
    border-color: #374151 !important;    /* Warna border agar tidak kontras */
}

/* Jika Anda ingin baris di dalam repeater juga menyesuaikan saat Dark Mode */
.dark .aw-table-repeater-container td {
    background-color: #111827; /* Lebih gelap dari header */
}
tr:nth-child(even) .sticky-col {
    background-color: #fafafa; /* abu-abu muda untuk baris genap */
}
.dark .custom-header-dark th {
    background-color: #18181b !important;
    color: #f3f4f6 !important;
    border-bottom: 1px solid #3f3f46; 
}

/* Memperbaiki pojok kiri atas */
.dark .custom-header-dark th:first-child {
    border-top-right-radius: 1.0rem; /* Sesuaikan dengan radius repeater kamu */
}

/* Memperbaiki pojok kanan atas */
.dark .custom-header-dark th:last-child {
    border-top-right-radius: 1.0rem; /* Sesuaikan dengan radius repeater kamu */
}
.dark .custom-header-dark th:first-child {
    border-top-left-radius: 1.0rem; /* Sesuaikan dengan radius repeater kamu */
}

/* Memperbaiki pojok kanan atas */
.dark .custom-header-dark th:last-child {
    border-top-left-radius: 1.0rem; /* Sesuaikan dengan radius repeater kamu */
}

tr:nth-child(odd) .sticky-col {
    background-color: #ffffff; /* putih untuk baris ganjil */
}
.dark .fi-ta-table thead tr {
    background-color:#18181b; 
}
.dark .sticky-col {
    background-color: #18181b; 
}
.dark tr:nth-child(odd) .sticky-col {
    background-color: #18181b; 
}

/* Baris Genap di Dark Mode */
.dark tr:nth-child(even) .sticky-col {
    background-color: #242427;
}

.fi-modal-window, 
.fi-modal-backdrop {
    z-index: 9999;
}

/* ==========================================================================
   PENGATURAN TABEL SECARA GLOBAL
   ========================================================================== */

/* Batasi tinggi tabel agar header atas tetap sticky saat di-scroll vertikal */
.fi-ta-content {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

/* Sticky header atas tabel (Wajib background agar data tidak menembus saat di-scroll) */
/*.fi-ta-table thead tr {*/
/*    position: sticky;*/
/*    top: 0;*/
/*    z-index: 5; */
/*    background-color: white;*/
/*}*/

.dark .fi-ta-table thead tr {
    background-color: #18181b; 
}


@media (max-width: 768px) {
    .sticky-col,
    .sticky-col-2 {
        position: static !important;
        left: auto !important;
        z-index: auto !important;
    }
}
