/* =====================================================================
   MesActes — composants d'interface communs (refonte UX/UI, DESIGN.md)
   Conventions reprises des espaces Scolarix (en-tête court, puces de filtre,
   lignes de liste, cartes avec lien de pied, indicateurs touchables, sections
   repliables), dessinées avec les jetons du Brand Book MesActes v2 :
   bleu d'action, papier, filets fins, angles francs, Spectral + Inter.
   Mobile d'abord (360 px). Toute cible tactile ≥ 44 px.
   ===================================================================== */

/* --- En-tête de page court ------------------------------------------- */
.ma-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ma-space-3); flex-wrap: wrap;
  margin: var(--ma-space-2) 0 var(--ma-space-5); }
.ma-tete__texte { min-width: 0; }
.ma-tete .ma-overline { display: block; margin-bottom: var(--ma-space-1); }
.ma-tete h1 { margin: 0; overflow-wrap: anywhere; }
.ma-tete__sous { margin: var(--ma-space-1) 0 0; color: var(--ma-gris); font-size: var(--ma-fs-small); }
.ma-tete__actions { display: flex; gap: var(--ma-space-2); flex-wrap: wrap; }
.ma-tete .ma-retour { display: inline-flex; align-items: center; min-height: var(--ma-control-min); margin-bottom: var(--ma-space-1); }

/* --- Puces de filtre (défilent horizontalement, jamais la page) ------- */
.ma-puces { display: flex; gap: var(--ma-space-2); overflow-x: auto; scrollbar-width: none; margin: 0 0 var(--ma-space-4);
  padding: 2px 0; -webkit-overflow-scrolling: touch; }
.ma-puces::-webkit-scrollbar { display: none; }
.ma-puce { display: inline-flex; align-items: center; gap: var(--ma-space-2); flex: 0 0 auto; min-height: var(--ma-control-min);
  padding: 0 var(--ma-space-4); border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-pill); background: var(--ma-surface);
  color: var(--ma-texte-2); font-size: var(--ma-fs-small); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ma-puce:hover { border-color: var(--ma-bleu); color: var(--ma-bleu); }
.ma-puce[aria-current="page"], .ma-puce[aria-pressed="true"] { background: var(--ma-bleu); border-color: var(--ma-bleu); color: #fff; }
.ma-puce__nb { font-family: var(--ma-font-texte); font-variant-numeric: tabular-nums; font-weight: 600; opacity: .85; }

/* --- Carte ------------------------------------------------------------ */
.ma-carte { background: var(--ma-surface); border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-md);
  padding: var(--ma-space-4); margin-bottom: var(--ma-space-4); min-width: 0; }
.ma-carte__tete { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ma-space-2); flex-wrap: wrap; margin-bottom: var(--ma-space-2); }
.ma-carte__titre { margin: 0; font-family: var(--ma-font-texte); font-size: 1rem; font-weight: 600; color: var(--ma-encre); }
.ma-carte__note { font-size: var(--ma-fs-label); color: var(--ma-gris); }
.ma-carte__pied { display: flex; align-items: center; justify-content: space-between; min-height: var(--ma-control-min);
  margin: var(--ma-space-3) calc(-1 * var(--ma-space-4)) calc(-1 * var(--ma-space-4)); padding: 0 var(--ma-space-4);
  border-top: 1px solid var(--ma-filet-leger); color: var(--ma-bleu); font-weight: 600; font-size: var(--ma-fs-small); text-decoration: none; }
.ma-carte__pied::after { content: "›"; font-size: 1.25rem; line-height: 1; }
.ma-carte > .ma-rangs:last-child { margin-bottom: calc(-1 * var(--ma-space-2)); }

/* --- Lignes de liste (remplacent les grandes fiches et les tableaux sur mobile) */
.ma-rangs { list-style: none; margin: 0; padding: 0; }
.ma-rang { display: flex; align-items: center; gap: var(--ma-space-3); min-height: 64px; padding: var(--ma-space-3) 0;
  border-bottom: 1px solid var(--ma-filet-leger); color: inherit; text-decoration: none; min-width: 0; }
.ma-rangs > li:last-child > .ma-rang, .ma-rangs > .ma-rang:last-child { border-bottom: 0; }
a.ma-rang:hover .ma-rang__titre { color: var(--ma-bleu); text-decoration: underline; }
a.ma-rang:active { background: var(--ma-bleu-pale); }
.ma-rang--carte { background: var(--ma-surface); border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-md); padding: var(--ma-space-3) var(--ma-space-4); margin-bottom: var(--ma-space-2); }
.ma-rangs > li:last-child > .ma-rang--carte { border-bottom: 1px solid var(--ma-filet); }
.ma-rang--alerte { border-left: 3px solid var(--ma-statut-attente-texte); }
.ma-rang__corps { flex: 1 1 auto; min-width: 0; }
.ma-rang__ligne { display: flex; align-items: center; justify-content: space-between; gap: var(--ma-space-2); flex-wrap: wrap; }
.ma-rang__titre { font-weight: 600; color: var(--ma-encre); line-height: 1.3; overflow-wrap: anywhere; }
.ma-rang__sous { display: block; margin-top: 2px; font-size: var(--ma-fs-small); color: var(--ma-gris); overflow-wrap: anywhere; }
.ma-rang__suite { display: block; margin-top: var(--ma-space-1); font-size: var(--ma-fs-small); color: var(--ma-texte-2); }
.ma-rang__suite strong { color: var(--ma-encre); }
.ma-rang__valeur { flex: 0 0 auto; font-weight: 600; color: var(--ma-encre); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ma-rang__chevron { flex: 0 0 auto; color: var(--ma-gris); font-size: 1.4rem; line-height: 1; }
.ma-rang__actions { flex: 0 0 auto; display: flex; gap: var(--ma-space-2); }
.ma-rang__actions form { margin: 0; }
.ma-rang .ma-badge { flex: 0 0 auto; }
@media (max-width: 479.98px) {
  .ma-rang--empile { flex-wrap: wrap; }
  .ma-rang--empile .ma-rang__actions { flex: 1 1 100%; }
  .ma-rang--empile .ma-rang__actions .ma-btn { flex: 1 1 auto; }
}

/* --- Indicateurs touchables ------------------------------------------ */
.ma-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ma-space-3); margin-bottom: var(--ma-space-4); }
@media (min-width: 992px) { .ma-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ma-kpi { position: relative; display: block; min-height: 96px; padding: var(--ma-space-3) var(--ma-space-4); background: var(--ma-surface);
  border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-md); color: inherit; text-decoration: none; min-width: 0; }
a.ma-kpi::after { content: "›"; position: absolute; top: var(--ma-space-2); right: var(--ma-space-3); color: var(--ma-gris); font-size: 1.2rem; }
a.ma-kpi:hover { border-color: var(--ma-bleu); }
.ma-kpi__libelle { display: block; font-size: var(--ma-fs-label); font-weight: 500; color: var(--ma-gris); padding-right: var(--ma-space-4); }
.ma-kpi__valeur { display: block; margin-top: var(--ma-space-1); font-family: var(--ma-font-titre); font-size: 1.75rem; font-weight: 600; color: var(--ma-encre);
  line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ma-kpi__sous { display: block; margin-top: 2px; font-size: var(--ma-fs-label); color: var(--ma-gris); }
.ma-kpi--alerte { border-left: 3px solid var(--ma-statut-attente-texte); }

/* --- Bloc « À faire maintenant » (une action dominante) -------------- */
.ma-afaire { display: flex; flex-direction: column; gap: var(--ma-space-3); margin-bottom: var(--ma-space-5); padding: var(--ma-space-4);
  background: var(--ma-surface); border: 1px solid var(--ma-filet); border-left: 4px solid var(--ma-bleu); border-radius: var(--ma-radius-md); }
.ma-afaire--attente { border-left-color: var(--ma-statut-attente-texte); }
.ma-afaire--succes { border-left-color: var(--ma-vert-succes); }
.ma-afaire--danger { border-left-color: var(--ma-rouge-texte); }
.ma-afaire--neutre { border-left-color: var(--ma-filet); }
.ma-afaire__tete { display: flex; align-items: flex-start; gap: var(--ma-space-3); }
.ma-afaire__tete > .ma-icon { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 2px; color: var(--ma-bleu); }
.ma-afaire--attente .ma-afaire__tete > .ma-icon { color: var(--ma-statut-attente-texte); }
.ma-afaire--succes .ma-afaire__tete > .ma-icon { color: var(--ma-vert-succes); }
.ma-afaire--danger .ma-afaire__tete > .ma-icon { color: var(--ma-rouge-texte); }
.ma-afaire__titre { margin: 0; font-family: var(--ma-font-texte); font-size: 1.05rem; font-weight: 600; color: var(--ma-encre); }
.ma-afaire__texte { margin: var(--ma-space-1) 0 0; color: var(--ma-texte-2); font-size: var(--ma-fs-small); }
.ma-afaire__actions { display: flex; flex-wrap: wrap; gap: var(--ma-space-2); }
.ma-afaire__actions form { margin: 0; }

/* --- Section repliable (explications secondaires, actions rares) ----- */
.ma-repli { border-top: 1px solid var(--ma-filet-leger); border-bottom: 1px solid var(--ma-filet-leger); margin: 0 0 var(--ma-space-4); }
.ma-repli + .ma-repli { margin-top: calc(-1 * var(--ma-space-4)); border-top: 0; }
.ma-repli > summary { display: flex; align-items: center; gap: var(--ma-space-2); min-height: 48px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--ma-encre); }
.ma-repli > summary::-webkit-details-marker { display: none; }
.ma-repli > summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; font-weight: 400; color: var(--ma-bleu); line-height: 1; }
.ma-repli[open] > summary::after { content: "\2212"; }
.ma-repli > summary:focus-visible { outline: none; box-shadow: var(--ma-focus-ring); }
.ma-repli__note { margin-left: var(--ma-space-1); font-weight: 400; color: var(--ma-gris); font-size: var(--ma-fs-small); }
.ma-repli__corps { padding: 0 0 var(--ma-space-4); }
.ma-repli--carte { background: var(--ma-surface); border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-md); padding: 0 var(--ma-space-4); }
.ma-repli--carte + .ma-repli--carte { margin-top: 0; border-top: 1px solid var(--ma-filet); }

/* --- Paires libellé / valeur compactes -------------------------------- */
.ma-paires { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ma-space-3); margin: 0; }
@media (min-width: 600px) { .ma-paires { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ma-paires > div { min-width: 0; }
.ma-paires dt { font-size: var(--ma-fs-label); color: var(--ma-gris); font-weight: 500; }
.ma-paires dd { margin: 2px 0 0; color: var(--ma-encre); overflow-wrap: anywhere; }

/* --- Titres de section ---------------------------------------------- */
.ma-titre-section { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ma-space-2); margin: var(--ma-space-6) 0 var(--ma-space-3); }
.ma-titre-section h2 { margin: 0; font-size: var(--ma-fs-h3); }
.ma-titre-section a { display: inline-flex; align-items: center; min-height: var(--ma-control-min); font-size: var(--ma-fs-small); font-weight: 600; }

/* --- Pastille d'ancienneté (dossiers anciens, information + texte) --- */
.ma-age { display: inline-flex; align-items: center; gap: 4px; font-size: var(--ma-fs-label); font-weight: 600; color: var(--ma-gris); white-space: nowrap; }
.ma-age--ancien { color: var(--ma-statut-attente-texte); }
.ma-age--ancien::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* --- Grille deux colonnes sur grand écran ---------------------------- */
.ma-duo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--ma-space-5); }
@media (min-width: 992px) { .ma-duo { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.ma-duo > * { min-width: 0; }

/* Référence en titre de page : garde la taille du titre (la classe .ma-ref la réduit ailleurs). */
.ma-tete h1 .ma-ref { font-size: inherit; font-weight: inherit; letter-spacing: 0; }
.ma-afaire__titre .ma-amount, .ma-rang__titre .ma-ref { font-size: inherit; font-weight: inherit; }

/* Contrôle d'une pièce : « Valider » direct, « Rejeter… » déplie le motif (refonte) */
.ma-rejet > summary { list-style: none; }
.ma-rejet > summary::-webkit-details-marker { display: none; }
.ma-rejet[open] > summary { margin-bottom: var(--ma-space-2); }
.ma-rejet { flex: 1 1 100%; }
.ma-piece + .ma-piece { margin-top: var(--ma-space-4); padding-top: var(--ma-space-4); border-top: 1px solid var(--ma-filet-leger); }
.ma-piece__titre { margin: 0; font-family: var(--ma-font-texte); font-size: 1rem; }
.ma-carte .ma-piece { padding: 0; margin: 0; background: none; border: 0; }
.ma-carte .ma-piece + .ma-piece { margin-top: var(--ma-space-4); padding-top: var(--ma-space-4); border-top: 1px solid var(--ma-filet-leger); }
.ma-controle { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ma-space-2); }
a.ma-rang__corps { color: inherit; text-decoration: none; min-height: var(--ma-control-min); }
a.ma-rang__corps:hover .ma-rang__titre { color: var(--ma-bleu); text-decoration: underline; }
a.ma-rang__corps:focus-visible { outline: none; box-shadow: var(--ma-focus-ring); }
/* Lignes de dossier : neutralise l'ancienne fiche .ma-dossier quand elle sert de conteneur de ligne */
.ma-rangs > li.ma-dossier { display: block; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; }
.ma-rangs > li.ma-dossier::before { content: none; }
.ma-rejet { flex: 0 1 auto; }
.ma-rejet[open] { flex: 1 1 100%; }
.ma-rangs.ma-liste-dossiers { display: block; }

/* En-tête de page historique (.ma-entete-page) aligné sur l'en-tête court : moins de marge, introduction discrète */
.ma-entete-page { margin: var(--ma-space-2) 0 var(--ma-space-5); }
.ma-entete-page > p.ma-text-2 { margin-top: var(--ma-space-1); font-size: var(--ma-fs-small); color: var(--ma-gris); max-width: var(--ma-measure); }
.ma-bloc { margin-bottom: var(--ma-space-6); }

/* Catalogue d'actes : niveau, exemplaires et « Ajouter » sur une même ligne quand la place le permet */
.ma-offre__champs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 var(--ma-space-3); }
.ma-offre__champs .ma-field { flex: 1 1 96px; min-width: 0; }
.ma-offre__ajouter { flex: 0 0 auto; margin-bottom: var(--ma-space-3); }
.ma-offre p { margin-bottom: var(--ma-space-2); }
.ma-list > li.ma-livraison { padding: var(--ma-space-4); border: 1px solid var(--ma-filet); }

/* Notifications : cartes resserrées */
.ma-notification__lien { padding: var(--ma-space-3) var(--ma-space-4); }
.ma-notifications { gap: var(--ma-space-2); }

/* Pagination */
.ma-pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--ma-space-3); flex-wrap: wrap; margin: var(--ma-space-4) 0 var(--ma-space-6); }
.ma-pagination__etat { font-size: var(--ma-fs-small); color: var(--ma-encre); font-variant-numeric: tabular-nums; }
.ma-pagination [aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* Graphiques en barres horizontales (une série, bleu MesActes) */
.ma-barres { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ma-space-2); }
.ma-barres__ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--ma-space-3); }
.ma-barres__libelle { grid-column: 1 / -1; }
@media (max-width: 479.98px) { .ma-barres__ligne { grid-template-columns: minmax(0, 1fr) auto; } .ma-barres__libelle { grid-column: 1 / -1; } }
.ma-barres__libelle { font-size: var(--ma-fs-small); color: var(--ma-texte-2); overflow-wrap: anywhere; }
.ma-barres__libelle a { color: inherit; }
.ma-barres__piste { position: relative; height: 12px; }
.ma-barres__barre { display: block; height: 100%; background: var(--ma-bleu); border-radius: 0 4px 4px 0; }
.ma-barres__ligne:hover .ma-barres__barre { background: var(--ma-bleu-fonce); }
.ma-barres__valeur { font-size: var(--ma-fs-small); font-weight: 600; color: var(--ma-encre); font-variant-numeric: tabular-nums; text-align: right; min-width: 2.5ch; }
.ma-graphe__tableau { margin: var(--ma-space-3) 0 0; border-bottom: 0; }
.ma-l-0 { width: 0%; }
.ma-l-2 { width: 2%; }
.ma-l-4 { width: 4%; }
.ma-l-6 { width: 6%; }
.ma-l-8 { width: 8%; }
.ma-l-10 { width: 10%; }
.ma-l-12 { width: 12%; }
.ma-l-14 { width: 14%; }
.ma-l-16 { width: 16%; }
.ma-l-18 { width: 18%; }
.ma-l-20 { width: 20%; }
.ma-l-22 { width: 22%; }
.ma-l-24 { width: 24%; }
.ma-l-26 { width: 26%; }
.ma-l-28 { width: 28%; }
.ma-l-30 { width: 30%; }
.ma-l-32 { width: 32%; }
.ma-l-34 { width: 34%; }
.ma-l-36 { width: 36%; }
.ma-l-38 { width: 38%; }
.ma-l-40 { width: 40%; }
.ma-l-42 { width: 42%; }
.ma-l-44 { width: 44%; }
.ma-l-46 { width: 46%; }
.ma-l-48 { width: 48%; }
.ma-l-50 { width: 50%; }
.ma-l-52 { width: 52%; }
.ma-l-54 { width: 54%; }
.ma-l-56 { width: 56%; }
.ma-l-58 { width: 58%; }
.ma-l-60 { width: 60%; }
.ma-l-62 { width: 62%; }
.ma-l-64 { width: 64%; }
.ma-l-66 { width: 66%; }
.ma-l-68 { width: 68%; }
.ma-l-70 { width: 70%; }
.ma-l-72 { width: 72%; }
.ma-l-74 { width: 74%; }
.ma-l-76 { width: 76%; }
.ma-l-78 { width: 78%; }
.ma-l-80 { width: 80%; }
.ma-l-82 { width: 82%; }
.ma-l-84 { width: 84%; }
.ma-l-86 { width: 86%; }
.ma-l-88 { width: 88%; }
.ma-l-90 { width: 90%; }
.ma-l-92 { width: 92%; }
.ma-l-94 { width: 94%; }
.ma-l-96 { width: 96%; }
.ma-l-98 { width: 98%; }
.ma-l-100 { width: 100%; }

/* Alertes du tableau de bord en lignes (niveau = icône + libellé + liseré, jamais la couleur seule) */
.ma-alertes-rangs { padding-top: 0; padding-bottom: 0; }
.ma-alertes-rangs { padding: 0; overflow: hidden; }
.ma-alertes-rangs .ma-rang { padding: var(--ma-space-3) var(--ma-space-4) var(--ma-space-3) var(--ma-space-3); border-left: 3px solid transparent; }
.ma-rang--danger { border-left-color: var(--ma-rouge-texte) !important; }
.ma-rang--warning { border-left-color: var(--ma-statut-attente-texte) !important; }
.ma-rang--info { border-left-color: var(--ma-bleu) !important; }
.ma-rang__icone { flex: 0 0 auto; width: 20px; height: 20px; color: var(--ma-gris); }
.ma-rang--danger .ma-rang__icone { color: var(--ma-rouge-texte); }
.ma-rang--warning .ma-rang__icone { color: var(--ma-statut-attente-texte); }
.ma-rang--info .ma-rang__icone { color: var(--ma-bleu); }
.ma-paires--chiffres dd { font-family: var(--ma-font-titre); font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ma-kpi__valeur { font-size: clamp(1.2rem, 4.6vw, 1.75rem); white-space: normal; overflow-wrap: anywhere; }

/* Tableaux : sur téléphone, chaque ligne devient une fiche (libellé de colonne devant chaque valeur) */
@media (max-width: 767.98px) {
  .ma-tableau-defilant:has(> .ma-table--cartes) { overflow-x: visible; }
  .ma-table--cartes, .ma-table--cartes tbody, .ma-table--cartes tr, .ma-table--cartes td, .ma-table--cartes tbody th { display: block; width: 100%; }
  .ma-table--cartes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ma-table--cartes tr { margin-bottom: var(--ma-space-3); padding: var(--ma-space-2) var(--ma-space-4); background: var(--ma-surface); border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-md); }
  .ma-table--cartes td, .ma-table--cartes tbody th { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ma-space-3); padding: var(--ma-space-2) 0;
    border-bottom: 1px solid var(--ma-filet-leger); text-align: right; overflow-wrap: anywhere; }
  .ma-table--cartes td:last-child { border-bottom: 0; }
  .ma-table--cartes td::before, .ma-table--cartes tbody th::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: var(--ma-fs-label); font-weight: 500; color: var(--ma-gris); }
  .ma-table--cartes td[data-label=""]::before, .ma-table--cartes td[data-label="Action"]::before { content: none; }
  .ma-table--cartes td[data-label="Action"], .ma-table--cartes td[data-label=""] { justify-content: flex-start; }
  .ma-table--cartes td > form { margin: 0; }
}

/* Filtres historiques (.ma-filtres) : même apparence que les puces, défilent sans élargir la page */
.ma-filtres { display: flex; gap: var(--ma-space-2); overflow-x: auto; scrollbar-width: none; padding: 2px 0; flex-wrap: nowrap; }
.ma-filtres::-webkit-scrollbar { display: none; }
.ma-filtres--onglets { flex-wrap: nowrap; }
.ma-filtre { display: inline-flex; align-items: center; gap: var(--ma-space-2); flex: 0 0 auto; min-height: var(--ma-control-min); padding: 0 var(--ma-space-4);
  border: 1px solid var(--ma-filet); border-radius: var(--ma-radius-pill); background: var(--ma-surface); color: var(--ma-texte-2);
  font-size: var(--ma-fs-small); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ma-filtre:hover { border-color: var(--ma-bleu); color: var(--ma-bleu); }
.ma-filtre[aria-current="page"] { background: var(--ma-bleu); border-color: var(--ma-bleu); color: #fff; font-weight: 600; }

/* Paramètres : valeur visible, « Modifier » déplie le formulaire */
.ma-parametres { padding-top: 0; padding-bottom: 0; }
.ma-parametre + .ma-parametre { border-top: 1px solid var(--ma-filet-leger); }
.ma-parametre__repli > summary { list-style: none; cursor: pointer; border-bottom: 0; }
.ma-parametre__repli > summary::-webkit-details-marker { display: none; }
.ma-parametre__modifier { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: var(--ma-control-min); padding: 0 var(--ma-space-2); color: var(--ma-bleu); font-weight: 600; font-size: var(--ma-fs-small); text-decoration: underline; }
.ma-parametre__repli[open] .ma-parametre__modifier { visibility: hidden; }
.ma-parametre__form { padding: 0 0 var(--ma-space-4); }
@media (max-width: 479.98px) { .ma-parametre__repli > summary { flex-wrap: wrap; } }

/* =====================================================================
   ADMINISTRATION — langage du tableau de bord Scolarix (dashboard/index.php)
   Mise en page, cartes, badges d'icône, anneaux et légendes de Scolarix ;
   couleurs et polices MesActes (choix du porteur de projet, 25/11/2026).
   Portée : espace de gestion (body.ma-espace-gestion).
   ===================================================================== */
.ma-espace-gestion {
  --dash-ink: var(--ma-encre);
  --dash-muted: #6B7086;
  --dash-border: #E6E8F0;
  --dash-soft: #F6F7FB;
  --dash-primary: var(--ma-bleu);
  --dash-rayon: 16px;
  --dash-ombre: 0 1px 2px rgba(21, 23, 43, .03);
  --dash-ombre-survol: 0 16px 32px rgba(21, 23, 43, .06);
  /* Palette catégorielle des graphiques, validée (dataviz : luminosité, daltonisme, contraste) */
  --ma-c1: #2E4AA6; --ma-c2: #6A9AE8; --ma-c3: #1E7A52; --ma-c4: #C8801E; --ma-c5: #8A5BB8;
}

/* --- En-tête de page (dash-header) --- */
.ma-espace-gestion .ma-tete, .ma-espace-gestion .ma-entete-page { margin: var(--ma-space-2) 0 var(--ma-space-6); }
.ma-espace-gestion .ma-tete .ma-overline, .ma-espace-gestion .ma-entete-page .ma-overline {
  display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--dash-primary); }
.ma-espace-gestion .ma-tete h1, .ma-espace-gestion .ma-entete-page h1 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; font-size: clamp(1.4rem, 1.2rem + .6vw, 1.65rem); color: var(--dash-ink); }
.ma-espace-gestion .ma-tete__sous, .ma-espace-gestion .ma-entete-page > p.ma-text-2 { margin: 0; font-size: 14px; color: var(--dash-muted); }
.ma-dash-pastille { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 30px; background: var(--ma-bleu-pale);
  color: var(--dash-primary); font-family: var(--ma-font-texte); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.ma-dash-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ma-space-4); }
.ma-dash-tete__actions { display: flex; gap: var(--ma-space-2); flex-shrink: 0; }
.ma-dash-rond { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--dash-border); background: var(--ma-surface); color: var(--dash-muted); transition: color .25s, border-color .25s, transform .25s; }
.ma-dash-rond:hover { color: var(--dash-primary); border-color: var(--dash-primary); transform: rotate(90deg); }
.ma-dash-rond .ma-icon { width: 18px; height: 18px; }
@media (max-width: 768px) { .ma-dash-tete { flex-direction: column; align-items: stretch; } }

/* --- Cartes (dash-card) --- */
.ma-espace-gestion .ma-carte, .ma-dcarte {
  background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre);
  padding: 1.35rem; transition: box-shadow .25s ease, transform .25s ease; }
.ma-dcarte:hover { box-shadow: var(--dash-ombre-survol); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .ma-dcarte:hover, .ma-dash-rond:hover { transform: none; } }
@media (max-width: 768px) { .ma-espace-gestion .ma-carte, .ma-dcarte { padding: 1rem; } }
.ma-dcarte { margin-bottom: 0; min-width: 0; display: flex; flex-direction: column; }
.ma-dcarte__tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 1.1rem; }
.ma-dcarte__titre { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ma-dcarte__titre h2, .ma-dcarte__titre h3 { margin: 0; font-family: var(--ma-font-texte); font-size: 15px; font-weight: 700; color: var(--dash-ink); }
.ma-dcarte__sous { display: block; font-size: 12px; color: var(--dash-muted); }
.ma-dcarte__total { font-size: 1.1rem; font-weight: 700; color: var(--dash-ink); text-align: right; font-variant-numeric: tabular-nums; }
.ma-dcarte__total small { display: block; font-size: 12px; font-weight: 500; color: var(--dash-muted); }
.ma-dcarte__lien { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 44px; margin-top: auto; padding-top: .85rem;
  border-top: 1px dashed var(--dash-border); font-size: 13px; font-weight: 600; color: var(--dash-primary); text-decoration: none; }
.ma-dcarte__lien:hover { color: var(--ma-bleu-fonce); text-decoration: underline; }
.ma-dcarte__corps { flex: 1 1 auto; }
.ma-dcarte__corps + .ma-dcarte__lien { margin-top: 1rem; }

/* --- Badge d'icône (dash-icon-badge) --- */
.ma-ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; }
.ma-ico .ma-icon { width: 20px; height: 20px; }
.ma-ico--bleu { background: rgba(46, 74, 166, .10); color: var(--ma-c1); }
.ma-ico--info { background: rgba(106, 154, 232, .16); color: #2F5DB0; }
.ma-ico--succes { background: rgba(30, 122, 82, .12); color: var(--ma-c3); }
.ma-ico--ambre { background: rgba(200, 128, 30, .14); color: #8A5410; }
.ma-ico--violet { background: rgba(138, 91, 184, .14); color: #6A3F98; }
.ma-ico--sombre { background: rgba(21, 23, 43, .06); color: var(--dash-ink); }
.ma-ico--danger { background: rgba(184, 50, 42, .10); color: var(--ma-rouge-texte); }

/* --- Grilles (row g-gs + col-lg-6 / col-md-4) --- */
.ma-dgrille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .ma-dgrille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .ma-dgrille--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .ma-dgrille--3l { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --- Anneau + légende (dash-donut-row) --- */
.ma-anneau-ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.ma-anneau { position: relative; flex-shrink: 0; width: 128px; height: 128px; }
.ma-anneau--grand { width: 200px; height: 200px; }
.ma-anneau svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ma-anneau__fond { fill: none; stroke: var(--dash-soft); stroke-width: 4.2; }
.ma-anneau__part { fill: none; stroke-width: 4.2; }
.ma-anneau__centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.ma-anneau__total { font-size: 1.3rem; font-weight: 700; color: var(--dash-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ma-anneau--grand .ma-anneau__total { font-size: 1.6rem; }
.ma-anneau__libelle { font-size: 11px; color: var(--dash-muted); text-transform: uppercase; letter-spacing: .05em; }
.ma-legende { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; }
.ma-legende li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--dash-border); font-size: 14px; }
.ma-legende li:last-child { border-bottom: 0; padding-bottom: 0; }
.ma-legende__point { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ma-legende__libelle { flex: 1; min-width: 0; color: var(--dash-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-legende__libelle a { color: inherit; }
.ma-legende__valeur { font-weight: 700; color: var(--dash-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ma-legende__pct { min-width: 46px; font-size: 12px; color: var(--dash-muted); text-align: right; font-variant-numeric: tabular-nums; }
.ma-s1 { stroke: var(--ma-c1); } .ma-s2 { stroke: var(--ma-c2); } .ma-s3 { stroke: var(--ma-c3); } .ma-s4 { stroke: var(--ma-c4); } .ma-s5 { stroke: var(--ma-c5); }
.ma-p1 { background: var(--ma-c1); } .ma-p2 { background: var(--ma-c2); } .ma-p3 { background: var(--ma-c3); } .ma-p4 { background: var(--ma-c4); } .ma-p5 { background: var(--ma-c5); }
@media (max-width: 768px) { .ma-anneau-ligne { flex-direction: column; align-items: center; } .ma-anneau-ligne .ma-legende { width: 100%; } }
@media (max-width: 576px) { .ma-anneau { width: 108px; height: 108px; } .ma-anneau__total { font-size: 1.05rem; } }

/* --- Cartes finance (finance-card) --- */
.ma-fin__tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.ma-fin__tendance { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 30px; font-size: 12px; font-weight: 700; }
.ma-fin__tendance--bleu { color: var(--ma-c1); background: rgba(46, 74, 166, .10); }
.ma-fin__tendance--info { color: #2F5DB0; background: rgba(106, 154, 232, .16); }
.ma-fin__tendance--succes { color: var(--ma-c3); background: rgba(30, 122, 82, .12); }
.ma-fin__montant { font-size: 1.55rem; font-weight: 700; color: var(--dash-ink); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ma-fin__montant small { margin-left: 3px; font-size: 12px; font-weight: 500; color: var(--dash-muted); }
.ma-fin__libelle { margin-top: 3px; font-size: 13px; color: var(--dash-muted); }
.ma-fin__pied { margin-top: 8px; font-size: 12px; color: var(--dash-muted); }
.ma-fin__barre { height: 6px; margin-top: 12px; background: var(--dash-soft); border-radius: 6px; overflow: hidden; }
.ma-fin__barre span { display: block; height: 100%; border-radius: 6px; background: var(--ma-c1); }
.ma-fin__barre--info span { background: var(--ma-c2); }
.ma-fin__barre--succes span { background: var(--ma-c3); }
@media (max-width: 768px) { .ma-fin__montant { font-size: 1.3rem; } }

/* --- Uniformisation de toute l'administration --- */
/* Tableaux : en-têtes en petites capitales sur fond doux ; le tableau vit dans une carte */
.ma-espace-gestion .ma-tableau-defilant { background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); }
.ma-espace-gestion .ma-table thead th { background: var(--dash-soft); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; color: var(--dash-muted); border-bottom: 0; padding: 12px 16px; }
.ma-espace-gestion .ma-table td, .ma-espace-gestion .ma-table tbody th { padding: 12px 16px; border-bottom: 1px solid var(--dash-border); }
.ma-espace-gestion .ma-table tbody tr:last-child td, .ma-espace-gestion .ma-table tbody tr:last-child th { border-bottom: 0; }
.ma-espace-gestion .ma-table tbody tr:hover { background: var(--dash-soft); }
@media (max-width: 767.98px) {
  .ma-espace-gestion .ma-tableau-defilant:has(> .ma-table--cartes) { background: none; border: 0; box-shadow: none; }
  .ma-espace-gestion .ma-table--cartes tr { border-color: var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); padding: 6px 16px; }
  .ma-espace-gestion .ma-table--cartes td, .ma-espace-gestion .ma-table--cartes tbody th { padding: 9px 0; }
  .ma-espace-gestion .ma-table--cartes tbody tr:hover { background: var(--ma-surface); }
}
/* Listes, filtres, soldes, pièces, livraisons : surfaces de carte */
.ma-espace-gestion .ma-gestion__contenu > .ma-container > .ma-lignes, .ma-espace-gestion section > .ma-lignes, .ma-espace-gestion .ma-piece,
.ma-espace-gestion .ma-list > li.ma-livraison, .ma-espace-gestion .ma-retraits > li {
  background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); }
.ma-espace-gestion section > .ma-lignes { padding: 0 1.35rem; }
.ma-espace-gestion form.ma-periode { padding: 1.1rem 1.35rem; margin-bottom: 1.5rem; background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); }
.ma-espace-gestion .ma-solde { border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); background: var(--ma-surface); }
.ma-espace-gestion .ma-solde__valeur { font-family: var(--ma-font-texte); font-weight: 700; color: var(--dash-ink); }
.ma-espace-gestion .ma-donnees { background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); padding: 0 1.35rem; }
.ma-espace-gestion .ma-repli--carte, .ma-espace-gestion .ma-rang--carte, .ma-espace-gestion .ma-kpi, .ma-espace-gestion .ma-afaire {
  border-color: var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); }
.ma-espace-gestion .ma-afaire { border-left-width: 4px; }
.ma-espace-gestion .ma-empty { background: var(--ma-surface); border: 1px dashed var(--dash-border); border-radius: var(--dash-rayon); }
/* Titres de section : sobres, comme les titres de carte Scolarix */
.ma-espace-gestion .ma-h3 { font-family: var(--ma-font-texte); font-size: 16px; font-weight: 700; color: var(--dash-ink); }
.ma-espace-gestion .ma-titre-section h2 { font-family: var(--ma-font-texte); font-size: 17px; font-weight: 700; }
/* Menu latéral : élément actif en pastille (nk-menu-item.active) */
.ma-espace-gestion .ma-menu__lien[aria-current="page"] { border-left-color: transparent; border-radius: 8px; background: var(--ma-bleu-pale); }
.ma-espace-gestion { background: #F5F6FA; }
.ma-espace-gestion .ma-gestion__contenu { max-width: 1180px; }
@media (min-width: 1024px) { .ma-espace-gestion .ma-gestion__contenu { padding-top: var(--ma-space-6); } }
/* Centre de pilotage : compléments */
.ma-lien-carte { color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.ma-lien-carte:hover .ma-fin__libelle { color: var(--dash-primary); text-decoration: underline; }
.ma-lien-carte:focus-visible { outline: none; box-shadow: var(--ma-focus-ring); }
.ma-mt { margin-top: 1rem; }
.ma-dgrille--empile { margin-bottom: 0; grid-template-columns: minmax(0, 1fr) !important; }
.ma-dcarte .ma-alertes-rangs { margin: 0 -1.35rem; }
.ma-dcarte .ma-repli--fin { margin: .5rem 0 0; border-bottom: 0; }
.ma-espace-gestion .ma-carte.ma-graphe { margin-bottom: 0; }
.ma-espace-gestion .ma-graphe .ma-carte__titre { font-size: 15px; font-weight: 700; }
.ma-espace-gestion .ma-barres__barre { background: var(--ma-c1); }
.ma-espace-gestion .ma-barres__ligne:hover .ma-barres__barre { background: var(--ma-bleu); }

/* --- Uniformisation (suite) : toute section de l'administration est une carte Scolarix --- */
/* Une section devient carte, sauf si elle contient déjà des cartes (pas de carte dans la carte) */
.ma-espace-gestion section.ma-bloc:not(:has(.ma-soldes, .ma-dcarte, .ma-carte, .ma-kpis, .ma-piece, .ma-livraison, .ma-retraits)) {
  background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); padding: 1.35rem; }
@media (max-width: 768px) { .ma-espace-gestion section.ma-bloc:not(:has(.ma-soldes, .ma-dcarte, .ma-carte, .ma-kpis, .ma-piece, .ma-livraison, .ma-retraits)) { padding: 1rem; } }
/* Ce qu'elle contient devient plat */
.ma-espace-gestion section.ma-bloc:not(:has(.ma-soldes, .ma-dcarte, .ma-carte, .ma-kpis, .ma-piece, .ma-livraison, .ma-retraits)) > .ma-tableau-defilant {
  border: 0; border-radius: 0; box-shadow: none; margin: 0 -1.35rem -1.35rem; }
.ma-espace-gestion section.ma-bloc:not(:has(.ma-soldes, .ma-dcarte, .ma-carte, .ma-kpis, .ma-piece, .ma-livraison, .ma-retraits)) > .ma-lignes {
  background: none; border: 0; box-shadow: none; padding: 0; }
.ma-espace-gestion section.ma-bloc > .ma-h3:first-child, .ma-espace-gestion section.ma-bloc > .ma-bloc__entete:first-child { margin-top: 0; margin-bottom: 1rem; }
.ma-espace-gestion section.ma-bloc .ma-list > li { border-bottom-style: dashed; border-bottom-color: var(--dash-border); }
@media (max-width: 767.98px) {
  .ma-espace-gestion section.ma-bloc:not(:has(.ma-soldes, .ma-dcarte, .ma-carte, .ma-kpis, .ma-piece, .ma-livraison, .ma-retraits)) > .ma-tableau-defilant { margin: 0; }
}

/* --- Alertes (caisses…) : lignes dans une carte, liseré de niveau + icône, comme le centre de pilotage --- */
.ma-espace-gestion .ma-alertes { background: var(--ma-surface); border: 1px solid var(--dash-border); border-radius: var(--dash-rayon); box-shadow: var(--dash-ombre); overflow: hidden; }
.ma-espace-gestion section.ma-bloc .ma-alertes { border: 0; box-shadow: none; border-radius: 0; margin: 0 -1.35rem; }
.ma-espace-gestion .ma-alertes__ligne { background: var(--ma-surface) !important; border: 0; border-left: 3px solid var(--ma-statut-attente-texte); border-bottom: 1px solid var(--dash-border);
  padding: 14px 1.35rem 14px calc(1.35rem - 3px); margin: 0; }
.ma-espace-gestion .ma-alertes__ligne:last-child { border-bottom: 0; }
.ma-espace-gestion .ma-alertes__ligne--danger { border-left-color: var(--ma-rouge-texte); }
.ma-espace-gestion .ma-alertes__ligne a { color: var(--dash-ink); font-weight: 600; text-decoration: none; }
.ma-espace-gestion .ma-alertes__ligne a:hover { color: var(--dash-primary); text-decoration: underline; }
/* Lignes dans une section-carte : séparateurs en pointillés au lieu de cartes imbriquées */
.ma-espace-gestion section.ma-bloc .ma-rangs .ma-rang--carte { border: 0; border-bottom: 1px dashed var(--dash-border); border-radius: 0; box-shadow: none; margin: 0; padding-left: 0; padding-right: 0; }
.ma-espace-gestion section.ma-bloc .ma-rangs > li:last-child > .ma-rang--carte { border-bottom: 0; }
/* Grilles et filtres : aucun enfant ne peut élargir la page */
.ma-espace-gestion .ma-quittance > * { min-width: 0; }
.ma-espace-gestion form.ma-periode > .ma-field { flex: 1 1 150px; min-width: 0; }
.ma-espace-gestion form.ma-periode .ma-select, .ma-espace-gestion form.ma-periode .ma-input { width: 100%; min-width: 0; }

/* =====================================================================
   ESPACES DE GESTION — mise en page de l'espace direction Scolarix
   (html/App/Views/base_groupe.php + base_direction.php) ; couleurs et polices MesActes.
   ===================================================================== */
/* --- Barre latérale (nk-sidebar) --- */
@media (min-width: 1024px) {
  .ma-espace-gestion .ma-gestion { grid-template-columns: 290px minmax(0, 1fr); }
  .ma-espace-gestion .ma-barre-laterale { border-right: 0; box-shadow: 0 1px 3px rgba(51, 65, 85, .05); padding: var(--ma-space-5) var(--ma-space-2) var(--ma-space-6); gap: var(--ma-space-2); }
  .ma-espace-gestion .ma-barre-laterale__logo { padding: 0 var(--ma-space-5) var(--ma-space-3); }
  .ma-espace-gestion .ma-barre-laterale > .ma-overline { display: none; }
}
.ma-espace-gestion .ma-menu__titre { padding: 4px 16px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #7C8AA5; }
.ma-espace-gestion .ma-menu__groupe { margin-top: var(--ma-space-5); }
.ma-espace-gestion .ma-menu__groupe:first-child { margin-top: 0; }
.ma-espace-gestion .ma-menu__lien { gap: 14px; margin: 2px 0; padding: 10px 12px 10px 16px; border-left: 0; border-radius: 8px; font-size: 15px; font-weight: 500; color: #334155; }
.ma-espace-gestion .ma-menu__lien .ma-icon { width: 22px; height: 22px; color: #64748B; }
.ma-espace-gestion a.ma-menu__lien:hover { background: var(--dx-accent-soft); color: var(--dx-accent); }
.ma-espace-gestion .ma-menu__lien[aria-current="page"] { background: var(--dx-accent-soft); color: var(--dx-accent); font-weight: 700; }
.ma-espace-gestion .ma-menu__lien[aria-current="page"] .ma-icon, .ma-espace-gestion a.ma-menu__lien:hover .ma-icon { color: var(--dx-accent); }

/* --- Colonne de contenu et bandeau du haut (nk-header) --- */
.ma-espace-gestion { --dx-accent: #2E4AA6; --dx-accent-soft: var(--ma-bleu-pale); }
.ma-gestion__colonne { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.ma-espace-gestion .ma-header--gestion { position: sticky; top: 0; z-index: var(--ma-z-header); display: flex; align-items: center; gap: var(--ma-space-3);
  min-height: 62px; padding: 0 var(--ma-gutter); background: var(--ma-surface); border-bottom: 0; box-shadow: 0 1px 3px rgba(51, 65, 85, .05); }
.ma-role-pastille { display: none; padding: 4px 12px; border-radius: 30px; background: var(--dx-accent-soft); color: var(--dx-accent); font-size: 12px; font-weight: 700; }
@media (min-width: 1024px) {
  .ma-espace-gestion .ma-header--gestion { display: flex; min-height: 65px; padding: 0 var(--ma-space-10); }
  .ma-espace-gestion .ma-header--gestion .ma-header__logo { display: none; }
  .ma-role-pastille { display: inline-flex; }
  .ma-espace-gestion .ma-gestion__contenu { padding-top: var(--ma-space-6); }
}
/* Compte : avatar + rôle + nom, menu déroulant */
.ma-compte-menu { position: relative; margin-left: auto; }
.ma-compte-menu > summary { list-style: none; cursor: pointer; }
.ma-compte-menu > summary::-webkit-details-marker { display: none; }
.ma-compte-menu__bouton { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ma-avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--dx-accent); color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ma-compte-menu__texte { display: none; flex-direction: column; line-height: 1.25; }
.ma-compte-menu__role { font-size: 12px; color: var(--dx-accent); }
.ma-compte-menu__nom { font-size: 14px; font-weight: 700; color: #334155; }
.ma-compte-menu__nom::after { content: " \2304"; font-size: 12px; color: #64748B; }
@media (min-width: 768px) { .ma-compte-menu__texte { display: flex; } }
.ma-compte-menu__panneau { position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--ma-z-overlay); min-width: 240px; padding: var(--ma-space-3) var(--ma-space-4);
  background: var(--ma-surface); border: 1px solid #E5EAF0; border-radius: 8px; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); }
.ma-compte-menu__identite { display: flex; flex-direction: column; gap: 2px; margin: 0 0 var(--ma-space-2); padding-bottom: var(--ma-space-2); border-bottom: 1px solid #E5EAF0; font-size: 14px; }
.ma-compte-menu__identite span { font-size: 13px; color: #64748B; }
.ma-compte-menu form { margin: 0; }

/* --- Barre d'onglets basse (gx-tabbar) et tiroir de navigation --- */
.ma-onglets { display: none; }
@media (max-width: 1023.98px) {
  .ma-onglets { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ma-z-nav); height: calc(62px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--ma-surface); border-top: 1px solid #E5EAF0; }
  .ma-onglets > a, .ma-onglets > details { flex: 1 1 0; min-width: 0; }
  .ma-onglets__lien { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 62px; min-height: 44px;
    color: #64748B; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .ma-onglets__lien .ma-icon { width: 22px; height: 22px; }
  .ma-onglets__lien[aria-current="page"], .ma-menu-mobile[open] > .ma-onglets__lien { color: var(--dx-accent); }
  .ma-onglets__lien span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ma-espace-gestion .ma-gestion__contenu { padding-bottom: calc(62px + var(--ma-space-8) + env(safe-area-inset-bottom)); }
  /* Tiroir : depuis la gauche, au-dessus de la barre d'onglets, fond assombri */
  .ma-espace-gestion .ma-menu-mobile[open]::before { content: ""; position: fixed; inset: 0 0 calc(62px + env(safe-area-inset-bottom)) 0; z-index: var(--ma-z-overlay); background: rgba(15, 23, 42, .45); }
  .ma-espace-gestion .ma-menu-mobile__panneau { position: fixed; left: 0; top: 0; right: auto; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: var(--ma-z-modal);
    width: min(290px, 86vw); max-height: none; padding: var(--ma-space-5) var(--ma-space-2) var(--ma-space-6); border: 0; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); overflow-y: auto; }
  .ma-espace-gestion .ma-menu-mobile__panneau > .ma-overline { display: block; padding: 0 16px var(--ma-space-3); }
  .ma-espace-gestion .ma-menu-mobile__compte { margin: var(--ma-space-4) var(--ma-space-2) 0; }
}

/* =====================================================================
   Langage des pages de l'espace direction (dx-*) — mêmes noms de classes que Scolarix
   ===================================================================== */
.dx { --ink: var(--ma-encre); --muted: #64748B; --line: #E5EAF0; --line-strong: #D5DCE5; --surface: #fff; --subtle: #F8FAFC;
      --accent: #2E4AA6; --accent-soft: var(--ma-bleu-pale);
      --good: #1E6B47; --good-soft: #E6F2EC; --warn: #75420B; --warn-soft: #FDF1E3; --bad: #B8322A; --bad-soft: #FBEDEC; --radius: 8px;
      color: var(--ink); font-size: 15px; }
.dx .dx-muted { color: var(--muted); } .dx .dx-strong { font-weight: 600; color: var(--ink); }
.dx .dx-mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.dx .is-good { color: var(--good) !important; } .dx .is-warn { color: var(--warn) !important; } .dx .is-bad { color: var(--bad) !important; }
.dx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.dx-crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); text-decoration: none; }
.dx-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.dx-crumbs [aria-current] { color: var(--ink); font-weight: 500; } .dx-crumbs span[aria-hidden] { color: var(--line-strong); }
.dx-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.dx-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.dx-sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.dx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; background: var(--surface);
           border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dx-kpi { display: flex; flex-direction: column; gap: 5px; padding: 17px 19px; border-right: 1px solid var(--line); min-width: 0; color: inherit; text-decoration: none; }
a.dx-kpi:hover { background: var(--subtle); }
.dx-kpi:last-child { border-right: 0; }
.dx-kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dx-kpi-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dx-kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); }
.dx-kpi-sub { font-size: 13px; color: var(--muted); }
.dx-kpis.dx-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) and (min-width: 768px) { .dx-kpis.dx-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dx-kpis.dx-kpis-4 .dx-kpi:nth-child(2n) { border-right: 0; } .dx-kpis.dx-kpis-4 .dx-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.dx-card { margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dx-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dx-card-title { margin: 0; font-family: var(--ma-font-texte); font-size: 15px; font-weight: 700; color: var(--ink); }
.dx-card-note { font-size: 14px; color: var(--muted); }
.dx-card-body { padding: 16px 20px; }
.dx-card-body > :last-child { margin-bottom: 0; }
.dx-card a.dx-link, .dx-card-head a { color: var(--accent); text-decoration: none; font-size: 14px; }
.dx-card-head a:hover { text-decoration: underline; }
.dx-empty { margin: 0; padding: 24px 20px; color: var(--muted); }
.dx-table-wrap { position: relative; overflow-x: auto; }
.dx-table { width: 100%; border-collapse: collapse; }
.dx-table th { padding: 10px 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; background: none; }
.dx-table td { padding: 11px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dx-table tbody tr:last-child td { border-bottom: 0; }
.dx-table tbody tr:hover td { background: var(--subtle); }
.dx-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dx-table td form { margin: 0; }
.dx-table a { color: var(--accent); }
.dx-mark { display: inline-block; min-width: 3.2rem; padding: 2px 6px; text-align: center; font-weight: 700; border-radius: 4px; font-variant-numeric: tabular-nums; }
.dx-mark.is-good { background: var(--good-soft); } .dx-mark.is-bad { background: var(--bad-soft); }
.dx-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dx-tools form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.dx-select, .dx-search { height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.dx-search { min-width: 220px; max-width: 100%; }
.dx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; border-radius: 6px; text-decoration: none; font-family: var(--ma-font-texte); }
.dx-btn .ma-icon { width: 16px; height: 16px; }
.dx-btn:hover { border-color: var(--accent); color: var(--accent); }
.dx-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; } .dx-btn-primary:hover { color: #fff; filter: brightness(1.08); }
.dx-btn-danger { color: var(--bad); border-color: var(--bad); } .dx-btn-danger:hover { color: #fff; background: var(--bad); }
.dx-btn[disabled] { opacity: .55; cursor: default; }
.dx-note { margin: 0 0 16px; padding: 11px 16px; font-size: 14px; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.dx-note strong { color: var(--ink); }
.dx-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.dx-grid2 > .dx-card, .dx-grid2 > div > .dx-card:last-child { margin-bottom: 0; }
.dx-pill { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.dx-pill.is-good { background: var(--good-soft); border-color: transparent; } .dx-pill.is-warn { background: var(--warn-soft); border-color: transparent; } .dx-pill.is-bad { background: var(--bad-soft); border-color: transparent; }
.dx-alerts { list-style: none; margin: 0; padding: 0; }
.dx-alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.dx-alert:last-child { border-bottom: 0; }
.dx-alert-dot { flex: 0 0 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--warn); }
.dx-alert-dot.is-bad { background: var(--bad); } .dx-alert-dot.is-good { background: var(--good); }
.dx-alert-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dx-bars { list-style: none; margin: 0; padding: 14px 20px; display: flex; flex-direction: column; gap: 9px; }
.dx-bar { display: grid; grid-template-columns: minmax(90px, 9rem) 1fr 3.6rem; align-items: center; gap: 11px; }
.dx-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.dx-bar-track { position: relative; height: 10px; background: var(--subtle); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.dx-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.dx-bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 20px 14px; font-size: 13px; color: var(--muted); }
/* Paires libellé / valeur dans une carte */
.dx-dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.dx-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.dx-dl > div:last-child { border-bottom: 0; }
.dx-dl dt { color: var(--muted); font-size: 14px; }
.dx-dl dd { margin: 0; text-align: right; color: var(--ink); overflow-wrap: anywhere; }
/* Sections repliables dans une carte */
.dx details.dx-fold { border-top: 1px solid var(--line); }
.dx details.dx-fold > summary { display: flex; align-items: center; min-height: 48px; padding: 0 20px; cursor: pointer; list-style: none; font-weight: 600; color: var(--accent); font-size: 14px; }
.dx details.dx-fold > summary::-webkit-details-marker { display: none; }
.dx details.dx-fold > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 400; }
.dx details.dx-fold[open] > summary::after { content: "\2212"; }
.dx details.dx-fold > :not(summary) { padding: 0 20px 16px; }
@media (max-width: 767px) {
  .dx-title { font-size: 1.3rem; }
  .dx-kpis, .dx-kpis.dx-kpis-4 { grid-template-columns: 1fr 1fr; } .dx-kpi { border-bottom: 1px solid var(--line); } .dx-kpi:nth-child(2n) { border-right: 0; }
  .dx-kpi:nth-last-child(-n+2):nth-child(2n+1), .dx-kpi:nth-last-child(-n+2):nth-child(2n+1) ~ .dx-kpi { border-bottom: 0; }
  .dx-kpi-value { font-size: 1.35rem; }
  .dx-search, .dx-select { flex: 1 1 100%; min-width: 0; }
  .dx-tools, .dx-tools form { width: 100%; }
  .dx-card-head { padding: 14px 16px; } .dx-card-body { padding: 14px 16px; } .dx-alert { padding: 12px 16px; }
  .dx-table.dx-stack thead { display: none; }
  .dx-table.dx-stack, .dx-table.dx-stack tbody, .dx-table.dx-stack tr, .dx-table.dx-stack td { display: block; }
  .dx-table.dx-stack tr { padding: 11px 16px; border-bottom: 1px solid var(--line); }
  .dx-table.dx-stack tbody tr:last-child { border-bottom: 0; }
  .dx-table.dx-stack td { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; border: 0; text-align: right; }
  .dx-table.dx-stack td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex-shrink: 0; }
  .dx-table.dx-stack td[data-label=""]::before { content: none; }
  .dx-table.dx-stack td.dx-cell-action { justify-content: flex-start; padding-top: 8px; }
  .dx-table.dx-stack tbody tr:hover td { background: none; }
  .dx-bar { grid-template-columns: 6.5rem 1fr 3.2rem; } .dx-grid2 { grid-template-columns: 1fr; }
  .dx-dl > div { padding: 9px 16px; }
}
/* Espace agent (dx) : compléments */
.dx-grid2--large { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .dx-grid2--large { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.dx-grid2 > div { min-width: 0; }
.dx-bloc { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dx-bloc:last-child { border-bottom: 0; }
.dx-bloc__tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dx-bloc__titre { margin: 0; font-family: var(--ma-font-texte); font-size: 15px; font-weight: 600; color: var(--ink); }
.dx-bloc--pied { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--subtle); }
.dx-bloc--pied p { flex-basis: 100%; margin: 0; font-size: 13px; }
.dx-note--action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dx-note--action form { margin: 0; }
.dx-kpi-value--texte { font-size: 1.2rem; }
.dx .ma-fichiers { margin: 0; }
.dx .ma-fichier { border-color: var(--line); }
/* Ce qui est dans une carte dx reste plat (pas de carte dans la carte) */
.dx .dx-card > .ma-lignes, .dx .dx-card > ul.ma-list { margin: 0; padding: 0 20px; background: none; border: 0; border-radius: 0; box-shadow: none; }
.dx .dx-card > .ma-lignes > li { border-bottom-color: var(--line); }
.dx .dx-card > .ma-tableau-defilant { border: 0; border-radius: 0; box-shadow: none; }
.dx .ma-details > summary { color: var(--accent); }
@media (max-width: 767px) { .dx .dx-card > .ma-lignes, .dx .dx-card > ul.ma-list { padding: 0 16px; } .dx-bloc { padding: 14px 16px; } }
/* La classe .ma-dossier (repère des tests) ne doit pas réappliquer l'ancienne fiche sur une ligne de tableau */
.dx .dx-table tr.ma-dossier { display: table-row; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; gap: 0; }
@media (max-width: 767px) { .dx .dx-table.dx-stack tr.ma-dossier { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line); } .dx .dx-table.dx-stack tbody tr.ma-dossier:last-child { border-bottom: 0; } }
.dx p { max-width: none; }
.dx-table .ma-ref { white-space: nowrap; }
@media (max-width: 767px) {
  .dx-table.dx-stack td.dx-cell-titre { display: block; text-align: left; padding-bottom: 6px; }
  .dx-table.dx-stack td.dx-cell-titre::before { content: none; }
  .dx-table.dx-stack td.dx-cell-titre .ma-ref { font-weight: 600; }
}
/* Boutons et champs MesActes à l'intérieur d'une page dx : même dessin que dx-btn / dx-select (Scolarix) */
.dx .ma-btn { min-height: 44px; height: auto; padding: 0 14px; border-radius: 6px; font-size: 14px; font-weight: 600; gap: 6px; }
.dx .ma-btn .ma-icon { width: 16px; height: 16px; }
.dx .ma-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dx .ma-btn--primary:hover { filter: brightness(1.08); color: #fff; }
.dx .ma-btn--secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.dx .ma-btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.dx .ma-btn--tertiary { color: var(--accent); }
.dx .ma-btn--danger { background: var(--surface); border: 1px solid var(--bad); color: var(--bad); }
.dx .ma-btn--danger:hover { background: var(--bad); color: #fff; }
.dx .ma-btn--block, .dx .ma-btn--mobile-block { width: auto; }
@media (max-width: 767px) { .dx .ma-btn--mobile-block { width: 100%; } }
.dx .ma-input, .dx .ma-select, .dx .ma-textarea { border-radius: 6px; border-color: var(--line-strong); }
.dx .ma-input, .dx .ma-select { min-height: 44px; height: 44px; }
.dx .ma-label { font-size: 13px; font-weight: 600; color: var(--ink); }
/* Contenu des cartes dx : listes et blocs plats, alertes sobres */
.dx .dx-card-body > .ma-lignes, .dx .dx-card-body > ul.ma-list { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.dx .dx-card-body > .ma-lignes > li, .dx .dx-card-body > ul.ma-list > li { border-bottom-color: var(--line); }
.dx .dx-card-body > .ma-lignes > li:first-child, .dx .dx-card-body > ul.ma-list > li:first-child { padding-top: 0; }
.dx .dx-card-body > .ma-empty, .dx .dx-card-body .ma-empty { border: 0; background: none; padding: 8px 0; }
.dx .ma-alert { border-radius: var(--radius); }
.dx .dx-card-body > .ma-formulaire { max-width: 640px; }
.dx .ma-soldes .ma-solde { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
/* Tableau qui occupe toute la largeur de la carte (sort du padding du corps) */
.dx .dx-card-body > .dx-plein { margin: -16px -20px; }
@media (max-width: 767px) { .dx .dx-card-body > .dx-plein { margin: -14px -16px; } }
/* Listes de fiches d'action (livraisons, retraits) dans une carte : lignes séparées, pas de carte dans la carte */
.dx .dx-card > .dx-liste { display: block; margin: 0; padding: 0; }
.dx .dx-card .ma-list > li.ma-livraison, .dx .dx-card .ma-retraits > li { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: none; padding: 16px 20px; margin: 0; }
.dx .dx-card .ma-list > li.ma-livraison:last-child, .dx .dx-card .ma-retraits > li:last-child { border-bottom: 0; }
.dx .dx-card-body > .ma-retraits { margin: -16px -20px; }
@media (max-width: 767px) { .dx .dx-card .ma-list > li.ma-livraison, .dx .dx-card .ma-retraits > li { padding: 14px 16px; } .dx .dx-card-body > .ma-retraits { margin: -14px -16px; } }
.ma-compte-menu__bouton { min-width: 44px; justify-content: center; }
.dx-title .ma-ref { font-size: inherit; font-weight: inherit; letter-spacing: 0; }
.dx-crumbs a, .dx-crumbs .ma-retour { min-height: 44px; display: inline-flex; align-items: center; }
