/* --- STYLES FINAUX POUR LE TABLEAU DES BALS --- */
:root {
    --gbc-primary: #009879;
    --gbc-text: #333333;
    --gbc-border-light: #e8e8e8;
    --gbc-border-medium: #dddddd;
    --gbc-white: #ffffff;
    --gbc-stripe: #f5f5f5;
    /* Couleur pour les lignes paires (zebra) - Plus contrasté */
}

.tableau-bals-country {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 20px 0;
    margin-bottom: 50vh;
    /* Espace vide pour permettre de centrer le dernier bal */
    font-size: 1.05em;
    /* Augmenté pour lisibilité */
    font-family: sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    background-color: var(--gbc-white);
    color: var(--gbc-text);
}

.tableau-bals-country thead tr {
    background-color: var(--gbc-primary) !important;
    color: #ffffff;
    text-align: center;
    height: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Renforce le contraste */
}

.tableau-bals-country thead th {
    padding: 6px 10px;
    /* Revert padding */
    font-weight: bold;
    background-color: var(--gbc-primary) !important;
    border-right: none;
    /* Supprime les lignes verticales de l'en-tête */
    border-bottom: none;
    /* Supprime la ligne du bas de l'en-tête */
}

.tableau-bals-country th,
#gbc-bals-container .tableau-bals-country td {
    padding: 0px 0px;
    /* Revert padding */
    border-bottom: 1px solid var(--gbc-border-light);
    vertical-align: middle;
    text-align: center;
    overflow-wrap: break-word;
    position: relative;
    /* Nécessaire pour positionner le pseudo-élément */
}

/* Création du séparateur vertical personnalisé */
#gbc-bals-container .tableau-bals-country td:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15%;
    /* Marge en haut */
    bottom: 15%;
    /* Marge en bas */
    right: 0;
    width: 1px;
    background-color: #e8e8e8;
}

/* La hauteur fixe est supprimée pour un affichage plus flexible */
.tableau-bals-country tbody tr {
    height: 150px;
}

.tableau-bals-country tbody tr.gbc-info-toggle-row,
.tableau-bals-country tbody tr.gbc-info-content-row {
    height: auto;
    background-color: transparent !important;
}

.tableau-bals-country tbody tr:nth-of-type(even),
.tableau-bals-country tbody tr.alt,
.tableau-bals-country tbody tr.odd {
    background-color: transparent !important;
}

/* Zebra striping : une ligne sur deux a un fond légèrement plus foncé */
.tableau-bals-country tbody tr.gbc-row-even {
    background-color: var(--gbc-stripe) !important;
}



/* Bordure de séparation renforcée pour les bals */
.tableau-bals-country .gbc-main-row:not(.has-info-row) td {
    border-bottom: 1px solid #dddddd;
}

.tableau-bals-country th:nth-child(1),
.tableau-bals-country td:nth-child(1) {
    width: 11%;
}

.tableau-bals-country th:nth-child(2),
.tableau-bals-country td:nth-child(2) {
    width: 21%;
}

.tableau-bals-country th:nth-child(3),
.tableau-bals-country td:nth-child(3) {
    width: 16%;
    text-align: center;
}

.tableau-bals-country th:nth-child(4),
.tableau-bals-country td:nth-child(4) {
    width: 15%;
}

.tableau-bals-country th:nth-child(5),
.tableau-bals-country td:nth-child(5) {
    width: 10%;
}

.tableau-bals-country th:nth-child(6),
.tableau-bals-country td:nth-child(6) {
    width: 27%;
}

.preview-with-download-wrapper {
    display: grid;
    grid-template-rows: 1fr auto;
    /* Ligne 1 (image) prend l'espace, Ligne 2 (bouton) s'adapte */
    height: 100%;
    /* Prend toute la hauteur de la cellule */
    box-sizing: border-box;
    /* Inclut le padding dans la hauteur */
    padding: 3px 0;
    /* Ajoute un peu d'espace en haut et en bas */
    justify-items: center;
    /* Centre horizontalement les éléments (image, bouton) */
    align-content: center;
    /* Centre verticalement le bloc image+bouton */
}

.tableau-bals-country td:nth-child(6) .preview-with-download-wrapper {
    gap: 3px;
}

.tableau-bals-country td:nth-child(3) .preview-with-download-wrapper {
    max-width: 120px;
    margin: 0 auto;
}

.preview-with-download-wrapper .preview-link {
    display: flex;
    align-items: center;
    /* Centre verticalement l'image/icône dans son espace */
}

.tableau-bals-country td:nth-child(3) .apercu-affiche {
    max-width: 110px;
    max-height: 130px;
    width: auto;
    height: auto;
}

.preview-with-download-wrapper .apercu-affiche {
    display: block;
    max-width: 140px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preview-with-download-wrapper .preview-link:hover .apercu-affiche {
    transform: scale(1.03);
    z-index: 10;
    position: relative;
}

.preview-with-download-wrapper .preview-icon {
    font-size: 2.5rem;
    text-decoration: none;
}

.preview-with-download-wrapper .download-button {
    display: block;
    font-size: 11px;
    color: #0073aa;
    text-decoration: none;
    padding: 0;
    line-height: 1.2;
    /* Réduit la hauteur de la ligne pour coller au texte */
    cursor: pointer;
    z-index: 1;
    position: relative;
}

.preview-with-download-wrapper .download-button:hover {
    text-decoration: underline;
}

.tableau-bals-country td:nth-child(6) .multiple-previews-container {
    display: grid;
    gap: 5px;
    height: 100%;
    place-items: center;
}

.tableau-bals-country td:nth-child(6) .multiple-previews-container {
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    max-width: 220px;
    margin: 0 auto;
}

.tableau-bals-country td:nth-child(6) .has-multiple-rows {
    grid-template-columns: repeat(2, 1fr);
    max-width: 190px;
}

.tableau-bals-country td:nth-child(6) .multiple-previews-container:not(.has-multiple-rows) .preview-with-download-wrapper {
    max-width: 120px;
}

.tableau-bals-country td:nth-child(6) .multiple-previews-container:not(.has-multiple-rows) .apercu-affiche {
    max-width: 110px;
    max-height: 130px;
    width: auto;
    height: auto;
}

.tableau-bals-country td:nth-child(6) .has-multiple-rows .preview-with-download-wrapper {
    max-width: 85px;
}

.tableau-bals-country td:nth-child(6) .has-multiple-rows .apercu-affiche {
    max-width: 65px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tableau-bals-country td:nth-child(6) .download-button {
    font-size: 11px;
    padding: 2px 6px;
    white-space: nowrap;
}

.tableau-bals-country td:nth-child(6) .has-multiple-rows .download-button {
    font-size: 9px;
    padding: 2px 4px;
}

.tableau-bals-country td:nth-child(6) .preview-icon {
    font-size: 28px;
}

.tableau-bals-country td:nth-child(6) .has-multiple-rows .preview-icon {
    font-size: 22px;
}

@media screen and (max-width: 768px) {
    .tableau-bals-country thead {
        display: none;
    }

    .tableau-bals-country tr {
        display: block;
        border-bottom: 3px solid var(--gbc-primary);
        padding-bottom: 10px;
    }

    .tableau-bals-country tbody tr {
        height: auto;
    }

    .tableau-bals-country td {
        padding-left: 50%;
        position: relative;
        border-bottom: 1px dotted #ccc;
        box-sizing: border-box;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-height: 40px;
        padding-right: 15px !important;
    }

    .tableau-bals-country td:last-child {
        border-bottom: none;
    }

    .tableau-bals-country td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
    }

    .tableau-bals-country td[data-label=\"Club\"] strong {
        font-size: 1.3em;
        line-height: 1.2;
    }

    /* Réduit le padding-left pour laisser plus d'espace au nom du club */
    .tableau-bals-country td[data-label="Club"] {
        padding-left: 15% !important;
        /* Au lieu de 50% */
        text-align: right;
        min-width: 0;
    }

    /* Le nom du club revient à la ligne si nécessaire */
    .tableau-bals-country td[data-label="Club"] strong {
        font-size: 1.1em !important;
        /* Garde la taille normale */
        line-height: 1.3;
        /* Meilleur espacement entre les lignes */
        flex-basis: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal !important;
        /* Permet le retour à la ligne */
        max-width: 100%;
        display: inline-block;
    }

    .tableau-bals-country .col-club-mobile-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }

    .tableau-bals-country th:nth-child(n),
    .tableau-bals-country td:nth-child(n) {
        width: 100% !important;
    }

    .tableau-bals-country td:nth-child(3) .preview-with-download-wrapper,
    .tableau-bals-country td:nth-child(6) .multiple-previews-container {
        margin: 10px 0;
        /* Supprime le centrage automatique horizontal (auto) */
        max-width: 250px;
    }

    .tableau-bals-country td:nth-child(6) .multiple-previews-container {
        padding-bottom: 10px;
    }

    .tableau-bals-country td[data-label="Affiche"],
    .tableau-bals-country td[data-label="Infos / Playlist(s)"] {
        /* On aligne le contenu à droite pour laisser de la place au label à gauche */
        justify-content: flex-end !important;
        padding-top: 15px;
        /* Ajoute un peu d'espace en haut pour ne pas coller le label */
    }

    /* Correction pour la ligne "+ d'infos" en vue mobile */
    .gbc-info-row td {
        display: block !important;
        /* Force l'affichage en bloc pour éviter le flex vertical */
        text-align: left !important;
        /* Garantit l'alignement à gauche */
        padding: 8px 15px !important;
        /* Applique un padding uniforme, sans le décalage de 50% */
        min-height: auto !important;
        /* La hauteur s'adapte au contenu */
    }

    .gbc-info-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px 16px 15px !important;
        margin-top: -8px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

    .gbc-info-text-wrapper {
        justify-content: flex-start !important;
        text-align: left !important;
        width: 100%;
    }

    .gbc-info-text {
        line-height: 1.5 !important;
    }

    /* Bordure de séparation après le bloc + d'infos en mobile */
    .gbc-info-row td {
        border-bottom: 3px solid var(--gbc-primary) !important;
        padding-bottom: 15px !important;
    }

    /* Rétablir les bordures entre les attributs pour les bals avec + d'infos en mobile */
    #gbc-bals-container .tableau-bals-country .gbc-main-row.has-info-row td {
        border-bottom: 1px solid #e8e8e8 !important;
    }

    /* Seulement la dernière cellule du bal principal n'a pas de bordure (avant le + d'infos) */
    #gbc-bals-container .tableau-bals-country .gbc-main-row.has-info-row td:last-child {
        border-bottom: none !important;
    }

    span.gbc-end-date-label {
        padding: 0px 2% 0px 2% !important;
    }
}

/* On cache le bouton de fermeture par défaut de Fancybox pour utiliser le nôtre (synchronisé) */
.f-button.is-close-btn,
.fancybox__toolbar .f-button[data-fancybox-close] {
    display: none !important;
}

.fancybox__container:not(.is-compact) .fancybox__slide.has-close-btn {
    padding-top: 0px;
}

.fancybox__container {
    /* On s'assure que FancyBox se place bien par-dessus la barre d'admin */
    padding-top: 0px;
    z-index: 9999 !important;
    --fancybox-bg: rgba(24, 24, 27, 0.95) !important;
}

/* Force la barre d'outils à être au-dessus de l'iframe (PDF) */
.fancybox__toolbar {
    z-index: 10000 !important;
    background: transparent !important;
    /* On retire le dégradé global */
    padding-top: 10px;
    padding-bottom: 20px;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

/* On stylise les boutons de la toolbar pour qu'ils soient visibles sur tout fond (blanc PDF ou noir image) */
.fancybox__toolbar .f-button {
    background: rgba(0, 0, 0, 0.6);
    /* Fond sombre semi-transparent pour le bouton */
    color: #fff;
    border-radius: 50%;
    /* Boutons ronds */
    margin: 0 4px;
    width: 40px;
    height: 40px;
    display: flex;
    /* Assure que le contenu est centré */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fancybox__toolbar .f-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.fancybox__toolbar .f-button svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}


.fancybox__content {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

/* Dans public/public-styles.css */
.gbc-month-title {
    margin-top: 40px;
    margin-bottom: 10px;
    color: white;
    /* Ou la couleur de votre thème */
}

/* Correction du padding pour les iframes dans Fancybox */
/* Force l'apparence d'une page A4 centrée */
body .fancybox__container .fancybox__slide.is-iframe .fancybox__content,
body .fancybox__container .fancybox__slide.has-iframe .fancybox__content,
body .fancybox__container .fancybox__slide.has-pdf .fancybox__content {
    padding: 0;
    margin: 0 auto;

    /* Ratio A4 Portrait (210/297) */
    aspect-ratio: 210/297;

    /* Dimensions calculées pour tenir dans l'écran tout en gardant le ratio */
    /* On prend le MINIMUM entre :
           1. 95% de la hauteur d'écran (pour ne pas toucher les bords verticaux)
           2. La largeur correspondante si on était limité par la largeur (95vw)
         */
    height: min(100vh, 95vw * 1.414) !important;
    width: min(95vw, 95vh * 0.707) !important;

    max-width: 1200px;
    background: #fff;
    /* Fond blanc pour faire "papier" */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    /* Ombre pour l'effet "feuille volante" */
}

/* Styles pour les boutons PDF injectés manuellement */
/* Styles pour les boutons personnalisés (PDF et Images) injectés manuellement */
.gbc-custom-actions {
    position: fixed !important;
    /* Fixe par rapport à l'écran */
    top: 10px;
    right: 10px;
    /* On remet à droite car on intègre la croix dedans */
    display: flex;
    gap: 8px;
    z-index: 99999;
    align-items: center;
    /* Assure l'alignement vertical */
}

.gbc-custom-actions .f-button {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 40px;
    /* Taille augmentée pour s'approcher du standard Fancybox */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
}

.gbc-custom-actions .f-button:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

.gbc-custom-actions .f-button svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* FIX : Reset de la hauteur pour les images pour permettre le clic en dehors (sur le slide) */
.fancybox__slide.has-image .fancybox__content {
    height: auto !important;
}

/* --- Animation de fondu pour les images --- */
.apercu-affiche {
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.2s;
    /* Ajout de transition sur transform */
}

.apercu-affiche.is-visible {
    opacity: 1;
}

.gbc-end-date-label {
    font-size: 0.9em;
    color: #555;
}

.gbc-cp-prefix {
    font-weight: bold;
}

/* Couleurs spécifiques pour chaque département des Pays de la Loire */
.gbc-cp-prefix-44 {
    color: #0077B6;
}

/* Loire-Atlantique - Bleu */
.gbc-cp-prefix-49 {
    color: #D9534F;
}

/* Maine-et-Loire - Rouge */
.gbc-cp-prefix-53 {
    color: #5CB85C;
}

/* Mayenne - Vert */
.gbc-cp-prefix-72 {
    color: #F0AD4E;
}

/* Sarthe - Orange */
.gbc-cp-prefix-85 {
    color: #6f42c1;
}

/* Vendée - Violet */

/* --- Styles pour la ligne "Plus d'infos" --- */
/* Supprime la bordure entre le bal et sa ligne d'info */
#gbc-bals-container .tableau-bals-country .gbc-main-row.has-info-row td {
    border-bottom: none;
}

.tableau-bals-country .gbc-info-row {
    height: auto !important;
    /* Annule la hauteur fixe de 150px héritée */
    position: relative;
    z-index: 100;
}

#gbc-bals-container .tableau-bals-country tr.gbc-info-row>td {
    padding: 0 !important;
    /* On force la suppression du padding de la cellule elle-même */
    background-color: inherit;
    /* Fond blanc identique aux autres lignes */
    height: auto;
    text-align: left !important;
    /* Annule le centrage hérité du thème */
    border-bottom: 1px solid #dddddd !important;
    /* Bordure harmonisée pour séparer du bal suivant */
    border-right: none;
    /* S'assure qu'il n'y a pas de bordure verticale */
}

.gbc-info-content-wrapper {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 20px 12px 3%;
    margin-top: -3px;
    background: linear-gradient(135deg, #e3f2fd 0%, #d4e8ed 100%);
    border-left: 4px solid var(--gbc-primary);
    border-radius: 7px 7px 7px 7px;
    margin-left: 4%;
    margin-right: 3%;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 100, 110, 0.12);
    min-height: 68px;
    /* Assure une hauteur minimale cohérente même sans boutons */
    box-sizing: border-box;
}

/* Conteneur du texte d'info (prefix + texte) */
.gbc-info-content-wrapper>.gbc-info-prefix,
.gbc-info-content-wrapper>.gbc-info-text {
    display: inline;
}

/* Wrapper pour le texte d'info - prend l'espace disponible */
.gbc-info-content-wrapper::before {
    content: none;
}

/* Conteneur pour le texte d'info - permet le flex et le passage sur 2 lignes */
.gbc-info-text-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    line-height: 1.6;
}

.gbc-info-prefix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    color: var(--gbc-primary);
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 8px;
    line-height: 1.6;
}

.gbc-info-prefix .dashicons {
    font-size: 22px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    color: var(--gbc-primary);
}

.gbc-info-text {
    flex: 1;
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    /* Pas d'italique global - le formatage est personnalisable */
}

/* Support du gras dans le texte */
.gbc-info-text strong,
.gbc-info-text b {
    font-weight: bold;
    color: #1a1a1a;
}

/* Support de l'italique dans le texte */
.gbc-info-text em,
.gbc-info-text i {
    font-style: italic;
}

/* Style des liens dans le texte */
.gbc-info-text a {
    color: #0077B6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.gbc-info-text a:hover {
    color: #005a8c;
    text-decoration: none;
}

/* Support du souligné dans le texte */
.gbc-info-text u {
    text-decoration: underline;
}

/* --- Conteneur des boutons --- */
.gbc-btns-wrapper {
    display: flex;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* --- Styles communs aux boutons --- */
.gbc-btn-inscription,
.gbc-btn-reservation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none !important;
    border-radius: 25px;
    transition: all 0.25s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Fix pour éviter le dépassement en largeur */
}

/* --- Bouton Inscription (bleu) --- */
.gbc-btn-inscription {
    background: linear-gradient(135deg, #5c9ece 0%, #3a7ca5 100%);
    box-shadow: 0 2px 8px rgba(58, 124, 165, 0.35);
}

.gbc-btn-inscription:hover {
    background: linear-gradient(135deg, #7ab5dc 0%, #5c9ece 100%);
    box-shadow: 0 4px 12px rgba(58, 124, 165, 0.5);
    transform: translateY(-2px);
    color: #ffffff !important;
    text-decoration: none !important;
}

/* --- Bouton Réservation (vert) --- */
.gbc-btn-reservation {
    background: linear-gradient(135deg, #4caf78 0%, #388e5c 100%);
    box-shadow: 0 2px 8px rgba(56, 142, 92, 0.35);
}

.gbc-btn-reservation:hover {
    background: linear-gradient(135deg, #6bc28e 0%, #4caf78 100%);
    box-shadow: 0 4px 12px rgba(56, 142, 92, 0.5);
    transform: translateY(-2px);
    color: #ffffff !important;
    text-decoration: none !important;
}

/* --- Icônes dans les boutons --- */
.gbc-btn-inscription .dashicons,
.gbc-btn-reservation .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Responsive pour les boutons */
@media screen and (max-width: 768px) {
    .gbc-btns-wrapper {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
    }

    .gbc-btn-inscription,
    .gbc-btn-reservation {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 1.05em;
    }

    /* Masquer les tooltips sur mobile (tactile) */
    .gbc-tooltip-preview,
    .gbc-tooltip-text {
        display: none !important;
    }
}

/* --- Styles pour les tooltips des boutons --- */
.gbc-has-tooltip {
    position: relative;
}

/* Tooltip texte */
.gbc-tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.95);
    color: #ffffff;
    font-size: 0.85em;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 99999;
}

/* Flèche du tooltip texte */
.gbc-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(33, 33, 33, 0.95);
}

/* Tooltip aperçu (image) */
.gbc-tooltip-preview {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 99999;
}

.gbc-tooltip-preview img {
    display: block;
    max-width: 180px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 4px;
}

/* Flèche du tooltip aperçu */
.gbc-tooltip-preview::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #ffffff;
}

/* Affichage au survol */
.gbc-has-tooltip:hover .gbc-tooltip-text,
.gbc-has-tooltip:hover .gbc-tooltip-preview {
    opacity: 1;
    visibility: visible;
}

/* Animation d'entrée */
.gbc-has-tooltip:hover .gbc-tooltip-text {
    transform: translateX(-50%) translateY(-4px);
}


.gbc-has-tooltip:hover .gbc-tooltip-preview {
    transform: translateX(-50%) translateY(-6px);
}


/* --- ANCRES ET SCROLLING --- */
/* Décalage pour compenser les en-têtes fixes lors du scroll vers une ancre */
tr[id^="bal-"] {
    scroll-margin-top: 150px;
    /* Ajustez selon hauteur du header */
}