/* Feuille de style commune aux trois pages.
   Aucune police ni librairie externe : tout est local, conformément à la règle du projet.
   Mise en page : barre de navigation verticale à gauche + zone de contenu à droite. */

:root{
  --accent:#0f766e;
  --accent-clair:#14b8a6;
  --accent-pale:#ecfdf5;
  --encre:#111827;
  --gris:#5b6472;
  --gris-pale:#9aa3af;
  --fond:#f5f7f9;
  --carte:#ffffff;
  --bord:#e4e9ef;
  --bord-fort:#d3dae3;
  --erreur:#b91c1c;
  --erreur-fond:#fef2f2;
  --nuit:#111c28;
  --nuit-clair:#1b2a38;
  --ombre:0 1px 2px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.05);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--fond);
  color:var(--encre);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}

/* ---------- Ossature : navigation à gauche, contenu à droite ---------- */
.app{ display:flex; min-height:100vh; align-items:stretch; }

.sidebar{
  width:264px;
  flex:0 0 264px;
  background:var(--nuit);
  color:#e8edf3;
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
  /* Sans ceci, la barre est étirée sur toute la hauteur de la page (des milliers de
     pixels quand le tableau est long) et « sticky » n'a plus aucune prise : elle
     défilerait avec le contenu au lieu de rester visible. */
  align-self:flex-start;
}

.marque{ padding:22px 20px 18px; border-bottom:1px solid rgba(255,255,255,.08); }
.marque-nom{ display:block; font-size:1.05rem; font-weight:700; letter-spacing:-.01em; color:#fff; }
.marque-sous{ display:block; font-size:.78rem; color:#8fa0b3; margin-top:2px; }

.nav{ padding:14px 12px; display:flex; flex-direction:column; gap:4px; flex:1; }
.nav-item{
  display:block;
  padding:11px 13px;
  border-radius:10px;
  text-decoration:none;
  color:#c9d4e0;
  border-left:3px solid transparent;
  transition:background .12s, color .12s;
}
.nav-item:hover{ background:rgba(255,255,255,.05); color:#fff; }
.nav-item.actif{ background:var(--nuit-clair); color:#fff; border-left-color:var(--accent-clair); }
.nav-etape{
  display:inline-block;
  font-size:.66rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--accent-clair);
  margin-bottom:3px;
}
.nav-titre{ display:block; font-size:.95rem; font-weight:600; }
.nav-info{ display:block; font-size:.78rem; color:#8fa0b3; margin-top:2px; line-height:1.4; }
.nav-item.actif .nav-info{ color:#a9b8c8; }

.sidebar-pied{
  padding:14px 20px 18px;
  border-top:1px solid rgba(255,255,255,.08);
  font-size:.72rem;
  color:#7e8fa2;
  line-height:1.5;
}

.contenu{ flex:1; min-width:0; padding:30px 34px 70px; }
.contenu-tete{ max-width:940px; margin:0 0 4px; }
.contenu-tete h1{ font-size:1.5rem; margin:0 0 4px; letter-spacing:-.015em; }
.contenu-tete .sous-titre{ color:var(--gris); margin:0; font-size:.95rem; }

/* ---------- Cartes ---------- */
.carte{
  background:var(--carte);
  border:1px solid var(--bord);
  border-radius:14px;
  padding:26px;
  margin-top:20px;
  max-width:940px;
  box-shadow:var(--ombre);
}
h1{ font-size:1.4rem; margin:0 0 6px; letter-spacing:-.015em; }
h2{ font-size:1.02rem; margin:0 0 8px; letter-spacing:-.01em; }
h2.section{
  margin-top:30px;
  padding-top:22px;
  border-top:1px solid var(--bord);
  font-size:.82rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--gris);
}

/* ---------- Formulaires ---------- */
label.champ{ display:block; font-weight:600; margin:22px 0 6px; font-size:.92rem; }
label.champ:first-of-type{ margin-top:6px; }
input[type=url], input[type=text], input[type=password], input[type=number], select, textarea{
  width:100%;
  padding:11px 13px;
  border:1px solid var(--bord-fort);
  border-radius:9px;
  font:inherit;
  background:#fff;
  color:inherit;
  transition:border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(15,118,110,.12);
}
textarea{ resize:vertical; min-height:130px; font-variant-numeric:tabular-nums; }
select{ cursor:pointer; }

.note, .aide-champ{ color:var(--gris); font-size:.84rem; margin:6px 0 0; }
code{ background:var(--fond); border:1px solid var(--bord); border-radius:4px; padding:1px 5px; font-size:.85em; }

fieldset{ border:1px solid var(--bord); border-radius:10px; padding:14px 16px 16px; margin:22px 0 0; }
legend{ font-weight:600; padding:0 6px; font-size:.92rem; }
.case{ display:flex; align-items:center; gap:10px; margin:9px 0; font-size:.93rem; cursor:pointer; }
.case input{ width:17px; height:17px; accent-color:var(--accent); cursor:pointer; }

.ligne-fichier{ display:flex; align-items:center; gap:12px; margin-top:10px; flex-wrap:wrap; }
.info-fichier{ color:var(--gris); font-size:.86rem; }

/* Adresse du site : masquée mais toujours affichée, pour ne jamais fabriquer
   des liens « localhost » sans s'en apercevoir. */
.ligne-domaine{ margin:0 0 4px; font-size:.86rem; color:var(--gris); }
.ligne-domaine strong{ color:var(--encre); font-weight:600; }
.ligne-domaine strong.domaine-local{ color:#92400e; background:#fef3c7; border:1px solid #fcd34d; border-radius:5px; padding:1px 6px; }
.lien-discret{
  background:none; border:0; padding:0 0 0 6px; font:inherit; font-size:.86rem;
  color:var(--accent); text-decoration:underline; cursor:pointer;
}

/* Caractère de campagne (étroit) + nom de campagne (large) sur la même ligne. */
.ligne-campagne{ display:flex; gap:10px; align-items:center; }
.ligne-campagne #code-campagne{ width:64px; flex:0 0 64px; text-align:center; font-weight:700; font-size:1.05rem; }
.ligne-campagne #nom-campagne{ flex:1; min-width:0; }

.case-tout{ padding-bottom:9px; margin-bottom:4px; border-bottom:1px solid var(--bord); }

/* ---------- Boutons ---------- */
.bouton-principal{
  background:var(--accent); color:#fff; border:0; border-radius:9px;
  padding:12px 24px; font:inherit; font-size:.97rem; font-weight:650;
  cursor:pointer; margin-top:24px; transition:background .12s;
}
.bouton-principal:hover{ background:#0c5f59; }
.bouton-principal:disabled{ opacity:.55; cursor:default; }
.bouton-secondaire, .bouton-export, .bouton-telecharger{
  display:inline-block; background:#fff; color:var(--accent);
  border:1px solid var(--bord-fort); border-radius:9px;
  padding:9px 16px; font:inherit; font-weight:600; font-size:.9rem; cursor:pointer;
  transition:border-color .12s, background .12s;
}
.bouton-secondaire:hover, .bouton-export:hover, .bouton-telecharger:hover{
  border-color:var(--accent); background:var(--accent-pale);
}
.bouton-telecharger{ background:var(--accent); color:#fff; border-color:var(--accent); }
.bouton-telecharger:hover{ background:#0c5f59; color:#fff; }
.bouton-telecharger:disabled{ opacity:.55; cursor:default; }
.exports{ display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }

/* ---------- Messages ---------- */
.message, .message-erreur{ margin:14px 0 0; font-size:.9rem; border-radius:9px; }
.message-erreur{ color:var(--erreur); background:var(--erreur-fond); border:1px solid #fecaca; padding:11px 14px; font-weight:600; }
.message{ padding:11px 14px; background:var(--fond); border:1px solid var(--bord); color:var(--gris); }
.message.erreur{ color:var(--erreur); background:var(--erreur-fond); border-color:#fecaca; font-weight:600; }
.message.info{ background:var(--accent-pale); border-color:#a7f3d0; color:#065f52; }

/* ---------- Progression ---------- */
.zone-progression{ margin-top:18px; }
.barre-progression{ height:8px; background:var(--bord); border-radius:99px; overflow:hidden; }
.barre-progression > div{ height:100%; width:0%; background:var(--accent); transition:width .15s; }
.texte-progression{ font-size:.86rem; color:var(--gris); margin-top:8px; }

/* ---------- Chiffres clés ---------- */
.stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(158px,1fr)); gap:12px; margin-top:4px; }
.stat{
  background:var(--carte); border:1px solid var(--bord); border-radius:11px; padding:14px 16px;
}
.stat .valeur{ font-size:1.6rem; font-weight:700; color:var(--accent); letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.15; }
.stat .libelle{ font-size:.79rem; color:var(--gris); margin-top:2px; }

/* ---------- Fichiers produits ---------- */
.liste-fichiers{ list-style:none; margin:10px 0 0; padding:0; }
.liste-fichiers li{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:13px 14px; border:1px solid var(--bord); border-radius:10px;
  margin-bottom:8px; flex-wrap:wrap; background:var(--carte);
}
.nom-fichier{ font-weight:600; font-size:.93rem; }
.detail-fichier{ color:var(--gris); font-size:.83rem; }

/* ---------- Tableaux ---------- */
/* Le tableau défile DANS son cadre plutôt que d'allonger la page : avec 500 lignes,
   la page faisait 24 000 px de haut et devenait impraticable. L'en-tête reste figée. */
.defilement-table{
  overflow:auto; margin-top:12px; max-height:430px;
  border:1px solid var(--bord); border-radius:11px; background:var(--carte);
}
.defilement-table.court{ max-height:none; }
table{ width:100%; border-collapse:collapse; font-size:.88rem; }
th, td{ padding:10px 14px; text-align:left; white-space:nowrap; }
thead th{
  position:sticky; top:0;
  background:#f8fafb;
  color:var(--gris);
  font-weight:600; font-size:.76rem; text-transform:uppercase; letter-spacing:.05em;
  border-bottom:1px solid var(--bord);
}
tbody tr{ border-bottom:1px solid #f0f3f6; }
tbody tr:last-child{ border-bottom:0; }
tbody tr:nth-child(even){ background:#fbfcfd; }
tbody tr:hover{ background:var(--accent-pale); }
tbody td{ color:var(--encre); }

/* Les numéros de téléphone : chiffres de largeur fixe, donc parfaitement alignés
   d'une ligne à l'autre — c'est ce qui rend une longue liste lisible. */
#corps-table td:first-child,
#corps-apercu td:first-child,
#corps-campagnes td:first-child{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum";
  font-weight:600;
  letter-spacing:.01em;
}
#corps-apercu td{ font-variant-numeric:tabular-nums; }

/* Étiquettes colorées dans les tableaux */
.etiquette{
  display:inline-block; padding:2px 9px; border-radius:99px;
  font-size:.76rem; font-weight:600; white-space:nowrap;
  background:var(--fond); border:1px solid var(--bord-fort); color:var(--gris);
}
.etiquette-delai{ background:var(--accent-pale); border-color:#a7f3d0; color:#065f52; }
.badge-bot{
  display:inline-block; margin-left:8px; padding:1px 7px; border-radius:99px;
  background:#fef3c7; border:1px solid #fcd34d; color:#92400e; font-size:.72rem; font-weight:600;
}

/* ---------- Accueil : les étapes ---------- */
.etapes{ display:grid; gap:14px; max-width:940px; margin-top:20px; }
.etape-carte{
  display:block; text-decoration:none; color:inherit;
  background:var(--carte); border:1px solid var(--bord); border-radius:14px;
  padding:22px 24px; box-shadow:var(--ombre);
  transition:border-color .12s, transform .12s;
}
.etape-carte:hover{ border-color:var(--accent); transform:translateY(-1px); }
.etape-num{
  display:inline-block; font-size:.68rem; font-weight:700; letter-spacing:.07em;
  text-transform:uppercase; color:var(--accent); margin-bottom:6px;
}
.etape-carte h2{ margin:0 0 5px; font-size:1.08rem; }
.etape-carte p{ margin:0; color:var(--gris); font-size:.92rem; }
.etape-fleche{ display:inline-block; margin-top:12px; color:var(--accent); font-weight:600; font-size:.9rem; }

/* ---------- Mobile : la navigation passe en haut ---------- */
@media (max-width:900px){
  .app{ flex-direction:column; }
  .sidebar{
    width:100%; flex:none; height:auto; position:static;
    flex-direction:row; align-items:center; gap:6px; overflow-x:auto; padding:0 10px;
  }
  .marque{ border-bottom:0; border-right:1px solid rgba(255,255,255,.08); padding:14px 16px 14px 8px; flex:0 0 auto; }
  .marque-sous{ display:none; }
  .nav{ flex-direction:row; padding:10px 0; gap:6px; flex:0 0 auto; }
  .nav-item{ border-left:0; border-bottom:3px solid transparent; padding:8px 12px; white-space:nowrap; }
  .nav-item.actif{ border-left:0; border-bottom-color:var(--accent-clair); }
  .nav-info, .sidebar-pied{ display:none; }
  .nav-etape{ margin-bottom:0; }
  .contenu{ padding:20px 16px 60px; }
  .carte{ padding:20px 18px; border-radius:12px; }
  th, td{ padding:9px 11px; }
}
