/* Tâche Libre prépare, votre équipe valide.
   Direction : un parapheur moderne. Papier blanc sur brume froide, encre bleu stylo pour tout ce qui engage. */
:root {
  --brume: #eceff4;
  --brume-2: #e3e7ee;
  --papier: #ffffff;
  --encre: #0f1b2d;
  --encre-2: #46536a;
  --encre-3: #8a94a6;
  --trait: #dfe3ea;
  --stylo: #2a3bd8;
  --stylo-fonce: #1f2db0;
  --stylo-doux: #eaedfd;
  --rouge: #dc4437;
  --rouge-doux: #fdeceb;
  --vert: #12924f;
  --vert-doux: #e4f4eb;
  --ambre: #a86400;
  --ambre-doux: #fff3df;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --ombre-feuille: 0 1px 1px rgba(15, 27, 45, .04), 0 8px 24px -6px rgba(15, 27, 45, .10), 0 24px 48px -24px rgba(15, 27, 45, .12);
  --courbe: cubic-bezier(.2, .8, .2, 1);
  --hauteur-titre: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--brume); color: var(--encre); overflow: hidden;
  font: 14.5px/1.5 "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "ss01", "tnum" 0; -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--stylo); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--stylo-doux); }

/* ---------- Barre de titre (déplaçable dans l'application) ---------- */
.barre-titre {
  height: var(--hauteur-titre); display: flex; align-items: center; gap: 18px;
  padding: 0 calc(env(titlebar-area-width, 100vw) * 0 + 150px) 0 18px; /* place pour les boutons Windows */
  -webkit-app-region: drag; user-select: none;
  background: rgba(236, 239, 244, .82); backdrop-filter: blur(14px);
  position: relative; z-index: 5;
}
.barre-titre button, .barre-titre a { -webkit-app-region: no-drag; }
.marque { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.sceau { width: 28px; height: 28px; border-radius: 50%; background: var(--stylo); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(42, 59, 216, .35); }
.sceau svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.nom { font-weight: 650; letter-spacing: -.015em; font-size: 15.5px; }
.client { color: var(--encre-3); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--trait); }

.onglets { position: relative; display: flex; gap: 2px; padding: 4px; background: var(--brume-2); border-radius: 999px; margin: 0 auto; }
.onglets a { position: relative; z-index: 1; padding: 6px 14px; border-radius: 999px; color: var(--encre-2); text-decoration: none; font-weight: 550; font-size: 13.5px; transition: color .2s; display: flex; align-items: center; gap: 7px; }
.onglets a:hover { color: var(--encre); }
.onglets a.actif { color: var(--encre); }
.onglets b { background: var(--rouge); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 6px; line-height: 17px; min-width: 18px; text-align: center; }
.onglets b:empty { display: none; }
.curseur { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; background: var(--papier); border-radius: 999px; box-shadow: 0 1px 3px rgba(15, 27, 45, .12); transition: transform .35s var(--courbe), width .35s var(--courbe); }

.etat-synchro { display: flex; align-items: center; gap: 8px; border: none; background: transparent; color: var(--encre-3); font-size: 12.5px; padding: 6px 10px; border-radius: 999px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.etat-synchro:hover { background: var(--brume-2); color: var(--encre-2); }
.point { width: 7px; height: 7px; border-radius: 50%; background: var(--encre-3); flex: none; }
.point.ok { background: var(--vert); box-shadow: 0 0 0 3px var(--vert-doux); }
.point.travail { background: var(--stylo); animation: battement 1s ease-in-out infinite alternate; }
.point.erreur { background: var(--rouge); }
@keyframes battement { to { box-shadow: 0 0 0 5px var(--stylo-doux); } }

/* --zoom : zoom CSS appliqué dans un navigateur (100vh n'en tient pas compte) ; dans l'application, zoom de la fenêtre et --zoom absent. */
main { height: calc(100vh / var(--zoom, 1) - var(--hauteur-titre)); position: relative; }
.page { height: 100%; overflow: auto; animation: apparition .28s var(--courbe); }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Boutons ---------- */
.btn { border: 1px solid var(--trait); background: var(--papier); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--encre-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.encre { background: var(--encre); border-color: var(--encre); color: #fff; }
.btn.encre:hover { background: #1c2a40; }
.btn.signer { background: var(--stylo); border-color: var(--stylo); color: #fff; padding: 10px 22px; font-size: 14.5px; box-shadow: 0 4px 14px -4px rgba(42, 59, 216, .55); }
.btn.signer:hover { background: var(--stylo-fonce); }
.btn.fantome { background: transparent; border-color: transparent; color: var(--encre-2); }
.btn.fantome:hover { background: var(--brume); }
kbd { font: 11px/1 inherit; color: inherit; opacity: .65; border: 1px solid currentColor; border-radius: 4px; padding: 1px 4px; margin-left: 6px; }

/* ---------- À valider ---------- */
.page-validation { display: grid; grid-template-columns: 340px 1fr; overflow: hidden; }
.file { display: flex; flex-direction: column; min-height: 0; padding: 6px 0 0 14px; }
.file-tete { padding: 4px 6px 10px; }
.filtres { display: flex; gap: 4px; }
.filtres button { border: none; background: transparent; border-radius: 999px; padding: 4px 11px; font-size: 13px; color: var(--encre-2); font-weight: 550; }
.filtres button:hover { background: var(--brume-2); }
.filtres button.actif { background: var(--encre); color: #fff; }
.file-liste { overflow: auto; padding: 0 6px 24px 0; display: flex; flex-direction: column; gap: 4px; }
.element { border: none; text-align: left; background: transparent; border-radius: var(--r-m); padding: 11px 13px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; transition: background .15s; position: relative; }
.element:hover { background: rgba(255, 255, 255, .55); }
.element.actif { background: var(--papier); box-shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 14px -6px rgba(15, 27, 45, .12); }
.element.actif::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--stylo); }
.element .qui { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.element .quand { font-size: 12px; color: var(--encre-3); }
.element .apercu { grid-column: 1 / -1; color: var(--encre-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pastille { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--encre-3); }
.pastille.URGENCE { background: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-doux); }
.pastille.DEVIS { background: var(--stylo); }
.pastille.CLIENT { background: var(--vert); }
.pastille.FOURNISSEUR { background: var(--ambre); }
.file-vide { padding: 24px 14px; color: var(--encre-3); font-size: 13px; }

.feuille-zone { overflow: auto; padding: 6px 28px 28px 14px; }
.feuille {
  background: var(--papier); border-radius: var(--r-l); box-shadow: var(--ombre-feuille);
  max-width: 820px; margin: 0 auto; padding: 34px 40px 0; position: relative;
  animation: arrivee .38s var(--courbe);
}
@keyframes arrivee { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.feuille.signee { animation: depart .42s var(--courbe) forwards; }
@keyframes depart { to { opacity: 0; transform: translateX(-40px) rotate(-1.5deg); } }
.feuille.refusee { animation: chute .35s ease-in forwards; }
@keyframes chute { to { opacity: 0; transform: translateY(24px); } }
.feuille .tete { display: flex; align-items: center; gap: 10px; color: var(--encre-3); font-size: 13px; margin-bottom: 14px; }
.chip { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--brume); color: var(--encre-2); }
.chip.URGENCE { background: var(--rouge-doux); color: var(--rouge); }
.chip.DEVIS { background: var(--stylo-doux); color: var(--stylo); }
.chip.CLIENT { background: var(--vert-doux); color: var(--vert); }
.chip.FOURNISSEUR { background: var(--ambre-doux); color: var(--ambre); }
.feuille h2 { font-size: 24px; line-height: 1.28; letter-spacing: -.02em; font-weight: 640; margin: 0 0 10px; max-width: 32ch; text-wrap: balance; }
.feuille .expediteur { color: var(--encre-2); margin: 0 0 18px; }
.feuille .expediteur strong { color: var(--encre); font-weight: 600; }
.vigilance { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 6px; }
.vigilance li { font-size: 13.5px; color: #7a4a00; background: var(--ambre-doux); border-radius: var(--r-s); padding: 7px 12px; }
.origine { border: 1px solid var(--trait); border-radius: var(--r-m); margin-bottom: 24px; }
.origine summary { list-style: none; cursor: pointer; padding: 11px 14px; color: var(--encre-2); font-size: 13.5px; display: flex; justify-content: space-between; }
.origine summary::after { content: "Afficher"; color: var(--stylo); font-weight: 600; }
.origine[open] summary::after { content: "Masquer"; }
.origine pre { margin: 0; padding: 0 14px 14px; white-space: pre-wrap; font: 13.5px/1.6 inherit; color: var(--encre-2); max-height: 260px; overflow: auto; }

.redaction-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.redaction-tete h3 { margin: 0; font-size: 14px; font-weight: 650; }
.redaction-tete span { font-size: 12.5px; color: var(--encre-3); }
.redaction { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--trait); border-radius: var(--r-m); padding: 16px 18px; font-size: 15px; line-height: 1.65; background: #fbfcfe; transition: border-color .15s, background .15s; }
.redaction:focus { outline: none; border-color: var(--stylo); background: #fff; box-shadow: 0 0 0 4px var(--stylo-doux); }
.redaction.reecrit { animation: reecrit .6s var(--courbe); }
@keyframes reecrit { 0% { background: var(--stylo-doux); } }
.reformuler { display: flex; gap: 6px; margin: 10px 0 0; align-items: center; flex-wrap: wrap; }
.reformuler span { font-size: 12.5px; color: var(--encre-3); margin-right: 2px; }
.reformuler button { border: 1px solid var(--trait); background: var(--papier); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 550; color: var(--encre-2); }
.reformuler button:hover { border-color: var(--stylo); color: var(--stylo); }
.rappel { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-m); background: var(--brume); font-size: 16px; font-weight: 600; }
.rappel .tel { font-size: 20px; letter-spacing: .01em; color: var(--stylo); font-variant-numeric: tabular-nums; }
.barre-signature {
  position: sticky; bottom: 0; margin: 28px -40px 0; padding: 16px 40px;
  background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); border-radius: 0 0 var(--r-l) var(--r-l);
  display: flex; align-items: center; gap: 10px;
}
.barre-signature .info { margin-right: auto; font-size: 12.5px; color: var(--encre-3); }

.accueil-vide { max-width: 520px; margin: 12vh auto 0; text-align: center; }
.accueil-vide .sceau { width: 56px; height: 56px; margin: 0 auto 18px; }
.accueil-vide .sceau svg { width: 30px; height: 30px; }
.accueil-vide h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 8px; }
.accueil-vide p { color: var(--encre-2); margin: 0; }
.accueil-vide .chiffres { display: flex; justify-content: center; gap: 28px; margin-top: 26px; }
.accueil-vide .chiffres div { font-size: 13px; color: var(--encre-3); }
.accueil-vide .chiffres strong { display: block; font-size: 22px; color: var(--encre); font-variant-numeric: tabular-nums; }

/* ---------- Pages larges ---------- */
.page-large { padding: 8px 40px 40px; }
.page-large > * { max-width: 1060px; margin-left: auto; margin-right: auto; }
.page-tete { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
h1 { font-size: 26px; letter-spacing: -.025em; font-weight: 650; margin: 8px 0 0; }
.chapeau { color: var(--encre-2); margin: -8px 0 18px; max-width: 70ch; }
input[type=search] { width: 320px; border: 1px solid transparent; background: var(--papier); border-radius: 999px; padding: 9px 16px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05); }
input[type=search]:focus { outline: none; border-color: var(--stylo); box-shadow: 0 0 0 4px var(--stylo-doux); }

.tableau-lignes { background: var(--papier); border-radius: var(--r-l); box-shadow: var(--ombre-feuille); overflow: hidden; }
.rangee { display: grid; grid-template-columns: 14px 1fr 150px 110px; gap: 16px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--trait); cursor: pointer; }
.rangee:last-child { border-bottom: none; }
.rangee:hover { background: #f8f9fc; }
.rangee .titre { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rangee .sous { font-size: 12.5px; color: var(--encre-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rangee .date { font-size: 12.5px; color: var(--encre-3); text-align: right; }
.statut { justify-self: end; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.statut.en_attente { background: var(--ambre-doux); color: var(--ambre); }
.statut.validee { background: var(--vert-doux); color: var(--vert); }
.statut.refusee, .statut.historique { background: var(--brume); color: var(--encre-3); }
.deplie { padding: 4px 22px 18px 52px; border-bottom: 1px solid var(--trait); background: #fafbfd; font-size: 13.5px; color: var(--encre-2); }
.deplie pre { white-space: pre-wrap; font: inherit; margin: 4px 0 10px; }
.deplie strong { color: var(--encre); }

.grille-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.contact { background: var(--papier); border-radius: var(--r-l); padding: 18px 20px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05); display: grid; grid-template-columns: 44px 1fr; gap: 4px 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; grid-row: span 2; font-size: 15px; }
.contact h4 { margin: 2px 0 0; font-size: 15.5px; }
.contact .role { font-size: 12.5px; color: var(--encre-3); }
.contact dl { grid-column: 1 / -1; margin: 12px 0 0; font-size: 13px; display: grid; grid-template-columns: 74px 1fr; gap: 4px 8px; }
.contact dt { color: var(--encre-3); }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Assistant ---------- */
.page-chat { display: flex; flex-direction: column; overflow: hidden; }
.fil-chat { flex: 1; overflow: auto; padding: 18px max(32px, calc(50% - 400px)) 18px; display: flex; flex-direction: column; gap: 18px; }
.message { max-width: 680px; line-height: 1.6; white-space: pre-wrap; animation: arrivee .3s var(--courbe); }
.message.moi { align-self: flex-end; background: var(--encre); color: #fff; padding: 11px 16px; border-radius: 18px 18px 4px 18px; }
.message.ia { align-self: flex-start; background: var(--papier); padding: 16px 20px; border-radius: 4px 18px 18px 18px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05); }
.message .cout { display: block; margin-top: 10px; font-size: 12px; color: var(--encre-3); white-space: normal; }
.message.attente { color: var(--encre-3); }
.message.attente::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: points 1.2s steps(4) infinite; }
@keyframes points { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.chat-vide { margin: auto; text-align: center; max-width: 460px; }
.chat-vide h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 8px; }
.chat-vide p { color: var(--encre-2); margin: 0; }
.bas-chat { padding: 0 max(32px, calc(50% - 400px)) 26px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; justify-content: center; }
.suggestions button { border: none; background: var(--papier); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--encre-2); box-shadow: 0 1px 2px rgba(15, 27, 45, .06); }
.suggestions button:hover { color: var(--stylo); }
.saisie-chat { display: flex; gap: 8px; align-items: flex-end; background: var(--papier); border-radius: 22px; padding: 8px 8px 8px 18px; box-shadow: var(--ombre-feuille); }
.saisie-chat:focus-within { box-shadow: var(--ombre-feuille), 0 0 0 3px var(--stylo-doux); }
.saisie-chat textarea { flex: 1; border: none; resize: none; outline: none; padding: 8px 0; max-height: 160px; background: transparent; font-size: 15px; }

/* ---------- Activité ---------- */
.bandeau-valeur { background: var(--encre); color: #fff; border-radius: var(--r-l); padding: 28px 32px; display: grid; grid-template-columns: auto 1fr; gap: 6px 32px; align-items: end; margin-bottom: 14px; }
.bandeau-valeur .grand { font-size: 54px; font-weight: 650; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.bandeau-valeur .explication { color: #b6bfcd; max-width: 46ch; }
.bandeau-valeur .explication strong { color: #fff; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--papier); border-radius: var(--r-l); padding: 18px 20px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05); }
.kpi .valeur { font-size: 30px; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi .libelle { font-size: 13px; color: var(--encre-3); }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bloc { background: var(--papier); border-radius: var(--r-l); padding: 20px 22px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05); }
.bloc h3 { margin: 0 0 14px; font-size: 15px; letter-spacing: -.01em; }
.categorie { display: grid; grid-template-columns: 100px 1fr 30px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13.5px; }
.categorie .piste { height: 8px; background: var(--brume); border-radius: 999px; overflow: hidden; }
.categorie .rempli { height: 100%; border-radius: 999px; background: var(--stylo); transition: width .6s var(--courbe); }
.categorie .rempli.URGENCE { background: var(--rouge); }
.categorie .rempli.CLIENT { background: var(--vert); }
.categorie .rempli.FOURNISSEUR { background: var(--ambre); }
.categorie .n { text-align: right; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.jauge { height: 10px; background: var(--brume); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.jauge div { height: 100%; background: var(--vert); border-radius: 999px; transition: width .6s var(--courbe); }
.conso-total { display: flex; justify-content: space-between; align-items: baseline; }
.conso-total strong { font-size: 26px; letter-spacing: -.02em; }
.petit { font-size: 12.5px; color: var(--encre-3); }
.conso-liste { list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px; max-height: 210px; overflow: auto; }
.conso-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--trait); color: var(--encre-2); }

/* ---------- Réglages ---------- */
.reglages { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.colonne-droite { display: flex; flex-direction: column; gap: 14px; }
.memoire { width: 100%; min-height: 54vh; border: 1px solid var(--trait); border-radius: var(--r-m); padding: 16px 18px; font: 13.5px/1.65 "Cascadia Code", Consolas, monospace; background: #fbfcfe; resize: vertical; }
.memoire:focus { outline: none; border-color: var(--stylo); box-shadow: 0 0 0 4px var(--stylo-doux); }
.ligne-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.connecteurs { display: flex; flex-direction: column; }
.connecteur { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--trait); font-size: 13.5px; }
.connecteur:first-child { border-top: none; padding-top: 0; }
.connecteur small { display: block; color: var(--encre-3); font-size: 12px; }
.connecteur .on { color: var(--vert); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.connecteur .off { color: var(--encre-3); font-size: 12.5px; white-space: nowrap; }
#moteur { font-size: 13.5px; color: var(--encre-2); }
#moteur strong { color: var(--encre); }

/* ---------- Notifications ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 30; pointer-events: none; }
.toast { background: var(--encre); color: #fff; padding: 11px 18px; border-radius: 999px; box-shadow: 0 10px 30px -8px rgba(15, 27, 45, .45); font-size: 13.5px; font-weight: 550; animation: toast .3s var(--courbe); max-width: 560px; }
.toast.erreur, .toast.urgent { background: var(--rouge); }
.toast.ok { background: var(--vert); }
@keyframes toast { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* Animations coupées dans Windows : rien ne bouge, sauf si la personne a choisi « Animations » dans la colonne de gauche */
@media (prefers-reduced-motion: reduce) { body:not(.animations-toujours) *, body:not(.animations-toujours) *::before, body:not(.animations-toujours) *::after { animation: none !important; transition: none !important; } }
@media (max-width: 980px) {
  .page-validation { grid-template-columns: 280px 1fr; }
  .client { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .deux-colonnes, .reglages { grid-template-columns: 1fr; }
}

/* Profil Université : couleurs des types d'expéditeur (chips et initiales) */
.chip.ETUDIANT, .initiales.ETUDIANT { background: var(--vert-doux); color: var(--vert); }
.chip.ENSEIGNANT, .initiales.ENSEIGNANT { background: var(--stylo-doux); color: var(--stylo); }
.chip.CANDIDAT, .initiales.CANDIDAT { background: var(--ambre-doux); color: var(--ambre); }
.chip.SERVICE, .initiales.SERVICE { background: #ece4f7; color: #6b3fa0; }
.chip.ETABLISSEMENT, .initiales.ETABLISSEMENT { background: #fde6d3; color: #b5651d; }
.chip.ADMINISTRATIF, .initiales.ADMINISTRATIF { background: #d7eef3; color: #1d7a91; }
.categorie .rempli.ETUDIANT { background: var(--vert); }
.categorie .rempli.ENSEIGNANT { background: var(--stylo); }
.categorie .rempli.CANDIDAT { background: var(--ambre); }

/* Panneau d'étiquetage d'une demande (profil université) */
.f-etiquettes { margin: 14px 0; padding: 14px 16px; background: var(--brume); border-radius: 14px; }
.f-etiquettes h3 { margin: 0 0 10px; font-size: 14px; }
.f-etiquettes h3 .petit { font-weight: 450; color: var(--encre-2); font-size: 12px; }
.etq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.etq-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 6px 4px 11px; border-radius: 999px; background: var(--stylo-doux); color: var(--stylo); }
.etq-x { border: 0; background: rgba(0, 0, 0, .08); color: inherit; width: 17px; height: 17px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center; padding: 0; }
.etq-x:hover { background: rgba(0, 0, 0, .18); }
.etq-vide { font-size: 12.5px; color: var(--encre-2); font-style: italic; }
.etq-ajout { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.etq-ajout > span { font-size: 12.5px; color: var(--encre-2); }
.etq-ajout select { flex: 1; max-width: 280px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }
.etq-remarque { display: flex; flex-direction: column; gap: 5px; }
.etq-remarque > span { font-size: 12.5px; color: var(--encre-2); }
.etq-remarque input { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }
.etq-actions { margin-top: 10px; }

/* Taille de l'affichage (menu Plus) */
.menu-plus-zoom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; margin-top: 4px; border-top: 1px solid var(--brume-2); }
.menu-plus-zoom > span { font-size: 13px; color: var(--encre-2); font-weight: 550; }
.zoom-btns { display: inline-flex; align-items: center; gap: 4px; }
.zoom-btns button { min-width: 34px; height: 30px; padding: 0 8px; border: 1px solid var(--brume-2); background: var(--brume); border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--encre); cursor: pointer; }
.zoom-btns button:hover { background: var(--brume-2); }
#zoom-reset { font-size: 12.5px; min-width: 52px; }

/* Signature des e-mails */
.signature-apercu-tete { margin: 12px 0 4px; }
.signature-apercu { display: block; width: 100%; min-height: 120px; border: 1px solid var(--brume-2); border-radius: 12px; background: #fff; }
iframe.signature-apercu { height: 160px; }
.note-signature { margin: 8px 0 0; font-size: 12.5px; color: var(--encre-2); }
.note-signature a { color: var(--stylo); }

/* Document à établir (laissez-passer, fiche de mission…) et refus avec e-mail */
.f-document { margin: 14px 0; padding: 16px 18px; background: var(--brume); border-radius: 14px; border: 1px solid var(--brume-2); }
.f-document.etabli { background: var(--stylo-doux); border-color: transparent; }
.doc-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.doc-tete h3 { margin: 0; font-size: 14px; }
.doc-tete h3 .petit { font-weight: 450; color: var(--encre-2); font-size: 12px; }
.doc-tete .chip { margin-left: auto; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--stylo); }
.doc-champs, .doc-acompleter { margin: 8px 0; padding-left: 18px; font-size: 13px; color: var(--encre-2); }
.doc-acompleter { color: #9a6700; }
.f-document .champ { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.f-document .champ > span { font-size: 12.5px; color: var(--encre-2); }
.f-document .champ input { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }
.doc-corps { width: 100%; resize: vertical; border: 1px solid var(--brume-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; background: #fff; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.doc-joindre { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--encre); }
.f-refus { margin: 14px 0; padding: 16px 18px; background: #fdf3f3; border: 1px solid #f3d2d2; border-radius: 14px; }
.f-refus .champ { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.f-refus .champ > span { font-size: 12.5px; color: var(--encre-2); }
.f-refus .champ input { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }
.redac-refus { width: 100%; resize: vertical; border: 1px solid var(--brume-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; background: #fff; }
.refus-bas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.apercu-doc { display: block; width: 100%; height: 60vh; border: 1px solid var(--brume-2); border-radius: 12px; background: #fff; }

/* Modèle suivi pour le document (laissez-passer…) */
.f-document.discret { background: transparent; border-style: dashed; }
.doc-modeles { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 10px 0; padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--brume-2); font-size: 13px; color: var(--encre-2); }
.doc-modeles-liste { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.doc-modeles .petit-btn { padding: 6px 12px; font-size: 13px; cursor: pointer; border: 1px solid var(--brume-2); }
.f-document select[data-role="doc-type"] { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }

/* Signature par boîte */
.signature-choix { display: grid; gap: 4px; margin: 4px 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--brume); }
.signature-choix .case { margin: 0; }
#signature-pour { max-width: 100%; }
.signature-resume { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.signature-resume button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--brume-2); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.signature-resume button strong { font-size: 13.5px; color: var(--encre); overflow-wrap: anywhere; }
.signature-resume button span { font-size: 12px; color: var(--encre-2); }
.signature-resume button.actif { border-color: var(--stylo, #3b4cca); box-shadow: 0 0 0 2px var(--stylo-doux, #e6e9ff); }
.erreur-envoi { margin: 12px 0 0; padding: 11px 14px; border-radius: 12px; background: #fdecea; color: #b3261e; font-size: 14px; line-height: 1.45; }

/* Document rempli depuis un modèle Word */
.doc-remps { display: grid; gap: 8px; margin: 10px 0; }
.doc-remps > .petit { margin: 0 0 2px; }
.doc-remp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; }
.doc-remp-avant { font-size: 12.5px; color: var(--encre-2); background: #fff8d6; border-radius: 8px; padding: 6px 9px; overflow-wrap: anywhere; }
.doc-remp input { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; min-width: 0; }
.doc-texte { margin: 8px 0; font-size: 13px; }
.doc-texte pre { white-space: pre-wrap; font: inherit; background: #fff; border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; }
.apercu-pdf { width: min(820px, 80vw); height: 70vh; border: 1px solid var(--brume-2); border-radius: 10px; background: #fff; }
@media (max-width: 640px) { .doc-remp { grid-template-columns: 1fr; } }
.doc-remp input.a-completer { border-color: #e8b400; background: #fffbe6; }

/* Laissez-passer rempli dans le modèle Word : modèle choisi, passages (remplis / à compléter / retirés) */
.doc-remps-tete, .doc-remp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto; gap: 10px; align-items: center; }
.doc-remps-tete { font-size: 12px; color: var(--encre-2); padding: 0 2px; }
.doc-remp.retire .doc-remp-avant { text-decoration: line-through; opacity: .6; }
.doc-remp.retire input[type="text"] { background: var(--brume); border-style: dashed; }
.doc-retirer { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--encre-2); white-space: nowrap; cursor: pointer; }
.doc-choix-modele { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; font-size: 13px; color: var(--encre-2); }
.doc-choix-modele select { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; color: var(--encre); }
.doc-pourquoi { margin: -2px 2px 8px; }
.doc-reste { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: #fff8d6; color: #7a5b00; font-size: 13px; }
.doc-encours { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--encre-2); font-size: 13.5px; }
@media (max-width: 720px) { .doc-remps-tete { display: none; } .doc-remp { grid-template-columns: 1fr; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--brume-2); } }

/* Plusieurs documents par demande : une carte par personne */
.doc-carte { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--brume-2); }
.doc-carte.non-joint { opacity: .6; }
.doc-carte-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-carte-titre { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-carte-titre strong { font-size: 14.5px; color: var(--encre); overflow-wrap: anywhere; }
.doc-carte-titre span { font-size: 12.5px; color: var(--encre-2); }
.doc-joindre-carte input { width: 18px; height: 18px; cursor: pointer; }
.doc-regle { margin: 8px 0 4px; padding: 7px 10px; border-radius: 9px; background: var(--brume); font-size: 12.5px; color: var(--encre); }
.doc-carte .doc-modeles { margin: 8px 0; background: transparent; border: 0; padding: 0; }
.doc-passages > summary, .doc-texte > summary { cursor: pointer; font-size: 13px; color: var(--encre-2); margin: 6px 0; }
.doc-ajout { display: flex; gap: 8px; margin: 10px 0 4px; }
.doc-ajout input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }
.doc-carte .doc-corps { margin-top: 6px; }

/* Connaissances : coffre de notes reliées */
.coffre { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.coffre-liste { display: flex; flex-direction: column; gap: 6px; max-height: 75vh; overflow: auto; padding-right: 4px; }
.coffre-liste input[type="search"] { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--brume-2); background: #fff; font: inherit; }
.coffre-liste h4 { margin: 12px 2px 4px; font-size: 12px; color: var(--encre-2); text-transform: uppercase; letter-spacing: .04em; }
.coffre-liste h4 span { font-weight: 400; }
.coffre-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 11px; border-radius: 10px; border: 1px solid transparent; background: transparent; font: inherit; cursor: pointer; }
.coffre-item:hover { background: var(--brume); }
.coffre-item.actif { background: #fff; border-color: var(--brume-2); }
.coffre-item strong { font-size: 13.5px; color: var(--encre); overflow-wrap: anywhere; }
.coffre-item span { font-size: 11.5px; color: var(--encre-2); }
.coffre-note { background: #fff; border: 1px solid var(--brume-2); border-radius: 16px; padding: 16px 18px; min-height: 300px; }
.coffre-note-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.coffre-titre { width: 100%; font-size: 18px; font-weight: 600; font-family: inherit; border: 0; border-bottom: 1px solid var(--brume-2); padding: 6px 0; margin-bottom: 10px; background: transparent; color: var(--encre); }
.coffre-contenu { width: 100%; min-height: 280px; resize: vertical; border: 1px solid var(--brume-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; font-family: inherit; background: #fff; }
.coffre-liens { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coffre-liens h4 { width: 100%; margin: 0 0 2px; font-size: 12px; color: var(--encre-2); }
.coffre-lien { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--brume-2); background: var(--brume); font: inherit; font-size: 12.5px; cursor: pointer; color: var(--encre); }
.coffre-lien.absente { cursor: default; opacity: .6; border-style: dashed; }
@media (max-width: 760px) { .coffre { grid-template-columns: 1fr; } .coffre-liste { max-height: none; } }
.onglets-page { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 14px; border-radius: 12px; background: var(--brume); }
.onglets-page button { padding: 7px 14px; border-radius: 9px; border: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--encre-2); cursor: pointer; }
.onglets-page button.actif { background: #fff; color: var(--encre); box-shadow: 0 1px 3px rgba(20, 24, 60, .08); }
