/**
 * Tableaux .table-responsive* : scroll horizontal + fond des en-têtes.
 * Épinglage au scroll : public/js/sticky-table-headers.js (thead fixed + spacer).
 */

.table-responsive,
.table-responsive-sm,
.table-responsive-md,
.table-responsive-lg,
.table-responsive-xl,
.table-responsive-xxl {
    overflow-x: auto !important;
    overflow-y: clip !important;
    -webkit-overflow-scrolling: touch;
}

@supports not (overflow: clip) {
    .table-responsive,
    .table-responsive-sm,
    .table-responsive-md,
    .table-responsive-lg,
    .table-responsive-xl,
    .table-responsive-xxl {
        overflow-y: visible !important;
    }
}

.table-responsive > .table,
.table-responsive-sm > .table,
.table-responsive-md > .table,
.table-responsive-lg > .table,
.table-responsive-xl > .table,
.table-responsive-xxl > .table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table > thead > tr > th,
.table thead th {
    background-color: var(--bs-table-bg, var(--bs-body-bg));
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 var(--bs-table-border-color, var(--bs-border-color-translucent, rgba(0, 0, 0, 0.12)));
}

.card .table > thead > tr > th,
.card .table thead th {
    background-color: var(--bs-card-bg, var(--bs-table-bg, var(--bs-body-bg)));
}

[data-bs-theme='dark'] .table > thead > tr > th,
[data-bs-theme='dark'] .table thead th {
    background-color: var(--bs-card-bg, var(--bs-body-bg));
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

/* Thead épinglé par JS (évite les bugs display avec fixed) */
table thead.js-thead-pinned {
    display: table;
    table-layout: fixed;
    background-color: var(--bs-card-bg, var(--bs-table-bg, var(--bs-body-bg)));
    box-shadow: 0 1px 0 var(--bs-border-color-translucent, rgba(0, 0, 0, 0.12));
}

[data-bs-theme='dark'] table thead.js-thead-pinned {
    background-color: var(--bs-card-bg, var(--bs-body-bg));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

table thead.js-thead-pinned tr {
    transform: none !important;
}

.js-sticky-thead-spacer {
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    pointer-events: none;
}

.table-responsive .table,
.table-responsive-sm > .table,
.table-responsive-md > .table,
.table-responsive-lg > .table,
.table-responsive-xl > .table,
.table-responsive-xxl > .table {
    margin-bottom: 0;
}

/* Tableaux larges : pas d’épinglage JS (évite sauts de scroll / décalage horizontal). */
.table-responsive.no-sticky-thead,
.table-responsive[data-sticky-thead='off'] {
    overflow-y: visible !important;
}
