/* ---------------------------------------------------------------------------
   En-têtes de page (page-header) - responsive
   Sur mobile : titre/description et bouton s'empilent verticalement.
   Sur sm et plus : disposition horizontale avec espace entre.
   --------------------------------------------------------------------------- */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 640px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.page-header__content {
    min-width: 0;
}
.page-header__actions {
    flex-shrink: 0;
    width: 100%;
}
@media (min-width: 640px) {
    .page-header__actions {
        width: auto;
    }
}

@media (prefers-color-scheme: dark) {
    .dark\:bg-gray-800 {
        --tw-bg-opacity: 1;
        background-color: whitesmoke !important;
    }
}

@media (prefers-color-scheme: dark) {
    .dark\:even\:bg-gray-900\/50:nth-child(even) {
        background-color: whitesmoke !important;
    }
}

// Règle générale pour les en-têtes
table.dataTable thead th, table.dataTable thead td, table.dataTable tfoot th, table.dataTable tfoot td {
    text-align: match-parent !important;
}

// Forcer le centrage pour les colonnes avec text-center (doit être après la règle générale)
table.dataTable thead th.text-center, table.dataTable thead td.text-center, table.dataTable tfoot th.text-center, table.dataTable tfoot td.text-center {
    text-align: center !important;
}

// le dernier thead td doit être aligné à droite (sauf si text-center est présent)
table.dataTable thead th:last-child:not(.text-center), table.dataTable thead td:last-child:not(.text-center), table.dataTable tfoot th:last-child:not(.text-center), table.dataTable tfoot td:last-child:not(.text-center) {
    text-align: right !important;
}

// Forcer le centrage pour les cellules tbody avec text-center
table.dataTable tbody td.text-center {
    text-align: center !important;
}

// Règle spécifique pour la colonne Actions (plus spécifique pour surcharger toutes les autres règles)
table.dataTable thead th.text-center:last-child,
table.dataTable tbody td.text-center:last-child {
    text-align: center !important;
}

// Centrer le dernier dt-column-header (règles très spécifiques pour surcharger DataTables)
table.dataTable thead th.dt-column-header:last-child,
table.dataTable thead th:last-child.dt-column-header,
table.dataTable thead th.text-center.dt-column-header:last-child,
table.dataTable thead th.dt-column-header.text-center:last-child,
table.dataTable thead th:last-child.text-center.dt-column-header {
    text-align: center !important;
}

// Centrer aussi le contenu interne du dernier dt-column-header
table.dataTable thead th.dt-column-header:last-child > *,
table.dataTable thead th:last-child.dt-column-header > *,
table.dataTable thead th.dt-column-header:last-child .dt-column-header-content {
    text-align: center !important;
    justify-content: center !important;
}