/* =====================================================================
   PORTAIL GST – STYLE COMMUN (mêmes couleurs et motifs que le site vitrine)
   ===================================================================== */

/* ============ 1. VARIABLES ============ */
:root {
  --violet: #4a2650;
  --violet-fonce: #331a38;
  --orange: #f0990f;
  --rouge: #e8481c;
  --vert: #1d7a3e;
  --fond: #faf7f2;
  --creme: #fdf0dc;
  --texte: #2b2230;
  --gris: #6b5f70;
  --bordure: #e2d8e8;
  --hauteur-header: 64px;

  --trace: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 260' fill='none' stroke='%23f0990f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M400 30H310l-40 40H200M400 100H350l-30 30v60M400 160H380l-20 20h-20'/%3E%3Ccircle cx='194' cy='70' r='6'/%3E%3Ccircle cx='320' cy='196' r='6'/%3E%3Ccircle cx='335' cy='180' r='5'/%3E%3C/svg%3E");
}

/* ============ 2. RÈGLES GÉNÉRALES ============ */
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
body {
  font-family: "Poppins", "Segoe UI", sans-serif; background: var(--fond); color: var(--texte);
  line-height: 1.6; min-height: 100vh; overflow-x: clip;
}
a { color: var(--violet); }
h1, h2, h3 { color: var(--violet); line-height: 1.2; letter-spacing: -.01em; }
h2 {
  font-size: 1.5rem; margin-bottom: 14px; padding-bottom: 10px;
  background: linear-gradient(var(--orange), var(--orange)) no-repeat left bottom / 48px 4px;
}

/* ============ 3. BOUTONS ============ */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: var(--violet-fonce);
  padding: 11px 24px; border: 2px solid var(--orange); border-radius: 30px;
  font-family: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 16px rgba(240,153,15,.35);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.bouton:hover { transform: translateY(-2px); }
.bouton:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.bouton:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.bouton.large { width: 100%; }
.bouton.petit { padding: 7px 16px; font-size: .9rem; }
.bouton.contour { background: transparent; color: var(--violet); border-color: var(--violet); box-shadow: none; }
.bouton.contour-blanc { background: transparent; color: white; border-color: rgba(255,255,255,.7); box-shadow: none; }
.bouton.contour-blanc:hover { border-color: var(--orange); color: var(--orange); }
.lien-bouton {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600; font-size: .9rem;
  color: var(--violet); text-decoration: underline; cursor: pointer;
}
.lien-bouton:hover { color: var(--orange); }

/* ============ 4. FORMULAIRES ============ */
.champ { display: grid; gap: 6px; }
label, .champ-label { font-weight: 600; font-size: .9rem; }
input, select {
  width: 100%; padding: 11px 12px; border: 2px solid #ddd; border-radius: 10px;
  font: inherit; background: white; color: var(--texte);
}
input:focus, select:focus { outline: none; border-color: var(--orange); }
.aide { font-size: .82rem; color: var(--gris); }
.erreur { color: var(--rouge); font-size: .82rem; min-height: 1em; }
.formulaire { display: grid; gap: 14px; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.tel { display: flex; align-items: stretch; }
.tel .indicatif {
  display: flex; align-items: center; padding: 0 12px; font-weight: 700; color: var(--violet);
  background: #f1ebf3; border: 2px solid #ddd; border-right: none; border-radius: 10px 0 0 10px;
}
.tel input { border-radius: 0 10px 10px 0; }
.tel:focus-within .indicatif { border-color: var(--orange); }

.mdp { position: relative; }
.mdp input { padding-right: 48px; }
.voir-mdp {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; border-radius: 8px; background: transparent;
  cursor: pointer; font-size: 1.1rem; color: var(--gris);
}
.voir-mdp:hover { background: #f1ebf3; }

.case { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .85rem; line-height: 1.45; cursor: pointer; }
.case input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; padding: 0; accent-color: var(--orange); }

.radio-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-carte { position: relative; cursor: pointer; font-weight: 400; }
.radio-carte input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-corps { display: block; padding: 10px 14px; border: 2px solid var(--bordure); border-radius: 12px; transition: border-color .2s, background .2s; }
.radio-corps strong { display: block; color: var(--violet); }
.radio-corps small { color: var(--gris); }
.radio-carte:hover .radio-corps { border-color: var(--orange); }
.radio-carte input:checked + .radio-corps { border-color: var(--orange); background: #fff4e0; }
.radio-carte input:focus-visible + .radio-corps { outline: 3px solid var(--orange); outline-offset: 2px; }
fieldset { border: none; padding: 0; min-width: 0; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }

/* Messages (succès / erreur / info) */
.message { padding: 10px 14px; border-radius: 10px; font-size: .9rem; font-weight: 600; border-left: 4px solid; }
.message:empty { display: none; }
.message.ok { background: #e7f5ec; border-color: var(--vert); color: var(--vert); }
.message.erreur-bloc { background: #fdece6; border-color: var(--rouge); color: #b8320e; }
.message.info { background: #fff4e0; border-color: var(--orange); color: var(--violet); }

/* ============ 5. EN-TÊTE ============ */
.entete {
  position: sticky; top: 0; z-index: 10; height: var(--hauteur-header);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 20px;
  background: var(--violet); border-bottom: 3px solid var(--orange);
  box-shadow: 0 6px 20px rgba(51,26,56,.28); color: white;
}
.entete .marque { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; min-width: 0; }
.entete .marque img { height: 44px; border-radius: 6px; background: white; }
.entete .marque span { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .marque small { display: block; font-weight: 500; font-size: .75rem; color: var(--orange); letter-spacing: .06em; text-transform: uppercase; }
.entete-actions { display: flex; align-items: center; gap: 10px; }
.entete-actions .retour { color: white; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.entete-actions .retour:hover { color: var(--orange); }

/* ============ 6. DÉCORATIONS ============ */
.puces-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.puces-deco i {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--s, 6px); height: var(--s, 6px); border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 12px 2px rgba(240,153,15,.75); opacity: .25;
  animation: scintille 3.6s ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes scintille { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.25); } }
@keyframes apparait { from { opacity: 0; transform: translateY(14px); } }

/* ============ 7. PAGE DE CONNEXION ============ */
.accueil-portail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: calc(100vh - var(--hauteur-header)); }
.panneau-gauche {
  position: relative; overflow: hidden; color: white; padding: 60px 48px;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  background: linear-gradient(160deg, var(--violet) 0%, var(--violet-fonce) 70%);
}
.panneau-gauche::before {
  content: ""; position: absolute; top: 0; right: 0; width: 380px; height: 247px;
  background: var(--trace) no-repeat right top / contain; opacity: .55; pointer-events: none;
}
.panneau-gauche::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 260px; height: 260px; border-top-right-radius: 100%;
  background: repeating-radial-gradient(circle at 0 100%, transparent 0 20px, rgba(240,153,15,.3) 20px 22px);
  pointer-events: none;
}
.panneau-gauche > :not(.puces-deco) { position: relative; z-index: 1; }
.panneau-gauche h1 { color: white; font-size: clamp(1.8rem, 3.4vw, 2.6rem); max-width: 16ch; }
.panneau-gauche h1 em { font-style: normal; color: var(--orange); }
.panneau-gauche p { max-width: 46ch; color: #e9ddee; }
.atouts { list-style: none; padding: 0; display: grid; gap: 10px; font-weight: 600; }
.atouts li { display: flex; gap: 12px; align-items: center; }
.atouts .ic {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); font-size: 1.1rem;
}
.robot-flotte { font-size: 3.4rem; animation: flotte 3s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
@keyframes flotte { 50% { transform: translateY(-8px); } }

.panneau-droit { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.carte-auth {
  position: relative; overflow: hidden; width: 100%; max-width: 470px; padding: 30px 28px 26px;
  background: white; border-radius: 18px; border-top: 6px solid var(--orange);
  box-shadow: 0 14px 36px rgba(74,38,80,.16); animation: apparait .4s ease;
}
.carte-auth::before {
  content: ""; position: absolute; top: 0; right: 0; width: 200px; height: 130px;
  background: var(--trace) no-repeat right top / contain; opacity: .25; pointer-events: none;
}
.carte-auth > * { position: relative; }
.onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 22px; background: #f4eef6; border-radius: 14px; }
.onglet {
  padding: 10px; border: none; border-radius: 10px; background: transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--violet); transition: background .2s, box-shadow .2s;
}
.onglet[aria-selected="true"] { background: white; box-shadow: 0 3px 10px rgba(74,38,80,.15); }
.onglet[aria-selected="true"]::after { content: ""; display: block; width: 26px; height: 3px; margin: 4px auto 0; border-radius: 3px; background: var(--orange); }
.onglet:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.carte-auth h2 { font-size: 1.35rem; }
.intro-form { font-size: .9rem; color: var(--gris); margin: -4px 0 16px; }
.ligne-entre { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.etapes-code { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: #fff4e0; border-left: 4px solid var(--orange); font-size: .85rem; color: var(--violet); }

/* ============ 8. ESPACE PARENT ============ */
.page { max-width: 1050px; margin: 0 auto; padding: 34px 20px 60px; }
.bienvenue {
  position: relative; overflow: hidden; padding: 28px 28px; border-radius: 18px; color: white; margin-bottom: 26px;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-fonce) 100%);
  box-shadow: 0 12px 30px rgba(51,26,56,.25);
}
.bienvenue::before {
  content: ""; position: absolute; top: 0; right: 0; width: 320px; height: 208px;
  background: var(--trace) no-repeat right top / contain; opacity: .5; pointer-events: none;
}
.bienvenue > :not(.puces-deco) { position: relative; z-index: 1; }
.bienvenue h1 { color: white; font-size: clamp(1.5rem, 3vw, 2rem); }
.bienvenue h1 span { color: var(--orange); }
.bienvenue p { color: #e9ddee; margin-top: 6px; }

.grille-espace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.colonne { display: grid; gap: 22px; }
.bloc {
  position: relative; background: white; border-radius: 16px; padding: 24px 22px;
  border-top: 5px solid var(--orange); box-shadow: 0 6px 20px rgba(74,38,80,.09);
}
.bloc-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.enfants { display: grid; gap: 14px; }
.enfant { border: 2px solid var(--bordure); border-radius: 14px; padding: 16px 18px; transition: border-color .2s; }
.enfant:hover { border-color: var(--orange); }
.enfant-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0990f, #e8731a); color: white; font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(240,153,15,.4);
}
.enfant-tete h3 { font-size: 1.1rem; }
.enfant-tete small { color: var(--gris); }
.inscription { padding: 10px 12px; border-radius: 10px; background: var(--fond); display: grid; gap: 4px; font-size: .88rem; }
.inscription + .inscription { margin-top: 8px; }
.inscription-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.inscription strong { color: var(--violet); }
.details { color: var(--gris); }
.statut { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.statut.en_attente { background: #fff4e0; color: #a9650a; }
.statut.validee { background: #e7f5ec; color: var(--vert); }
.statut.annulee { background: #fdece6; color: #b8320e; }

.vide { text-align: center; padding: 24px 10px; color: var(--gris); }
.vide .gros { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.bientot { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: #f4eef6; color: var(--violet); font-size: .9rem; }
.bientot .ic { font-size: 1.6rem; }

.zone-repliable { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--bordure); animation: apparait .3s ease; }
.chargement { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50vh; color: var(--violet); font-weight: 600; }
.roue { width: 26px; height: 26px; border: 3px solid #eadff0; border-top-color: var(--orange); border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.pied { text-align: center; font-size: .8rem; color: var(--gris); padding: 24px 16px 30px; }
.pied a { color: var(--violet); font-weight: 600; }

/* ============ 9. TÉLÉPHONE ET ACCESSIBILITÉ ============ */
@media (max-width: 900px) {
  .accueil-portail { grid-template-columns: 1fr; }
  .panneau-gauche { padding: 38px 22px 34px; }
  .panneau-gauche .atouts, .robot-flotte { display: none; }
  .panneau-gauche::after { width: 130px; height: 130px; opacity: .6; }
  .panneau-gauche::before { width: 220px; height: 143px; opacity: .35; }
  .grille-espace { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .entete { padding: 0 12px; }
  .entete .marque img { height: 38px; }
  .entete .marque span { font-size: .92rem; }
  .entete-actions .retour { display: none; }
  .carte-auth { padding: 24px 16px 20px; }
  .panneau-droit { padding: 24px 12px; }
  .deux-colonnes, .radio-cartes { grid-template-columns: 1fr; }
  .page { padding: 22px 12px 40px; }
  .bienvenue, .bloc { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .puces-deco i, .robot-flotte, .roue { animation: none; }
  .carte-auth, .zone-repliable { animation: none; }
  .bouton { transition: none; }
}

/* =====================================================================
   10. PANNEAU D’ADMINISTRATION
   ===================================================================== */
.admin { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; max-width: 1280px; margin: 0 auto; padding: 26px 20px 60px; }
.menu-admin { position: sticky; top: calc(var(--hauteur-header) + 20px); align-self: start; display: grid; gap: 4px; padding: 12px; background: white; border-radius: 16px; box-shadow: 0 6px 20px rgba(74,38,80,.09); border-top: 5px solid var(--orange); }
.menu-admin button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px;
  border: none; border-radius: 10px; background: transparent; cursor: pointer; text-align: left;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--violet); transition: background .2s;
}
.menu-admin button:hover { background: #f4eef6; }
.menu-admin button[aria-current="page"] { background: var(--violet); color: white; }
.menu-admin button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.pastille-nb { min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--orange); color: var(--violet-fonce); font-size: .75rem; font-weight: 700; text-align: center; line-height: 22px; }
.pastille-nb:empty { display: none; }

.vue { display: grid; gap: 20px; animation: apparait .3s ease; }
.vue-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.vue-tete h1 { font-size: 1.6rem; }
.vue-tete p { color: var(--gris); font-size: .92rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { position: relative; overflow: hidden; padding: 18px 20px; border-radius: 16px; background: white; box-shadow: 0 6px 20px rgba(74,38,80,.09); border-left: 5px solid var(--orange); }
.stat .nb { display: block; font-size: 2rem; font-weight: 800; color: var(--violet); line-height: 1.1; }
.stat .lib { font-size: .85rem; font-weight: 600; color: var(--gris); }
.stat .ic { position: absolute; right: 14px; top: 12px; font-size: 1.6rem; opacity: .8; }

.outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.outils input, .outils select { width: auto; flex: 1 1 180px; padding: 9px 12px; }
.outils input[type="search"] { flex: 2 1 260px; }

.tableau-scroll { overflow-x: auto; border-radius: 14px; background: white; box-shadow: 0 6px 20px rgba(74,38,80,.09); }
table.donnees { width: 100%; border-collapse: collapse; font-size: .86rem; }
.donnees th { position: sticky; top: 0; text-align: left; padding: 12px 12px; background: #f4eef6; color: var(--violet); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.donnees td { padding: 11px 12px; border-top: 1px solid #f0e9f2; vertical-align: top; }
.donnees tr:hover td { background: #fdfbfd; }
.donnees .principal { font-weight: 600; color: var(--violet); }
.donnees .secondaire { display: block; color: var(--gris); font-size: .8rem; }
.donnees select { width: auto; padding: 5px 8px; font-size: .82rem; border-radius: 8px; }
.actions-ligne { display: flex; gap: 6px; flex-wrap: wrap; }
.mini {
  padding: 5px 10px; border-radius: 8px; border: 1.5px solid var(--bordure); background: white; cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 600; color: var(--violet); white-space: nowrap; transition: border-color .2s, background .2s;
}
.mini:hover { border-color: var(--orange); background: #fff4e0; }
.mini.danger { color: #b8320e; }
.mini.danger:hover { border-color: var(--rouge); background: #fdece6; }
.mini:disabled { opacity: .5; cursor: not-allowed; }
.badge-role { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700; background: #f1ebf3; color: var(--violet); }
.badge-role.admin { background: var(--violet); color: white; }
.badge-role.prof { background: #e3f0fb; color: #1f5f99; }
.statut.actif { background: #e7f5ec; color: var(--vert); }
.statut.banni { background: #fdece6; color: #b8320e; }

.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 2px solid var(--bordure); border-radius: 12px; }
.interrupteur + .interrupteur { margin-top: 10px; }
.interrupteur strong { color: var(--violet); }
.bascule { position: relative; width: 50px; height: 28px; flex-shrink: 0; }
.bascule input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.bascule span { position: absolute; inset: 0; border-radius: 28px; background: #d9cfde; transition: background .2s; }
.bascule span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.bascule input:checked + span { background: var(--vert); }
.bascule input:checked + span::after { transform: translateX(22px); }
.bascule input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
textarea { width: 100%; padding: 11px 12px; border: 2px solid #ddd; border-radius: 10px; font: inherit; resize: vertical; }
textarea:focus { outline: none; border-color: var(--orange); }

.code-affiche { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: #fff4e0; border-left: 4px solid var(--orange); color: var(--violet); font-size: .9rem; }
.code-affiche strong { font-size: 1.1rem; letter-spacing: .08em; color: var(--violet-fonce); }
.journal-ligne { display: grid; grid-template-columns: 22px 150px 140px minmax(0, 1fr); align-items: start; gap: 12px; padding: 10px 14px; border-top: 1px solid #f0e9f2; font-size: .85rem; }
.journal-ligne:first-child { border-top: none; }
.journal-ligne time { color: var(--gris); }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; padding: 16px 12px 40px; }
  .menu-admin { position: static; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .journal-ligne { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .vue { animation: none; } .bascule span, .bascule span::after { transition: none; } }
.interrupteur label { display: grid; gap: 2px; cursor: pointer; }
.interrupteur label .secondaire { font-size: .8rem; color: var(--gris); font-weight: 400; }

/* ============ 11. SUIVI ET ANNONCES ============ */
.fil-suivi { display: grid; gap: 12px; }
.suivi, .annonce {
  position: relative; padding: 14px 16px 12px; border-radius: 14px; background: white;
  border: 2px solid var(--bordure); border-left: 5px solid var(--orange);
}
.annonce { box-shadow: 0 6px 20px rgba(74,38,80,.08); border-left-color: var(--violet); }
.suivi.felicitations { border-left-color: #e0a800; background: #fffaf0; }
.suivi.absence { border-left-color: var(--rouge); }
.suivi.progression { border-left-color: var(--vert); }
.suivi-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.suivi-cat { font-size: .78rem; font-weight: 700; color: var(--violet); text-transform: uppercase; letter-spacing: .04em; }
.suivi-tete time { font-size: .8rem; color: var(--gris); }
.suivi p, .annonce p { white-space: pre-line; font-size: .92rem; }
.annonce h3 { font-size: 1.05rem; margin-bottom: 4px; }
.suivi-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: .8rem; color: var(--gris); font-style: italic; }
.suivi-enfant { margin-top: 10px; display: grid; gap: 8px; }
.suivi-enfant .suivi { border-width: 1px; border-left-width: 4px; padding: 10px 12px; }
.jr-case { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--orange); cursor: pointer; }
@media (max-width: 900px) { .journal-ligne { grid-template-columns: 22px minmax(0, 1fr); } .journal-ligne > :not(.jr-case) { grid-column: 2; } }

/* ============ 12. MESSAGERIE ============ */
.msg-cadre { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); min-height: 420px; border: 2px solid var(--bordure); border-radius: 14px; overflow: hidden; background: white; }
.msg-colonne-liste { border-right: 2px solid var(--bordure); display: flex; flex-direction: column; min-width: 0; background: #fcfafd; }
.msg-outils { padding: 12px; border-bottom: 1px solid var(--bordure); }
.msg-choix { padding: 12px; border-bottom: 1px solid var(--bordure); background: #fff4e0; display: grid; gap: 6px; }
.msg-choix-ligne { display: flex; gap: 8px; }
.msg-choix-ligne select { flex: 1; padding: 8px 10px; }
.msg-liste { overflow-y: auto; max-height: 520px; }
.msg-item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  padding: 12px; border: none; border-bottom: 1px solid #f0e9f2; background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--texte);
}
.msg-item:hover { background: #f4eef6; }
.msg-item.actif { background: #fff4e0; box-shadow: inset 4px 0 0 var(--orange); }
.msg-item:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; background: #f1ebf3; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.msg-resume { min-width: 0; display: grid; }
.msg-resume strong { color: var(--violet); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-resume span { font-size: .8rem; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item.non-lu .msg-resume span { color: var(--texte); font-weight: 600; }
.msg-meta { display: grid; justify-items: end; gap: 4px; font-size: .72rem; color: var(--gris); }
.msg-colonne-fil { display: flex; flex-direction: column; min-width: 0; }
.msg-entete { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bordure); }
.msg-titre { font-weight: 700; color: var(--violet); }
.msg-retour { display: none; white-space: nowrap; }
.msg-fil { flex: 1; overflow-y: auto; max-height: 440px; min-height: 260px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--fond); }
.bulle { max-width: 78%; padding: 9px 13px 6px; border-radius: 16px; box-shadow: 0 2px 6px rgba(74,38,80,.08); }
.bulle p { white-space: pre-line; overflow-wrap: anywhere; font-size: .92rem; }
.bulle time { display: block; text-align: right; font-size: .68rem; opacity: .75; margin-top: 2px; }
.bulle.autre { align-self: flex-start; background: white; border-bottom-left-radius: 4px; }
.bulle.moi { align-self: flex-end; background: var(--violet); color: white; border-bottom-right-radius: 4px; }
.bulle-auteur { display: block; font-size: .72rem; font-weight: 700; color: var(--orange); margin-bottom: 2px; }
.bulle.autre.role-parent .bulle-auteur { color: var(--violet); }
.msg-colonne-fil > .message { margin: 8px 16px 0; }
.msg-saisie { display: flex; gap: 10px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--bordure); }
.msg-saisie textarea { flex: 1; resize: none; }
.msg-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px; text-align: center; color: var(--gris); }
.msg-vide span { font-size: 2.4rem; }
@media (max-width: 760px) {
  .msg-cadre { grid-template-columns: 1fr; }
  .msg-colonne-liste { border-right: none; }
  .msg-vide { display: none; }
  .fil-ouvert .msg-colonne-liste { display: none; }
  .msg-retour { display: inline; }
  .bulle { max-width: 90%; }
}

/* ============ 13. PIÈCES JOINTES ============ */
.pj { margin-top: 10px; display: grid; gap: 8px; }
.pj-images { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-images a { display: block; width: 110px; height: 110px; border-radius: 10px; overflow: hidden; border: 2px solid var(--bordure); transition: border-color .2s, transform .2s; }
.pj-images a:hover { border-color: var(--orange); transform: translateY(-2px); }
.pj-images img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-docs { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-doc { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: #f4eef6; color: var(--violet); text-decoration: none; font-size: .85rem; font-weight: 600; max-width: 100%; }
.pj-doc span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pj-doc small { color: var(--gris); font-weight: 400; }
.pj-doc:hover { background: #fff4e0; }
.champ-fichiers input[type="file"] { padding: 9px; border-style: dashed; background: #fcfafd; cursor: pointer; }
.pj-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-choisi { padding: 3px 10px; border-radius: 20px; background: #fff4e0; color: var(--violet); font-size: .78rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .pj-images a { transition: none; } }
.fermer-info {
  margin-left: auto; width: 30px; height: 30px; flex-shrink: 0; border: none; border-radius: 50%;
  background: rgba(74,38,80,.1); color: var(--violet); font-size: .95rem; cursor: pointer; transition: background .2s;
}
.fermer-info:hover { background: var(--orange); color: var(--violet-fonce); }
.fermer-info:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.code-affiche { width: 100%; }
code { padding: 1px 6px; border-radius: 6px; background: #f4eef6; color: var(--violet); font-size: .85em; }

/* ============ 14. ŒIL DU MOT DE PASSE ============ */
.voir-mdp.visible { background: #fff4e0; box-shadow: inset 0 0 0 2px var(--orange); }

/* ============ 15. PRÉSENCES ============ */
.mois-nav { display: inline-flex; align-items: center; gap: 10px; }
.mois-nav strong { min-width: 130px; text-align: center; color: var(--violet); text-transform: capitalize; }
.mois-nav .mini { font-size: 1rem; padding: 3px 11px; }
table.appel th, table.appel td { text-align: center; }
table.appel th:first-child, table.appel td:first-child { text-align: left; position: sticky; left: 0; background: white; z-index: 1; min-width: 150px; }
table.appel th:first-child { background: #f4eef6; }
.th-appel { display: grid; gap: 4px; justify-items: center; }
.date-appel { text-transform: none; }
.date-appel.aujourdhui { color: var(--orange); }
.mini.tous { padding: 2px 7px; font-size: .7rem; text-transform: none; letter-spacing: 0; }
.td-appel { padding: 6px !important; }
.case-appel {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 9px; border: 2px dashed #d9cfde; background: white; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1rem; color: white; transition: transform .15s, background .15s, border-color .15s;
}
.case-appel:hover:not(:disabled) { transform: scale(1.08); border-color: var(--orange); }
.case-appel:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.case-appel:disabled { opacity: .35; cursor: not-allowed; }
.case-appel.present { background: #22a35a; border: 2px solid #1d7a3e; }
.case-appel.absent { background: #e04b2c; border: 2px solid #b8320e; }
td.taux { font-size: .78rem; color: var(--gris); white-space: nowrap; }
.legende-appel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--gris); }
.legende-appel .case-appel { width: 22px; height: 22px; font-size: .75rem; border-radius: 6px; cursor: default; margin-left: 8px; }
.seance-jour { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 2px solid var(--bordure); border-radius: 12px; }
.seance-jour > div { display: grid; }
.seance-jour strong { color: var(--violet); }

/* Calendrier des parents */
.bouton-cal { margin-top: 10px; text-decoration: none; padding: 6px 12px; border-radius: 20px; background: #f4eef6; font-size: .85rem; }
.bouton-cal:hover { background: #fff4e0; }
.cal { margin-top: 10px; padding: 12px; border: 1px solid var(--bordure); border-radius: 12px; background: white; }
.cal .mois-nav { display: flex; justify-content: center; margin-bottom: 8px; }
.cal-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-entete { text-align: center; font-size: .72rem; font-weight: 700; color: var(--gris); }
.cal-case { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 36px; border-radius: 8px; font-size: .8rem; color: #b5a9ba; }
.cal-case.vide { visibility: hidden; }
.cal-case.seance { color: var(--violet); font-weight: 700; background: #f4eef6; }
.cal-case.present { background: #22a35a; color: white; }
.cal-case.absent { background: #e04b2c; color: white; }
.cal-case i { font-style: normal; font-size: .7rem; line-height: 1; }
.cal-case.aujourdhui { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-resume { display: flex; gap: 10px; justify-content: center; margin-top: 10px; font-size: .82rem; font-weight: 600; }
.puce-p { color: #1d7a3e; } .puce-a { color: #b8320e; }

/* ============ 16. TRAVAIL À LA MAISON ============ */
.devoir { position: relative; padding: 14px 16px 12px; border-radius: 14px; background: white; border: 2px solid var(--bordure); border-left: 5px solid #1f6fb2; }
.devoir.termine { opacity: .7; border-left-color: var(--vert); }
.devoir h3 { font-size: 1.05rem; margin-bottom: 4px; }
.devoir p { white-space: pre-line; font-size: .92rem; }
.echeance { font-size: .78rem; font-weight: 700; color: #1f5f99; background: #e3f0fb; padding: 2px 10px; border-radius: 20px; }
.echeance.depassee { color: #b8320e; background: #fdece6; }
.echeance.fait { color: var(--vert); background: #e7f5ec; }
.devoir-coches { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.case.fait { font-weight: 600; color: var(--violet); }
.case.fait.coche { color: var(--vert); }
@media (prefers-reduced-motion: reduce) { .case-appel { transition: none; } }
.msg-cadre.msg-unique { grid-template-columns: 1fr; min-height: 0; }
.msg-unique .msg-fil { max-height: 380px; min-height: 180px; }

/* ============ 17. SUIVI DES PROFESSEURS (administration) ============ */
.onglets-sp { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: #f4eef6; border-radius: 14px; }
.onglets-sp button { padding: 8px 14px; border: none; border-radius: 10px; background: transparent; cursor: pointer; font: inherit; font-weight: 600; font-size: .86rem; color: var(--violet); }
.onglets-sp button[aria-selected="true"] { background: white; box-shadow: 0 3px 10px rgba(74,38,80,.15); }
.onglets-sp button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.bloc.lecture-seule { border-top-color: #9b8fa0; }
.badge-lecture { position: absolute; top: 12px; right: 14px; padding: 3px 10px; border-radius: 20px; background: #f1ebf3; color: var(--gris); font-size: .75rem; font-weight: 700; }
.lecture-seule #sp-panneau { margin-top: 18px; }
.eleve-suivi { display: block; margin-bottom: 6px; color: var(--violet); font-size: .9rem; }

/* Calendrier des parents : bouton plus visible */
.bouton-cal { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--bordure); font-weight: 700; color: var(--violet); }
.bouton-cal[aria-expanded="true"] { border-color: var(--orange); background: #fff4e0; }

/* ============ 18. MESSAGES : modifier, supprimer, joindre ============ */
.msg-entete .mini.danger { margin-left: auto; white-space: nowrap; }
.msg-saisie-bloc { border-top: 1px solid var(--bordure); }
.msg-saisie-bloc .msg-saisie { border-top: none; }
.msg-fichiers { padding: 8px 12px 0; }
.msg-fichiers:empty { display: none; }
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bouton-trombone {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%; background: #f4eef6; cursor: pointer; font-size: 1.15rem; transition: background .2s;
}
.bouton-trombone:hover { background: #fff4e0; }
.bouton-trombone:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
.bulle-pied { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.bulle-pied time { margin-top: 0; }
.bulle-actions { display: inline-flex; gap: 2px; opacity: .35; transition: opacity .2s; }
.bulle:hover .bulle-actions, .bulle:focus-within .bulle-actions { opacity: 1; }
.bulle-actions button { border: none; background: transparent; cursor: pointer; font-size: .85rem; padding: 2px 4px; border-radius: 6px; }
.bulle-actions button:hover { background: rgba(255,255,255,.25); }
.bulle.autre .bulle-actions button:hover { background: #f4eef6; }
.bulle-actions button:focus-visible { outline: 2px solid var(--orange); }
.bulle-edition { display: grid; gap: 6px; min-width: 220px; }
.bulle-edition textarea { color: var(--texte); }
.bulle .pj { margin-top: 6px; }
.bulle.moi .pj-doc { background: rgba(255,255,255,.15); color: white; }
.bulle.moi .pj-doc small { color: #e9ddee; }
.bulle .pj-images a { width: 140px; height: 140px; }
@media (hover: none) { .bulle-actions { opacity: .8; } }

/* Messagerie dans un espace étroit (ex. colonne de l’espace parent) : même affichage que sur téléphone */
#zone-messagerie, #sp-discussion, #zone-admin-discussion { container-type: inline-size; }
.msg-entete { flex-wrap: wrap; }
@container (max-width: 680px) {
  .msg-cadre { grid-template-columns: 1fr; }
  .msg-colonne-liste { border-right: none; }
  .msg-vide { display: none; }
  .fil-ouvert .msg-colonne-liste { display: none; }
  .msg-retour { display: inline; }
  .bulle { max-width: 90%; }
}

/* Page équipe : rien n’est affiché tant que la porte n’est pas vérifiée */
body.porte-fermee > * { visibility: hidden; }

/* ============ 19. ANNÉE, SÉCURITÉ, RÉINITIALISATION ============ */
.barre-annee {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1280px; margin: 18px auto 0; padding: 10px 16px;
  background: white; border-radius: 14px; box-shadow: 0 6px 20px rgba(74,38,80,.09); border-left: 5px solid var(--orange);
}
.barre-annee label { font-weight: 700; color: var(--violet); }
.barre-annee select { width: auto; padding: 7px 10px; font-weight: 600; }
@media (max-width: 900px) { .barre-annee { margin: 12px 12px 0; } }
.menu-admin .menu-danger { margin-top: 8px; border-top: 1px dashed var(--bordure); border-radius: 0 0 10px 10px; color: #b8320e; }
.menu-admin .menu-danger[aria-current="page"] { background: #b8320e; color: white; }
.zone-danger { border-top-color: var(--rouge); }
.bouton-danger { background: #e04b2c; border-color: #e04b2c; color: white; box-shadow: 0 6px 16px rgba(224,75,44,.35); }
code.code-acces { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #fff4e0; color: var(--violet-fonce); font-weight: 700; letter-spacing: .05em; font-size: .85rem; }
.details-eleves { margin-top: 10px; }
.details-eleves summary { cursor: pointer; font-weight: 600; color: var(--violet); font-size: .88rem; }
.liste-eleves { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.puce-eleve { padding: 3px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.puce-eleve.fait { background: #e7f5ec; color: var(--vert); }
.puce-eleve.pas-fait { background: #fdece6; color: #b8320e; }
td.sous-titre-table { background: #f4eef6; color: var(--violet); font-weight: 700; font-size: .8rem; }
.voile-obligatoire { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(51,26,56,.85); }
.voile-obligatoire .carte-auth { max-width: 460px; }
