/* Couleurs Polar Energies : noir du logotype, bleu glacier de l'ours, rouge de la flamme. */
:root {
  --polar-noir: #111111;
  --polar-bleu: #1fb6e8;
  --polar-bleu-fonce: #0e7fa8;
  --polar-bleu-clair: #e8f7fd;
  --polar-rouge: #e63323;
  --gris: #6b7280;
  --trait: #d9dee5;
  --fond: #f1f4f7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: #111827;
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.page { max-width: 1080px; margin: 0 auto; padding: 16px 16px 56px; }

.entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  background: #ffffff;
  border-bottom: 4px solid var(--polar-bleu);
  border-radius: 10px 10px 0 0;
  padding: 12px 20px;
  margin-bottom: 16px;
}
.logo { width: 72px; height: 72px; flex: none; }
.entete-texte { flex: 1 1 320px; min-width: 0; }
.marque { color: var(--polar-rouge); font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
h1 { font-size: 26px; font-weight: 800; color: var(--polar-noir); margin: 2px 0; letter-spacing: 0.3px; line-height: 1.2; }
.sous { color: var(--polar-bleu-fonce); margin: 0; }
.menu { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qui-suis-je { color: var(--gris); font-size: 13px; margin-right: 4px; }

.message {
  position: sticky;
  top: 8px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 600;
  background: #e8f6ee;
  color: #17603a;
  border-left: 5px solid #1d8a4a;
}
.message.erreur { background: #fdeceb; color: #8a1c12; border-left-color: var(--polar-rouge); }
.attente { color: var(--gris); text-align: center; padding: 32px; }

.carte {
  background: #ffffff;
  border: 1px solid var(--trait);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.carte.etroite { max-width: 520px; margin-left: auto; margin-right: auto; }
.carte h2 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: var(--polar-noir);
  border-left: 6px solid var(--polar-bleu);
  margin: -16px -20px 14px;
  padding: 9px 16px;
  border-radius: 7px 7px 0 0;
}
.intro { color: var(--gris); margin: 0 0 12px; }
.aide { color: var(--gris); font-size: 13px; margin: 2px 0 6px; }

/* Formulaires */
.formulaire label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.formulaire input:not([type="checkbox"]), .formulaire select, .tableau select {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #b9c0ca;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
}
.tableau select { margin-top: 0; padding: 5px 8px; min-width: 130px; }
.formulaire label.case { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.grille-creation { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
.large { grid-column: 1 / -1; }

/* Liste */
.barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.barre.haut { justify-content: space-between; }
.ligne-liste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-left: 6px solid var(--polar-bleu);
}
.ligne-liste:hover { background: var(--polar-bleu-clair); }
.liste-titre { font-weight: 700; flex: 1 1 280px; }
.liste-detail { color: var(--gris); flex: 1 1 240px; }
.vide-liste { color: var(--gris); text-align: center; }
.pastille { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.pastille.a_preparer { background: #fff4e5; color: #9a5b00; }
.pastille.prepare { background: var(--polar-bleu-clair); color: var(--polar-bleu-fonce); }
.pastille.finalise { background: #eef0f3; color: #111111; }
.pastille.envoye { background: #fdeceb; color: #b3261a; }
.pastille.signe { background: #e8f6ee; color: #17703c; }

/* Boutons */
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--polar-noir);
  background: #ffffff;
  color: var(--polar-noir);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #f3f4f6; }
.btn.principal { background: var(--polar-noir); color: #ffffff; }
.btn.principal:hover { background: #2b2b2b; }
.btn.signature { background: var(--polar-bleu); border-color: var(--polar-bleu); color: #06222e; }
.btn.signature:hover { background: #46c3ee; }
.btn.danger { border-color: var(--polar-rouge); color: var(--polar-rouge); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sauvegarde { color: var(--gris); font-size: 12px; margin-left: auto; }

/* Étapes */
.etapes { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; }
.etape {
  flex: 1 1 130px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 4px;
  background: #e3e7ec;
  color: var(--gris);
}
.etape.faite { background: var(--polar-bleu-clair); color: var(--polar-bleu-fonce); }
.etape.courante { background: var(--polar-noir); color: #ffffff; }
.consigne {
  background: var(--polar-bleu-clair);
  border-left: 5px solid var(--polar-bleu);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
  font-weight: 600;
}
.consigne-bas { margin: 0 0 10px; color: var(--gris); }
.alerte {
  background: #fdeceb;
  border-left: 5px solid var(--polar-rouge);
  color: #8a1c12;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
}

/* Questions */
.champ { margin-bottom: 14px; }
.libelle { font-weight: 600; margin-bottom: 4px; }
.libelle.petit { font-size: 13px; }
.qui {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  color: #ffffff;
  background: var(--polar-bleu-fonce);
  vertical-align: middle;
}
.bloc { border-left: 4px solid var(--polar-bleu); padding: 2px 0 2px 12px; }
.bloc.direction { border-left-color: var(--polar-noir); }
.bloc.direction .qui { background: var(--polar-noir); }
.saisie {
  width: 100%;
  font: inherit;
  border: 1px solid #b9c0ca;
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
  background: #ffffff;
  color: #111827;
}
.saisie:focus, .formulaire input:focus, .formulaire select:focus { outline: 2px solid var(--polar-bleu); border-color: var(--polar-bleu); }
.reponse { white-space: pre-wrap; overflow-wrap: anywhere; }
.masque { color: #9aa1ab; font-style: italic; }

/* Niveaux */
.niveaux { display: flex; flex-wrap: wrap; gap: 5px; }
.niveau {
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid #b9c0ca;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
}
.niveau:hover { border-color: var(--polar-bleu); }
.niveau.choisi { color: #ffffff; font-weight: 700; border-color: transparent; }
.niveau.n1.choisi { background: #c23b2c; }
.niveau.n2.choisi { background: #c77d0a; }
.niveau.n3.choisi { background: #1d8a4a; }
.niveau.n4.choisi { background: var(--polar-bleu-fonce); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; min-width: 640px; }
.tableau th {
  text-align: left;
  font-size: 12px;
  padding: 8px 10px;
  background: var(--polar-bleu-clair);
  border-bottom: 2px solid var(--polar-bleu);
}
.tableau th.col-direction { background: #eef0f3; border-bottom-color: var(--polar-noir); }
.tableau td { padding: 8px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.competence { font-weight: 600; width: 34%; }

/* Lignes d'objectifs */
.ligne-objectif { border: 1px solid var(--trait); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.ligne-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.numero {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 12px;
  background: var(--polar-noir);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
}
.lien-suppr { font: inherit; font-size: 12px; background: none; border: none; color: var(--polar-rouge); cursor: pointer; padding: 0; }
.cellules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; }
.actions { border-top: 4px solid var(--polar-bleu); }

@media (max-width: 560px) {
  h1 { font-size: 21px; }
  .logo { width: 56px; height: 56px; }
  .carte { padding: 14px; }
  .carte h2 { margin: -14px -14px 12px; }
}
