/* ============================================================
   ÉQUIPE D'AGENTS — charte Mon Enseigne
   bleu nuit #172554→#1e3a8a · ambre #f59e0b
   ============================================================ */
* { box-sizing: border-box; }

:root {
  --bleu1: #0f172a;
  --bleu2: #172554;
  --bleu3: #1e3a8a;
  --ambre: #f59e0b;
  --ambre2: #fbbf24;
  --txt: #e2e8f0;
  --txt2: #94a3b8;
  --bord: #334155;
  --vert: #16a34a;
  --rouge: #dc2626;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bleu1);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* ══ BARRE DU HAUT ══ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--bleu2), var(--bleu3));
  border-bottom: 2px solid var(--ambre);
}
.burger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.logo { font-size: 24px; }
.brand-t { font-weight: 700; font-size: 16px; color: #fff; }
.brand-s { font-size: 11.5px; color: #bfdbfe; }
.progwrap { width: 160px; flex-shrink: 0; }
.proglabel { font-size: 11px; color: #bfdbfe; text-align: right; margin-bottom: 3px; }
.progbar { height: 6px; background: rgba(255,255,255,.18); border-radius: 3px; overflow: hidden; }
.progfill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--ambre), var(--ambre2));
  transition: width .3s;
}

/* ══ DISPOSITION ══ */
.layout { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #0b1424;
  border-right: 1px solid var(--bord);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}
.side-block { padding: 0 16px 14px; border-bottom: 1px solid var(--bord); }
.side-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--txt2); margin-bottom: 8px;
}
.stats { display: flex; gap: 8px; }
.st {
  flex: 1; background: var(--bleu2); border-radius: 8px;
  padding: 7px 4px; text-align: center;
}
.st b { display: block; color: var(--ambre); font-size: 17px; }
.st span { font-size: 9.5px; color: var(--txt2); }

#nav { display: flex; flex-direction: column; padding: 10px 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--txt); text-decoration: none;
  font-size: 13.5px; transition: background .15s;
}
.nav-item:hover { background: #16233a; }
.nav-item.actif {
  background: linear-gradient(90deg, var(--bleu2), var(--bleu3));
  color: #fff; box-shadow: inset 3px 0 0 var(--ambre);
}
.ni-emoji { font-size: 16px; }
.ni-titre { flex: 1; }

.side-foot { padding: 12px 16px 0; border-top: 1px solid var(--bord); }
.ghost {
  width: 100%; background: none; border: 1px solid var(--bord);
  color: var(--txt2); padding: 8px; border-radius: 8px;
  font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.ghost:hover { border-color: var(--ambre); color: var(--txt); }
.genere { font-size: 10.5px; color: #475569; margin-top: 8px; text-align: center; }

.content {
  flex: 1; min-width: 0;
  padding: 24px 28px 60px;
  max-width: 1040px;
}

/* ══ CARTES ══ */
.card {
  background: #101b2e;
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card h2 {
  font-size: 18px; margin: 0 0 12px; color: var(--ambre);
  border-bottom: 1px solid var(--bord); padding-bottom: 8px;
}
.card h3 { font-size: 15px; margin: 16px 0 8px; color: #fff; }

/* ══ HÉROS ══ */
.hero {
  background: linear-gradient(135deg, var(--bleu2), var(--bleu3));
  border-radius: 14px; padding: 26px 24px; margin-bottom: 20px;
  border: 1px solid #1e40af;
}
.hero.small { padding: 20px; }
.hero h1 { font-size: 26px; margin: 0 0 8px; color: #fff; }
.hero.small h1 { font-size: 22px; }
.lead { font-size: 14.5px; color: #cbd5e1; margin: 0; max-width: 760px; }
.hero-stats { display: flex; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.hs b { display: block; font-size: 22px; color: var(--ambre2); }
.hs span { font-size: 11.5px; color: #93c5fd; }
.retour {
  display: inline-block; color: #93c5fd; text-decoration: none;
  font-size: 13px; margin-bottom: 10px;
}
.retour:hover { color: var(--ambre2); }

/* ══ DEUX VOIES ══ */
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.voie {
  background: var(--bleu2); border-radius: 10px; padding: 14px;
  border-left: 4px solid var(--ambre);
}
.voie-titre { font-weight: 700; color: #fff; font-size: 14px; margin-bottom: 6px; }
.voie p { margin: 0 0 8px; font-size: 13.5px; color: #cbd5e1; }
.voie-quand { font-size: 12px; color: var(--txt2); font-style: italic; }

/* ══ RACCOURCIS ══ */
.raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.raccourci {
  display: block; background: var(--bleu2); border: 1px solid var(--bord);
  border-radius: 10px; padding: 14px; text-decoration: none; color: var(--txt);
  transition: all .15s;
}
.raccourci:hover { border-color: var(--ambre); transform: translateY(-2px); }
.rc-ico { font-size: 22px; display: block; margin-bottom: 6px; }
.raccourci b { display: block; font-size: 14px; color: #fff; margin-bottom: 3px; }
.raccourci small { font-size: 12px; color: var(--txt2); }

/* ══ ARBRE ══ */
.arbre { text-align: center; }
.noeud {
  display: inline-block; background: var(--bleu2); border: 1px solid var(--bord);
  border-radius: 10px; padding: 10px 16px; margin: 6px; min-width: 150px;
  font-size: 13.5px; font-weight: 600;
}
.noeud span { display: block; font-size: 11px; color: var(--txt2); font-weight: 400; }
.noeud.racine {
  background: linear-gradient(135deg, var(--bleu3), #1e40af);
  border-color: var(--ambre); font-size: 15px;
}
.noeud.special { border-color: var(--ambre); }
.branches { margin-top: 12px; }
.legende-chaine {
  margin-top: 16px; font-size: 13px; color: var(--ambre2);
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35);
  border-radius: 8px; padding: 10px; display: inline-block;
}

/* ══ GRILLE AGENTS ══ */
.grille-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.fiche {
  background: #101b2e; border: 1px solid var(--bord); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column;
  transition: all .15s;
}
.fiche:hover { border-color: var(--ambre); }
.fiche-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.fiche-emoji { font-size: 30px; }
.fiche-nom { font-size: 16px; font-weight: 700; color: #fff; }
.fiche-role { font-size: 12px; color: var(--ambre); }
.fiche-desc { font-size: 13.5px; color: #cbd5e1; flex: 1; margin: 0 0 12px; }
.fiche-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
  font-size: 10.5px; background: var(--bleu2); border: 1px solid var(--bord);
  color: var(--txt2); padding: 3px 8px; border-radius: 10px;
}
.tag.or { background: rgba(245,158,11,.15); border-color: var(--ambre); color: var(--ambre2); }
.btn-voir {
  width: 100%; background: var(--bleu3); border: none; color: #fff;
  padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-voir:hover { background: #1e40af; }

/* ══ IDENTITÉ (markdown) ══ */
.identite {
  background: #0b1424; border: 1px solid var(--bord); border-radius: 10px;
  padding: 16px; font-size: 14px; max-height: 620px; overflow-y: auto;
}
.identite .md-h2 {
  font-size: 19px; color: var(--ambre); margin: 0 0 14px;
  border-bottom: 2px solid var(--ambre); padding-bottom: 8px;
}
.identite .md-h3, .identite .md-h4 {
  font-size: 15px; color: var(--ambre2); margin: 18px 0 8px;
}
.identite p { margin: 8px 0; }
.identite ul { margin: 8px 0; padding-left: 20px; }
.identite li { margin: 4px 0; }
.identite b { color: #fff; }

.note {
  font-size: 12.5px; color: var(--txt2); background: var(--bleu2);
  border-left: 3px solid var(--ambre2); padding: 8px 12px;
  border-radius: 6px; margin-bottom: 12px;
}

/* ══ SECTIONS REPLIABLES ══ */
.liste-sections { display: flex; flex-direction: column; gap: 8px; }
.sec { background: var(--bleu2); border-radius: 8px; overflow: hidden; }
.sec summary {
  padding: 10px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--txt); list-style: none;
}
.sec summary::-webkit-details-marker { display: none; }
.sec summary::before { content: "▸ "; color: var(--ambre); }
.sec[open] summary::before { content: "▾ "; }
.sec-corps { padding: 4px 14px 14px; font-size: 13.5px; border-top: 1px solid var(--bord); }

/* ══ ÉTAPES ══ */
.avancement { margin-top: 16px; }
.av-bar { height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; }
.av-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ambre), var(--ambre2)); transition: width .3s; }
.av-txt { font-size: 12px; color: #bfdbfe; margin-top: 5px; }

.etape { border-left: 4px solid var(--bord); }
.etape.faite { border-left-color: var(--vert); opacity: .82; }
.etape.faite .etape-titre { text-decoration: line-through; color: var(--txt2); }
.etape-tete { margin-bottom: 8px; }
.etape-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.etape-check input { width: 20px; height: 20px; accent-color: var(--vert); cursor: pointer; flex-shrink: 0; }
.etape-num {
  background: var(--ambre); color: var(--bleu2); font-weight: 700;
  width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.etape-titre { font-size: 16px; font-weight: 700; color: #fff; }
.etape-but { font-size: 13.5px; color: #cbd5e1; margin: 0 0 12px; font-style: italic; }
.etape-actions { background: #0b1424; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.etape-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--txt2); margin-bottom: 8px;
}
.etape-actions ol { margin: 0; padding-left: 22px; }
.etape-actions li { margin: 6px 0; font-size: 13.5px; }

.bloc { border-radius: 8px; padding: 11px 14px; margin-top: 10px; font-size: 13.5px; }
.bloc-titre { display: block; font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.bloc.verif { background: rgba(22,163,74,.12); border-left: 3px solid var(--vert); color: #bbf7d0; }
.bloc.piege { background: rgba(220,38,38,.12); border-left: 3px solid var(--rouge); color: #fecaca; }
.bloc.info { background: rgba(59,130,246,.12); border-left: 3px solid #3b82f6; color: #bfdbfe; }

/* ══ SKILLS ══ */
.grille-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.skill {
  background: #101b2e; border: 1px solid var(--bord); border-radius: 12px;
  padding: 16px; border-left: 4px solid var(--ambre);
}
.skill-tete { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.skill-emoji { font-size: 20px; }
.skill p { font-size: 13.5px; margin: 0 0 9px; color: #cbd5e1; }
.skill-quand { font-size: 12px; color: var(--ambre2); font-style: italic; }

/* ══ CODE ══ */
.code {
  background: #060c17; border: 1px solid var(--bord); border-radius: 8px;
  padding: 12px 14px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--ambre2); overflow-x: auto;
  line-height: 1.65; margin: 10px 0; white-space: pre;
}
.inline {
  background: var(--bleu2); border: 1px solid var(--bord);
  padding: 1.5px 6px; border-radius: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  color: var(--ambre2);
}

/* ══ TABLEAUX ══ */
.md-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.md-table td, .md-table th {
  border: 1px solid var(--bord); padding: 7px 10px; font-size: 13px;
  text-align: left; vertical-align: top;
}
.md-table th { background: var(--bleu2); color: var(--ambre); }
.droite { text-align: right; color: var(--txt2); }
.liste-fichiers td:first-child { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

.loading { text-align: center; color: var(--txt2); padding: 40px; }

/* ══ OVERLAY (menu mobile) ══ */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.5);
}
.overlay.ouvert { display: block; }

/* ══ MOBILE ══ */
@media (max-width: 820px) {
  .burger { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 95;
    width: 280px; transform: translateX(-100%);
    transition: transform .25s; overflow-y: auto;
  }
  .sidebar.ouvert { transform: translateX(0); }
  .content { padding: 16px 14px 60px; }
  .progwrap { width: 90px; }
  .brand-t { font-size: 14px; }
  .brand-s { display: none; }
  .deux-colonnes { grid-template-columns: 1fr; }
  .hero { padding: 20px 16px; }
  .hero h1 { font-size: 21px; }
  .hero-stats { gap: 14px; }
  .grille-agents, .grille-skills { grid-template-columns: 1fr; }
  .etape-titre { font-size: 14.5px; }
  .identite { max-height: none; }
  .raccourcis { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .content { padding: 12px 10px 50px; }
  .card { padding: 14px 14px; }
  .hero h1 { font-size: 19px; }
  .code { font-size: 11px; padding: 10px; }
}
