.mars-tableau-complexe a {
    color: inherit;
    font-weight: inherit;
    text-decoration: underline;
    font-size: inherit;
}

.mars-tableau-complexe a:hover,
.mars-tableau-complexe a:focus {
    color: var(--text-action-hovered);
    text-decoration: none;
    outline: none;
}

.pasDeSautDeLigne {
    align-items: center;
}

.mars-tableau-complexe__flex {
    display: flex;
}

.mars-tableau-complexe__block {
    display: block;
}

p {
    word-break: break-word;
}

.mars-tableau-complexe__container_tableaux {
    width: var(--size_940px);
    margin: 0 auto;
    border: var(--size_2px) solid var(--border-decorative-smoky);
    border-radius: var(--size_16px);
}

.mars-tableau-complexe__onglets {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin-bottom: var(--size_64px);
    border-bottom: var(--size_1px) solid var(--background-button);
}

.mars-tableau-complexe__button_onglet {
    height: calc(100% - 5px);
    align-items: center;
    padding-top: var(--size_16px);
    padding-bottom: var(--size_15px);
    cursor: pointer;
    display: flex;
    justify-content: center;
    text-align: center;

    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: var(--size_16px);
    line-height: 1.6;
    letter-spacing: 0;
    color: var(--text-decorative-prime);
    background-color: var(--background-base);
    border: none;
    position: relative;
}

.mars-tableau-complexe__button_onglet.mars-tableau-complexe__button_onglet-active,
.mars-tableau-complexe__button_onglet:not(.mars-tableau-complexe__button_onglet-active):hover {
    font-weight: 700;
}

.mars-tableau-complexe__button_onglet.mars-tableau-complexe__button_onglet-active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 4px;
    background-color: var(--background-decorative);
    border-radius: 10px 10px 0 0;
}

.mars-tableau-complexe__button_onglet:not(.mars-tableau-complexe__button_onglet-active):hover:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 4px;
    background-color: var(--background-decorative-normal-light);
    border-radius: 10px 10px 0 0;
}

.mars-tableau-complexe__hidden {
    display: none;
}

.mars-tableau-complexe__with-popin {
    position: relative;
}

.mars-tableau-complexe__with-popin .button_pop_in {
    cursor: pointer;
    border: none;
    background-color: transparent;
}

.mars-tableau-complexe__with-popin .button_pop_in::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.mars-tableau-complexe__bulle_aide {
    margin-bottom: 1px;
    color: var(--icon-action);
}

.mars-tableau-complexe__cellule-libelle-popin .mars-tableau-complexe__bulle_aide {
    margin-bottom: 2px;
}

.mars-tableau-complexe__cellule-libelle-popin .mars-tableau-complexe__bulle_aide-header, .mars-tableau-complexe__bulle_aide-header {
    margin-left: 5px;
}

/*Pour les pictos dans des cellules*/
.mars-tableau-complexe__cellule-picto-semantic-alert {
    fill: var(--semantic-alert);
}

.mars-tableau-complexe__cellule-picto-semantic-success {
    fill: var(--semantic-success);
}

.mars-tableau-complexe__cellule-picto-icon-decorative {
    fill: var(--icon-decorative);
}

.mars-tableau-complexe__cellule-picto-icon-default {
    fill: var(--icon-default);
}

/*Supprimer le cadre noir autour de l'element focalise.
Comme il y a une intervention JavaScript,
ne pas utiliser cette methode entrainerait l'apparition d'un cadre noir autour des cellules sans bouton
apres la fermeture du modal.*/
th:focus,
td:focus {
    outline: none;
}

.mars-tableau-complexe__margin_top_16 {
    margin-top: 16px;
}

.mars-tableau-complexe__margin_top_0 {
    margin-top: 0;
}

/*CSS dedie pour desktop*/
@media (min-width: 960px) {

    .mars-tableau-complexe__tableaux_mobile {
        display: none;
    }

    .mars-tableau-complexe__onglets {
        width: var(--size_940px);
        justify-content: flex-start;
    }

    .mars-tableau-complexe__button_onglet {
        width: var(--size_178px);
    }

    .mars-tableau-complexe__container_mobile {
        display: none;
    }

    .mars-tableau-complexe__container_desktop {
        display: block;
        width: var(--size_940px);
        margin: 0 auto;
    }

    .mars-tableau-complexe__tableaux_desktop_header {
        width: var(--size_892px);
        margin-top: var(--size_24px);
        margin-left: var(--size_24px);
        border-collapse: collapse;
    }

    .mars-tableau-complexe__sticky-header-wrapper {
        position: sticky;
        top: var(--size_99px);
        background-color: var(--background-base);
        transition: box-shadow 0.3s ease;
    }

    .mars-tableau-complexe__tableaux_desktop_corps {
        width: var(--size_892px);
        margin-bottom: var(--size_24px);
        margin-left: var(--size_24px);
        border-collapse: collapse;
    }

    .mars-tableau-complexe__cellule_tableaux {
        height: var(--size_52px);
        text-align: center;
        vertical-align: middle;
        border-bottom: var(--size_1px) solid var(--border-decorative-smoky);
    }

    .mars-tableau-complexe__libelle_lignes {
        height: var(--size_52px);
        text-align: left;
        padding-left: var(--size_12px);
        vertical-align: middle;
        border-bottom: var(--size_1px) solid var(--border-decorative-smoky);
    }

    .mars-tableau-complexe__ligne_separation {
        white-space: normal;
        width: 100%;
        display: flex;
        position: relative;
        align-items: center;
        height: var(--size_52px);
        padding-left: var(--size_12px);
        border-radius: var(--size_8px);
        background: var(--background-decorative-smoky);
        color: var(--text-decorative-prime);

        font-family: Open Sans, sans-serif;
        font-weight: 700;
        font-size: var(--size_16px);
        line-height: 1.4;
    }

    tr:not(.mars-tableau-complexe__first-line) + tr.mars-tableau-complexe__separating-line > td,
    tr:not(.mars-tableau-complexe__first-line) + tr.mars-tableau-complexe__separating-line > td {
        padding-top: var(--size_40px);
    }

    .table-body table tr:last-child td {
        border-bottom: none;
    }


    .mars-tableau-complexe__header {
        color: var(--text-decorative-prime);
        vertical-align: top;
        padding-top: var(--size_8px);
        padding-bottom: var(--size_12px);
        font-weight: bold;
    }

    .mars-tableau-complexe__header_libelle {
        color: var(--text-decorative-prime);
        padding-left: var(--size_12px);
        vertical-align: top;
        padding-top: var(--size_8px);
        padding-bottom: var(--size_12px);
        font-weight: bold;
    }

    .mars-tableau-complexe__case_container_cellule_header {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        text-align: center;
    }

    .mars-tableau-complexe__case_container_cellule {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        text-align: center;
        padding: var(--size_8px);
    }

    .mars-tableau-complexe__case_container_libelle {
        width: auto;
        white-space: nowrap;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
    }

    .mars-tableau-complexe__sticky-header-wrapper.mars-tableau-complexe__is-sticky-header {
        box-shadow: 0 0 16px 1px rgba(28, 73, 103, 0.40);
        border-radius: 0 0 8px 8px;
    }

    .mars-tableau-complexe__modal .mars-modal-body {
        max-height: 60vh;
    }

}

.mars-tableau-complexe__sticky-header-wrapper:has(.mars-modal.modal-show) {
    z-index: 100;
}

.mars-tableau-complexe__sticky-header-wrapper {
    z-index: 10;
}


/*CSS d�di�  pour mobile*/
@media (max-width: 959px) {

    table {
        border-collapse: collapse;
        width: 100%;
        margin: 0 auto;
    }

    .mars-tableau-complexe__table-body-scrollX table.tableaux_mobile {
        margin-bottom: var(--size_16px);
    }

    td, th {
        padding-right: var(--size_16px);
    }


    .mars-tableau-complexe__container_desktop {
        display: none;
    }

    /*faut le garder pour l'onglet*/
    .mars-tableau-complexe__container_mobile {
        display: block;
        width: calc(100vw - var(--size_24px));
        margin-left: var(--size_24px);
    }


    .mars-tableau-complexe__tableaux_desktop {
        display: none;
    }

    .mars-tableau-complexe__sticky-header-wrapper {
        position: sticky;
        top: var(--size_64px); /* Colle l'en-tête en haut de l'écran */
        background-color: var(--background-base);

        /*overflow-x: auto;*/
        overflow-x: hidden; /* passage en hidden pour corriger le bug safari */

        /* Cache la barre de défilement horizontale de cet élément */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE 10+ */

    }

    /* C'est en effet aussi un wrapper*/
    .mars-tableau-complexe__table-body-scrollX {
        overflow-x: auto; /* Permet le défilement horizontal du corps du tableau */
        overflow-y: hidden;
    }

    .mars-tableau-complexe__cellule_pair_header {
        width: var(--size_200px);
        min-height: var(--size_72px);
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        border: var(--size_2px) solid var(--border-decorative-smoky);
        background-color: #f4f9fc;
        position: relative;
        font-weight: bold;
    }

    .mars-tableau-complexe__cellule_impair_header {
        width: var(--size_200px);
        min-height: var(--size_72px);
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        border: var(--size_2px) solid var(--border-decorative-smoky);
        background-color: var(--background-base);
        font-weight: bold;
    }


    .mars-tableau-complexe__cellule_pair {
        width: var(--size_200px);
        min-height: var(--size_48px);
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        background-color: #F4F9FC;
        position: relative;
        padding: var(--size_8px);
    }


    .mars-tableau-complexe__cellule_impair {
        width: var(--size_200px);
        min-height: var(--size_48px);
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        background-color: var(--background-base);
        padding: var(--size_8px);
    }

    .mars-tableau-complexe__libelle_whole_ligne {
        min-height: var(--size_36px);
        position: sticky;
        left: 0;
        width: calc(100vw - var(--size_48px)) !important;
        border: var(--size_2px) solid var(--border-decorative-smoky);
        border-radius: var(--size_4px);
        padding-left: var(--size_12px);
        display: flex;
        justify-content: flex-start;
        text-align: left;
        align-items: center;
        background-color: var(--background-base);
    }

    .wholeLigneSeconde {
        padding-top: var(--size_16px);
    }

    .mars-tableau-complexe__onglets {
        position: sticky;
        left: var(--size_24px);
        background-color: var(--background-base);
        justify-content: center;
        width: calc(100vw - var(--size_48px)) !important;
    }

    .mars-tableau-complexe__button_onglet {
        flex: 1;
    }

    .mars-tableau-complexe__ligne_separation_mobile {
        position: sticky;
        left: 0;
        width: calc(100vw - var(--size_48px)) !important;
        white-space: normal;
        display: flex;
        align-items: center;
        min-height: var(--size_52px);
        border-radius: var(--size_4px);
        margin-bottom: var(--size_16px);
        /*margin-top: var(--size_16px);*/
        padding-left: var(--size_12px);
        background: var(--background-decorative-smoky);
        color: var(--text-decorative-prime);

        font-family: Open Sans, sans-serif;
        font-weight: 700;
        font-size: var(--size_16px);
        line-height: 1.4;
    }

    .mars-tableau-complexe__column-overlay {
        position: absolute;
        top: 0;
        background-color: #f4f9fc;
        z-index: -1;
        pointer-events: none;
        height: 100%;
    }

    .mars-tableau-complexe__sticky-header-wrapper.mars-tableau-complexe__is-sticky-header {
        box-shadow: 0 0 16px 1px rgba(28, 73, 103, 0.40);
        border-radius: 0 0 0 8px;
    }

    .tableaux_mobile {
        height: fit-content;
    }

    .tableaux_mobile .mars-tableau-complexe__header-line {
        height: 100%;
    }

    .mars-tableau-complexe__header-line > .mars-tableau-complexe__with-popin > .mars-tableau-complexe__cellule_impair_header,
    .mars-tableau-complexe__header-line > .mars-tableau-complexe__with-popin > .mars-tableau-complexe__cellule_pair_header {
        height: 100%;
    }

    .mars-tableau-complexe__modal .mars-modal-squelette {
        border-radius: var(--size_8px) var(--size_8px) 0 0;
    }

    .mars-tableau-complexe__modal .mars-modal-body {
        max-height: 60vh;
    }
}

/*  la fin du choix media*/

/* specificites modale de tableaux */
.mars-tableau-complexe__modal .mars-modal-squelette {
    width: var(--size_624px);
    background-color: var(--background-base);
    background-clip: padding-box;
    border-radius: var(--size_8px);
    pointer-events: auto;
    outline: 0;
}

.mars-tableau-complexe__modal .mars-modal-content {
    display: flex;
    flex-direction: column;
    padding: var(--size_24px);
}

.mars-tableau-complexe__modal .mars-modal-fermer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: var(--size_8px);
}

.mars-tableau-complexe__modal .mars-modal-header {
    border-bottom: none;
}

.mars-tableau-complexe__modal .mars-modal-crc-fermer {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: var(--size_16px);
    line-height: 160%;
    letter-spacing: 0;
}

.mars-tableau-complexe__modal .btn-close {
    border: none;
    background-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

.mars-tableau-complexe__modal .mars-modal-body {
    flex: 1 1 auto;
    padding-top: 0;
    padding-bottom: 0;
    overflow-y: auto;
    scrollbar-color: var(--background-decorative-prime) #ffffff;
}

.mars-tableau-complexe__modal .mars-modal-header {
    padding-top: 0;
    padding-bottom: var(--size_20px);
}

.mars-tableau-complexe__modal .mars-modal-body p {
    white-space: normal;
}

.mars-tableau-complexe__modal .mars-modal-title {
    color: var(--text-decorative-prime);
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: var(--size_24px);
    line-height: 120%;
    letter-spacing: 0;

}

.mars-tableau-complexe__cellule-popin {
    display: inline-flex;
    white-space: normal;
}


.mars-tableau-complexe__cellule-popin p {
    display: inline;
    margin: 0;
}

.mars-tableau-complexe__cellule-popin button {
    vertical-align: middle;
}
