/*
 * Maarif Access — thème de l'interface web (cahier des charges, section 6.6).
 * S'appuie uniquement sur les variables de tokens.css.
 * Sprint S1 : typographie, barre latérale, pages d'authentification.
 */

body {
    font-family: var(--ma-font-body);
    color: var(--ma-ink);
}

h1, h2, h3, h4, h5, h6,
.page-title,
.ma-heading {
    font-family: var(--ma-font-heading);
}

/* ------------------------------------------------------------------ */
/* Barre latérale : fond marine, texte blanc à 80 %, actif marine foncé */
/* avec filet turquoise de 3 px à gauche, titres de section turquoise clair */
/* ------------------------------------------------------------------ */

#sidebar.sidebar {
    background: var(--ma-navy);
    border-right: 0;
    width: var(--ma-sidebar-width);
}

#sidebar.sidebar .sidebar-menu > ul > li .submenu-hdr {
    color: var(--ma-teal-light);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

#sidebar.sidebar .sidebar-menu > ul > li .submenu-hdr::after {
    background: rgba(255, 255, 255, 0.12);
}

#sidebar.sidebar .sidebar-menu ul li a,
#sidebar.sidebar .sidebar-menu ul li a span,
#sidebar.sidebar .sidebar-menu ul li a i {
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
}

#sidebar.sidebar .sidebar-menu ul li a {
    border-radius: var(--ma-radius-field);
}

#sidebar.sidebar .sidebar-menu ul li a:hover,
#sidebar.sidebar .sidebar-menu ul li a:hover span,
#sidebar.sidebar .sidebar-menu ul li a:hover i {
    color: var(--ma-white);
    background: rgba(255, 255, 255, 0.06);
}

#sidebar.sidebar .sidebar-menu ul li.active > a,
#sidebar.sidebar .sidebar-menu ul li a.active {
    background: var(--ma-navy-dark);
    box-shadow: inset 3px 0 0 var(--ma-teal);
}

#sidebar.sidebar .sidebar-menu ul li.active > a span,
#sidebar.sidebar .sidebar-menu ul li a.active span {
    color: var(--ma-white);
    font-weight: 500;
}

#sidebar.sidebar .sidebar-menu ul li.active > a i,
#sidebar.sidebar .sidebar-menu ul li a.active i {
    color: var(--ma-teal);
    background: transparent;
}

#sidebar.sidebar .sidebar-menu .menu-arrow::before {
    border-color: rgba(255, 255, 255, 0.8) !important;
}

#sidebar.sidebar .sidebar-menu ul li ul li a::after {
    background: rgba(255, 255, 255, 0.5);
    border-color: transparent;
}

.ma-sidebar-identity {
    display: flex;
    align-items: center;
    gap: var(--ma-space-3);
    padding: var(--ma-space-4);
    margin-bottom: var(--ma-space-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Logo seul, qui remplit tout le cercle : pas de fond ni de marge blanche autour */
.ma-sidebar-identity__logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.ma-sidebar-identity__name {
    display: block;
    color: var(--ma-white);
    font-family: var(--ma-font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.ma-sidebar-identity__meta {
    display: block;
    color: var(--ma-teal-light);
    font-size: 11px;
}

/* ------------------------------------------------------------------ */
/* Pages d'authentification : fond marine, symbole Maarif en filigrane */
/* à 5 %, carte blanche centrée, logo couleur 96 px, choix de langue   */
/* ------------------------------------------------------------------ */

.ma-auth {
    min-height: 100vh;
    margin: 0;
    background: var(--ma-navy);
    font-family: var(--ma-font-body);
    color: var(--ma-ink);
    position: relative;
    overflow-x: hidden;
}

.ma-auth::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url('../img/maarif/symbole-blanc.png') center / min(80vh, 90vw) no-repeat;
    opacity: 0.05;
    pointer-events: none;
}

.ma-auth__wrap {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ma-space-5);
    padding: var(--ma-space-6) var(--ma-space-4);
}

.ma-auth__card {
    width: 100%;
    max-width: 420px;
    background: var(--ma-white);
    border-radius: var(--ma-radius-card);
    box-shadow: var(--ma-shadow-modal);
    padding: var(--ma-space-6);
}

.ma-auth__logo {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto var(--ma-space-4);
}

.ma-auth__title {
    font-family: var(--ma-font-heading);
    font-size: 22px;
    line-height: 30px;
    font-weight: 600;
    color: var(--ma-navy);
    text-align: center;
    margin-bottom: var(--ma-space-1);
}

.ma-auth__subtitle {
    color: var(--ma-slate);
    font-size: 14px;
    text-align: center;
    margin-bottom: var(--ma-space-5);
}

.ma-auth .form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ma-ink);
}

.ma-auth .form-control {
    height: 40px;
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-field);
    font-size: 14px;
}

.ma-auth .form-control:focus {
    border-color: var(--ma-teal);
    box-shadow: var(--ma-focus-ring);
}

.ma-auth .form-control.is-invalid {
    border-color: var(--ma-danger);
}

.ma-auth .invalid-feedback,
.ma-auth .ma-field-error {
    color: var(--ma-danger);
    font-size: 12px;
    margin-top: var(--ma-space-1);
}

.ma-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ma-space-2);
    height: 40px;
    padding: 0 var(--ma-space-4);
    border: 0;
    border-radius: var(--ma-radius-field);
    background: var(--ma-navy);
    color: var(--ma-white);
    font-size: 14px;
    font-weight: 500;
}

.ma-btn-primary:hover,
.ma-btn-primary:focus {
    background: var(--ma-navy-dark);
    color: var(--ma-white);
}

.ma-link {
    color: var(--ma-teal-dark);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.ma-link:hover {
    color: var(--ma-navy);
    text-decoration: underline;
}

.ma-alert {
    display: flex;
    gap: var(--ma-space-2);
    padding: var(--ma-space-3);
    border-radius: var(--ma-radius-field);
    font-size: 14px;
    margin-bottom: var(--ma-space-4);
}

.ma-alert--danger {
    background: var(--ma-danger-bg);
    color: var(--ma-danger);
}

.ma-alert--success {
    background: var(--ma-success-bg);
    color: var(--ma-success);
}

.ma-alert--info {
    background: var(--ma-info-bg);
    color: var(--ma-info);
}

.ma-alert--warning {
    background: var(--ma-warning-bg);
    color: var(--ma-warning);
}

.ma-auth__lang {
    display: flex;
    gap: var(--ma-space-2);
}

.ma-auth__lang a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: var(--ma-space-1) var(--ma-space-2);
    border-radius: var(--ma-radius-field);
}

.ma-auth__lang a.is-active,
.ma-auth__lang a:hover {
    color: var(--ma-white);
    background: rgba(255, 255, 255, 0.12);
}

.ma-auth__footer {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
    margin: 0;
}

.ma-password-rules {
    color: var(--ma-gray);
    font-size: 12px;
    margin: var(--ma-space-1) 0 0;
}

/* ------------------------------------------------------------------ */
/* En-tête : marque Maarif Access                                      */
/* ------------------------------------------------------------------ */

.header .header-left .ma-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--ma-space-2);
    line-height: 1;
    text-decoration: none;
}

.header .header-left .ma-brand img {
    width: 32px;
    height: 32px;
}

.header .header-left .dark-logo.ma-brand {
    display: none;
}

@media (max-width: 991.98px) {
    .header .header-left .ma-brand {
        justify-content: center;
    }

    .header .header-left .ma-brand img {
        width: 32px;
    }
}

.header .header-left .ma-brand span {
    font-family: var(--ma-font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--ma-navy);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Mise en page (6.5) : barre latérale de 264 px, messages visibles     */
/* à droite de la barre latérale et sous l'en-tête                     */
/* ------------------------------------------------------------------ */

@media (min-width: 992px) {
    body:not(.mini-sidebar) .header .header-left {
        width: var(--ma-sidebar-width);
    }

    body:not(.mini-sidebar) .page-wrapper {
        margin-left: var(--ma-sidebar-width);
    }

    .main-wrapper > .alert {
        margin: calc(56px + var(--ma-space-4)) var(--ma-space-5) calc(-56px + var(--ma-space-2)) calc(var(--ma-sidebar-width) + var(--ma-space-5)) !important;
        position: relative;
        z-index: 2;
    }
}

@media (max-width: 991.98px) {
    .main-wrapper > .alert {
        margin: calc(56px + var(--ma-space-4)) var(--ma-space-4) calc(-56px + var(--ma-space-2)) !important;
        position: relative;
        z-index: 2;
    }
}

/* ------------------------------------------------------------------ */
/* Badges de statut (6.6) : fond clair, texte foncé, 12 px, arrondi     */
/* ------------------------------------------------------------------ */

.ma-badge {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
}

.ma-badge--success { background: var(--ma-success-bg); color: var(--ma-success); }
.ma-badge--warning { background: var(--ma-warning-bg); color: var(--ma-warning); }
.ma-badge--danger { background: var(--ma-danger-bg); color: var(--ma-danger); }
.ma-badge--info { background: var(--ma-info-bg); color: var(--ma-info); }

/* Mot de passe provisoire lisible dans le bandeau des identifiants */
.alert code {
    font-size: 15px;
    font-weight: 600;
    color: var(--ma-ink);
    background: var(--ma-cloud);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Composants de page (6.6) : en-tête de page, cartes, indicateurs,    */
/* état vide, listes compactes                                         */
/* ------------------------------------------------------------------ */

.ma-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ma-space-4);
    margin-bottom: var(--ma-space-5);
}

.ma-page-header__title {
    font-family: var(--ma-font-heading);
    font-size: 28px;
    line-height: 36px;
    font-weight: 700;
    color: var(--ma-ink);
    margin: 0;
}

.ma-page-header__subtitle {
    color: var(--ma-slate);
    font-size: 14px;
    margin: var(--ma-space-1) 0 0;
}

.ma-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ma-space-2);
}

.ma-card {
    background: var(--ma-white);
    border-radius: var(--ma-radius-card);
    box-shadow: var(--ma-shadow-card);
    margin-bottom: var(--ma-space-5);
}

.ma-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ma-space-3);
    padding: var(--ma-space-4) var(--ma-space-5);
    border-bottom: 1px solid var(--ma-border);
}

.ma-card__title {
    display: flex;
    align-items: center;
    gap: var(--ma-space-2);
    font-family: var(--ma-font-heading);
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
    color: var(--ma-ink);
    margin: 0;
}

.ma-card__title i {
    color: var(--ma-teal-dark);
    font-size: 20px;
}

.ma-card__body {
    padding: var(--ma-space-4) var(--ma-space-5);
}

.ma-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--ma-space-4);
    margin-bottom: var(--ma-space-5);
}

.ma-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--ma-space-4);
    padding: var(--ma-space-5);
    background: var(--ma-white);
    border-radius: var(--ma-radius-card);
    box-shadow: var(--ma-shadow-card);
}

.ma-kpi__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--ma-teal-light);
    color: var(--ma-teal-dark);
    font-size: 24px;
}

.ma-kpi__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ma-kpi__label {
    color: var(--ma-slate);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.ma-kpi__value {
    font-family: var(--ma-font-heading);
    font-size: 28px;
    line-height: 32px;
    font-weight: 700;
    color: var(--ma-navy);
    font-variant-numeric: tabular-nums;
}

.ma-kpi__hint {
    color: var(--ma-gray);
    font-size: 12px;
    line-height: 18px;
}

.ma-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--ma-space-2);
    padding: var(--ma-space-6) var(--ma-space-4);
}

.ma-empty__icon {
    font-size: 32px;
    color: var(--ma-gray);
}

.ma-empty__text {
    color: var(--ma-slate);
    font-size: 14px;
    margin: 0;
}

.ma-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ma-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ma-space-3);
    min-height: 48px;
    padding: var(--ma-space-2) 0;
    border-bottom: 1px solid var(--ma-border);
}

.ma-list__item:last-child {
    border-bottom: 0;
}

.ma-list__main {
    min-width: 0;
}

.ma-list__title {
    display: block;
    color: var(--ma-ink);
    font-size: 14px;
    font-weight: 500;
}

.ma-list__meta {
    display: block;
    color: var(--ma-gray);
    font-size: 12px;
}

.ma-time {
    flex-shrink: 0;
    min-width: 96px;
    color: var(--ma-navy);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* En-tête : boutons, menus déroulants, avatar à initiales            */
/* ------------------------------------------------------------------ */

.ma-badge {
    text-transform: none;
    letter-spacing: 0;
}

.ma-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ma-space-1);
    min-width: 36px;
    height: 36px;
    padding: 0 var(--ma-space-2);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-field);
    background: var(--ma-white);
    color: var(--ma-slate);
    font-size: 13px;
    font-weight: 600;
}

.ma-header-btn i {
    font-size: 20px;
}

.ma-header-btn:hover,
.ma-header-btn:focus {
    color: var(--ma-navy);
    border-color: var(--ma-navy);
}

.ma-header-btn__count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ma-danger);
    color: var(--ma-white);
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.ma-header-menu {
    min-width: 280px;
    padding: 0;
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-card);
    box-shadow: var(--ma-shadow-modal);
    overflow: hidden;
}

.ma-header-menu__title {
    font-family: var(--ma-font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--ma-ink);
    margin: 0;
    padding: var(--ma-space-3) var(--ma-space-4);
    border-bottom: 1px solid var(--ma-border);
}

.ma-header-menu__scroll {
    max-height: 320px;
    overflow-y: auto;
}

.ma-header-menu__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: normal;
    padding: var(--ma-space-3) var(--ma-space-4);
    border-bottom: 1px solid var(--ma-border);
}

.ma-header-menu__profile {
    display: flex;
    flex-direction: column;
    padding: var(--ma-space-3) var(--ma-space-4);
    border-bottom: 1px solid var(--ma-border);
}

.ma-header-menu .dropdown-item {
    font-size: 14px;
    padding: var(--ma-space-2) var(--ma-space-4);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--ma-navy-light);
    color: var(--ma-navy);
}

.ma-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ma-navy);
    color: var(--ma-white);
    font-family: var(--ma-font-heading);
    font-size: 13px;
    font-weight: 600;
    object-fit: cover;
}

/* ------------------------------------------------------------------ */
/* Composants Bootstrap alignés sur la charte (6.6), sur toutes les    */
/* pages : boutons, champs, tableaux, cartes, modales                  */
/* ------------------------------------------------------------------ */

.btn {
    border-radius: var(--ma-radius-field);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    padding: 9px var(--ma-space-4);
}

.btn-sm {
    padding: 5px var(--ma-space-3);
}

.btn-primary {
    background: var(--ma-navy);
    border-color: var(--ma-navy);
    color: var(--ma-white);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--ma-navy-dark) !important;
    border-color: var(--ma-navy-dark) !important;
    color: var(--ma-white) !important;
}

.btn-outline-primary,
.ma-btn-secondary {
    background: var(--ma-white);
    border: 1px solid var(--ma-navy);
    color: var(--ma-navy);
}

.btn-outline-primary:hover,
.ma-btn-secondary:hover {
    background: var(--ma-navy-light);
    color: var(--ma-navy);
}

.ma-btn-quick {
    background: var(--ma-teal-dark);
    border: 1px solid var(--ma-teal-dark);
    color: var(--ma-white);
}

.ma-btn-quick:hover {
    background: var(--ma-navy);
    color: var(--ma-white);
}

.btn-danger,
.ma-btn-danger {
    background: var(--ma-danger);
    border-color: var(--ma-danger);
    color: var(--ma-white);
}

.form-control,
.form-select {
    min-height: 40px;
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-field);
    font-size: 14px;
    color: var(--ma-ink);
}

.form-control::placeholder {
    color: var(--ma-gray);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ma-teal);
    box-shadow: var(--ma-focus-ring);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--ma-danger);
}

.invalid-feedback,
.text-danger {
    color: var(--ma-danger) !important;
}

.table > thead > tr > th {
    background: var(--ma-cloud);
    color: var(--ma-slate);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table > tbody > tr > td {
    height: 48px;
    color: var(--ma-ink);
    font-variant-numeric: tabular-nums;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--ma-navy-light);
    --bs-table-bg-state: var(--ma-navy-light);
}

/* Les libellés masqués (visually-hidden) des en-têtes restent dans le conteneur défilant :
   sans repère positionné, ils élargissent la page et créent un défilement horizontal. */
.table-responsive {
    position: relative;
}

/* Le conteneur défilant coupe ce qui dépasse : un tableau d'une ou deux lignes laisse la place au
   menu d'actions (Modifier, Supprimer), sinon un campus qui démarre ne peut pas l'atteindre. */
.table-responsive:has(tbody [data-bs-toggle="dropdown"]) {
    min-height: 14rem;
}

.card {
    border-color: var(--ma-border);
    border-radius: var(--ma-radius-card);
    box-shadow: var(--ma-shadow-card);
}

.modal-content {
    border: 0;
    border-radius: var(--ma-radius-modal);
    box-shadow: var(--ma-shadow-modal);
}

.page-wrapper {
    background: var(--ma-cloud);
}

/* Notification éphémère : en haut à droite, couleur du statut, icône */
.ma-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--ma-space-2);
    max-width: 360px;
    padding: var(--ma-space-3) var(--ma-space-4);
    border-radius: var(--ma-radius-field);
    box-shadow: var(--ma-shadow-modal);
    font-size: 14px;
}

.ma-toast--success { background: var(--ma-success-bg); color: var(--ma-success); }
.ma-toast--danger { background: var(--ma-danger-bg); color: var(--ma-danger); }
.ma-toast--warning { background: var(--ma-warning-bg); color: var(--ma-warning); }
.ma-toast--info { background: var(--ma-info-bg); color: var(--ma-info); }

/* Chargement : squelettes gris aux dimensions du contenu */
.ma-skeleton {
    display: block;
    border-radius: var(--ma-radius-field);
    background: linear-gradient(90deg, var(--ma-border) 25%, var(--ma-cloud) 50%, var(--ma-border) 75%);
    background-size: 200% 100%;
    animation: ma-skeleton 1.4s ease-in-out infinite;
}

@keyframes ma-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ma-skeleton { animation: none; }
}

/* Guide de style */
.ma-swatch {
    display: flex;
    flex-direction: column;
    gap: var(--ma-space-1);
}

.ma-swatch__color {
    height: 64px;
    border-radius: var(--ma-radius-field);
    border: 1px solid var(--ma-border);
}

.ma-swatch__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ma-ink);
}

.ma-swatch__code {
    font-size: 12px;
    color: var(--ma-gray);
    font-variant-numeric: tabular-nums;
}

.ma-type-sample {
    margin: 0 0 var(--ma-space-3);
    color: var(--ma-ink);
}

/* Styles de texte (6.6) utilisables dans toutes les vues */
.ma-t-page { font-family: var(--ma-font-heading); font-size: 28px; line-height: 36px; font-weight: 700; }
.ma-t-section { font-family: var(--ma-font-heading); font-size: 22px; line-height: 30px; font-weight: 600; }
.ma-t-card { font-family: var(--ma-font-heading); font-size: 18px; line-height: 26px; font-weight: 600; }
.ma-t-kpi { font-family: var(--ma-font-heading); font-size: 28px; line-height: 32px; font-weight: 700; color: var(--ma-navy); font-variant-numeric: tabular-nums; }
.ma-t-body { font-size: 14px; line-height: 22px; font-weight: 400; }
.ma-t-label { font-size: 14px; line-height: 20px; font-weight: 500; }
.ma-t-th { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; }
.ma-t-small { font-size: 12px; line-height: 18px; font-weight: 400; }

/* Largeurs de modale (6.6) : 560 px formulaire simple, 800 px sinon */
.ma-modal-sm { max-width: 560px; }
.ma-modal-lg { max-width: 800px; }

/* Blocs de squelette */
.ma-skeleton--title { height: 20px; width: 60%; margin-bottom: var(--ma-space-2); }
.ma-skeleton--line { height: 14px; margin-bottom: var(--ma-space-2); }
.ma-skeleton--short { width: 80%; }
.ma-skeleton--button { height: 40px; width: 40%; }

/* Fond marine (logo blanc) */
.ma-bg-navy { background: var(--ma-navy); border-radius: var(--ma-radius-field); }

/* ------------------------------------------------------------------ */
/* Barre latérale : défilement natif, sur toutes les pages, sans      */
/* dépendre du JavaScript (l'ancien plugin slimScroll ne s'activait   */
/* pas sur certaines pages et ne suivait pas l'ouverture des menus)   */
/* ------------------------------------------------------------------ */

#sidebar.sidebar {
    overflow: hidden;
}

#sidebar .sidebar-inner {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

#sidebar .sidebar-inner::-webkit-scrollbar {
    width: 6px;
}

#sidebar .sidebar-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

#sidebar .sidebar-menu {
    padding-bottom: var(--ma-space-7);
}

/* ------------------------------------------------------------------ */
/* Pages d'erreur et de maintenance (section 6)                         */
/* ------------------------------------------------------------------ */

.ma-error {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ma-space-6) var(--ma-space-4);
    background: var(--ma-cloud);
}

.ma-error__card {
    width: 100%;
    max-width: 520px;
    padding: var(--ma-space-6);
    text-align: center;
    background: var(--ma-white);
    border-radius: var(--ma-radius-card);
    box-shadow: var(--ma-shadow-card);
}

.ma-error__logo { max-height: 56px; margin-bottom: var(--ma-space-5); }

.ma-error__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin-bottom: var(--ma-space-4);
    font-size: 48px;
    border-radius: 50%;
}

.ma-error__icon--danger { background: var(--ma-danger-bg); color: var(--ma-danger); }
.ma-error__icon--warning { background: var(--ma-warning-bg); color: var(--ma-warning); }
.ma-error__icon--info { background: var(--ma-info-bg); color: var(--ma-info); }
.ma-error__icon--neutral { background: var(--ma-navy-light); color: var(--ma-navy); }

.ma-error__code {
    margin: 0 0 var(--ma-space-2);
    font-family: var(--ma-font-heading);
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
}

.ma-error__code--danger { color: var(--ma-danger); }
.ma-error__code--warning { color: var(--ma-warning); }
.ma-error__code--info { color: var(--ma-info); }
.ma-error__code--neutral { color: var(--ma-navy); }

.ma-error__title { margin-bottom: var(--ma-space-3); font-size: 22px; color: var(--ma-ink); }
.ma-error__message { margin-bottom: var(--ma-space-5); color: var(--ma-slate); }
.ma-error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ma-space-2); }
.ma-error__footer { margin-top: var(--ma-space-4); font-size: 13px; color: var(--ma-gray); }

/* Liste défilante dans une fenêtre (sélection d'élèves, de destinataires) */
.ma-scroll-box {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-field);
}

/* ------------------------------------------------------------------ */
/* Fenêtre de confirmation après un enregistrement réussi              */
/* ------------------------------------------------------------------ */

.ma-success-popup-swal .swal2-popup {
    border-radius: 20px;
    overflow: hidden;
    padding: 0;
    max-width: 420px;
    box-shadow: var(--ma-shadow-modal);
}
.ma-success-popup-swal .swal2-html-container {
    padding: 0;
    margin: 0;
}
.ma-success-popup-swal .ma-success-popup-bg {
    background: linear-gradient(135deg, var(--ma-navy) 0%, var(--ma-navy-dark) 100%);
    padding: 2.5rem 1.5rem 1.5rem;
    position: relative;
}
.ma-success-popup-swal .ma-success-popup-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
.ma-success-popup-swal .ma-success-popup-logo-wrap {
    position: relative;
    z-index: 1;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.25rem;
    background: var(--ma-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ma-shadow-modal);
    padding: 12px;
}
.ma-success-popup-swal .ma-success-popup-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ma-success-popup-swal .ma-success-popup-title {
    position: relative;
    z-index: 1;
    color: var(--ma-white);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}
.ma-success-popup-swal .ma-success-popup-msg {
    position: relative;
    z-index: 1;
    color: var(--ma-white);
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0;
}
.ma-success-popup-swal .swal2-actions {
    padding: 1.25rem 1.5rem 1.5rem;
    margin: 0;
}
.ma-success-popup-swal .swal2-confirm {
    border-radius: 12px !important;
    padding: 0.6rem 1.75rem !important;
    font-weight: 600 !important;
}
