/* Scroll only table body */
.dataTables_wrapper .table-responsive {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    /* position:sticky elements always create their own stacking context, and
       without a positioned ancestor here, that context can escape and render
       above unrelated absolutely-positioned siblings elsewhere on the page
       (e.g. the DataTables Buttons export dropdown) regardless of z-index.
       Establishing a low-z-index stacking context here contains the sticky
       thead so it can no longer out-rank content outside this wrapper. */
    position: relative;
    z-index: 1;
}

/* Sticky header */
.dataTables_wrapper .table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgb(243 244 246 / var(--tw-bg-opacity));
    border-bottom: 2px solid #ddd;
}

/* Force white background for Date column header */
.dataTables_wrapper .table-responsive thead th:nth-child(2) {
    background: rgb(243 244 246 / var(--tw-bg-opacity)) !important;
}

/* Also fix while sorting (important) */
.dataTables_wrapper .table-responsive thead th.sorting,
.dataTables_wrapper .table-responsive thead th.sorting_asc,
.dataTables_wrapper .table-responsive thead th.sorting_desc {
    background-color: rgb(243 244 246 / var(--tw-bg-opacity)) !important;
}

/* Fix checkbox column */
/* .dataTables_wrapper .table-responsive th:first-child,
.dataTables_wrapper .table-responsive td:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 11;
} */


.project_stock_exports .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.project_stock_exports .table-responsive .table {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}

/* Style the scrollbar for better visibility */
.project_stock_exports .table-responsive::-webkit-scrollbar {
    height: 8px;
    background-color: #f5f5f5;
}

.project_stock_exports .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.project_stock_exports .table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.project_stock_exports .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* For Firefox */
.project_stock_exports .table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Add to your view to override any hidden columns */
.project_stock_exports table th:nth-child(1),
.project_stock_exports table td:nth-child(1) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for DataTables fixed columns */
.dtfc-fixed-left {
    display: table-cell !important;
    position: relative !important;
}

/* Ensure all columns are visible */
.dataTable th,
.dataTable td {
    display: table-cell !important;
}