.hbc-espace-club {
    --hbc-violet: #4b006e;
    --hbc-violet-clair: #f4eef7;
    --hbc-bordure: #d7c9de;
    color: #242027;
    font-family: Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

body.hbc-page-espace-club .woocommerce-MyAccount-navigation,
body:has(.hbc-espace-club > .hbc-navigation-compte) .woocommerce-MyAccount-navigation,
body.hbc-interface-responsable .woocommerce-MyAccount-navigation,
body.hbc-espace-club-vue-interne .woocommerce-MyAccount-navigation {
    display: none !important;
}

body.hbc-page-espace-club .woocommerce-MyAccount-content,
body:has(.hbc-espace-club > .hbc-navigation-compte) .woocommerce-MyAccount-content,
body.hbc-interface-responsable .woocommerce-MyAccount-content,
body.hbc-espace-club-vue-interne .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
}

/* Styles autonomes : aucun collage dans le CSS additionnel n'est nécessaire
   pour les outils internes. Ne pas modifier la densité du planning annuel. */
body .hbc-espace-club p:not(.hbc-planning-table *) {
    font-family: inherit;
    font-size: inherit;
    line-height: 1.45;
    margin-block: 0 8px;
}

:root body.hbc-page-espace-club .hbc-espace-club :is(h2, h3, h4) {
    font-family: Inter, Arial, sans-serif !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-block: 16px 6px !important;
}

:root body.hbc-page-espace-club .hbc-espace-club h2 { font-size: 22px !important; }
:root body.hbc-page-espace-club .hbc-espace-club h3 { font-size: 19px !important; }
:root body.hbc-page-espace-club .hbc-espace-club h4 { font-size: 17px !important; }
:root body .hbc-espace-club :is(section, .hbc-planning-wrap, .hbc-espace-club__carte) > :is(h2, h3, h4):first-child { margin-top: 0 !important; }

body.hbc-page-espace-club .wp-block-post-title {
    font-family: Inter, Arial, sans-serif !important;
    font-size: 22px !important;
    line-height: 1.3 !important;
    margin-bottom: 12px !important;
}

body .hbc-espace-club :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-family: inherit;
    font-size: 16px;
}

.hbc-navigation-compte {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin: 0 0 18px;
}

.hbc-navigation-compte--bas {
    margin: 26px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--hbc-bordure, #d7c9de);
}

.hbc-navigation-compte__lien {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid #4b006e;
    border-radius: 4px;
    color: #4b006e !important;
    font-weight: 700;
    text-decoration: none;
}

.hbc-navigation-compte__lien:hover,
.hbc-navigation-compte__lien:focus-visible {
    background: #4b006e;
    color: #fff !important;
}

.hbc-espace-club .hbc-planning-formulaire textarea {
    box-sizing: border-box;
    display: block;
    margin: 8px 0;
    width: 100%;
}

.hbc-planning-actions__liens {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.hbc-planning-actions__liens form {
    margin: 0;
}

.hbc-espace-club .hbc-planning-filtres { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.hbc-planning-filtres > label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-weight: 600; }
.hbc-planning-filtres select { max-width: 100%; font-weight: 400; }
.hbc-planning-filtres > button { justify-self: start; }
.hbc-espace-club .hbc-planning-filtres-equipes { margin: 8px 0 18px; }
.hbc-espace-club .hbc-planning-filtres-equipes a {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.hbc-espace-club .hbc-planning-filtres-equipes a:focus-visible { outline: 2px solid var(--hbc-violet); outline-offset: 3px; }

.hbc-equipe-acces-planning { margin: 18px 0; }
.hbc-equipe-acces-planning > a { margin-bottom: 6px; }

/* Une entrée violette par outil, des cartes blanches pour ses équipes. */
.hbc-espace-club .hbc-planning-gestion {
    margin: 12px 0;
    border: 1px solid var(--hbc-bordure);
    border-radius: 6px;
    background: var(--hbc-violet-clair);
}
.hbc-espace-club .hbc-planning-gestion > summary {
    padding: 12px 14px;
    border-radius: 5px;
    background: var(--hbc-violet);
    color: #fff !important;
    font-weight: 700;
    cursor: pointer;
}
.hbc-espace-club .hbc-planning-gestion > summary:hover,
.hbc-espace-club .hbc-planning-gestion > summary:focus-visible { background: #300047; }
.hbc-espace-club .hbc-planning-gestion > summary:focus-visible { outline: 2px solid var(--hbc-violet); outline-offset: 3px; }
.hbc-planning-gestion__contenu { padding: 14px; }
.hbc-planning-equipes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hbc-espace-club .hbc-planning-equipe {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--hbc-bordure);
    border-radius: 5px;
    background: #fff;
    color: #242027;
}
.hbc-planning-equipe > summary { color: var(--hbc-violet); cursor: pointer; font-weight: 600; }
.hbc-planning-equipe > summary:focus-visible { outline: 2px solid var(--hbc-violet); outline-offset: 4px; }
.hbc-planning-gestion__club { margin-bottom: 12px; }
.hbc-suivi-equipe[open] { grid-column: 1 / -1; }

.hbc-espace-club .hbc-planning-wrap {
    max-width: none;
}

body.hbc-espace-club-vue-large .hbc-espace-club,
body.hbc-espace-club-vue-planning .hbc-espace-club {
    width: calc(100vw - 40px);
    max-width: none;
    margin-left: calc(50% - 50vw + 20px);
}

body.hbc-espace-club-vue-planning .hbc-planning-scroll {
    width: 100%;
    overflow: auto;
    height: 75vh;
    height: 75dvh;
    max-height: none;
    min-height: 440px;
    -webkit-overflow-scrolling: touch;
}

.hbc-espace-club > h2 {
    margin-bottom: 3px;
    color: var(--hbc-violet);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.hbc-espace-club__bienvenue {
    margin-top: 0;
}

.hbc-espace-club__grille {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.hbc-espace-club__carte {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    border: 1px solid var(--hbc-bordure);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(43, 16, 56, .06);
}

.hbc-espace-club .hbc-espace-club__carte h3 {
    margin: 0 0 3px !important;
    color: var(--hbc-violet);
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.hbc-espace-club__carte p {
    flex: 1;
    margin: 0 0 16px;
}

.hbc-espace-club__action {
    display: inline-block;
    padding: .65em 1em;
    border-radius: 4px;
    background: var(--hbc-violet);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.hbc-espace-club__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.hbc-espace-club__actions > .hbc-espace-club__action {
    margin: 0 !important;
}

.hbc-espace-club__action:hover,
.hbc-espace-club__action:focus-visible {
    background: #300047;
    color: #fff !important;
}

:root body .hbc-espace-club a.hbc-espace-club__action {
    color: #fff !important;
}

.hbc-espace-club__attente {
    display: inline-block;
    color: #625769;
    font-size: 14px;
    font-style: italic;
}

.hbc-espace-club__refus {
    padding: 12px 16px;
    border-left: 4px solid #b32d2e;
    background: #fcf0f1;
}

.hbc-espace-club__refus p {
    margin: 0;
}

.hbc-espace-club__mode {
    margin-top: 24px;
    padding: 16px 18px;
    border-left: 4px solid var(--hbc-violet);
    background: var(--hbc-violet-clair);
}

.hbc-espace-club__mode p {
    margin: 0 0 12px;
}

.hbc-espace-club__mode p:last-child {
    margin-bottom: 0;
}

.hbc-espace-club__onglets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.hbc-espace-club__onglets a {
    padding: 7px 11px;
    border: 1px solid var(--hbc-bordure);
    border-radius: 4px;
    background: #fff;
    color: var(--hbc-violet);
    text-decoration: none;
}

.hbc-espace-club__onglets a:hover,
.hbc-espace-club__onglets a:focus-visible,
.hbc-espace-club__onglets a.is-active {
    border-color: var(--hbc-violet);
    background: var(--hbc-violet);
    color: #fff !important;
}

/* Les liens du thème/CSS additionnel sont parfois plus spécifiques. */
:root body .hbc-espace-club .hbc-espace-club__onglets a:is(.is-active, :hover, :focus-visible) {
    color: #fff !important;
}

.hbc-espace-club__tableau-conteneur {
    max-width: 100%;
    overflow-x: auto;
    margin: 12px 0 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.hbc-espace-club__tableau {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

.hbc-espace-club__tableau th,
.hbc-espace-club__tableau td {
    padding: 6px 8px;
    border: 1px solid var(--hbc-bordure);
    text-align: left;
    vertical-align: top;
}

.hbc-espace-club__tableau th {
    background: var(--hbc-violet-clair);
    color: #312537;
    font-weight: 700;
}

.hbc-espace-club__tableau tbody tr:nth-child(even) {
    background: #faf8fb;
}

.hbc-espace-club__tableau--licencies {
    min-width: 1050px;
    table-layout: auto;
}

.hbc-espace-club__tableau--licencies th {
    background: #fff;
    border-bottom: 1px solid #c3c4c7;
    color: #1d2327;
    font-size: 13px;
    font-weight: 600;
}

.hbc-espace-club__tableau--licencies td {
    color: #50575e;
}

.hbc-espace-club__tableau--licencies td:first-child,
.hbc-espace-club__tableau--licencies td:nth-child(2) {
    color: #1d2327;
}

.hbc-espace-club__statut {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid #c3c4c7;
    border-radius: 999px;
    background: #f6f7f7;
    color: #2c3338;
    font-size: 12px;
    white-space: nowrap;
}

.hbc-boutique-produit {
    margin: 20px 0 30px;
    padding: 18px;
    border: 1px solid var(--hbc-bordure);
    border-radius: 6px;
    background: #f8f6fa;
}

.hbc-boutique-produit > h3 {
    margin-top: 0;
}

.hbc-boutique-produit__formulaire {
    background: transparent;
}

.hbc-boutique-produit__categories,
.hbc-boutique-produit__variantes,
.hbc-boutique-produit__large {
    grid-column: 1 / -1;
}

.hbc-boutique-produit__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 16px;
    padding: 12px;
    border: 1px solid var(--hbc-bordure);
    background: #fff;
}

.hbc-boutique-produit__categories legend {
    padding: 0 5px;
    font-weight: 700;
}

.hbc-boutique-produit__categories label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    font-weight: 400;
}

.hbc-boutique-produit__variantes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    border-left: 4px solid var(--hbc-violet);
    background: var(--hbc-violet-clair);
}

.hbc-boutique-produit__variantes p {
    grid-column: 1 / -1;
    margin: 0;
    color: #50575e;
    font-size: 13px;
}

.hbc-boutique-produit__image {
    display: block;
    margin-top: 8px;
}

.hbc-boutique-produit__image img,
.hbc-boutique-produits__miniature img {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 3px;
    object-fit: cover;
}

.hbc-boutique-image-absente {
    display: inline-block;
    max-width: 110px;
    font-size: 12px;
    color: #625769;
}

.hbc-boutique-images label {
    display: block;
    margin-bottom: 8px;
}

.hbc-boutique-produit__image img[hidden] {
    display: none !important;
}

.hbc-boutique-produits__tableau {
    min-width: 980px;
    table-layout: auto;
}

.hbc-boutique-produits__tableau th,
.hbc-boutique-produits__tableau td {
    vertical-align: middle;
}

.hbc-boutique-produits__miniature {
    width: 72px;
}

.hbc-espace-club__formulaire {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--hbc-bordure);
    border-radius: 6px;
    background: #fff;
}

.hbc-espace-club__formulaire label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
}

.hbc-espace-club__formulaire input,
.hbc-espace-club__formulaire select,
.hbc-espace-club__formulaire textarea {
    max-width: 100%;
    min-height: 40px;
}

.hbc-espace-club__formulaire p {
    grid-column: 1 / -1;
    margin: 0;
}

.hbc-espace-club__formulaire-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: end;
}

.hbc-espace-club__formulaire-inline label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
}

.hbc-espace-club__formulaire-inline input {
    max-width: 145px;
}

.hbc-espace-club__message {
    margin: 14px 0;
    padding: 10px 14px;
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
}

.hbc-espace-club__message--error {
    border-left-color: #b32d2e;
    background: #fcf0f1;
}

.hbc-espace-club__message--success {
    border-left-color: #00a32a;
    background: #edfaef;
}

.hbc-espace-club__message p {
    margin: 0;
}

.hbc-espace-club .hbc-stage-panneau {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #c3c4c7;
    border-radius: 5px;
    background: #f8f7fa;
}

.hbc-stage-panneau > summary { cursor: pointer; font-weight: 600; }
.hbc-stage-formulaire { display: grid; gap: 10px; margin: 10px 0; }
.hbc-stage-formulaire > label { display: block; }
.hbc-stage-formulaire select { max-width: 100%; }
.hbc-stage-formulaire > button { justify-self: start; }
.hbc-stage-recherche { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 10px 0; }
.hbc-stage-recherche select { max-width: 100%; }
.hbc-stage-choix { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 10px; border: 1px solid #c3c4c7; }
.hbc-stage-choix label { display: block; }
.hbc-stage-ligne { border-top: 1px solid #c3c4c7; padding-top: 8px; margin-top: 12px; }
.hbc-stage-tableau { min-width: 850px; }
.hbc-espace-club .hbc-stage-lien { width: 100%; box-sizing: border-box; }

/* Suivi privé des activités : conserver la densité du planning annuel. */
.hbc-suivi-presences {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid #c3c4c7;
    border-radius: 5px;
    background: #f8f7fa;
}
.hbc-suivi-gestion summary { cursor: pointer; font-weight: 600; }
.hbc-suivi-formulaire { display: grid; gap: 10px; margin: 10px 0 18px; }
.hbc-suivi-formulaire > label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hbc-suivi-formulaire > button { justify-self: start; max-width: 100%; white-space: normal; }
.hbc-suivi-joueur { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 12px 12px; border: 1px solid #c3c4c7; min-width: 0; }
.hbc-suivi-joueur legend { font-weight: 600; padding: 0 5px; }
.hbc-suivi-joueur label { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; }
.hbc-suivi-presences { scroll-margin-top: 32px; }
.hbc-planning-table .hbc-planning-entrainement { background: #f2e8f7; color: #4b176d; border-left: 3px solid #4b176d; }

@media (max-width: 700px) {
    .hbc-espace-club .hbc-planning-filtres { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); }
    .hbc-planning-equipes { grid-template-columns: minmax(0, 1fr); }
    .hbc-planning-gestion__contenu { padding: 10px; }
    body.hbc-espace-club-vue-large .hbc-espace-club,
    body.hbc-espace-club-vue-planning .hbc-espace-club {
        width: calc(100vw - 20px);
        margin-left: calc(50% - 50vw + 10px);
    }

    .hbc-espace-club__grille {
        grid-template-columns: 1fr;
    }

    .hbc-espace-club__formulaire {
        grid-template-columns: 1fr;
    }

    .hbc-boutique-produit__variantes {
        grid-template-columns: 1fr;
    }
}
