/* Thème AG Grid Personnalisé : Alpine Teal Edition */
.ag-theme-insuco {
    /* --- Variables de Base --- */
    --ag-active-color: #00828e;
    --ag-background-color: #ffffff;
    --ag-foreground-color: #2c3e50;
    --ag-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ag-font-size: 13px;
    --ag-border-color: #e9ecef;
    --ag-border-radius: 8px;

    /* --- En-têtes --- */
    --ag-header-background-color: #00828e;
    --ag-header-foreground-color: #ffffff;
    --ag-header-column-separator-display: block;
    --ag-header-column-separator-color: rgba(255, 255, 255, 0.2);
    --ag-header-column-separator-height: 40%;

    /* --- Lignes et Sélection --- */
    --ag-row-hover-color: rgba(0, 130, 142, 0.04);
    --ag-selected-row-background-color: rgba(0, 130, 142, 0.08);
    --ag-odd-row-background-color: #f8fafb;
    --ag-row-border-color: #f1f3f5;

    /* --- Checkbox --- */
    --ag-checkbox-checked-color: #00828e;
    --ag-checkbox-unchecked-color: #adb5bd;
    --ag-checkbox-indeterminate-color: #00828e;
    --ag-checkbox-border-radius: 4px;

    /* --- Conteneur Global --- */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--ag-border-color);
    overflow: hidden; /* Assure que les coins arrondis coupent le contenu interne */
}

/* --- Ajustements spécifiques aux cellules --- */
.ag-theme-insuco .ag-cell {
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
    padding-left: 16px;
    padding-right: 16px;
}

/* Style des liens URL cliquables - Plus propre */
.ag-theme-insuco .ag-url-cell {
    color: #00828e;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.ag-theme-insuco .ag-url-cell:hover {
    text-decoration: underline;
    color: #005f68;
}

.ag-theme-insuco .ag-cell-focus {
    background-color: transparent !important; /* On évite de masquer la couleur de ligne */
    border: 2px solid #00828e !important; /* Bordure plus épaisse */
    box-shadow: inset 0 0 0 1px rgba(0, 130, 142, 0.2);
    transition: border 0.1s ease-in-out;
}

/* --- Focus et Accessibilité --- */
.ag-theme-insuco .ag-cell-focus:not(.ag-cell-range-selected) {
    border: 2px solid #00828e !important;
    outline: none;
    z-index: 10;
}

/* --- Header Labels --- */
.ag-theme-insuco .ag-header-cell-label {
    justify-content: center;
    letter-spacing: 0.3px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

/* Filter icon: frosted pill to distinguish it from the header background */
.ag-theme-insuco .ag-icon-filter {
    opacity: 0.85;
    color: white;
}
.ag-theme-insuco .ag-icon-filter:hover {
    opacity: 1;
}

.ag-theme-insuco .ag-header-cell-filtered .ag-icon-filter {
    opacity: 1;
    color: white;
}

/* Hide the separator on the last header column */
.ag-theme-insuco .ag-header-cell:last-child .ag-header-cell-resize,
.ag-theme-insuco .ag-header-cell:last-child::after {
    display: none !important;
}

/* --- Pagination --- */

.ag-theme-insuco .ag-paging-panel {
    border-top: 1px solid var(--ag-border-color);
    color: #6c757d;
    font-weight: 500;
}

.ag-theme-insuco .ag-paging-button {
    cursor: pointer;
    transition: transform 0.1s;
}

.ag-theme-insuco .ag-paging-button:not(.ag-disabled):hover {
    color: #00828e;
    transform: scale(1.1);
}

/* Arrondir légèrement les checkboxes pour un look moins "Windows 95" */
.ag-theme-insuco .ag-checkbox-input-wrapper {
    border-radius: 3px;
}

/* ----------------------------------------------------------*/
/* RESPONSIVE MOBILE                                         */
/* ----------------------------------------------------------*/
@media (max-width: 768px) {
    .ag-theme-insuco {
        --ag-font-size: 11px;
    }

    .ag-theme-insuco .ag-cell {
        padding-left: 8px;
        padding-right: 8px;
    }

    .ag-theme-insuco .ag-header-cell {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Scroll horizontal sur les tableaux */
    .ag-theme-insuco .ag-root-wrapper {
        overflow-x: auto;
    }
}