/* -------------------------------------------
   Style commun tables (lisibilité)
------------------------------------------- */
.table-modern {
    font-variant-numeric: tabular-nums;
    /* chiffres alignés */
}

.table-modern th {
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}

.table-modern td {
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    background-color: #f8f9fa;
    /* hover discret */
}

/* -------------------------------------------
   Pivot CSVA : sticky header + 1ère colonne
------------------------------------------- */
.table-pivot th,
.table-pivot td {
    white-space: nowrap;
    /* évite les retours qui décalent */
}

.table-pivot thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    box-shadow: inset 0 -1px #e9ecef, 0 2px 8px rgba(0, 0, 0, .04);
}

.table-pivot td:first-child,
.table-pivot th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 #e9ecef;
    text-align: left;
    /* clé à gauche */
}

.table-pivot td:not(:first-child) {
    text-align: right;
    /* valeurs à droite */
}

/* Pivot: interactions lisibles */
.table-pivot td[data-val] {
    transition: background-color .2s ease, color .2s ease;
}

.table-pivot .pivot-open {
    color: inherit !important;
    /* le lien prend la couleur de la cellule */
    font-weight: 600;
    text-underline-offset: 2px;
    cursor: pointer;
}

.table-pivot .pivot-open:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Zéro = gris discret (déjà présent si tu avais .is-zero) */
.table-pivot td.is-zero {
    color: #adb5bd;
}

/* Colonne TOTAL : bien lisible sans heatmap */
.table-pivot th.pivot-total {
    text-align: right;
}

.table-pivot td.pivot-total {
    font-weight: 700;
    background: #f1f3f5;
    /* gris très clair */
    text-align: right;
}

/* -------------------------------------------
   Exceptions CSVB : sticky header + ellipsis
------------------------------------------- */
.table-exceptions thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    box-shadow: inset 0 -1px #e9ecef;
}

.text-ellipsis {
    display: inline-block;
    max-width: 260px;
    /* ajuste selon la place désirée */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

/* Optionnel : réduire encore la densité si nécessaire */
.table-modern.table-sm td,
.table-modern.table-sm th {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

/* Bouton lien dans le pivot (discret) */
.pivot-open {
    text-decoration: underline;
}

.pivot-open:hover {
    text-decoration-thickness: 2px;
}

/* -------------------------------------------
   CSVC Overdue/Languishing : sticky header
------------------------------------------- */
.table-overdue thead th,
.table-languish thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    box-shadow: inset 0 -1px #e9ecef;
}

/* Petites pastilles/labels pour les destinations ignorées */
.ignore-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .5rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    background: #f8f9fa;
    font-size: .875rem;
}
