/* Colonnes masquées (ex. mobile-only) : Filament cache le th/td mais pas le placeholder groups-row. */
.elia-table-cell-layout-hidden {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Sticky actions : fond header unifié (ligne groupes + sous-en-tête actions). */
.fi-ta-sticky-record-actions .fi-ta-table > thead > tr.fi-ta-table-head-groups-row,
.fi-ta-sticky-record-actions .fi-ta-table > thead > tr.fi-ta-table-head-groups-row > th {
    background-color: rgba(var(--theme-table-header-effective-rgb, 249 250 251), calc(var(--theme-table-header-effective-alpha, 1) * var(--theme-mode-opacity, 1))) !important;
    background-image: none !important;
}

.fi-ta-sticky-record-actions .fi-ta-table thead th.fi-ta-sticky-action-cell,
.fi-ta-sticky-record-actions .fi-ta-table thead th.fi-ta-actions-header-cell,
.fi-ta-sticky-record-actions .fi-ta-table thead th.fi-ta-sticky-action-group-header-cell,
.fi-ta-sticky-record-actions .fi-ta-table thead tr.fi-ta-table-head-groups-row > th.fi-ta-sticky-action-group-header-cell:empty {
    background-color: rgba(var(--theme-table-header-effective-rgb, 249 250 251), calc(var(--theme-table-header-effective-alpha, 1) * var(--theme-mode-opacity, 1))) !important;
    background-image: none !important;
    box-shadow: none !important;
    border-inline-end: none !important;
}

.dark .fi-ta-sticky-record-actions .fi-ta-table > thead > tr.fi-ta-table-head-groups-row,
.dark .fi-ta-sticky-record-actions .fi-ta-table > thead > tr.fi-ta-table-head-groups-row > th,
.dark .fi-ta-sticky-record-actions .fi-ta-table thead th.fi-ta-sticky-action-cell,
.dark .fi-ta-sticky-record-actions .fi-ta-table thead th.fi-ta-actions-header-cell,
.dark .fi-ta-sticky-record-actions .fi-ta-table thead th.fi-ta-sticky-action-group-header-cell,
.dark .fi-ta-sticky-record-actions .fi-ta-table thead tr.fi-ta-table-head-groups-row > th.fi-ta-sticky-action-group-header-cell:empty {
    background-color: rgba(var(--theme-table-header-effective-rgb, 17 24 39), calc(var(--theme-table-header-effective-alpha, 1) * var(--theme-mode-opacity, 1))) !important;
    background-image: none !important;
}

@media (min-width: 768px) {
    .fi-ta-sticky-record-actions .elia-mobile-only-column-header,
    .fi-ta-sticky-record-actions .elia-mobile-only-column-cell,
    .fi-ta-sticky-record-actions .fi-ta-header-cell-mobile-more-infos,
    .fi-ta-sticky-record-actions .fi-ta-cell-mobile-more-infos,
    .fi-ta-sticky-record-actions thead tr.fi-ta-table-head-groups-row > th.elia-groups-row-mobile-only-placeholder,
    .fi-ta-sticky-record-actions thead tr.fi-ta-table-head-groups-row > th:empty:not(.fi-ta-header-group-cell):has(+ th:empty:last-child),
    .fi-ta-sticky-record-actions thead tr:not(.fi-ta-table-head-groups-row) th.fi-ta-actions-header-cell ~ th,
    .fi-ta-sticky-record-actions tbody td.fi-ta-cell:has(> .fi-ta-actions) ~ td {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }
}

/* Mobile (< md) : panneau « Plus d'infos » — w-full (Tailwind sur blade + cellule). */
@media (max-width: 767px) {
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell-mobile-more-infos,
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .elia-mobile-more-infos-cell {
        padding-inline: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible;
    }

    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell-mobile-more-infos > .fi-ta-cell-label,
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .elia-mobile-more-infos-cell > .fi-ta-cell-label {
        display: none !important;
    }

    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell-mobile-more-infos .fi-ta-cell-content,
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .elia-mobile-more-infos-cell .fi-ta-cell-content,
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell-mobile-more-infos .fi-ta-col,
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .elia-mobile-more-infos-cell .fi-ta-col {
        width: 100% !important;
        max-width: 100% !important;
        display: block;
        box-sizing: border-box;
    }

    .elia-table-mobile-more-infos-panel {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        border-radius: 0;
        border-inline-width: 0;
    }
}

@media (max-width: 639px) {
    .fi-ta-sticky-record-actions .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell-mobile-more-infos,
    .fi-ta-sticky-record-actions .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .elia-mobile-more-infos-cell {
        width: calc(100% + 3rem) !important;
        max-width: calc(100% + 3rem) !important;
        margin-inline-end: -3rem !important;
        padding-inline: 0 !important;
    }
}
