:root{
  --green:#16a34a; --green-dark:#0f7a38; --soft:#ecfdf5; --text:#0f172a;
  --muted:#475569; --white:#fff; --border:#e2e8f0;
  --shadow:0 10px 25px rgba(2,6,23,.06);
}

/* Base */
*{box-sizing:border-box}

/* on sépare html et body pour gérer la hauteur + flex */
html{
  height:100%;
}
body{
  margin:0;
  padding:0;
  min-height:100%;
  display:flex;
  flex-direction:column;          /* header / main / footer en colonne */
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--soft);
  color:var(--text);
}

a{color:inherit; text-decoration:none}
a:focus,button:focus,input:focus,select:focus,textarea:focus{
  outline:3px solid #22c55e55; outline-offset:2px
}

.container{max-width:1100px; margin:0 auto; padding:20px}

/* Header */
.header{background:var(--green); color:#fff; box-shadow:var(--shadow)}
.nav{display:flex; justify-content:space-between; align-items:center; padding:18px 20px; gap:10px; flex-wrap:wrap}
.brand{display:flex; gap:12px; align-items:center}
.logo{width:34px; height:34px; border-radius:50%; background:radial-gradient(circle at 30% 30%,#22c55e 0,#16a34a 60%,#0f7a38 100%)}
.brand strong{font-size:clamp(20px,3vw,32px)}
.menu{display:flex; gap:16px; align-items:center; flex-wrap:wrap}
.menu a{color:#eaffea; padding:8px 10px; border-radius:10px}
.menu a:hover{background:#15803d}

/* Hero */
.hero{padding:50px 20px; text-align:center}
.hero h1{margin:0 0 10px; font-size:clamp(28px,5vw,46px)}
.hero p{margin:6px auto 0; max-width:820px; color:#0b3b1f}

/* Boutons */
.btn{display:inline-block; background:var(--green); color:#fff; border:0; border-radius:14px; padding:12px 16px; font-weight:800; box-shadow:var(--shadow); cursor:pointer}
.btn:hover{background:var(--green-dark)}
.btn-outline{background:transparent; border:2px solid var(--green); color:var(--green)}
.btn.xxs{padding:2px 6px; font-size:.72rem; border-radius:6px}
button.link{background:none; border:0; color:var(--green); cursor:pointer}
button.link.xxs{font-size:.72rem}

/* Niveaux */
.levels{display:flex; gap:16px; justify-content:center; flex-wrap:wrap; margin-top:20px}
.level-btn{display:inline-block; background:#16a34a; color:#fff; padding:18px 22px; border-radius:16px; font-weight:800; box-shadow:var(--shadow)}
.level-btn:hover{background:#0f7a38}

/* === GRILLES GÉNÉRIQUES (sessions, niveaux, séquences…) === */

.grid{
  display:grid;
  gap:1.25rem;
  grid-template-columns:repeat(2,minmax(0,1fr)); /* 2 cartes par ligne */
}

/* 3 cartes par ligne (comme session.php) */
.grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

/* 2 cartes par ligne (pour sequence.php) */
.grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* Cartes de séquences sur la page level.php : on réutilise .grid-3 */
.sequence-list{
  /* juste pour compat éventuelle, la mise en forme est gérée par .grid / .grid-3 */
}

/* Grille responsive */
@media (max-width:1100px){
  .grid-3,
  .grid-2{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:720px){
  .grid,
  .grid-3,
  .grid-2{
    grid-template-columns:1fr; /* 1 carte par ligne sur mobile */
  }
}

/* Cartes */
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:var(--shadow);
  font-size:.9rem;
  overflow-x:auto;
}
.card h3{margin:8px 0 6px}

/* Badge */
.badge{
  display:inline-block;
  background:#dcfce7;
  color:#065f46;
  border:1px solid #bbf7d0;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
}

/* TABLEAUX — compacts et confinés */
.table{
  width:100%;
  border-collapse:separate; border-spacing:0;
  background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow);
  overflow:hidden; max-width:100%; table-layout:fixed;
  font-size:.78rem;
}
.table th,.table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  text-align:left; vertical-align:middle; word-break:break-word; white-space:nowrap;
}
.table th{
  background:#f8fafc; color:var(--muted); text-transform:uppercase; font-weight:600; font-size:.7rem;
}
.table tr:hover td{background:#f9fdfb}

/* Colonnes étroites pour “Liste des séquences” */
.col-pub{width:64px; text-align:center}
.col-level{width:56px; text-align:center}
.col-num{width:48px; text-align:center}
.col-actions{width:140px; text-align:center}
.col-title{width:auto}
.col-title .title-text{display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%}
.table .sep{margin:0 4px; color:#94a3b8}

/* Formulaires */
input,select,textarea{
  width:100%;
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  font-size:.9rem;
}
.row{display:grid; grid-template-columns:1fr 1fr; gap:12px}

/* CASES À COCHER — ultra compactes */
.checkbox-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:4px; margin:6px 0;
}
.checkbox-grid > label{
  display:flex; align-items:center; gap:6px;
  padding:3px 5px; border:0; border-radius:6px;
  background:transparent; box-shadow:none; line-height:1.2;
}
.checkbox-grid input[type="checkbox"]{margin:0; transform:scale(0.9)}
.checkbox-grid span{
  font-size:.82rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.checkbox-grid > label:hover{background:#f1f5f9}

/* Divers */
.footer{
  background:#0f5132; color:#eaffe7;
  margin-top:40px;
}
.footer .container{padding:26px 20px}
.small{font-size:13px; color:var(--muted)}
.actions a{margin-right:10px}
.notice{background:#ecfeff; border:1px solid #a5f3fc; padding:10px; border-radius:10px}
.error{color:#b91c1c}
.back{display:inline-block; margin:8px 0; color:#0f5132}

/* main = zone centrale qui doit “pousser” le footer en bas */
.main{
  flex:1;
}

/* Responsive déjà géré pour .grid-2 / .grid-3 plus haut,
   ici on garde juste le reste */
@media (max-width:700px){
  .row{grid-template-columns:1fr}
  .card{font-size:.85rem; padding:10px}
  .table{font-size:.74rem}
  .table th,.table td{padding:6px 8px}
  .checkbox-grid{grid-template-columns:1fr}
}

/* === Style général pour "Séquence X" (partout) === */
.seq-num{
  color:#007bff;
  font-weight:700;
}

/* Style des titres de séquence dans les cartes */
.card h3{
  margin:8px 0 6px;
  line-height:1.3;
  font-size:1rem;
}
.card h3 .seq-num{
  display:block;
  margin-bottom:4px;
}
.card h3 .seq-title{
  color:#0f172a;
  font-weight:600;
  display:block;
}

/* Mots clés en bleu (Séquence, Séance) */
.kw-blue{ color:#007bff; font-weight:700; }

/* Niveau (5e/4e/3e) mis en valeur */
.kw-level{ color:#007bff; font-weight:700; font-size:1.1rem; }

/* Lien d'action principal (Ouvrir / Télécharger) */
.link-primary{ color:#007bff; font-weight:700; text-decoration:none; }
.link-primary:hover{ text-decoration:underline; }

/* “Séquence 1” sous le H1 : plus grand et dense */
.seq-meta{
  font-size:1.35rem;
  font-weight:800;
  margin:2px 0 10px;
  line-height:1.1;
}

/* lien “⟵ 3e” en haut : bleu + plus grand */
.back-level{
  color:#007bff;
  font-weight:700;
  font-size:1.15rem;
}
.back-level:hover{ text-decoration:underline; }

/* --- Bloc complet de chaque document dans l'administration --- */
ul.docs-admin li.doc-item{
  margin:8px 0;
  padding:12px;
  border:1px solid #dcdfe3;
  border-radius:10px;
  background:#f6f7f9;
  box-shadow:0 1px 2px rgba(0,0,0,0.04);
}

/* léger effet au survol */
ul.docs-admin li.doc-item:hover{
  background:#eef1f5;
}

/* liens "Ouvrir" en bleu */
a.ouvrir, a.ouvrir:visited{
  color:#007bff;
  font-weight:600;
  text-decoration:underline;
}
a.ouvrir:hover{ text-decoration-thickness:2px; }

.card a {
  color: #0066ff;
  font-weight: 600;
}

.session-list li {
  margin-bottom: 12px;   /* tu peux mettre 8px ou 10px si tu veux encore plus d’espace */
}

/* --- Cartes de documents dans les séances / séquences (fond bleu clair) --- */
.doc-card{
  margin:8px 0;
  padding:10px;
  border-radius:10px;
  border:1px solid #bfdbfe;   /* bord bleu clair */
  background:#eff6ff;         /* fond bleu très clair */
}





/* Bouton publication séquence */
.btn-pub-oui {
  background: #16a34a;      /* vert */
  border: 1px solid #16a34a;
  color: #ffffff;
}

.btn-pub-oui:hover {
  background: #15803d;
  border-color: #15803d;
}

/* Non publié = orange */
.btn-pub-non {
  background: #f97316;      /* orange */
  border: 1px solid #f97316;
  color: #ffffff;
}

.btn-pub-non:hover {
  background: #ea580c;
  border-color: #ea580c;
}



/*.....................css pour  le bouton de choix de classe dans le header.................................................*/

.header-plan-form {
  margin-left: 20px;
}

.header-plan-form select {
  padding: 4px 8px;
  font-size: 14px;
}

/* classe utilitaire si tu veux cacher le label visuellement mais pour les lecteurs d'écran */
.visually-hidden {
  position:absolute;
  left:-10000px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}




/* ===== Séances : numéro à gauche, titre à droite (anti-chevauchement) ===== */
.session-list{
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
}

.session-item{
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0;
}

.session-num{
  flex: 0 0 110px;          /* largeur fixe */
  width: 110px;
  text-align: right;
  font-weight: 800;
  white-space: nowrap;      /* empêche "Séance 1" de casser */
  line-height: 1.4;
}

.session-link{
  flex: 1 1 auto;
  display: block;           /* important */
  line-height: 1.4;
  min-width: 0;             /* important pour le retour à la ligne en flex */
}




.session-title{
  display: flex;
  align-items: flex-start;
  gap: 18px;              /* espace clair entre numéro et titre */
  margin-bottom: 2rem;
}

.session-title-num{
  flex: 0 0 130px;
  text-align: right;
  font-weight: 900;
  color: #0b5fff;         /* BLEU */
  white-space: nowrap;
}

.session-title-text{
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.15;
  padding-left: 14px;
  border-left: 3px solid #0b5fff33; /* séparateur doux */
}

