/* =====================================================================
   Niamor Studio : TOUTE la charte graphique est dans ce fichier.
   Pour changer l'apparence du site, on ne modifie que les variables
   du bloc :root ci-dessous (couleurs, polices, arrondis, espacements).
   Le nom, le logo et les textes de marque sont dans marque-plateforme.js.
   ===================================================================== */

/* Direction « Repère » (choisie par Romain le 10/11/2026) : tableau de bord clair, cartes blanches très arrondies,
   filets fins, un seul violet en accent rare. Thème sombre au choix (bouton de l'en-tête), automatique par défaut.
   Maquettes et captures : design/propositions/ (piste 4) dans l'historique du dépôt. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Poppins:ital,wght@1,900&display=swap');

:root {
  color-scheme: light dark;

  /* --- Couleurs de fond --- */
  --fond:            #F6F5F9;  /* fond de page */
  --fond-carte:      #FFFFFF;  /* cartes, blocs */
  --fond-survol:     #FBFAFD;  /* carte survolée */
  --fond-champ:      #FFFFFF;  /* champs de saisie */
  --fond-doux:       #F1F0F4;  /* pastilles, icônes, encarts */
  --fond-actif:      #EFE8FF;  /* élément sélectionné (lavande, sans dégradé) */

  /* --- Bordures --- */
  --bordure:         #E5E2ED;  /* filets fins des cartes et séparations */
  --bordure-forte:   #858092;  /* contours des champs et boutons secondaires (contraste 3:1) */
  --bordure-accent:  #673DE6;

  /* --- Texte --- */
  --texte:           #252236;
  --texte-doux:      #625D72;
  --texte-discret:   #6B667A;
  --texte-label:     #3A3648;

  /* --- Couleur d'accent (violet, à garder rare : action principale, élément actif, focus) --- */
  --accent:          #673DE6;
  --accent-survol:   #5630C7;
  --texte-sur-accent:#FFFFFF;
  --accent-texte:    #5630C7;  /* liens et textes en accent */

  /* --- Couleurs des statuts --- */
  --succes:          #187346;  --succes-fond:   #E6F3EB;
  --attente:         #8A5700;  --attente-fond:  #FBF0DC;
  --neutre:          #5E5A6B;  --neutre-fond:   #EFEEF3;
  --erreur:          #B3263E;  --erreur-fond:   #FBE8EB;

  /* --- Polices --- */
  --police:          'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --police-titres:   var(--police);
  --police-logo:     'Poppins', var(--police);

  /* --- Formes --- */
  --arrondi-petit:   10px;
  --arrondi:         12px;
  --arrondi-carte:   24px;
  --arrondi-grand:   24px;
  --arrondi-pastille:999px;

  /* --- Largeurs --- */
  --largeur-page:    1200px;
  --largeur-etroite: 480px;
  --largeur-menu:    232px;   /* menu latéral sur ordinateur */
  --hauteur-onglets: 64px;    /* barre d'onglets en bas sur téléphone */
}

/* Thème sombre. Le visiteur choisit Clair, Sombre ou Automatique avec le bouton de l'en-tête
   (theme-choix.js, qui pose data-theme="clair" ou "sombre" sur <html>). Automatique (par défaut) suit l'appareil.
   Les deux blocs ci-dessous doivent garder exactement les mêmes couleurs. */
:root[data-theme="clair"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    color-scheme: dark;
    --fond:            #14121B;
    --fond-carte:      #1D1A27;
    --fond-survol:     #221F2D;
    --fond-champ:      #211D2B;
    --fond-doux:       #272332;
    --fond-actif:      #2C2340;
    --bordure:         #332D40;
    --bordure-forte:   #827A95;
    --bordure-accent:  #B59AFF;
    --texte:           #F5F2FC;
    --texte-doux:      #BCB5CD;
    --texte-discret:   #ABA4BD;
    --texte-label:     #DCD6E8;
    --accent:          #B59AFF;
    --accent-survol:   #C7B2FF;
    --texte-sur-accent:#21123D;
    --accent-texte:    #CDBBFF;
    --succes:          #78D6A4;  --succes-fond:   #173126;
    --attente:         #EBC477;  --attente-fond:  #352A14;
    --neutre:          #BCB5CD;  --neutre-fond:   #2A2635;
    --erreur:          #FF9BAA;  --erreur-fond:   #3A1C24;
  }
}
:root[data-theme="sombre"] {
  color-scheme: dark;
  --fond:            #14121B;
  --fond-carte:      #1D1A27;
  --fond-survol:     #221F2D;
  --fond-champ:      #211D2B;
  --fond-doux:       #272332;
  --fond-actif:      #2C2340;
  --bordure:         #332D40;
  --bordure-forte:   #827A95;
  --bordure-accent:  #B59AFF;
  --texte:           #F5F2FC;
  --texte-doux:      #BCB5CD;
  --texte-discret:   #ABA4BD;
  --texte-label:     #DCD6E8;
  --accent:          #B59AFF;
  --accent-survol:   #C7B2FF;
  --texte-sur-accent:#21123D;
  --accent-texte:    #CDBBFF;
  --succes:          #78D6A4;  --succes-fond:   #173126;
  --attente:         #EBC477;  --attente-fond:  #352A14;
  --neutre:          #BCB5CD;  --neutre-fond:   #2A2635;
  --erreur:          #FF9BAA;  --erreur-fond:   #3A1C24;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--police-titres); font-weight: 500; letter-spacing: -0.015em; }
a { color: var(--accent-texte); }
a:hover { color: var(--accent-survol); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- En-tête et pied de page ---------- */
.entete {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; min-height: 64px;
  background: var(--fond-carte);
  border-bottom: 1px solid var(--bordure);
  position: relative; z-index: 30;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--texte);
  font-family: var(--police-logo); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: 20px; letter-spacing: -0.02em;
}
.logo:hover { color: var(--texte); }
/* Le carré du logo n'apparaît que si un logo image est défini dans marque-plateforme.js */
.logo-signe:not(:has(img)) { display: none; }
.logo .puce { font-family: var(--police); font-style: normal; text-transform: none; letter-spacing: 0; }
.logo-signe {
  width: 34px; height: 34px; border-radius: var(--arrondi-petit);
  background: var(--fond-doux); color: var(--texte);
  display: grid; place-items: center; font-weight: 800;
}
.logo-signe img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.entete-droite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--texte-doux); font-size: 14px; }

.pied {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  padding: 24px; margin-top: auto;
  border-top: 1px solid var(--bordure);
  color: var(--texte-discret); font-size: 13px;
}

/* ---------- Mises en page ---------- */
.page { width: 100%; max-width: var(--largeur-page); margin: 0 auto; padding: 36px 16px 72px; }
.centre {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px 64px; text-align: center;
}
.colonne-etroite { width: 100%; max-width: var(--largeur-etroite); }

/* ---------- Textes ---------- */
.surtitre {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--texte-doux);
}
.titre-1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.2; font-weight: 500; letter-spacing: -0.02em; }
.titre-2 { font-size: 22px; font-weight: 500; }
.accent { color: var(--accent-texte); }
.doux { color: var(--texte-doux); }
.petit { font-size: 14px; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--arrondi-carte);
  padding: 24px;
}

/* Cartes de choix d'espace (accueil) */
.espaces { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.espace {
  display: flex; align-items: center; gap: 18px;
  width: 100%; min-height: 44px; padding: 20px 22px;
  background: var(--fond-carte); border: 1px solid var(--bordure); border-radius: var(--arrondi-carte);
  color: var(--texte); font: inherit; text-align: left; cursor: pointer; text-decoration: none;
}
.espace:hover { border-color: var(--bordure-forte); background: var(--fond-survol); color: var(--texte); }
.espace b { font-size: 17px; font-weight: 600; }
.espace-texte { flex: 1; }
.espace-texte span { display: block; color: var(--texte-doux); font-size: 14px; }
.icone {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--fond-doux); color: var(--texte); border: 1px solid var(--bordure);
}
.icone-pleine { background: var(--fond-actif); color: var(--accent-texte); border-color: transparent; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.champ label { font-size: 14px; font-weight: 500; color: var(--texte-label); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--texte);
  background: var(--fond-champ); border: 1px solid var(--bordure-forte); border-radius: var(--arrondi);
  padding: 0 14px; min-height: 48px; width: 100%;
}
textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--texte-discret); opacity: 1; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--arrondi); border: 1px solid transparent;
  font: inherit; font-weight: 500; font-size: 15px;
  text-decoration: none; cursor: pointer;
}
.btn-principal { background: var(--accent); color: var(--texte-sur-accent); }
.btn-principal:hover { background: var(--accent-survol); color: var(--texte-sur-accent); }
.btn-secondaire { background: var(--fond-carte); color: var(--texte); border-color: var(--bordure-forte); }
.btn-secondaire:hover { background: var(--fond-doux); color: var(--texte); }
.btn-lien { background: none; border: 0; padding: 0; min-height: 44px; color: var(--accent-texte); font: inherit; font-weight: 600; cursor: pointer; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-large { width: 100%; }

/* ---------- Pastilles de statut ---------- */
.puce {
  display: inline-flex; align-items: center; padding: 5px 11px;
  border-radius: var(--arrondi-pastille); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.puce-succes  { background: var(--succes-fond);  color: var(--succes); }
.puce-attente { background: var(--attente-fond); color: var(--attente); }
.puce-neutre  { background: var(--neutre-fond);  color: var(--neutre); }

/* ---------- Messages ---------- */
.message {
  padding: 14px 16px; border-radius: var(--arrondi); font-size: 14px; text-align: left;
  border: 1px solid var(--bordure);
}
.message-succes { background: var(--succes-fond); color: var(--succes); border-color: transparent; }
.message-erreur { background: var(--erreur-fond); color: var(--erreur); border-color: transparent; }

/* ---------- Choix du thème (bouton de l'en-tête, posé par theme-choix.js) ---------- */
.choix-theme { position: relative; }
.choix-theme-bouton { padding: 0 14px; }
.choix-theme-icone { display: inline-flex; }
.choix-theme-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 240px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--fond-carte); border: 1px solid var(--bordure); border-radius: var(--arrondi);
  box-shadow: 0 12px 32px rgb(20 18 27 / 0.18);
}
.choix-theme-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px;
  background: none; border: 0; border-radius: var(--arrondi-petit); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--texte); text-align: left;
}
.choix-theme-menu button:hover { background: var(--fond-doux); }
.choix-theme-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.choix-theme-menu button[aria-checked="true"] { background: var(--fond-actif); color: var(--accent-texte); font-weight: 600; }
.choix-theme-menu small { display: block; color: var(--texte-doux); font-size: 12px; font-weight: 400; }

/* ---------- Navigation des espaces ---------- */
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--texte-doux); text-decoration: none; padding: 10px 14px; border-radius: var(--arrondi-pastille);
  font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 10px;
}
.nav a:hover { color: var(--texte); }
.nav a[aria-current="page"] { background: var(--fond-actif); color: var(--accent-texte); font-weight: 600; }

/* ---------- Formulaire en plusieurs étapes ---------- */
.formulaire-etapes { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.formulaire-etapes aside { flex: 1 1 240px; max-width: 300px; }
.formulaire-etapes > section { flex: 999 1 520px; min-width: 0; }
.liste-etapes { list-style: none; padding: 0; margin: 24px 0 0; }
.liste-etapes li { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--texte-doux); font-size: 14px; font-weight: 500; }
.liste-etapes .num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; border: 1px solid var(--bordure-forte);
}
.liste-etapes li.faite { color: var(--texte); }
.liste-etapes li.faite .num { background: var(--texte); border-color: var(--texte); color: var(--fond-carte); }
.liste-etapes li.active { color: var(--texte); font-weight: 600; }
.liste-etapes li.active .num { background: var(--accent); border-color: var(--accent); color: var(--texte-sur-accent); }
.progression { height: 4px; border-radius: 4px; background: var(--fond-doux); overflow: hidden; }
.progression > div { height: 100%; background: var(--accent); transition: width .25s; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grille-champs .plein { grid-column: 1 / -1; }
.titre-groupe { display: block; font-size: 15px; font-weight: 600; margin: 24px 0 10px; }
.facultatif { color: var(--texte-discret); font-weight: 500; font-size: 12px; }
.obligatoire { color: var(--erreur); }
.indication { color: var(--texte-discret); font-size: 12px; }
.prive { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--texte-doux); background: var(--fond-doux); border-radius: var(--arrondi-pastille); padding: 2px 8px; margin-left: 6px; }

/* Lignes réseau : nom, lien, abonnés */
.reseau { display: grid; grid-template-columns: 110px minmax(0, 1fr) 160px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bordure); }
.reseau:last-of-type { border-bottom: 0; }
.reseau label { font-size: 14px; font-weight: 600; color: var(--texte); }

/* Choix multiples en pastilles */
.puces-choix { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.puce-choix { position: relative; }
.puce-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.puce-choix span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--bordure-forte); border-radius: var(--arrondi-pastille); font-size: 14px; font-weight: 500; color: var(--texte-label); background: var(--fond-carte);
}
.puce-choix input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--texte-sur-accent); }
.puce-choix input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Grandes options (radio ou case) */
.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer;
  border: 1px solid var(--bordure-forte); border-radius: var(--arrondi); margin-top: 8px;
}
.option input { width: 18px; min-height: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.option small { display: block; color: var(--texte-doux); font-size: 13px; }
.option:has(input:checked) { border-color: var(--accent); background: var(--fond-actif); }

/* Dépôt de fichier */
.depot { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1.5px dashed var(--bordure-forte); border-radius: var(--arrondi); flex-wrap: wrap; }
.apercu { width: 64px; height: 64px; border-radius: 50%; background: var(--fond-doux); color: var(--texte-doux); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-weight: 800; }
.apercu.carre { border-radius: var(--arrondi); }
.apercu img { width: 100%; height: 100%; object-fit: cover; }
.depot input[type="file"] { border: 0; padding: 0; min-height: 0; background: none; font-size: 14px; color: var(--texte-doux); }
.depot input[type="file"]::file-selector-button {
  font: inherit; font-weight: 500; color: var(--texte); background: var(--fond-carte); cursor: pointer;
  border: 1px solid var(--bordure-forte); border-radius: var(--arrondi); padding: 10px 14px; margin-right: 10px;
}

/* Récapitulatif */
.recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.recap dl { margin: 0; }
.recap dt { color: var(--texte-discret); font-size: 12px; margin-top: 10px; }
.recap dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }

.actions-formulaire { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Chiffres clés ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi small { color: var(--texte-doux); font-size: 13px; }
.kpi b { display: block; font-size: 34px; font-weight: 500; line-height: 1.1; margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Listes (candidatures, programmes) ---------- */
.ligne-liste { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--bordure); flex-wrap: wrap; }
.ligne-liste:last-child { border-bottom: 0; }
.ligne-liste .infos { flex: 1; min-width: 160px; }
.pastille-marque {
  width: 42px; height: 42px; border-radius: var(--arrondi); flex-shrink: 0;
  display: grid; place-items: center; font-weight: 600; color: var(--texte-doux); background: var(--fond-doux); overflow: hidden;
}
.pastille-marque[style*="background"] { color: #fff; }  /* initiale blanche seulement sur la couleur de la marque */
.pastille-marque img { width: 100%; height: 100%; object-fit: cover; }
.mot-agence { margin-top: 12px; padding: 12px 14px; border-radius: var(--arrondi); background: var(--fond-doux); border: 0; color: var(--texte-label); font-size: 14px; }
.mot-agence b { color: var(--texte); }

/* ---------- Frise de suivi d'une collaboration ---------- */
.frise { display: flex; list-style: none; padding: 0; margin: 22px 0 0; }
.frise li { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--texte-discret); padding-top: 24px; }
.frise li::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bordure-forte); background: var(--fond-carte); z-index: 1;
}
.frise li::after { content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--bordure-forte); }
.frise li:first-child::after { display: none; }
.frise li.faite { color: var(--texte); font-weight: 600; }
.frise li.faite::before { background: var(--texte); border-color: var(--texte); }
.frise li.faite::after { background: var(--texte); }
.frise li.en-cours { color: var(--accent-texte); font-weight: 600; }
.frise li.en-cours::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--fond-carte); }

/* ---------- Onglets ---------- */
.onglets { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--bordure); }
.onglets button {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--texte-doux); background: none; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; min-height: 44px; margin-bottom: -1px;
}
.onglets button:hover { color: var(--texte); }
.onglets button[aria-selected="true"] { color: var(--texte); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- Carte candidature (côté marque) ---------- */
.candidature { display: flex; gap: 20px; flex-wrap: wrap; }
.candidature .photo-createur { width: 96px; height: 96px; border-radius: var(--arrondi-carte); object-fit: cover; background: var(--fond-doux); flex-shrink: 0; display: grid; place-items: center; font-size: 32px; font-weight: 600; color: var(--texte-doux); overflow: hidden; }
.candidature .photo-createur img { width: 100%; height: 100%; object-fit: cover; }
.candidature .corps { flex: 1; min-width: 240px; }
.etiquettes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.etiquette { font-size: 12px; font-weight: 500; color: var(--texte-label); border: 1px solid var(--bordure); border-radius: var(--arrondi-pastille); padding: 3px 10px; }
.chiffres { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.chiffres div small { display: block; color: var(--texte-discret); font-size: 12px; }
.chiffres div b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.citation { color: var(--texte-label); font-size: 14px; margin-top: 12px; line-height: 1.6; }
.decision-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.decision-bas { justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bordure); }
details.fiche-complete { margin-top: 14px; border-top: 1px solid var(--bordure); padding-top: 10px; }
details.fiche-complete summary { cursor: pointer; color: var(--accent-texte); font-weight: 600; font-size: 14px; min-height: 44px; display: flex; align-items: center; }

/* ---------- Pilotage agence ---------- */
.kpi-lien { text-align: left; font: inherit; color: var(--texte); cursor: pointer; }
.kpi-lien:hover { border-color: var(--bordure-forte); background: var(--fond-survol); }
.a-faire { list-style: none; padding: 0; margin: 0; }
.a-faire li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--bordure); font-size: 14px; }
.a-faire li:last-child { border-bottom: 0; }
.a-faire .point { width: 8px; height: 8px; border-radius: 50%; background: var(--attente); flex-shrink: 0; }
.tableau-defilant { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tableau th { text-align: left; color: var(--texte-doux); font-size: 12px; font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--bordure); white-space: nowrap; }
.tableau td { padding: 12px; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filtres select, .filtres input { width: auto; min-width: 180px; }
.interrupteur { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; min-height: 36px; }
.interrupteur input { width: 18px; height: 18px; min-height: 18px; accent-color: var(--accent); }
.bloc-prive { margin-top: 12px; padding: 12px 14px; border-radius: var(--arrondi); border: 1px dashed var(--bordure-forte); }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

/* ---------- Navigation des espaces : menu latéral et barre d'onglets ----------
   S'applique seulement quand le menu a au moins deux entrées (créateur, agence).
   Un menu à une seule entrée (marque, import) reste dans l'en-tête. Aucune modification du HTML :
   les icônes sont posées ici, d'après l'adresse de chaque lien. */
.nav a::before { content: none; width: 20px; height: 20px; flex-shrink: 0; background: currentColor;
  -webkit-mask: var(--icone) center / 20px 20px no-repeat; mask: var(--icone) center / 20px 20px no-repeat; }
.nav a[href="createur.html"], .nav a[href="#pilotage"] { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E"); }
.nav a[href="#programmes"], .nav a[href="#candidatures"] { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E"); }
.nav a[href="fiche.html"], .nav a[href="#fiches"] { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='11' r='2.5'/%3E%3Cpath d='M5.5 17c.8-2 2-3 3.5-3s2.7 1 3.5 3M14 9h4M14 13h4'/%3E%3C/svg%3E"); }
.nav a[href="#marques"] { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9l1.5-5h13L20 9'/%3E%3Cpath d='M4 9v11h16V9'/%3E%3Cpath d='M4 9h16M10 20v-6h4v6'/%3E%3C/svg%3E"); }
.nav a[href="#alertes"] { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z'/%3E%3Cpath d='M10 20.5a2 2 0 0 0 4 0'/%3E%3C/svg%3E"); }

@media (min-width: 1100px) {
  body:has(.entete .nav > a + a) { padding-left: var(--largeur-menu); }
  body:has(.entete .nav > a + a) .entete { margin-left: calc(-1 * var(--largeur-menu)); }
  .entete:has(.nav > a + a) .nav {
    position: fixed; top: 64px; left: 0; bottom: 0; width: var(--largeur-menu); z-index: 20;
    flex-direction: column; flex-wrap: nowrap; gap: 2px; padding: 16px 12px;
    background: var(--fond); border-right: 1px solid var(--bordure); overflow-y: auto;
  }
  .entete:has(.nav > a + a) .nav::before {
    content: attr(aria-label); display: block; padding: 6px 12px 8px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-doux);
  }
  .entete:has(.nav > a + a) .nav a { border-radius: var(--arrondi-petit); padding: 0 12px; border: 1px solid transparent; color: var(--texte); }
  .entete:has(.nav > a + a) .nav a::before { content: ''; color: var(--texte-doux); }
  .entete:has(.nav > a + a) .nav a:hover { background: var(--fond-doux); }
  .entete:has(.nav > a + a) .nav a[aria-current="page"] { background: var(--fond-carte); border-color: var(--bordure); color: var(--texte); }
  .entete:has(.nav > a + a) .nav a[aria-current="page"]::before { color: var(--accent); }
  body:has(.entete .nav > a + a) .page { margin-left: 0; padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 1099px) {
  body:has(.entete .nav > a + a) { padding-bottom: calc(var(--hauteur-onglets) + env(safe-area-inset-bottom, 0px)); }
  .entete:has(.nav > a + a) .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--fond-carte); border-top: 1px solid var(--bordure);
  }
  .entete:has(.nav > a + a) .nav a {
    flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 0 2px;
    border-radius: var(--arrondi-petit); font-size: 11px; text-align: center; background: none; color: var(--texte-doux); white-space: nowrap;
  }
  .entete:has(.nav > a + a) .nav a::before { content: ''; }
  .entete:has(.nav > a + a) .nav a[aria-current="page"] { background: none; color: var(--accent-texte); }
}

/* ---------- Téléphone ---------- */
@media (max-width: 700px) {
  .reseau { grid-template-columns: 1fr; gap: 6px; }
  .formulaire-etapes aside { max-width: none; }
  .liste-etapes { display: none; }
}
@media (max-width: 640px) {
  .entete { padding: 10px 16px; gap: 8px; }
  .logo { font-size: 16px; white-space: nowrap; }
  .logo { gap: 6px; }
  .logo .puce { padding: 3px 8px; font-size: 11px; margin-left: 0 !important; }
  .entete-droite { gap: 8px; flex-wrap: nowrap; margin-left: auto; }
  .entete-droite .btn { min-height: 44px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
  .choix-theme-bouton { width: 44px; padding: 0 !important; }  /* icône seule sur téléphone, le nom reste lu à voix haute */
  .choix-theme-texte { display: none; }
}
/* Petits téléphones : on resserre l'en-tête pour que logo, choix du thème et « Se déconnecter » tiennent sur une ligne */
@media (max-width: 420px) {
  .entete { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .entete-droite { gap: 6px; }
  .logo { font-size: 14px; gap: 5px; }
  .logo .puce { padding: 2px 6px; font-size: 10px; }
  .entete-droite .btn:not(.choix-theme-bouton) { padding: 0 10px; }
  .entete-droite > b { display: none; }  /* nom de la marque : déjà écrit dans le titre de la page */
  .entete .nav:not(:has(> a + a)) { order: 3; width: 100%; }
  /* Menu à une seule entrée qui est la page en cours (espace marque) : inutile sur téléphone */
  .nav:not(:has(> a + a)):has(> a[aria-current="page"]) { display: none; }
  .carte { padding: 18px; }
  .espace { padding: 16px; gap: 14px; }
}
