/* ===================== BASE & MISE EN PAGE ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--encre);
  background: var(--fond);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; color: var(--encre); }
/* Emphase discrète : on préfère le demi-gras (600) au gras plein (700 par
   défaut) pour alléger l'ensemble de l'interface. */
b, strong { font-weight: 600; }
a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 3px; }

/* ---- Coquille application : barre latérale + contenu ---- */
.app { display: flex; min-height: 100vh; }

.barre {
  width: var(--barre-l);
  flex: 0 0 var(--barre-l);
  background: var(--bleu-nuit);
  color: #dfe4f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.barre__marque {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.marque { display: flex; align-items: center; gap: 12px; }
.marque__ecusson { flex: 0 0 auto; }
.marque__texte { line-height: 1.15; }
.marque__titre { font-family: var(--serif); font-size: 17px; font-weight: 600; color: #fff; }
.marque__sous { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9fb0d8; }

.barre__nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav__groupe { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7f8db5; padding: 14px 12px 6px; }
.nav__lien {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: var(--r-sm);
  color: #cdd6ee; font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav__lien:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav__lien.actif { background: var(--bleu); color: #fff; box-shadow: inset 3px 0 0 var(--or); }
.nav__lien svg { flex: 0 0 20px; }

.barre__pied {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px; color: #93a1c9;
}
.barre__pied strong { color: #e7ecf9; display: block; font-weight: 600; }

/* ---- Zone principale ---- */
.contenu { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.entete {
  background: var(--surface);
  border-bottom: 1px solid var(--trait);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; gap: 20px;
  position: sticky; top: 0; z-index: 30;
}
.entete__fil { display: flex; flex-direction: column; }
.entete__fil small { color: var(--gris-clair); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.entete__fil span { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.entete__recherche { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.entete__user { position: relative; display: flex; align-items: center; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bleu); color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px; font-family: var(--sans);
}
.avatar--btn { border: 0; cursor: pointer; padding: 0; transition: box-shadow .15s; }
.avatar--btn:hover, .avatar--btn[aria-expanded=true] { box-shadow: 0 0 0 3px var(--bleu-clair); }
.avatar--lg { width: 44px; height: 44px; font-size: 16px; flex: 0 0 auto; }

.user-pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 252px; background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--r-md); box-shadow: var(--ombre-3); padding: 14px;
}
.user-pop__tete { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--trait); }
.user-pop__id { line-height: 1.3; min-width: 0; }
.user-pop__id b { font-size: 14px; display: block; }
.user-pop__id small { color: var(--gris); font-size: 12px; }
.user-pop__ecole { display: flex; align-items: center; gap: 8px; color: var(--gris); font-size: 12.5px; padding: 12px 2px; }
.user-pop__ecole svg { color: var(--bleu); flex: 0 0 auto; }
.user-pop__sortie {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--trait); background: var(--surface-2); color: var(--encre);
  border-radius: var(--r-sm); padding: 9px 12px; font-family: var(--sans); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.user-pop__sortie:hover { border-color: var(--rouge); color: var(--rouge); background: #fdf3f4; }

.page { padding: 28px; max-width: 1180px; width: 100%; }
.page__titre { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page__titre h1 { font-size: 27px; margin: 0; }
.page__titre p { margin: 4px 0 0; color: var(--gris); font-size: 14px; }

/* Filet drapeau — signature discrète */
.filet-drapeau { height: 3px; width: 100%; background: linear-gradient(90deg, var(--bleu) 0 50%, var(--rouge) 50% 100%); }

/* Tout logo repose sur un fond blanc pour rester lisible sur les fonds sombres */
.embleme { background: #fff; border-radius: 12px; padding: 3px; box-sizing: border-box; }

/* Utilitaires */
.muet { color: var(--gris); }
.centre { text-align: center; }
.pleine-hauteur { min-height: 100vh; }
.masque { display: none !important; }
html.menu-ouvert, html.menu-ouvert body { overflow: hidden; height: 100%; }

/* Barre de menu mobile */
.menu-bascule { display: none; }

@media (max-width: 900px) {
  .barre {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: var(--ombre-3);
  }
  .barre.ouverte { transform: translateX(0); }
  .menu-bascule {
    display: inline-grid; place-items: center;
    width: 42px; height: 42px; border-radius: var(--r-sm);
    border: 1px solid var(--trait); background: var(--surface); cursor: pointer;
  }
  .entete { padding: 0 14px; gap: 12px; }
  .entete__fil { display: none; }              /* le titre reste visible dans le corps de la page */
  .entete__recherche { max-width: none; }
  .page { padding: 18px 16px; }
  .voile { position: fixed; inset: 0; background: rgba(7,22,64,.45); z-index: 35; touch-action: none; }
}

@media (max-width: 520px) {
  .entete { gap: 8px; padding: 0 10px; }
  .entete__user { gap: 6px; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }
  .entete__recherche input { font-size: 13px; }
}
