:root {
  --navy: #0F5FA6;        /* bleu vif de l'en-tête, comme Moodle */
  --gold: #00A99D;        /* sarcelle — accent, onglets actifs (remplace l'or) */
  --cream: #F4F1EA;       /* fond général */
  --carte: #E8F6F8;       /* fond bleu clair des cartes de module */
  --sombre: #3C4858;      /* pied de page fonce */
  --alerte-fond: #E4F7F7; /* bandeau d'alerte clair */

  /* Couleurs complémentaires de la charte d'oct. 2026, dérivées des
     couleurs d'origine ci-dessus (à garder, choix de la direction). */
  --navy-fonce: #0B4F8C;
  --encre: #2C2C2C;
  --encre-2: #4A5563;
  --encre-3: #7A8590;
  --trait: #E2DED2;
  --surface: #FFFFFF;
  --piste: #E3EAEE;
  --accent-vif: #00A99D;
  --accent-pale: #E4F7F7;
  --ok: #1A7A3C;
  --ok-pale: #E8F6EE;
  --attention: #A3720A;
  --attention-pale: #FDF3E2;
  --critique: #A32D2D;
  --critique-pale: #FBECEB;
  /* Versions soutenues, pour les jauges et les liserés : assez vives pour
     se lire d'un coup d'œil sur fond blanc. */
  --ok-vif: #2E9B57;
  --attention-vif: #D9961A;
  --critique-vif: #C8473F;
  --accent-fonce: #00776F;
  /* Les polices latines n'ont pas de lettres arabes : le navigateur prend
     alors Noto Sans Arabic, chargée seulement si la page en contient. */
  --police-titres: "Bricolage Grotesque", "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --police-texte: "Figtree", "Noto Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--cream);
  color: #2c2c2c;
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  color: var(--navy);
}

.navbar {
  background-color: var(--navy);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-marque {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--cream);
  object-fit: cover;
  display: block;
}

.navbar-marque span {
  font-size: 22px;
  font-weight: 700;
}

.navbar-utilisateur {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.navbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.navbar-onglets {
  background: white;
  border-bottom: 1px solid #e2ded2;
  padding: 0 24px;
  position: relative;
}

.navbar-liens {
  display: flex;
  flex-wrap: wrap;
}

.navbar-liens a {
  color: #2c2c2c;
  text-decoration: none;
  font-size: 16px;
  padding: 12px 14px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.navbar-liens a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Formulaires de connexion/inscription — plus étroits, pas besoin de
   toute la largeur de page pour un email et un mot de passe. */
.formulaire-etroit {
  max-width: 380px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
  color: #333;
}

input, select {
  padding: 9px 11px;
  border: 1px solid #d6d2c4;
  border-radius: 6px;
  font-size: 16px;
  background: #fff;
  max-width: 380px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

button {
  background-color: var(--navy);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  white-space: nowrap;
}

button:hover {
  opacity: 0.9;
}

.lien-secondaire {
  margin-top: 16px;
  font-size: 15px;
  color: #333;
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.flash-error { color: #a32d2d; }
.flash-info { color: #185fa5; }
.flash-warning { color: #854f0b; }

.carte-attente {
  background: var(--carte);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
  color: #333;
}

.liste-demandes {
  list-style: none;
  padding: 0;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.carte-demande {
  background: #fff;
  border: 1px solid #e2ddcd;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.carte-demande .infos {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 15px;
  color: #555;
  min-width: 240px;
  flex: 1 1 auto;
}

.carte-demande .infos strong {
  font-size: 15px;
  color: var(--navy);
}

.carte-demande .actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.carte-demande .actions form {
  margin: 0;
}

.carte-demande .actions a {
  font-size: 15px;
  padding: 8px 14px;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  text-decoration: none;
  background: #fff;
  font-weight: 500;
}

.carte-demande .actions button {
  font-size: 15px;
  padding: 8px 14px;
}

.carte-demande .actions a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.bouton-danger {
  background-color: #fff !important;
  color: #a32d2d !important;
  border: 1px solid #a32d2d !important;
}

.bouton-danger:hover {
  background-color: #a32d2d !important;
  color: #fff !important;
}

.carte-demande form {
  margin: 0;
}

.bouton-approuver {
  background-color: var(--navy);
}

.bouton-refuser {
  background-color: transparent;
  color: #a32d2d;
  border: 1px solid #a32d2d;
}

textarea {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
}

.ligne-case {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.badge-retard {
  display: inline-block;
  background: var(--carte);
  color: #a32d2d;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 15px;
  font-weight: normal;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 15px;
}

.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #ece8da;
}

.table th {
  color: #fff;
  background: var(--navy);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.table tbody tr:nth-child(even) {
  background: #faf8f2;
}

.table tbody tr:hover {
  background: var(--carte);
}

.solde-du {
  color: #a32d2d;
  font-weight: 600;
}

.solde-ok {
  color: #1a7a3c;
  font-weight: 600;
}

/* Tableau de bord (cartes par module) */
.role-badge {
  display: inline-block;
  background: transparent;
  color: #5b5b5b;
  padding-left: 0 !important;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 15px;
  margin-bottom: 16px;
}

.grille-cartes {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  align-items: stretch;
}

.carte-module {
  display: block;
  flex: 1 1 250px;
  max-width: 320px;
  min-height: 74px;
  background: var(--carte);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--navy);
  border: 1px solid #d5e9ee;
  border-top: 4px solid var(--gold);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.carte-module-icone {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 8px;
}

.grille-cartes-groupe-titre {
  flex-basis: 100%;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8471;
  font-weight: 700;
  margin: 8px 0 -6px;
}

.grille-cartes-groupe-titre:first-child {
  margin-top: 0;
}

.carte-module h3 {
  margin: 0;
}

.carte-module:hover {
  box-shadow: 0 3px 10px rgba(15, 95, 166, 0.14);
}

.carte-module:hover {
  transform: translateY(-2px);
}

.carte-module h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
}

.carte-module p {
  margin: 0;
  font-size: 15px;
  color: #555;
}

/* Espace développeur */
.barre-recherche {
  margin: 12px 0;
  display: flex;
  gap: 8px;
}

.table-dev {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-top: 10px;
}

.table-dev th, .table-dev td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.table-dev th {
  color: var(--navy);
  font-weight: 600;
}

.table-dev select {
  padding: 4px;
}

/* En-tête d'accueil avec logo */
.accueil-entete {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
}

.accueil-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.accueil-entete h1 {
  margin-bottom: 4px;
}

/* Logo pleine taille sur les pages de connexion / inscription */
.logo-page {
  text-align: center;
  margin-bottom: 12px;
}

.logo-page img {
  width: 160px;
  height: auto;
}

/* Grille emploi du temps */
.table-edt th, .table-edt td {
  border: 1px solid #e5e0d0;
  text-align: center;
  vertical-align: top;
  padding: 8px;
}
.table-edt th {
  background-color: var(--navy);
  color: var(--cream);
}
.cellule-edt-moi {
  background-color: #FFF3E0;
}

.ligne-lecture-seule {
  background-color: #FAFAF5;
  font-style: italic;
}

/* Statistiques — barre laterale */
.stats-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-top: 16px;
}

.stats-sidebar {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--carte);
  border-radius: 10px;
  padding: 12px;
}

.stats-lien {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--navy);
  text-decoration: none;
  font-size: 16px;
}

.stats-lien:hover {
  background: #ecebe0;
}

.stats-lien-actif {
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
}

.stats-contenu {
  flex: 1;
  min-width: 0;
}

/* Page d'accueil publique — bandeau façon banniere de cours Moodle */
.hero {
  text-align: center;
  padding: 56px 20px;
  background: linear-gradient(135deg, var(--gold), #007b73);
  border-radius: 12px;
  margin-top: 24px;
}

.hero-logo {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 16px;
  background: white;
  padding: 6px;
}

.hero h1 {
  font-size: 34px;
  margin: 0 0 6px;
  color: white;
}

.hero-devise {
  color: white;
  opacity: 0.9;
  font-weight: 600;
  margin: 0 0 20px;
}

.hero-texte {
  max-width: 560px;
  margin: 0 auto 28px;
  color: white;
  opacity: 0.95;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.bouton-principal, .bouton-secondaire {
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.bouton-principal {
  background: white;
  color: var(--gold);
}

.bouton-secondaire {
  background: transparent;
  color: white;
  border: 1px solid white;
}

.fonctionnalites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.fonctionnalite {
  background: var(--carte);
  border-top: 4px solid var(--gold);
  border-radius: 4px;
  padding: 20px;
}

.fonctionnalite h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 16px;
}

.fonctionnalite p {
  margin: 0;
  font-size: 16px;
  color: #555;
}

.pied-accueil {
  text-align: center;
  padding: 24px 0;
  color: #cfd3d9;
  font-size: 15px;
  background: var(--sombre);
  margin: 40px -20px -40px;
}

/* Responsive — telephone et petits ecrans */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 22px;
  cursor: pointer;
}

.table {
  display: block;
  overflow-x: auto;
}

.table thead, .table tbody, .table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.table th, .table td {
  overflow-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 800px) {
  .navbar-toggle {
    display: block;
  }

  .navbar-liens {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 10px 20px 20px;
    z-index: 20;
  }

  .navbar-liens-ouvert {
    display: flex !important;
  }

  .navbar-liens a {
    margin: 2px 0;
    color: var(--cream);
    border-bottom: none;
  }

  .navbar-liens a:hover {
    color: var(--gold);
  }

  .stats-layout {
    flex-direction: column;
  }

  .stats-sidebar {
    flex: none;
    width: 100%;
    box-sizing: border-box; /* la marge intérieure ne fait plus déborder l'écran */
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 26px;
  }

  .container {
    padding: 0 14px;
  }
}

/* Champ mot de passe avec bouton afficher/masquer */
.champ-mdp-conteneur {
  position: relative;
  display: flex;
}

.champ-mdp-conteneur input {
  flex: 1;
  padding-right: 40px;
}

.mdp-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
}

/* Ligne de saisie des frais dans la liste des classes */
.ligne-frais {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2ddcd;
}

.ligne-frais label {
  font-size: 16px;
  color: #666;
  gap: 4px;
}

.ligne-frais select,
.ligne-frais input {
  max-width: 130px;
  font-size: 15px;
  padding: 6px 8px;
}

/* En-tête de page : titre + actions alignés */
.entete-page {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* Messages (succès / erreur) en bandeau net */
.flashes {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}

.flashes li {
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 8px;
  border-left: 4px solid var(--gold);
  background: var(--carte);
  color: #22443f;
}

.flashes .flash-error {
  border-left-color: #a32d2d;
  background: #fbeceb;
  color: #7d2020;
}

/* Cartes de chiffres : le nombre doit primer sur l'étiquette */
.carte-stat {
  min-height: 0;
  padding: 14px 16px 16px;
}

.carte-stat h3 {
  font-size: 16px;
  font-weight: 600;
  color: #5d6b70;
  margin: 0 0 6px 0;
}

.carte-stat p {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
}

.carte-stat p.solde-du,
.carte-stat p.solde-ok {
  font-size: 26px;
}

/* Boutons côte à côte dans un tableau (ex: Enregistrer / Supprimer) */
.actions-tableau {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions-tableau form {
  margin: 0;
}

/* Cartes de statistiques : colonnes régulières, même largeur partout,
   pas de "trou" en fin de ligne comme avec un flex simple. */
.grille-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: stretch;
}

.grille-stats .carte-module {
  max-width: none;
  flex: none;
}

/* Page de connexion — carte à deux colonnes (formulaire + info) */
.carte-connexion {
  display: flex;
  max-width: 760px;
  margin: 40px auto;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 95, 166, 0.12);
  border: 1px solid #e6e2d3;
}

.connexion-formulaire {
  flex: 1 1 55%;
  padding: 36px 32px;
}

.connexion-formulaire form,
.connexion-formulaire input {
  max-width: none;
}

.connexion-info {
  flex: 1 1 45%;
  background: var(--carte);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #d5e9ee;
}

.connexion-info h2 {
  margin-top: 0;
  font-size: 19px;
}

.connexion-info hr {
  border: none;
  border-top: 1px solid #cfe6ea;
  margin: 20px 0;
}

.bouton-secondaire-large {
  display: inline-block;
  text-align: center;
  background: var(--gold);
  color: #fff;
  padding: 11px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 6px;
}

.bouton-secondaire-large:hover {
  opacity: 0.9;
}

@media (max-width: 700px) {
  .carte-connexion {
    flex-direction: column;
    margin: 16px;
  }
  .connexion-info {
    border-left: none;
    border-top: 1px solid #d5e9ee;
  }
}

/* Formulaires de filtre (recherche par date, etc.) — en ligne, jamais
   empilés comme un formulaire de saisie classique. */
.formulaire-filtre {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin: 16px 0;
}

.formulaire-filtre label {
  min-width: 140px;
}

.formulaire-filtre select,
.formulaire-filtre input {
  max-width: 180px;
}

/* Menu déroulant avec recherche par nom (voir recherche-nom.js) */
.recherche-nom-conteneur {
  position: relative;
}

.recherche-nom-resultats {
  position: absolute;
  z-index: 30;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  display: none;
}

.recherche-nom-resultats div {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 15px;
}

.recherche-nom-resultats div:hover,
.recherche-nom-resultats div.actif {
  background: var(--carte);
}

/* Graphiques en barres (statistiques) */
.graphique-conteneur {
  background: #fff;
  border: 1px solid #e6e2d3;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  max-width: 500px;
}

.graphique-titre {
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 8px 0;
  font-size: 14px;
}

/* État vide (listes sans résultat) — remplace un simple texte gris par
   quelque chose d'intentionnel, cohérent partout dans l'application. */
.etat-vide {
  text-align: center;
  padding: 36px 20px;
  color: #7a7a7a;
  background: #fbfaf6;
  border: 1px dashed #d9d4c3;
  border-radius: 10px;
  margin: 16px 0;
}

.etat-vide-icone {
  display: block;
  font-size: 34px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.etat-vide p {
  margin: 0;
  font-size: 15px;
}

.etat-vide a {
  font-weight: 600;
}

/* Variantes colorées des cartes de chiffres — pour repérer un total au
   premier coup d'œil, sans avoir à lire l'étiquette. */
.carte-stat-vert { background: #e8f6ee; border-top-color: #1a7a3c; }
.carte-stat-vert p { color: #1a7a3c; }

.carte-stat-rouge { background: #fbeceb; border-top-color: #a32d2d; }
.carte-stat-rouge p { color: #a32d2d; }

.carte-stat-or { background: #fdf3e2; border-top-color: #b8860b; }
.carte-stat-or p { color: #a3720a; }

.carte-stat-bleu { background: #e8f0fb; border-top-color: var(--navy); }
.carte-stat-bleu p { color: var(--navy); }

/* Fil d'Ariane */
.fil-ariane {
  font-size: 13px;
  color: #7a7a7a;
  margin-bottom: 14px;
}

.fil-ariane a {
  color: #5d6b70;
  text-decoration: none;
}

.fil-ariane a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.fil-ariane-sep {
  margin: 0 6px;
  color: #c4c0b0;
}

.fil-ariane-actuel {
  color: var(--navy);
  font-weight: 600;
}

/* Bannière en haut d'une page de module (icône + titre + description) */
.banniere-page {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--navy), var(--gold));
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 18px;
  color: #fff;
}

.banniere-page-icone {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
}

.banniere-page h1 {
  color: #fff;
  margin: 0 0 4px 0;
  font-size: 22px;
}

.banniere-page p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

@media (max-width: 600px) {
  .banniere-page {
    flex-direction: column;
    text-align: center;
  }
}

/* ========== Menu latéral (remplace la barre horizontale pour les
   utilisateurs connectés) — sept. 2026 ========== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 235px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.sidebar-marque {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.sidebar-marque .logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cream);
  flex-shrink: 0;
}

.sidebar-marque span {
  font-weight: 700;
  font-size: 15px;
}

.sidebar-utilisateur {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.sidebar-utilisateur span:last-child {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-liens {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  flex: 1;
}

.sidebar-liens a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 10px 18px;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.sidebar-liens a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-liens a.lien-actif {
  background: rgba(255, 255, 255, 0.12);
  border-left-color: var(--gold);
  color: #fff;
  font-weight: 600;
}

.sidebar-groupe-titre {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  padding: 14px 18px 4px;
}

.sidebar-lien-groupe {
  padding-left: 34px !important;
}

.sidebar-toggle-mobile {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
}

.contenu-principal {
  flex: 1;
  min-width: 0;
  margin-left: 235px;
}

@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.sidebar-ouverte {
    transform: translateX(0);
  }

  .sidebar-toggle-mobile {
    display: block;
  }

  .sidebar-overlay.actif {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 45;
  }

  .contenu-principal {
    margin-left: 0;
    padding-top: 56px;
  }
}

/* Listes déroulantes de la barre latérale (Finances, enfants, Mon espace) */
.sidebar-deroulant summary {
  list-style: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 18px;
  font-size: 14px;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-deroulant summary::-webkit-details-marker {
  display: none;
}

.sidebar-deroulant summary::after {
  content: "▸";
  position: absolute;
  right: 18px;
  transition: transform 0.15s ease;
}

.sidebar-deroulant[open] summary::after {
  transform: rotate(90deg);
}

.sidebar-deroulant summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-deroulant[open] {
  background: rgba(0, 0, 0, 0.12);
}

.sidebar-deroulant a {
  display: block;
  padding-left: 42px !important;
  font-size: 13.5px;
}

/* Barre horizontale du haut : la devise de l'école */
.barre-devise {
  background: #fff;
  border-bottom: 3px solid var(--gold);
  color: var(--navy);
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  padding: 10px 20px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 30px;
}

.barre-devise-texte {
  flex: 1;
}

.recherche-globale {
  margin: 0;
  flex: 0 0 240px;
  max-width: 40%;
}

.recherche-globale input[type=search] {
  margin: 0;
  width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  font-style: normal;
  font-size: 15px;
}

/* Tableau de bord : uniquement le logo de l'école */
.accueil-logo-central {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.accueil-logo-central img {
  width: 100%;
  max-width: 360px;
  height: auto;
}

@media (max-width: 800px) {
  .barre-devise {
    padding-left: 64px;
    font-size: 14px;
  }

  .contenu-principal {
    padding-top: 0;
  }
}

/* Nom de la plateforme sur les pages publiques (avant connexion) */
.nom-plateforme {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px 0;
}

.sidebar-marque span {
  white-space: normal;
  line-height: 1.25;
  font-size: 14px;
}

.sidebar-lien-plateforme {
  background: rgba(222, 162, 48, 0.18);
  border-left-color: var(--gold) !important;
  font-weight: 600;
}

.actions-console { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.actions-console form { margin: 0; }
.actions-console button { padding: 0.35rem 0.8rem; font-size: 0.95rem; }

.formulaire-note-test { display: flex !important; flex-direction: row !important; gap: 0.4rem; align-items: center; flex-wrap: nowrap; margin: 0; max-width: none; }
.formulaire-note-test input[type=number] { width: 4.5rem !important; margin: 0; }
.formulaire-note-test span { white-space: nowrap; }
.formulaire-note-test button { margin: 0; white-space: nowrap; padding: 0.35rem 0.7rem; }
.table-tests th:last-child, .table-tests td:last-child { width: 12.5rem; }

/* Tableau de bord : carte de l'école + cartes des guides */
.accueil-carte-ecole {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--navy);
  color: #fff;
  border-radius: 14px;
  padding: 28px 30px;
  margin-bottom: 26px;
}

.accueil-carte-ecole-logo {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  padding: 14px;
  box-sizing: border-box;
}

.accueil-carte-ecole-logo img {
  max-width: 100%;
  max-height: 100%;
}

.accueil-carte-ecole h1 {
  color: #fff;
  margin: 0 0 8px 0;
  font-size: 24px;
  line-height: 1.25;
}

.accueil-carte-ecole p {
  margin: 0;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.accueil-titre-guides {
  font-size: 19px;
  margin: 0 0 12px 0;
}

.grille-guides {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.carte-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid #dfe6ec;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.carte-guide:hover, .carte-guide:focus-visible {
  box-shadow: 0 6px 18px rgba(15, 95, 166, 0.16);
  transform: translateY(-2px);
}

.carte-guide-icone {
  font-size: 26px;
  line-height: 1;
}

.carte-guide-texte {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.carte-guide-texte strong {
  color: var(--navy);
  font-size: 17px;
}

.carte-guide-texte span {
  color: #4a5563;
  font-size: 15px;
  line-height: 1.4;
}

.carte-guide-lien {
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
}

/* Page d'un guide */
.guide {
  max-width: 760px;
}

.guide-role {
  font-size: 18px;
  margin: 0 0 18px 0;
}

.guide-etapes {
  list-style: none;
  counter-reset: etape;
  margin: 0 0 20px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-etapes li {
  counter-increment: etape;
  position: relative;
  background: #fff;
  border: 1px solid #dfe6ec;
  border-radius: 10px;
  padding: 14px 16px 14px 58px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-etapes li::before {
  content: counter(etape);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}

.guide-etapes strong {
  color: var(--navy);
}

.guide-a-savoir {
  background: var(--carte);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.guide-a-savoir p {
  margin: 4px 0 0 0;
}

.guide-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .accueil-carte-ecole {
    flex-direction: column;
    text-align: center;
    padding: 22px 18px;
  }
}

.guide-bouton {
  background: var(--navy);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.guide-bouton:hover {
  background: #0c4d87;
}

/* Onglets de période (bulletins) */
.onglets-periode {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px 0;
}

.onglets-periode a {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cfd8e0;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.onglets-periode a.actif {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Pagination et recherche */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.pagination a, .pagination-inactif {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #cfd8e0;
  background: #fff;
  text-decoration: none;
  font-weight: 600;
  color: var(--navy);
}

.pagination-inactif {
  color: #9aa5b1;
  background: transparent;
}

.pagination-resume {
  color: #4a5563;
  font-size: 15px;
}

.barre-recherche {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px;
  align-items: center;
  max-width: 520px;
  margin: 0 0 16px 0;
}

.barre-recherche input[type=search] {
  flex: 1;
  margin: 0;
}

.barre-recherche button {
  margin: 0;
  white-space: nowrap;
}

.barre-recherche-large { max-width: 760px; }
.barre-recherche select { margin: 0; width: auto; }

.table-bulletin th:first-child, .table-bulletin td:first-child { width: 20%; }
.table-bulletin th:nth-child(3), .table-bulletin td:nth-child(3),
.table-bulletin th:nth-child(5), .table-bulletin td:nth-child(5) { width: 8%; }

/* Fiche élève */
.fiche-eleve {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #dfe6ec;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 12px 0 18px 0;
}

.photo-eleve {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cfd8e0;
}

.fiche-eleve-champs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
  flex: 1;
  min-width: 260px;
}

.fiche-eleve-champs dt {
  color: #5a6573;
  font-weight: 600;
}

.fiche-eleve-champs dd {
  margin: 0;
}

/* ==========================================================================
   Charte Toumaï (oct. 2026)
   Placée en fin de fichier : elle remplace l'aspect des composants
   existants (menu, boutons, tableaux, bandeaux) sans toucher aux pages.
   ========================================================================== */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

body {
  font-family: var(--police-texte);
  font-size: 15.5px;
  color: var(--encre);
  background: var(--cream);
}

h1, h2, h3 {
  font-family: var(--police-titres);
  color: var(--navy);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.container a:not([class]) {
  color: var(--navy);
  text-decoration-color: rgba(15, 95, 166, 0.35);
  text-underline-offset: 3px;
}

.container a:not([class]):hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent-vif);
  outline-offset: 2px;
}

/* Icônes dessinées */
.sprite-icones {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg.icone {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

/* Champs et boutons */
input, select, textarea {
  font-family: inherit;
  border-color: #D6D2C4;
  border-radius: 8px;
  color: var(--encre);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-vif);
  border-color: var(--gold);
}

button {
  font-family: inherit;
  font-size: 15px;
  background-color: var(--navy);
  border-radius: 8px;
  padding: 9px 16px;
}

button:hover {
  opacity: 1;
  background-color: var(--navy-fonce);
}

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--trait);
  background: var(--surface);
  color: var(--encre);
  text-decoration: none;
  white-space: nowrap;
}

.bouton:hover {
  border-color: var(--encre-3);
}

.bouton-plein {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.bouton-plein:hover {
  background: var(--navy-fonce);
  border-color: var(--navy-fonce);
}

/* Tableaux : en-tête discret plutôt qu'un bandeau bleu plein */
.table th {
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  border-bottom: 0;
}

.table th, .table td {
  border-bottom-color: var(--trait);
}

.table {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.table tbody tr:nth-child(even) {
  background: transparent;
}

.table tbody tr:hover {
  background: var(--carte);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.solde-du { color: var(--critique); }
.solde-ok { color: var(--ok); }

/* Pastilles d'état (Bon, À suivre, Critique…) */
.badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-ok { background: var(--ok-pale); color: var(--ok); }
.badge-attention { background: var(--attention-pale); color: var(--attention); }
.badge-critique { background: var(--critique-pale); color: var(--critique); }

/* Bandeau de page : sobre, il ne prend plus un quart de l'écran */
.banniere-page {
  padding: 14px 20px;
  margin-bottom: 20px;
  gap: 14px;
}

.banniere-page-icone {
  width: 44px;
  height: 44px;
  color: #fff;
  border-radius: 10px;
}

.banniere-page-icone svg.icone {
  width: 22px;
  height: 22px;
}

.banniere-page h1 {
  color: #fff;
  font-size: 24px;
  margin: 0;
}

.banniere-page p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14.5px;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .banniere-page {
    flex-direction: row;
    text-align: left;
  }
}

.fil-ariane a { color: var(--encre-2); }
.fil-ariane-actuel { color: var(--encre); }

.carte-attente {
  background: var(--alerte-fond);
  border: 1px solid #F0D9A8;
}

.carte-attente-critique {
  background: var(--critique-pale);
  border-color: #F2C4BA;
}

/* Menu latéral */
.sidebar {
  background: var(--navy);
  width: 240px;
}

.contenu-principal {
  margin-left: 240px;
}

.sidebar-marque {
  padding: 18px 16px 16px;
  border-bottom: 0;
}

.sidebar-marque .logo-mark {
  width: 40px;
  height: 40px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

.sidebar-marque span {
  font-family: var(--police-titres);
  font-size: 15.5px;
  font-weight: 600;
}

.sidebar-utilisateur {
  margin: 0 12px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-utilisateur .navbar-avatar {
  background: var(--cream);
  color: var(--navy);
  font-size: 13px;
}

.sidebar-liens {
  padding: 12px 10px;
  gap: 1px;
}

.sidebar-liens a,
.sidebar-deroulant summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-left: 0;
  border-radius: 8px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.88);
}

.sidebar-liens a svg.icone,
.sidebar-deroulant summary svg.icone {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-liens a:hover,
.sidebar-deroulant summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-liens a.lien-actif {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 var(--accent-vif);
}

.sidebar-liens a.lien-actif svg.icone {
  color: #fff;
}

.sidebar-deroulant summary::after {
  right: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-deroulant[open] {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 8px;
}

.sidebar-deroulant a {
  padding: 7px 10px 7px 39px !important;
  font-size: 14px;
}

.sidebar-lien-plateforme {
  background: rgba(0, 169, 157, 0.22);
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  box-shadow: inset 3px 0 0 var(--accent-vif);
}

.sidebar-pied {
  padding: 12px 22px 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-pied strong {
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--police-titres);
  font-weight: 600;
}

.sidebar-toggle-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  border-radius: 8px;
}

@media (max-width: 800px) {
  .sidebar-toggle-mobile { display: flex; }
  .contenu-principal { margin-left: 0; }
}

/* Barre du haut : devise de l'école et recherche */
.barre-devise {
  background: var(--surface);
  border-bottom: 3px solid var(--gold);
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  padding: 10px 32px;
}

.recherche-globale {
  flex: 0 1 320px;
}

.recherche-globale input[type=search] {
  border-radius: 8px;
  background: var(--cream);
  border-color: var(--trait);
}

.container {
  max-width: 1240px;
  margin: 28px auto;
  padding: 0 32px;
}

@media (max-width: 800px) {
  .barre-devise { padding-left: 64px; padding-right: 16px; }
  .container { padding: 0 16px; margin-top: 20px; }
}

/* Cartes des guides */
.carte-guide {
  border: 1px solid #DFE6EC;
  border-left: 4px solid var(--gold);
  background: var(--surface);
}

.carte-guide:hover, .carte-guide:focus-visible {
  box-shadow: 0 6px 18px rgba(15, 95, 166, 0.16);
  border-color: #CFD8E0;
}

.carte-guide-icone {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-pale);
  color: var(--gold);
  border-radius: 9px;
}

.carte-guide-icone svg.icone {
  width: 20px;
  height: 20px;
}

.carte-guide-texte strong {
  color: var(--navy);
  font-size: 16px;
}

.carte-guide-lien {
  color: var(--navy);
}

.grille-guides-compacte {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.grille-guides-compacte .carte-guide {
  flex-direction: row;
  align-items: center;
  padding: 10px 12px;
}

.grille-guides-compacte .carte-guide-texte strong {
  font-size: 14.5px;
  font-family: var(--police-texte);
}

.accueil-carte-ecole {
  background: var(--navy);
}

.accueil-carte-ecole h1 {
  color: #fff;
}

/* ========== Tableau de bord de la direction (oct. 2026) ========== */

.accueil {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.accueil > .carte-attente,
.accueil > .accueil-carte-ecole,
.accueil > .accueil-titre-guides {
  margin: 0;
}

.tdb-entete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tdb-entete h1 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.tdb-entete p {
  margin: 4px 0 0;
  color: var(--encre-2);
}

.tdb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tdb-indicateurs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

/* Chaque chiffre porte un « ton » : la couleur dit tout de suite si ça
   va (vert), s'il faut suivre (ambre) ou agir (rouge). Le bleu plein est
   réservé à l'argent encaissé, le chiffre que la direction cherche en
   premier ; le sarcelle aux chiffres sans jugement (effectifs). */
.tdb-ton-neutre { --ton: var(--accent-fonce); --ton-pale: var(--accent-pale); --ton-vif: var(--accent-vif); }
.tdb-ton-ok { --ton: var(--ok); --ton-pale: var(--ok-pale); --ton-vif: var(--ok-vif); }
.tdb-ton-attention { --ton: var(--attention); --ton-pale: var(--attention-pale); --ton-vif: var(--attention-vif); }
.tdb-ton-critique { --ton: var(--critique); --ton-pale: var(--critique-pale); --ton-vif: var(--critique-vif); }

.tdb-indicateur {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tdb-indicateur.tdb-ton-ok,
.tdb-indicateur.tdb-ton-attention,
.tdb-indicateur.tdb-ton-critique {
  border-inline-start: 5px solid var(--ton-vif);
}

.tdb-indicateur-titre {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--encre-2);
}

.tdb-indicateur-valeur .badge {
  font-family: var(--police-texte);
  vertical-align: middle;
  margin-inline-start: 6px;
}

.tdb-puce {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--ton-pale, var(--piste));
  color: var(--ton, var(--navy));
}

.tdb-puce svg.icone {
  width: 18px;
  height: 18px;
}

.tdb-indicateur-valeur {
  font-family: var(--police-titres);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--ton, var(--encre));
}

.tdb-indicateur.tdb-ton-neutre .tdb-indicateur-valeur {
  color: var(--encre);
}

/* L'argent encaissé : seule tuile pleine, on la voit en premier. */
.tdb-indicateur.tdb-ton-principal {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  --ton: #fff;
  --ton-pale: rgba(255, 255, 255, 0.16);
}

.tdb-ton-principal .tdb-indicateur-titre,
.tdb-ton-principal .tdb-indicateur-detail,
.tdb-ton-principal .tdb-indicateur-valeur small {
  color: rgba(255, 255, 255, 0.86);
}

.tdb-ton-principal .tdb-hausse,
.tdb-ton-principal .tdb-baisse {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  padding: 1px 8px;
}

.tdb-indicateur-valeur small {
  font-family: var(--police-texte);
  font-size: 13px;
  font-weight: 600;
  color: var(--encre-2);
  margin-left: 5px;
}

.tdb-indicateur-detail {
  font-size: 13.5px;
  color: var(--encre-2);
}

.tdb-indicateur-detail strong {
  color: var(--encre);
  font-variant-numeric: tabular-nums;
}

.tdb-hausse { color: var(--ok); font-weight: 600; }
.tdb-baisse { color: var(--critique); font-weight: 600; }

.tdb-jauge {
  display: block;
  height: 8px;
  background: var(--piste);
  border-radius: 99px;
  overflow: hidden;
}

.tdb-jauge > span {
  display: block;
  height: 100%;
  background: var(--ton-vif, var(--accent-vif));
  border-radius: 99px;
}

.tdb-grille {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.tdb-grille > .panneau:only-child {
  grid-column: 1 / -1;
}

.panneau {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panneau-tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.panneau h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.panneau-tete a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}

.panneau-tete a:hover {
  text-decoration: underline;
}

.tdb-sous-titre {
  margin: -8px 0 0;
  font-size: 13.5px;
  color: var(--encre-2);
}

.tdb-discret {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--encre-3);
}

.tdb-vide {
  margin: 0;
  color: var(--encre-2);
}

/* Échéancier */
.tdb-echeances {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tdb-echeance-haut {
  display: flex;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 6px;
}

.tdb-echeance-haut .tdb-discret {
  display: inline;
  margin-left: 6px;
  font-size: 12.5px;
}

.tdb-chiffres {
  color: var(--encre-2);
  font-variant-numeric: tabular-nums;
}

.tdb-chiffres strong {
  color: var(--encre);
}

.tdb-chiffres .badge {
  margin-inline-start: 4px;
}

.tdb-piste {
  height: 14px;
  background: var(--piste);
  border-radius: 4px;
  overflow: hidden;
}

.tdb-piste > span {
  display: block;
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
}

.tdb-legende {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--encre-2);
}

.tdb-legende span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tdb-legende i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.tdb-legende-encaisse { background: var(--navy); }
.tdb-legende-reste { background: var(--piste); }

/* À traiter */
.tdb-taches {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tdb-taches li + li {
  border-top: 1px solid var(--trait);
}

.tdb-taches a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 2px;
  color: inherit;
  text-decoration: none;
}

.tdb-taches a:hover strong {
  text-decoration: underline;
}

.tdb-taches strong {
  font-size: 14.5px;
}

.tdb-taches svg.icone {
  color: var(--encre-3);
  width: 16px;
  height: 16px;
}

.tdb-pastille {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.tdb-pastille-critique { background: var(--critique-pale); color: var(--critique); }
.tdb-pastille-attention { background: var(--attention-pale); color: var(--attention); }
.tdb-pastille-info { background: var(--piste); color: var(--navy); }

/* Tableaux du tableau de bord */
.defile-horizontal {
  overflow-x: auto;
  margin: 0 -4px;
}

.tableau-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tableau-compact th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--encre-3);
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--trait);
  white-space: nowrap;
}

.tableau-compact td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--trait);
  white-space: nowrap;
}

.tableau-compact .cellule-discrete {
  font-size: 13px;
  color: var(--encre-3);
}

.tableau-compact tr:last-child td {
  border-bottom: 0;
}

.tableau-compact .nombre {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tdb-taux {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.tdb-taux .tdb-jauge {
  flex: 1;
}

.tdb-taux .tdb-jauge > span {
  background: var(--ton-vif, var(--navy));
}

.tdb-taux strong {
  width: 40px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ton, inherit);
}

.lien-eleve {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.lien-eleve:hover > span:last-child {
  text-decoration: underline;
}

.lien-eleve small {
  display: block;
  font-size: 12px;
  color: var(--encre-3);
}

.initiales-rondes {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--piste);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.tdb-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--encre-2);
}

.tdb-mode::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--encre-3);
}

.tdb-mode-mobile_money::before { background: var(--accent-vif); }
.tdb-mode-virement_bancaire::before { background: var(--navy); }

/* Absences du jour */
.tdb-absences {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.tdb-absences li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--trait);
}

.tdb-absences li:last-child {
  border-bottom: 0;
}

.tdb-absences strong {
  color: var(--critique);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tdb-absences .tdb-discret {
  display: inline;
}

@media (max-width: 1100px) {
  .tdb-grille {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .tdb-entete h1 { font-size: 25px; }
  .tdb-actions { width: 100%; }
  .tdb-actions .bouton { flex: 1 1 auto; justify-content: center; }
  .tdb-indicateurs { grid-template-columns: minmax(0, 1fr); }
}

/* Bouton « afficher le mot de passe » : un œil, barré quand le mot de
   passe est visible. */
.mdp-toggle svg.icone {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.mdp-toggle .icone:last-child,
.mdp-toggle[aria-pressed="true"] .icone:first-child {
  display: none;
}

.mdp-toggle[aria-pressed="true"] .icone:last-child {
  display: inline-block;
}

.etat-vide-icone {
  color: var(--gold);
  opacity: 1;
}

.etat-vide-icone svg.icone {
  width: 34px;
  height: 34px;
  stroke-width: 1.5;
}

.badge-retard svg.icone {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.mdp-toggle,
.mdp-toggle:hover {
  background: none;
  color: var(--encre-2);
}

.mdp-toggle:hover {
  color: var(--navy);
}

/* Rangée de boutons d'action en haut d'une page de liste */
.barre-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

/* Recherche : le menu des classes passe à la ligne au lieu de
   déborder de l'écran sur téléphone. */
.barre-recherche {
  flex-wrap: wrap;
}

.barre-recherche input[type=search] {
  flex: 1 1 200px;
  min-width: 0;
}

.barre-recherche select {
  max-width: 100%;
}

.liens-export {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--encre-2);
}

.liens-export a {
  font-weight: 600;
  color: var(--navy);
}

img.initiales-rondes {
  object-fit: cover;
  padding: 0;
}

/* ========== Vérification publique d'un document (oct. 2026) ========== */

.verification {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.verification h1 {
  margin: 0;
}

.verification-intro {
  margin: 0;
  color: var(--encre-2);
  max-width: 62ch;
}

.verification-statut {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid;
}

.verification-statut svg.icone {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.verification-statut strong {
  display: block;
  font-family: var(--police-titres);
  font-size: 19px;
  margin-bottom: 2px;
}

.verification-statut span {
  color: var(--encre-2);
}

.verification-statut-ok {
  background: var(--ok-pale);
  border-color: #BFE3CC;
  color: var(--ok);
}

.verification-statut-inconnu,
.verification-statut-annule {
  background: var(--critique-pale);
  border-color: #F0C9C4;
  color: var(--critique);
}

.verification-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--encre-2);
  background: var(--cream);
  border-radius: 6px;
  padding: 3px 8px;
}

.verification-champs {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  gap: 0;
  margin: 0;
  font-size: 14.5px;
}

.verification-champs dt,
.verification-champs dd {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--trait);
}

.verification-champs dt {
  color: var(--encre-2);
  padding-right: 20px;
}

.verification-champs dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.verification-champs dt:last-of-type,
.verification-champs dd:last-of-type {
  border-bottom: 0;
}

.verification-formulaire input[type=text] {
  flex: 1 1 200px;
  min-width: 0;
  max-width: none;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.verification-formulaire input[type=text]::placeholder {
  text-transform: none;
  letter-spacing: normal;
}

.hero-verifier {
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--encre-2);
}

.hero-verifier a {
  font-weight: 600;
  color: var(--navy);
}

/* ========== Relances WhatsApp (oct. 2026) ========== */

.whatsapp-boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

form.whatsapp-form {
  display: block;
  margin: 0;
}

.bouton-whatsapp,
.bouton-whatsapp:hover {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  background: #fff;
  color: var(--encre);
  border: 1px solid #A8DDB8;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: normal;
}

.bouton-whatsapp:hover {
  background: #EAF8EF;
  border-color: #25A35A;
}

.bouton-whatsapp svg.icone {
  width: 20px;
  height: 20px;
  color: #1F9D55;
}

.bouton-whatsapp small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--encre-2);
  font-variant-numeric: tabular-nums;
}

.whatsapp-sans-numero {
  font-size: 13.5px;
  color: var(--encre-3);
  font-style: italic;
}

.relances-section {
  margin-bottom: 18px;
}

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

.relances-liste li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--trait);
}

.relances-liste li:first-child {
  border-top: 0;
}

.relances-eleve {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.relances-eleve .tdb-discret {
  display: inline;
}

.relances-eleve a {
  color: var(--navy);
  text-decoration: none;
}

.relances-compte {
  display: inline;
  font-family: var(--police-texte);
  font-size: 13px;
  margin-left: 6px;
}

form.relances-date {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
}

form.relances-date label {
  flex-direction: row;
  font-size: 14px;
  color: var(--encre-2);
}

form.relances-date input {
  margin: 0;
  padding: 5px 8px;
  font-size: 14px;
}

.relances-fiche {
  margin: 16px 0;
}

form.relances-email {
  margin: 0;
}

/* ========== Arabe : police et écriture de droite à gauche (oct. 2026) ========== */

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("../fonts/noto-sans-arabic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

.choix-langue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  font-style: normal;
  text-decoration: none;
  flex-shrink: 0;
}

.choix-langue:hover {
  border-color: var(--navy);
}

.choix-langue[lang="ar"] {
  font-size: 17px;
  line-height: 1;
}

.navbar .choix-langue {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  margin-inline-end: 14px;
}

[dir="rtl"] body {
  line-height: 1.7;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  letter-spacing: 0;
}

/* Les libellés en capitales espacées n'ont pas de sens en arabe. */
[dir="rtl"] .tdb-indicateur-titre,
[dir="rtl"] .tableau-compact th {
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}

/* Menu à droite */
[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

[dir="rtl"] .contenu-principal {
  margin-left: 0;
  margin-right: 240px;
}

[dir="rtl"] .sidebar-liens a.lien-actif,
[dir="rtl"] .sidebar-lien-plateforme {
  box-shadow: inset -3px 0 0 var(--accent-vif);
}

[dir="rtl"] .sidebar-deroulant summary::after {
  right: auto;
  left: 12px;
  content: "◂";
}

[dir="rtl"] .sidebar-deroulant[open] summary::after {
  transform: rotate(-90deg);
}

[dir="rtl"] .sidebar-deroulant a {
  padding: 7px 39px 7px 10px !important;
}

[dir="rtl"] .barre-devise {
  text-align: right;
}

@media (max-width: 800px) {
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  [dir="rtl"] .sidebar.sidebar-ouverte {
    transform: translateX(0);
  }

  [dir="rtl"] .sidebar-toggle-mobile {
    left: auto;
    right: 14px;
  }

  [dir="rtl"] .contenu-principal {
    margin-right: 0;
  }

  [dir="rtl"] .barre-devise {
    padding-left: 16px;
    padding-right: 64px;
  }
}

/* Alignements */
[dir="rtl"] .table th,
[dir="rtl"] .table td,
[dir="rtl"] .tableau-compact th,
[dir="rtl"] .tableau-compact td {
  text-align: right;
}

[dir="rtl"] .tableau-compact .nombre {
  text-align: left;
}

[dir="rtl"] .tdb-taux strong {
  text-align: left;
}

[dir="rtl"] .carte-guide {
  border-left: 1px solid #DFE6EC;
  border-right: 4px solid var(--gold);
}

[dir="rtl"] .carte-demande {
  border-left: 1px solid #e2ddcd;
  border-right: 4px solid var(--gold);
}

[dir="rtl"] .bouton-whatsapp {
  text-align: right;
}

/* Les flèches « suivant » pointent vers la gauche en arabe. */
[dir="rtl"] .tdb-taches svg.icone,
[dir="rtl"] svg.icone use[href="#i-chevron"] {
  transform: scaleX(-1);
}

[dir="rtl"] .mdp-toggle {
  right: auto;
  left: 4px;
}

/* Codes et numéros : toujours de gauche à droite. */
.verification-code,
.cellule-discrete {
  unicode-bidi: isolate;
}

[dir="rtl"] .verification-formulaire input[type=text],
[dir="rtl"] input[type=email],
[dir="rtl"] input[name=email] {
  direction: ltr;
  text-align: right;
}

[dir="rtl"] .tdb-indicateur-valeur small {
  margin-left: 0;
  margin-right: 5px;
}

/* Cellule de tableau qui ne se coupe pas (dates, montants, références). */
.sans-coupure { white-space: nowrap; }

/* --- Application installable et hors ligne (oct. 2026) --- */
.bandeau-hors-ligne {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 1000;
  padding: 10px 18px;
  background: var(--attention-pale);
  color: var(--encre);
  border-bottom: 2px solid var(--attention);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.bandeau-hors-ligne.bandeau-insiste { animation: bandeau-insiste 0.45s ease-in-out; }

@keyframes bandeau-insiste {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .bandeau-hors-ligne.bandeau-insiste { animation: none; }
}

/* Sans connexion, les boutons d'envoi paraissent désactivés. */
.hors-ligne-actif form button[type="submit"],
.hors-ligne-actif form input[type="submit"] { opacity: 0.45; cursor: not-allowed; }

.bouton-installer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 14px 0;
  padding: 9px 12px;
  width: calc(100% - 28px);
  background: rgba(0, 169, 157, 0.22);
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.bouton-installer:hover { background: rgba(0, 169, 157, 0.38); background: color-mix(in srgb, var(--gold) 38%, transparent); }
.bouton-installer:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bouton-installer .icone { width: 18px; height: 18px; }

.page-hors-ligne { background: var(--cream); }

.hors-ligne {
  max-width: 34rem;
  margin: 0 auto;
  padding: 12vh 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--encre);
}

.hors-ligne img { border-radius: 16px; }
.hors-ligne h1, .hors-ligne h2 { margin: 0; color: var(--navy); font-family: var(--police-titres); }
.hors-ligne p { margin: 0; line-height: 1.6; }
.hors-ligne-arabe { padding-top: 12px; border-top: 1px solid var(--trait); font-family: var(--police-texte); }
.hors-ligne-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }

/* Paramètres : les deux sélecteurs de couleur de l'école côte à côte */
.ligne-couleurs { display: flex; gap: 16px; flex-wrap: wrap; }
.ligne-couleurs label { flex: 0 0 auto; }
.ligne-couleurs input[type=color] { width: 72px; height: 40px; padding: 2px; cursor: pointer; }

/* Pré-inscription : champ piège invisible pour les robots */
.champ-piege { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ========== Lien propre à chaque école (/e/…) ========== */

a.navbar-marque {
  color: inherit;
  text-decoration: none;
}

.connexion-logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
}

.lien-ecole {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 400;
}

.lien-ecole a {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.lien-ecole-copier {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--trait);
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  width: auto;
  margin: 0;
}

.lien-ecole-copier:hover {
  border-color: var(--navy);
}

.carte-lien-ecole {
  background: var(--accent-pale);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  max-width: 640px;
}

.carte-lien-ecole p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--encre-2);
}

.champ-prefixe {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-weight: 400;
  color: var(--encre-2);
  font-size: 14px;
}

.champ-prefixe input {
  flex: 1 1 160px;
  min-width: 0;
}

/* Sur le bandeau coloré de l'accueil, ces deux lignes étaient en gris et
   bleu foncés : illisibles. Elles passent en blanc. */
.hero .hero-verifier {
  color: rgba(255, 255, 255, 0.92);
}

.hero .hero-verifier a {
  color: #fff;
  text-decoration: underline;
}
