/* Tâche Libre — « Raffiné ». Chargé en dernier, par-dessus verre.css.
   Le fond se calme, les surfaces deviennent blanches et nettes, les titres passent en Poppins (la lettre du logo).
   Une demande se lit en trois temps : qui écrit, ce qu'il veut en bref, la réponse à valider.
   Pour revenir à l'état précédent : retirer la ligne raffine.css de index.html. */
:root {
  --titre: "Poppins", "Instrument Sans", "Segoe UI", sans-serif;
  --encre: #0b1238;
  --encre-2: #3d4567;
  --encre-3: #6b7393;
  --stylo: #2a3bd8;
  --stylo-fonce: #1f2db0;
  --stylo-doux: #eef0ff;
  --trait: rgba(11, 18, 56, .08);
  --scene: linear-gradient(180deg, #f6f7fe, #eef0fc);
  --carte: 0 0 0 1px rgba(11, 18, 56, .06), 0 30px 60px -42px rgba(11, 18, 80, .5);
  --halo: 0 12px 26px -12px rgba(42, 59, 216, .7);
}

/* ---------- Fond et surfaces ---------- */
body { background: #f5f6fc; }
.aurore i { opacity: .26; }
.feuille, .tableau-lignes, .bloc, .contact, .kpi, .entreprise-carte, .vide-page, .carte-import, .membre-carte {
  background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--carte);
}

/* ---------- Titres ---------- */
h1, .page-tete h1, #agenda-titre { font-family: var(--titre); font-weight: 700; letter-spacing: -.045em; }
.bloc h3, .groupe-tete h2, .redaction-tete h3, .fiche h4, .accueil-vide h2 { font-family: var(--titre); letter-spacing: -.025em; }
.page-large > .chapeau { color: var(--encre-2); }

/* ---------- Boutons et sélecteurs ---------- */
.btn { border-radius: 10px; font-family: var(--titre); font-weight: 600; font-size: 13px; letter-spacing: -.01em; }
.btn.signer { background: var(--stylo); border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--halo); }
.btn.signer:hover { background: #3d4fee; }
.btn.mini { border-radius: 8px; }
kbd { border-radius: 5px; font-family: inherit; }
.filtres { border-radius: 11px; padding: 3px; background: rgba(11, 18, 56, .055); box-shadow: none; }
.filtres button { border-radius: 8px; font-family: var(--titre); font-size: 12.5px; letter-spacing: -.01em; color: var(--encre-2); }
.filtres button:hover { background: rgba(255, 255, 255, .7); }
.filtres button.actif, .filtres button.actif:hover { background: #fff; color: var(--stylo); box-shadow: 0 1px 2px rgba(11, 18, 56, .14), 0 0 0 1px rgba(11, 18, 56, .04); }

/* ---------- Pastilles, étiquettes, initiales ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 7px; font: 600 11.5px/1.5 var(--titre); letter-spacing: -.005em; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.statut { border-radius: 7px; font-family: var(--titre); font-size: 11.5px; }
.initiales {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px;
  font: 600 13px/1 var(--titre); letter-spacing: -.01em; background: #eceef6; color: var(--encre-2);
}
.initiales.URGENCE { background: var(--rouge-doux); color: var(--rouge); }
.initiales.DEVIS { background: var(--stylo-doux); color: var(--stylo); }
.initiales.CLIENT { background: var(--vert-doux); color: var(--vert); }
.initiales.FOURNISSEUR { background: var(--ambre-doux); color: var(--ambre); }
.initiales.grand { width: 54px; height: 54px; border-radius: 17px; font-size: 18px; }

/* ---------- À valider : la file ---------- */
.page-validation { grid-template-columns: clamp(320px, 22vw, 420px) 1fr; } /* la liste suit la largeur de l'écran */
.file { padding: 8px 0 0 18px; }
.file-tete { padding: 4px 6px 12px 2px; }
.file-liste { gap: 6px; padding: 2px 8px 24px 2px; }
.element { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 1px 12px; align-items: start; padding: 13px 14px 14px; border-radius: 16px; }
.element .initiales { grid-row: 1 / span 3; }
.element .qui { display: block; font: 600 14px/1.35 var(--titre); letter-spacing: -.02em; }
.element .quand { font-size: 12px; line-height: 1.6; color: var(--encre-3); }
.element .apercu { grid-column: 2 / -1; font-size: 13px; line-height: 1.45; color: var(--encre-2); }
.element .nature { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.element .confie { padding: 3px 8px; border-radius: 7px; background: rgba(11, 18, 56, .06); color: var(--encre-2); font: 600 11.5px/1.5 var(--titre); }
.element:hover { background: rgba(255, 255, 255, .75); }
.element.actif { background: #fff; box-shadow: 0 0 0 1px rgba(42, 59, 216, .18), 0 20px 36px -26px rgba(42, 59, 216, .7); }
.element.actif::before { display: none; }

/* ---------- À valider : la demande ouverte ---------- */
.feuille-zone { padding: 8px 32px 28px 18px; }
.feuille { max-width: clamp(880px, 60vw, 1120px); padding: 30px 36px 0; border-radius: 22px; } /* plus large sur grand écran */
.f-tete { display: flex; align-items: center; gap: 16px; }
.f-qui { flex: 1; min-width: 0; }
.feuille .f-qui h2 { margin: 0; max-width: none; font: 700 26px/1.12 var(--titre); letter-spacing: -.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-qui p { margin: 4px 0 0; color: var(--encre-2); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; font-size: 12.5px; color: var(--encre-3); }

.f-bref { margin-top: 24px; padding: 20px 24px 22px; border-radius: 16px; background: var(--scene); }
.f-bref h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font: 600 12.5px/1.4 var(--titre); letter-spacing: -.005em; color: var(--stylo); }
.f-bref h3::before { content: ""; width: 15px; height: 15px; background: url(/logo-symbole.png) center / contain no-repeat; }
.f-resume { margin: 0; max-width: 64ch; font-size: 16.5px; line-height: 1.5; font-weight: 500; color: var(--encre); text-wrap: pretty; }
.f-bref h3.attention { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(11, 18, 56, .08); color: #94590a; }
.f-bref h3.attention::before { width: 7px; height: 7px; margin: 0 4px; border-radius: 50%; background: #e09a1a; box-shadow: 0 0 0 4px rgba(224, 154, 26, .2); }
.f-bref .vigilance { margin: 0; gap: 6px; }
.f-bref .vigilance li { position: relative; padding: 0 0 0 18px; border-radius: 0; background: none; color: var(--encre-2); font-size: 14px; line-height: 1.5; }
.f-bref .vigilance li::before { content: ""; position: absolute; left: 5px; top: .66em; width: 5px; height: 5px; border-radius: 50%; background: #e09a1a; }

.f-suite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 16px 2px 18px; font-size: 13.5px; color: var(--encre-2); }
.f-suite:empty { display: none; margin: 0 0 22px; }
.f-suite .attribution { margin: 0; }
.f-dossier strong { color: var(--encre); font-weight: 600; }
.origine { margin-bottom: 26px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(11, 18, 56, .09); }
.origine summary { padding: 13px 16px; font-family: var(--titre); font-weight: 600; font-size: 13px; color: var(--encre); }
.origine summary::after { font-weight: 600; }
.origine pre { padding: 0 16px 16px; }

.redaction-tete { margin-bottom: 10px; }
.redaction-tete h3 { font-size: 16px; font-weight: 700; }
.redaction { min-height: 236px; padding: 18px 20px; border-radius: 14px; border: 1px solid rgba(11, 18, 56, .11); background: #fff; font-size: 15px; line-height: 1.65; }
.reformuler { gap: 6px; margin-top: 12px; }
.reformuler span { margin-right: 4px; font: 600 12.5px var(--titre); color: var(--encre-3); }
.reformuler button { padding: 5px 11px; border-radius: 8px; border: none; background: rgba(11, 18, 56, .055); font: 600 12.5px var(--titre); color: var(--encre-2); }
.reformuler button:hover { background: var(--stylo-doux); color: var(--stylo); }

.fiche { margin-top: 22px; padding: 20px 22px; border: none; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(11, 18, 56, .09); }
.fiche h4 { font-size: 16px; font-weight: 700; }
.fiche .infos { margin: 14px 0 6px; padding: 14px 16px; border-radius: 12px; background: var(--scene); }
.fiche th { font-family: var(--titre); }
.fiche strong { font-family: var(--titre); font-size: 13.5px; letter-spacing: -.01em; }
.outils-feuille { margin-top: 18px; }
.barre-signature {
  margin: 26px -36px 0; padding: 14px 36px 16px; border-top: 1px solid rgba(11, 18, 56, .06); border-radius: 0 0 22px 22px;
  background: rgba(255, 255, 255, .93); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.accueil-vide .chiffres strong { font-family: var(--titre); letter-spacing: -.04em; }

/* ---------- Reçus ---------- */
.groupe { margin-bottom: 26px; }
.groupe-tete { align-items: center; gap: 9px; margin: 0 0 10px 6px; }
.groupe-tete h2 { font-size: 16px; font-weight: 700; }
.groupe-tete > span:last-child { padding: 1px 8px; border-radius: 999px; background: rgba(11, 18, 56, .06); font: 600 12px/1.6 var(--titre); color: var(--encre-2); }
.tableau-lignes { border-radius: 18px; }
.rangee { grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 14px; padding: 13px 18px; }
.rangee:hover { background: #f8f9fe; }
.r-corps { min-width: 0; }
.rangee .titre { display: flex; align-items: baseline; gap: 10px; font: 600 14.5px/1.4 var(--titre); letter-spacing: -.02em; }
.r-source { flex: none; font: 400 12.5px "Instrument Sans", sans-serif; letter-spacing: 0; color: var(--encre-3); }
.rangee .sous { margin-top: 1px; font-size: 13.5px; color: var(--encre-2); }
.deplie { padding: 6px 22px 18px 70px; background: #fafbfe; }

@media (max-width: 1100px) {
  .page-validation { grid-template-columns: 300px 1fr; }
  .feuille { padding: 24px 24px 0; }
  .barre-signature { margin: 22px -24px 0; padding: 14px 24px 16px; }
  .f-meta { display: none; }
}

.feuille-zone { padding-bottom: 0; }
.feuille { margin-bottom: 26px; }
.fiche h4 .btn { flex: none; white-space: nowrap; }


/* ---------- Contacts regroupés par entreprise ---------- */
.entreprise-groupe { grid-column: 1 / -1; background: var(--papier); border-radius: var(--r-l); padding: 18px 20px 14px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05), inset 0 0 0 1px rgba(15, 27, 45, .06); }
.entreprise-groupe > header { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center; }
.entreprise-groupe h4 { margin: 0; font-size: 16.5px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.entreprise-groupe h4 small { font-size: 11.5px; font-weight: 500; color: var(--encre-3); }
.entreprise-groupe .role { font-size: 12.5px; color: var(--encre-3); margin-top: 3px; }
.entreprise-groupe .adresse-groupe { font-size: 12.5px; color: var(--encre-3); margin-top: 2px; }
.avatar.carre { width: 46px; height: 46px; border-radius: 12px; font-size: 15px; }
.avatar.petit { width: 30px; height: 30px; font-size: 11.5px; }
.entreprise-groupe ul { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 14px; }
.entreprise-groupe li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(15, 27, 45, .025); }
.entreprise-groupe li .qui { min-width: 0; }
.entreprise-groupe li .qui b { display: block; font-size: 14px; font-weight: 600; }
.entreprise-groupe li .qui span { display: block; font-size: 12.5px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entreprise-groupe li .gestes { display: flex; gap: 4px; }
.entreprise-groupe .ajout-groupe { margin-top: 2px; }
.titre-seuls { grid-column: 1 / -1; margin: 14px 0 0; font-size: 14px; font-weight: 600; color: var(--encre-2); }
.titre-seuls small { font-weight: 500; color: var(--encre-3); margin-left: 4px; }
#vue-contacts { margin-left: auto; }
@media (max-width: 640px) { .entreprise-groupe ul { grid-template-columns: 1fr; } .entreprise-groupe li { grid-template-columns: 30px 1fr; } .entreprise-groupe li .gestes { grid-column: 2; } }

/* Glisser-déposer entre entreprises */
.entreprise-groupe li[draggable], .contact[draggable] { cursor: grab; }
.tire { opacity: .45; }
.survol-depot { outline: 2px dashed var(--stylo, #2a3bd8); outline-offset: 3px; background-color: rgba(42, 59, 216, .04); }
.vide-groupe { grid-column: 1 / -1; color: var(--encre-3); font-size: 13px; padding: 10px 12px !important; border: 1.5px dashed rgba(15, 27, 45, .14); border-radius: 10px; background: none !important; display: block !important; }
.zone-seuls { grid-column: 1 / -1; border-radius: var(--r-l); padding: 4px 2px 8px; }
.zone-seuls .grille-contacts { margin-top: 10px; }
.entreprise-groupe h4 .btn { margin-left: auto; }
#btn-nouvelle-fiche-entreprise { margin-left: 6px; }

.zone-danger { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(15, 27, 45, .08); }
.zone-danger .btn { color: var(--rouge, #c62828); }
.zone-danger .btn.rouge { font-weight: 650; }

/* ---------- Carnet d'apprentissage ---------- */
.carnet-barre { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.carnet-barre .choix-membre { min-width: 260px; margin: 0; }
.carnet-attente { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; background: #fff6e5; color: #8a5300; }
.carnet-ajout { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.carnet-ajout .champ { margin: 0; }
.carnet-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.regle { background: var(--papier); border-radius: var(--r-l); padding: 14px 16px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05), inset 0 0 0 1px rgba(15, 27, 45, .06); }
.regle.inactive { opacity: .55; }
.regle-tete { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.regle .origine { font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--brume, #eef0f6); color: var(--encre-2); }
.regle .origine.correction { background: #e8f0ff; color: #2a3bd8; }
.regle .origine.administrateur { background: #f1e9ff; color: #7a3fd0; }
.regle-texte { width: 100%; resize: vertical; font: inherit; font-size: 14.5px; padding: 8px 10px; border-radius: 9px; border: 1px solid rgba(15, 27, 45, .12); background: #fff; }
.regle-actions { display: flex; gap: 6px; margin-top: 8px; }
.regle-actions .rouge { color: var(--rouge, #c62828); }
.regle-exemple { margin-top: 8px; font-size: 13px; }
.regle-exemple .deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.regle-exemple pre { white-space: pre-wrap; font: inherit; font-size: 12.5px; background: rgba(15, 27, 45, .03); padding: 8px; border-radius: 8px; max-height: 180px; overflow: auto; }
/* Consigne libre sur une demande */
.consigne-libre { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin-top: 10px; }
.consigne-libre input[type="text"] { width: 100%; }
.consigne-libre .retenir { font-size: 12.5px; color: var(--encre-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
/* Micro */
.avec-micro { position: relative; display: flex; align-items: stretch; gap: 6px; }
.avec-micro > textarea, .avec-micro > input { flex: 1; }
.micro { border: 0; background: rgba(15, 27, 45, .05); border-radius: 9px; padding: 0 10px; cursor: pointer; font-size: 15px; }
.micro:hover { background: rgba(42, 59, 216, .12); }
.micro.ecoute { background: #ffe1e1; animation: pulse-micro 1s ease-in-out infinite; }
@keyframes pulse-micro { 50% { box-shadow: 0 0 0 4px rgba(198, 40, 40, .2); } }
#form-chat .micro { align-self: center; height: 38px; }
@media (max-width: 700px) { .carnet-ajout, .consigne-libre, .regle-exemple .deux-col { grid-template-columns: 1fr; } }

/* ---------- Barre simplifiée : 5 onglets + « Plus » ---------- */
.onglet-plus { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; border: 0; background: none; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--encre-2); cursor: pointer; white-space: nowrap; }
.onglet-plus:hover, .onglet-plus.actif { color: var(--stylo-fonce, #1f2db8); }
.onglet-plus svg { width: 16px; height: 16px; fill: currentColor; opacity: .75; flex: none; }
.onglet-plus b { background: linear-gradient(180deg, #ff6a5c, #e0402f); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 6px; line-height: 17px; min-width: 18px; text-align: center; }
.onglet-plus b:empty { display: none; }
body.nav-mini .onglet-plus span { display: none; }
.menu-plus { position: fixed; z-index: 60; width: 340px; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .97); box-shadow: 0 0 0 1px rgba(13, 21, 48, .06), 0 24px 48px -20px rgba(13, 21, 48, .45); display: grid; gap: 2px; }
.menu-plus[hidden] { display: none; }
.menu-plus a { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; color: var(--encre); text-decoration: none; }
.menu-plus a[hidden] { display: none; }
.menu-plus a:hover, .menu-plus a:focus-visible, .menu-plus a.actif { background: rgba(42, 59, 216, .07); outline: none; }
.menu-plus a svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(42, 59, 216, .08); fill: none; stroke: #2a3bd8; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.menu-plus a span { display: grid; font-weight: 600; font-size: 14px; }
.menu-plus a small { font-weight: 450; font-size: 12.5px; color: var(--encre-3); }
.menu-plus a b { background: linear-gradient(180deg, #ff6a5c, #e0402f); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.menu-plus a b:empty { display: none; }

/* ================= Devis et factures ================= */
.devis-demande { background: var(--papier); border-radius: var(--r-l); padding: 14px 16px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05), inset 0 0 0 1px rgba(15, 27, 45, .06); margin-bottom: 14px; }
.devis-demande .ligne-actions { flex-wrap: wrap; align-items: center; gap: 8px; }
.devis-demande select { height: 36px; border-radius: 10px; }
.devis-filtres { display: flex; gap: 6px; margin: 0 0 10px; }
.devis-corps { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.devis-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 70vh; overflow: auto; }
.devis-liste li[data-devis-ouvrir] { background: var(--papier); border-radius: var(--r-m); padding: 10px 12px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(15, 27, 45, .07); }
.devis-liste li[data-devis-ouvrir]:hover { box-shadow: inset 0 0 0 1px var(--stylo-doux); }
.devis-liste li.ouvert { box-shadow: inset 0 0 0 2px var(--stylo); }
.devis-liste li > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.statut-devis { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--brume); color: var(--encre-2); white-space: nowrap; }
.statut-devis.valide { background: var(--vert-doux); color: var(--vert); }
.statut-devis.exporte { background: var(--stylo-doux); color: var(--stylo-fonce); }
.a-chiffrer { color: var(--ambre); font-weight: 600; }
.devis-editeur { background: var(--papier); border-radius: var(--r-l); padding: 16px 18px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05), inset 0 0 0 1px rgba(15, 27, 45, .06); min-width: 0; }
.devis-tete { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.devis-tete h2 { margin: 0; font-size: 19px; display: flex; align-items: center; gap: 6px; }
.devis-tete .numero { font: inherit; width: 11ch; border: none; border-bottom: 1px dashed var(--trait); background: transparent; padding: 0 2px; }
.devis-verifier { background: var(--ambre-doux); border-radius: var(--r-m); padding: 8px 12px; margin-bottom: 12px; font-size: 13.5px; }
.devis-verifier ul { margin: 4px 0 0; padding-left: 18px; }
.devis-grille-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; margin-bottom: 12px; }
.devis-grille-champs .large { grid-column: 1 / -1; }
.table-defile { overflow-x: auto; }
.devis-lignes { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.devis-lignes th { text-align: left; font-weight: 600; color: var(--encre-2); padding: 6px; border-bottom: 1px solid var(--trait); }
.devis-lignes td { padding: 5px 6px; border-bottom: 1px solid rgba(15, 27, 45, .06); vertical-align: top; }
.devis-lignes .n { text-align: right; white-space: nowrap; }
.devis-lignes input, .devis-lignes textarea, .devis-lignes select { width: 100%; font: inherit; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--trait); background: #fff; }
.devis-lignes:not(.grille) { table-layout: fixed; }
.devis-lignes:not(.grille) th:nth-child(1) { width: 88px; } .devis-lignes:not(.grille) th:nth-child(2) { width: auto; }
.devis-lignes:not(.grille) th:nth-child(3), .devis-lignes:not(.grille) th:nth-child(6) { width: 58px; }
.devis-lignes:not(.grille) th:nth-child(4) { width: 84px; } .devis-lignes:not(.grille) th:nth-child(5) { width: 92px; }
.devis-lignes:not(.grille) th:nth-child(7) { width: 92px; } .devis-lignes:not(.grille) th:nth-child(8) { width: 104px; }
.devis-lignes td:nth-child(8) { white-space: nowrap; }
.devis-lignes input.manque { border-color: var(--ambre); background: var(--ambre-doux); }
.devis-lignes textarea { resize: vertical; min-height: 36px; }
.origine-prix { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--brume); color: var(--encre-2); margin-right: 4px; }
.origine-prix.grille { background: var(--vert-doux); color: var(--vert); }
.origine-prix.precedent { background: var(--stylo-doux); color: var(--stylo-fonce); }
.origine-prix.a_chiffrer { background: var(--ambre-doux); color: var(--ambre); }
.choix-tarif { min-width: 280px; height: 32px; border-radius: 10px; border: 1px solid var(--trait); padding: 0 10px; }
.devis-totaux { margin: 12px 0 0 auto; max-width: 320px; display: grid; gap: 4px; font-size: 14px; }
.devis-totaux > div { display: flex; justify-content: space-between; gap: 12px; }
.devis-totaux .ttc { border-top: 2px solid var(--encre); padding-top: 4px; font-size: 15px; }
.devis-actions { flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: flex-start; }
.devis-reglages { margin-top: 18px; }
.devis-reglages summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.devis-reglages summary h3 { margin: 0; display: inline; }
.devis-reglages h4 { margin: 16px 0 6px; }
.colonne-export { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; max-width: 560px; }
.colonne-export select, .colonne-export input { flex: 1; height: 32px; border-radius: 8px; border: 1px solid var(--trait); padding: 0 8px; font: inherit; }
.devis-lignes.grille { min-width: 520px; margin-top: 8px; }
@media (max-width: 1100px) { .devis-corps { grid-template-columns: 1fr; } .devis-liste { max-height: none; } }

/* ================= Parcours des rendez-vous et fiche contact (comme sur la démonstration du site) ================= */
/* Rendez-vous proposé dans la réponse */
.rdv-propose { margin: 14px 0 4px; padding: 14px 16px; border-radius: var(--r-m); background: var(--stylo-doux); box-shadow: inset 0 0 0 1px rgba(42, 59, 216, .18); }
.rdv-propose .rp-tete { display: flex; align-items: center; gap: 8px; }
.rdv-propose .rp-tete svg { width: 18px; height: 18px; fill: none; stroke: var(--stylo); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rdv-propose h3 { margin: 0; font-size: 14px; color: var(--stylo-fonce); }
.rdv-propose dl { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 8px; margin: 10px 0; }
.rdv-propose dl div { padding: 8px 10px; border-radius: var(--r-s); background: var(--papier); }
.rdv-propose dt { font-size: 11.5px; color: #64708a; }
.rdv-propose dd { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }
.rdv-propose .case { font-size: 13px; }
@media (max-width: 700px) { .rdv-propose dl { grid-template-columns: 1fr; } }

/* États d'un rendez-vous */
.etat-rdv { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 600; background: var(--brume); color: #46536a; white-space: nowrap; }
.etat-rdv::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etat-rdv.attente { background: var(--ambre-doux); color: var(--ambre); }
.etat-rdv.confirme { background: var(--stylo-doux); color: var(--stylo); }
.etat-rdv.a_replanifier { background: var(--rouge-doux); color: var(--rouge); }
.etat-rdv.fait { background: var(--vert-doux); color: var(--vert); }
.etat-rdv.annule { background: var(--brume); color: #7b8597; text-decoration: line-through; }
.evenement .etat-mini { display: block; font-style: normal; font-size: 10.5px; font-weight: 600; opacity: .85; }
.evenement.etat-attente { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .35) 6px 12px); }
.evenement.etat-a_replanifier { outline: 2px dashed var(--rouge); outline-offset: -2px; }
.evenement.etat-annule { opacity: .45; }
.evenement.etat-annule strong { text-decoration: line-through; }
.evenement.etat-fait { opacity: .7; }

/* Parcours dans la fenêtre d'un rendez-vous */
.parcours-rdv { margin: 12px 0; padding: 12px 14px; border-radius: var(--r-m); background: #f7f8fb; box-shadow: inset 0 0 0 1px var(--trait); }
.parcours-rdv .pr-tete { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13.5px; }
.pr-etapes { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--trait); display: grid; gap: 7px; }
.pr-etapes li { position: relative; display: grid; font-size: 12.5px; }
.pr-etapes li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--stylo); box-shadow: 0 0 0 3px #f7f8fb; }
.pr-etapes li.attente::before { background: var(--ambre); } .pr-etapes li.fait::before { background: var(--vert); } .pr-etapes li.a_replanifier::before, .pr-etapes li.annule::before { background: var(--rouge); }
.pr-etapes span { color: #64708a; }
.pr-cr { margin: 10px 0 0; font-size: 13px; } .pr-cr b { display: block; font-size: 12px; color: #64708a; }
.pr-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Fiche contact */
.fiche-contact { display: grid; gap: 16px; min-width: 0; }
#modale:has(.fiche-contact) { width: min(860px, 94vw); max-width: 94vw; }
#modale:has(.fiche-contact) #modale-form { overflow-x: hidden; }
.fc-tete { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; }
.fc-tete .avatar { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
.fc-tete h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.fc-tete p { margin: 4px 0 0; color: #64708a; font-size: 13.5px; }
.fc-chiffres { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.fc-chiffres li { display: grid; justify-items: center; min-width: 74px; padding: 8px 10px; border-radius: var(--r-m); background: var(--brume); font-size: 11.5px; color: #64708a; }
.fc-chiffres b { font-size: 19px; color: var(--encre); }
.fc-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.fc-champs div { padding: 10px 12px; border-radius: var(--r-s); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait); }
.fc-champs dt { font-size: 11.5px; color: #64708a; }
.fc-champs dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.fc-champs a { color: var(--stylo); text-decoration: none; }
.fc-prochain { display: grid; gap: 3px; padding: 14px 16px; border-radius: var(--r-m); background: var(--stylo); color: #fff; }
.fc-prochain .fc-lib { font-size: 12px; opacity: .85; }
.fc-prochain b { font-size: 16px; }
.fc-prochain span { font-size: 13.5px; opacity: .92; }
.fc-prochain .etat-rdv { justify-self: start; margin-top: 4px; background: rgba(255, 255, 255, .18); color: #fff; }
.fc-titre { margin: 4px 0 0; font-size: 15px; }
.fc-parcours { list-style: none; margin: 0 0 0 6px; padding: 0 0 0 18px; border-left: 2px solid var(--trait); display: grid; gap: 12px; }
.fc-parcours li { position: relative; display: grid; grid-template-columns: 118px 1fr; gap: 10px; font-size: 13px; }
.fc-parcours li::before { content: ""; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--stylo); box-shadow: 0 0 0 3px var(--papier); }
.fc-parcours li.fc-rdv::before { border-radius: 3px; }
.fc-parcours li.fc-rdv.a-venir::before { background: var(--papier); box-shadow: inset 0 0 0 2px var(--stylo), 0 0 0 3px var(--papier); }
.fc-parcours li.echange::before { background: #b6bfce; }
.fc-parcours li.fc-devis::before { background: var(--ambre); }
.fc-parcours time { color: #64708a; font-size: 12px; }
.fc-parcours b { display: block; font-weight: 600; }
.fc-parcours span { display: block; color: #64708a; font-size: 12px; }
.fc-parcours i { margin-top: 5px; }
.statut-demande { display: inline-block; padding: 1px 8px; border-radius: 6px; font-style: normal; font-size: 11.5px; background: var(--brume); color: #46536a; }
.statut-demande.validee { background: var(--vert-doux); color: var(--vert); } .statut-demande.en_attente { background: var(--ambre-doux); color: var(--ambre); }
.fc-resultat, .fc-cr { margin: 4px 0 0; color: #46536a; font-size: 12.5px; }
.fc-gestes { display: flex; gap: 8px; justify-content: flex-start; }
.contact[data-id], .entreprise-groupe li[data-id] { cursor: pointer; }
@media (max-width: 700px) { .fc-tete { grid-template-columns: 44px 1fr; } .fc-chiffres { grid-column: 1 / -1; } .fc-champs { grid-template-columns: 1fr; } .fc-parcours li { grid-template-columns: 1fr; gap: 2px; } }

/* Boîtes e-mail supplémentaires (ex. une par master) */
.filtre-boite { width: 100%; margin-top: 8px; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--trait); background: var(--papier); color: var(--encre); }
.confie.boite { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Profil Université : pas de devis ni de fiche de chiffrage */
body.profil-universite a[data-page="devis"],
body.profil-universite [data-outil="fiche"],
body.profil-universite [data-outil="copier-fiche"],
body.profil-universite [data-outil="devis"],
body.profil-universite [data-outil="voir-devis"] { display: none !important; }

/* Bilan de l'IA après import des boîtes */
.bilan-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.bilan-colonnes section { border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; background: var(--papier); }
.bilan-colonnes h3 { font-size: 14px; margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; }
.bilan-colonnes h3 span { font-weight: 500; opacity: .75; }
.bilan-colonnes ul { margin: 0; padding-left: 16px; font-size: 13px; }
.bilan-colonnes li { margin-bottom: 8px; }
.bilan-colonnes .part { font-size: 12px; opacity: .7; }
.bilan-ok { border-top: 3px solid var(--vert) !important; }
.bilan-moyen { border-top: 3px solid var(--ambre) !important; }
.bilan-non { border-top: 3px solid var(--rouge) !important; }

/* Profil Université : le calendrier est par master, sans congés/absences ni agenda relié d'employé */
body.profil-universite #btn-absences,
body.profil-universite #btn-agenda-relie,
body.profil-universite #bloc-absences { display: none !important; }
