.themis-navigation {
    width: min(1500px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 80px;
}

.est-masquee {
    display: none !important;
}

.barre-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
}

.barre-navigation .groupe-navigation.est-masquee {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
}

.indicateur-annee {
    width: fit-content;
    margin: 14px auto 0;
    padding: 6px 11px;
    color: rgba(255, 255, 255, .78);
    border: 1px solid rgba(255, 255, 255, .16);
    font-size: .76rem;
    letter-spacing: .035em;
}

.indicateur-annee strong {
    color: #fff;
    font-weight: 850;
}

.logo-themis {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    margin-right: 8px;
}

.logo-themis img {
    display: block;
    width: 68px;
    height: 68px;
    object-fit: contain;
}

.groupe-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bouton-choix {
    min-width: 68px;
    min-height: 48px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
    cursor: pointer;
    font-weight: 850;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, border-color .16s ease, opacity .16s ease;
}

.bouton-choix:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .2);
    filter: brightness(1.06);
}

.bouton-choix:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .72);
    outline-offset: 3px;
}

.bouton-choix.actif {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .2), 0 12px 28px rgba(0, 0, 0, .24);
    transform: translateY(-2px);
}

.bouton-choix.est-indisponible,
.bouton-choix:disabled {
    color: rgba(255, 255, 255, .46) !important;
    background: rgba(78, 91, 101, .48) !important;
    border-color: rgba(255, 255, 255, .09) !important;
    box-shadow: none;
    cursor: default;
    filter: grayscale(.6);
    opacity: .72;
}

.bouton-diplome,
.bouton-modalite {
    color: #fff;
    background: linear-gradient(110deg, var(--bleu), var(--turquoise));
}

.bouton-diplome {
    min-width: 76px;
}

.bouton-consulter {
    min-width: 168px;
    color: #fff;
    background: #05080b;
}

.bouton-departement {
    color: #fff;
}

.departement-cj {
    color: #123f4d;
    background: #54c3e8;
}

.departement-gea {
    background: #942647;
}

.departement-geii {
    color: #4a2746;
    background: #c995c1;
}

.departement-info {
    color: #233807;
    background: #9bc531;
}

.departement-rt {
    color: #60340f;
    background: #f7bd8c;
}

.departement-sd {
    background: #ed0a5b;
}

.bouton-modalite {
    min-width: 62px;
}

.ligne-formations {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 14px;
    margin-top: 34px;
}

.bouton-formation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 145px;
    min-height: 62px;
    padding: 10px 17px;
}

.formation-libelle {
    display: block;
    font-size: .9rem;
    font-weight: 850;
    line-height: 1.2;
}

.formation-parcours {
    display: block;
    margin-top: 4px;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .06em;
    line-height: 1.15;
}

.zone-tableau {
    margin-top: 32px;
    padding: 42px;
    color: var(--bleu-profond);
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: 0;
    box-shadow: var(--ombre);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
}


.bouton-administration-fixe {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 48px;
    padding: 11px 18px;
    color: #fff;
    background: #05080b;
    border: 1px solid var(--turquoise);
    border-radius: 0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
    font-weight: 850;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.bouton-administration-fixe:hover {
    color: #fff;
    background: var(--bleu);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .34);
}

.bouton-administration-fixe:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .72);
    outline-offset: 3px;
}

.popup-ouverte {
    overflow: hidden;
}

.popup-mccc {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.popup-mccc-fond {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(2, 14, 25, .76);
    border: 0;
    cursor: default;
    backdrop-filter: blur(4px);
}

.popup-mccc-fenetre {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100vw - 48px));
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 0;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .4);
}

.popup-mccc-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    color: #fff;
    background: linear-gradient(110deg, var(--bleu), var(--turquoise));
}

.popup-mccc-entete h2 {
    margin: 0;
    font-size: 1.1rem;
}

.popup-mccc-fermer {
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 1.9rem;
    line-height: 1;
}

.popup-mccc-contenu {
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 36px;
    color: var(--bleu-profond);
    font-size: 1.2rem;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .barre-navigation {
        gap: 9px;
    }

    .logo-themis {
        width: 62px;
        height: 62px;
    }

    .logo-themis img {
        width: 58px;
        height: 58px;
    }

    .bouton-choix {
        min-height: 44px;
        padding: 9px 12px;
    }

    .bouton-consulter {
        min-width: 150px;
    }
}

@media (max-width: 720px) {
    .themis-navigation {
        width: min(100% - 28px, 1500px);
        padding-top: 20px;
    }

    .barre-navigation {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .logo-themis {
        flex-basis: 100%;
        margin-right: 0;
    }

    .groupe-navigation {
        justify-content: center;
        flex-wrap: wrap;
    }

    .groupe-departements {
        flex-basis: 100%;
    }

    .bouton-formation {
        flex: 1 1 150px;
        min-width: 0;
    }
}

/* Tableaux MCCC */
.zone-tableau {
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 400;
}

.bloc-semestre + .bloc-semestre {
    margin-top: 34px;
}

.titre-semestre {
    margin: 0 0 10px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 850;
    text-align: center;
}

.tableau-defilement {
    width: 100%;
    overflow-x: auto;
    border-radius: 0;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

.tableau-mccc {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    color: var(--bleu-profond);
    background: #fff;
}

.tableau-mccc th,
.tableau-mccc td {
    border: 1px solid rgba(9, 46, 67, .14);
}

.tableau-mccc thead th {
    padding: 10px 10px;
    color: #fff;
    background: rgba(9, 46, 67, .96);
    font-size: .78rem;
    font-weight: 850;
    text-align: center;
    vertical-align: bottom;
}

.tableau-mccc thead th:nth-child(1) {
    width: 92px;
}

.tableau-mccc thead th:nth-child(2) {
    min-width: 310px;
    text-align: left;
}

.tableau-mccc th.colonne-competence {
    width: 42px;
    min-width: 42px;
    height: 126px;
    padding: 0;
    vertical-align: middle;
}

.tableau-mccc th.colonne-competence span {
    display: inline-block;
    white-space: nowrap;
    transform: rotate(-90deg);
    transform-origin: center;
    font-size: .72rem;
    letter-spacing: .025em;
}

.tableau-mccc th.colonne-volume {
    width: 68px;
    min-width: 68px;
}

.tableau-mccc tbody td {
    padding: 8px 10px;
    font-size: .78rem;
    line-height: 1.25;
}

.tableau-mccc tbody tr:nth-child(even) td {
    background: rgba(20, 142, 159, .045);
}

.tableau-mccc tbody tr.ligne-sae td {
    background: rgba(20, 142, 159, .09);
}

.tableau-mccc tbody tr:hover td {
    background: rgba(20, 142, 159, .15);
}

.cellule-code {
    white-space: nowrap;
    font-weight: 850;
    text-align: center;
}

.cellule-libelle {
    min-width: 310px;
    font-weight: 650;
}

.cellule-nombre {
    white-space: nowrap;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cellule-competence {
    width: 42px;
    min-width: 42px;
    padding-left: 5px !important;
    padding-right: 5px !important;
}

.cellule-volume {
    width: 68px;
    min-width: 68px;
}

@media (max-width: 720px) {
    .tableau-mccc thead th:nth-child(2),
    .cellule-libelle {
        min-width: 240px;
    }
}

/* Teintes des tableaux selon le département */
.tableau-departement-cj {
    --departement-rgb: 84, 195, 232;
    --departement-texte: #123f4d;
}

.tableau-departement-gea {
    --departement-rgb: 148, 38, 71;
    --departement-texte: #ffffff;
}

.tableau-departement-geii {
    --departement-rgb: 201, 149, 193;
    --departement-texte: #4a2746;
}

.tableau-departement-info {
    --departement-rgb: 155, 197, 49;
    --departement-texte: #233807;
}

.tableau-departement-rt {
    --departement-rgb: 247, 189, 140;
    --departement-texte: #60340f;
}

.tableau-departement-sd {
    --departement-rgb: 237, 10, 91;
    --departement-texte: #ffffff;
}

.tableau-mccc[class*="tableau-departement-"] thead th {
    color: var(--departement-texte);
    background: rgba(var(--departement-rgb), .92);
}

.tableau-mccc[class*="tableau-departement-"] thead th.colonne-competence {
    background: rgba(var(--departement-rgb), .64);
}

/* Ressources : teinte légère, alternée une ligne sur deux. */
.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-ressource:nth-child(odd) td {
    background: rgba(var(--departement-rgb), .055);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-ressource:nth-child(even) td {
    background: rgba(var(--departement-rgb), .105);
}

/* SAE : même couleur départementale, mais nettement plus marquée. */
.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-sae:nth-child(odd) td {
    background: rgba(var(--departement-rgb), .16);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-sae:nth-child(even) td {
    background: rgba(var(--departement-rgb), .22);
}

/* Les coefficients de compétences sont visuellement séparés des volumes horaires. */
.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-ressource:nth-child(odd) td.cellule-competence {
    background: rgba(var(--departement-rgb), .14);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-ressource:nth-child(even) td.cellule-competence {
    background: rgba(var(--departement-rgb), .19);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-sae:nth-child(odd) td.cellule-competence {
    background: rgba(var(--departement-rgb), .27);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr.ligne-sae:nth-child(even) td.cellule-competence {
    background: rgba(var(--departement-rgb), .33);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr:hover td {
    background: rgba(var(--departement-rgb), .27);
}

.tableau-mccc[class*="tableau-departement-"] tbody tr:hover td.cellule-competence {
    background: rgba(var(--departement-rgb), .40);
}

/* Règlement des études / MCCC */
.popup-mccc-fenetre {
    width: min(1180px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}

.popup-mccc-entete {
    flex: 0 0 auto;
}

.popup-mccc-contenu {
    min-height: 0;
    display: block;
    overflow: auto;
    padding: 0;
    color: var(--bleu-profond);
    font-size: 1rem;
    font-weight: 400;
    background: #eef3f6;
}

.reglement-document {
    width: min(900px, calc(100% - 48px));
    min-height: 500px;
    margin: 28px auto;
    padding: 46px 54px 60px;
    background: #fff;
    border: 1px solid rgba(6, 50, 82, .16);
    box-shadow: 0 16px 44px rgba(0, 24, 43, .12);
    line-height: 1.62;
}

.reglement-document.est-editable {
    outline: none;
    border-color: rgba(0, 163, 153, .55);
    box-shadow: 0 16px 44px rgba(0, 24, 43, .14), inset 4px 0 0 var(--turquoise);
}

.reglement-document.est-editable:focus {
    border-color: var(--turquoise);
}

.reglement-document h1 {
    margin: 0 0 30px;
    color: var(--bleu);
    font-size: 1.75rem;
    line-height: 1.2;
    text-align: center;
}

.reglement-document h2 {
    margin: 32px 0 14px;
    color: var(--bleu);
    font-size: 1.18rem;
    line-height: 1.3;
}

.reglement-document h3 {
    margin: 24px 0 10px;
    color: var(--turquoise-fonce, #008f88);
    font-size: 1rem;
}

.reglement-document p {
    margin: 0 0 14px;
}

.reglement-document > p.reglement-note,
.reglement-document > p:first-child {
    color: #5d6c75;
    font-size: .86rem;
    text-align: center;
}

.reglement-document ul,
.reglement-document ol {
    margin: 10px 0 18px 24px;
    padding: 0;
}

.reglement-document li {
    margin: 6px 0;
}

.reglement-document table {
    width: 100%;
    margin: 20px 0 28px;
    border-collapse: collapse;
    font-size: .92rem;
}

.reglement-document th,
.reglement-document td {
    padding: 9px 11px;
    border: 1px solid #aebcc5;
    vertical-align: top;
}

.reglement-document th {
    background: #e8f2f5;
    color: var(--bleu-profond);
    text-align: left;
}

.reglement-document blockquote {
    margin: 24px 0 12px;
    padding: 10px 16px;
    border-left: 4px solid var(--turquoise);
    background: #eef8f7;
}

.reglement-document a {
    color: var(--bleu);
}

.reglement-vide {
    padding: 90px 30px;
    text-align: center;
}

.reglement-vide h2 {
    margin-top: 0;
}

.reglement-edition-barre {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    background: #e6eef2;
    border-bottom: 1px solid #c4d2da;
}

.reglement-edition-barre button {
    min-height: 34px;
    padding: 6px 10px;
    color: var(--bleu-profond);
    background: #fff;
    border: 1px solid #b7c6cf;
    border-radius: 0;
    cursor: pointer;
    font: inherit;
    font-size: .85rem;
    font-weight: 750;
}

.reglement-edition-barre button:hover {
    background: #f4fbfb;
    border-color: var(--turquoise);
}

.reglement-edition-separateur {
    width: 1px;
    height: 25px;
    margin: 0 3px;
    background: #b7c6cf;
}

.reglement-edition-suivi {
    position: sticky;
    top: 55px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 16px;
    color: #2d556c;
    background: #edf4f6;
    border-bottom: 1px solid #c4d2da;
    font-size: .8rem;
}

.reglement-version {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.reglement-version strong {
    color: var(--bleu-profond);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.reglement-version span {
    color: #607582;
}

.reglement-edition-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.reglement-edition-etat {
    color: #2d655f;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.reglement-edition-etat.etat-enregistrement {
    color: #8a6811;
}

.reglement-edition-etat.etat-erreur {
    color: #a3263b;
}

.reglement-edition-etat.etat-publie {
    color: #08766f;
}

.bouton-publier-reglement {
    min-height: 34px;
    padding: 7px 15px;
    color: #fff;
    background: var(--turquoise);
    border: 1px solid var(--turquoise);
    border-radius: 0;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
}

.bouton-publier-reglement:hover:not(:disabled) {
    filter: brightness(.92);
}

.bouton-publier-reglement:disabled {
    cursor: wait;
    opacity: .55;
}

@media (max-width: 720px) {
    .popup-mccc {
        padding: 10px;
    }

    .popup-mccc-fenetre {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .reglement-edition-suivi {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .reglement-edition-actions {
        width: 100%;
        justify-content: space-between;
    }

    .reglement-document {
        width: calc(100% - 20px);
        margin: 10px auto;
        padding: 26px 20px 36px;
    }

    .reglement-document h1 {
        font-size: 1.4rem;
    }
}

.bouton-versions-reglement {
    min-height: 34px;
    padding: 7px 15px;
    color: var(--bleu-profond);
    background: #fff;
    border: 1px solid #9eb1bc;
    border-radius: 0;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
}

.bouton-versions-reglement:hover {
    background: #f4fbfb;
    border-color: var(--turquoise);
}

.popup-versions-reglement {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.popup-versions-reglement.est-masquee {
    display: none;
}

.popup-versions-reglement-fond {
    position: absolute;
    inset: 0;
    padding: 0;
    background: rgba(2, 20, 31, .72);
    border: 0;
    cursor: pointer;
}

.popup-versions-reglement-fenetre {
    position: relative;
    z-index: 1;
    width: min(680px, calc(100vw - 48px));
    max-height: min(720px, calc(100vh - 48px));
    overflow: hidden;
    color: var(--bleu-profond);
    background: #f7fafb;
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.popup-versions-reglement-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 18px;
    color: #fff;
    background: var(--bleu-profond);
}

.popup-versions-reglement-entete h2 {
    margin: 0;
    font-size: 1.05rem;
}

.popup-versions-reglement-fermer {
    width: 34px;
    height: 34px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 0;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.popup-versions-reglement-contenu {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 18px;
}

.popup-versions-reglement-contenu > p {
    margin: 0 0 16px;
    color: #536b79;
    line-height: 1.5;
}

.liste-versions-reglement {
    display: grid;
    gap: 8px;
}

.version-reglement-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #d2dde3;
}

.version-reglement-infos {
    display: grid;
    gap: 3px;
}

.version-reglement-infos strong {
    color: var(--bleu-profond);
}

.version-reglement-infos span,
.versions-reglement-vide {
    color: #6b7d87;
    font-size: .82rem;
}

.bouton-charger-version-reglement {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 13px;
    color: #fff;
    background: var(--turquoise);
    border: 1px solid var(--turquoise);
    border-radius: 0;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    font-weight: 850;
}

.bouton-charger-version-reglement:hover {
    filter: brightness(.92);
}

@media (max-width: 720px) {
    .version-reglement-ligne {
        align-items: stretch;
        flex-direction: column;
    }

    .bouton-charger-version-reglement {
        width: 100%;
    }
}

.reglement-export-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bouton-export-reglement {
    min-height: 34px;
    padding: 7px 11px;
    color: var(--bleu-profond);
    background: #f7fbfc;
    border: 1px solid #9eb1bc;
    border-radius: 0;
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .03em;
}

.bouton-export-reglement:hover:not(:disabled) {
    color: #fff;
    background: var(--bleu-profond);
    border-color: var(--bleu-profond);
}

.bouton-export-reglement:disabled {
    cursor: wait;
    opacity: .5;
}

@media (max-width: 900px) {
    .reglement-edition-actions {
        flex-wrap: wrap;
    }
}
