/* Elevora CRM — css/espace-agent.css
   L'espace partenaire des agents (29/09/2026, brief « Nouvelles fonctionnalités », partie 1) :
   côté agent (js/60) et côté équipe (js/60b). Les briques du CRM d'abord — .agt-* (css/agents.css),
   .rel-resume (css/releves.css), .pr-* et .ag-* (css/elevora.css), les onglets .tk-onglet
   (css/taches.css) ; ce fichier n'ajoute que ce qui leur manque. Les couleurs viennent des jetons
   de css/elevora.css, justes dans les deux thèmes ; aucun liseré épais sur un côté, aucune animation. */

/* ── Le menu ─────────────────────────────────────────────────────────────────────────────
   Les entrées de l'espace partenaire (ajoutées par js/60) ne s'affichent que pour un agent. La
   règle de css/elevora.css qui réduit son menu à Pipeline et Mes relevés les masquerait aussi :
   celle-ci, plus précise, les rend visibles. Contrat pas encore signé : seul l'écran de
   signature existe, le menu de l'espace s'efface. */
body:not(.espace-agent) .nav-agent{display:none!important}
body.espace-agent .nav-group-body > .nav-i.nav-agent:not(#ea-_):not(#ea-__){display:flex!important}
body.espace-agent.ea-contrat-bloque .nav-group-body > .nav-i.nav-agent:not(#ea-_):not(#ea-__),
body.espace-agent.ea-contrat-bloque #nav-pipeline,
body.espace-agent.ea-contrat-bloque #nav-releves{display:none!important}
.nav-agent .nav-b[hidden]{display:none}

/* ── Les pages ───────────────────────────────────────────────────────────────────────────── */
.ea-page{display:flex;flex-direction:column;gap:var(--s4);min-width:0}
.ea-tete{display:flex;flex-direction:column;gap:4px}
.ea-tete .adm-h{margin:0}
.ea-tete .pr-note{margin:0;max-width:78ch;font-size:13px;color:var(--text2)}
.ea-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:10px 0 0}
.ea-actions:first-child{margin-top:0}
.ea-bloc{display:flex;flex-direction:column;gap:10px;padding:var(--s4) var(--s5);background:var(--bg2);border:1px solid var(--border);border-radius:var(--rl);min-width:0}
.ea-bloc > .agt-h3{margin:0}
.ea-bloc > .pr-note{margin:0}
.ea-leger{color:var(--text3);font-weight:500}
.ea-err{min-height:1.2em;font-size:12.5px;color:var(--red)}
.ea-err:empty{min-height:0}
.agt-kpi dd .ea-kpi-note{display:block;margin:4px 0 0;font:500 11.5px/1.4 var(--font);letter-spacing:0;white-space:normal;color:var(--text3)}
.ea-kpi-pied{margin:0}
.agt-kpis + .ea-kpi-pied{margin-top:var(--s3)}
.ea-liste-simple{margin:0;padding-left:1.2em;display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--text2)}
.ea-compte{margin:0;font-size:12.5px;color:var(--text3)}

/* L'attente : contrat pas encore prêt, espace en préparation. */
.ea-attente{padding:var(--s4) var(--s5);background:var(--bg2);border:1px solid var(--border2);border-radius:var(--rl);font-size:13.5px;line-height:1.55;color:var(--text2);max-width:78ch}
.ea-attente p{margin:0 0 6px}
.ea-attente p:last-child{margin:0}
.ea-attente b{color:var(--text)}

/* « À faire » de la vue d'ensemble : une liste de liens, chacun une cible confortable. */
.ea-carte .ag-champ{max-width:680px}
.ea-a-faire ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ea-a-faire li{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:44px;padding:6px 0;border-top:1px solid var(--border);font-size:13px;color:var(--text2)}
.ea-a-faire li:first-child{border-top:0}
.ea-a-faire .pr-lien{margin-top:0;font-size:12.5px}

/* Le comparatif : l'agent face à la moyenne des agents actifs. */
.ea-cmp td,.ea-cmp th{white-space:nowrap}

/* ── Le contrat et sa signature ─────────────────────────────────────────────────────────── */
.ea-contrat-texte{max-height:52vh;overflow:auto;padding:var(--s4);background:var(--bg);border:1px solid var(--border2);border-radius:var(--r);font-size:13.5px;line-height:1.65;color:var(--text);overflow-wrap:anywhere}
.ea-contrat-texte:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ea-contrat-texte h2,.ea-contrat-texte h3,.ea-contrat-texte h4{font:600 14px var(--font-display);margin:1.1em 0 .4em;color:var(--text)}
.ea-contrat-texte > :first-child{margin-top:0}
.ea-contrat-texte p{margin:0 0 .8em}
.ea-contrat-court{max-height:30vh}
.ea-coche{display:flex;align-items:flex-start;gap:10px;min-height:44px;padding:8px 0;font-size:13.5px;color:var(--text);cursor:pointer}
.ea-coche input{width:18px;height:18px;margin:2px 0 0;flex:none;accent-color:var(--accent)}
/* Le cadre de signature : une feuille blanche dans les deux thèmes, comme le papier signé ; le trait
   est foncé (#1A1A2E, 16:1 sur blanc). Le contour se voit sur les deux fonds. */
.ea-sig-cadre{position:relative;height:190px;max-width:560px;background:#fff;border:1px solid var(--border-input);border-radius:var(--r);overflow:hidden}
.ea-sig-cadre canvas{display:block;width:100%;height:100%;cursor:crosshair}
/* « Signez ici » : sur la feuille blanche des deux thèmes, donc une encre foncée (#4A4A5E, 8,4:1 sur blanc). */
.ea-sig-ph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:13px;color:#4A4A5E;pointer-events:none}
.ea-sig-ph[hidden]{display:none}
.ea-sig-cadre:focus-within{outline:2px solid var(--accent);outline-offset:2px}

/* ── La lecture et la signature du contrat (V18, 05/10/2026) ────────────────────────────────
   Des cartes sobres du système (--bg2, bordure fine, --rl), aucune ombre, aucun dégradé : un en-tête
   avec les trois étapes, puis l'aperçu du PDF et la signature côte à côte dès 1100 px (l'un sous
   l'autre en dessous). Les paragraphes gardent une largeur de lecture, les cartes occupent toute la
   largeur utile. */
.ec-carte{display:flex;flex-direction:column;gap:var(--s3);padding:var(--s5);background:var(--bg2);border:1px solid var(--border);border-radius:var(--rl);min-width:0}
.ec-carte p{margin:0;font-size:13.5px;line-height:1.6;color:var(--text2);max-width:72ch}
.ec-titre{margin:0;font:600 17px/1.3 var(--font-display);color:var(--text)}
.ec-sous{margin:0;font:600 15px/1.3 var(--font-display);color:var(--text)}
.ec-sous2{margin-top:var(--s3)}
.ec-ico{flex:none;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:var(--r);background:var(--bg3);color:var(--text2)}
.ec-ico-ok{background:var(--green-bg);color:var(--green)}
.ec-corps{display:flex;flex-direction:column;gap:var(--s2);min-width:0;flex:1 1 auto}
.ec-meta{font-size:12.5px!important;color:var(--text2)!important;overflow-wrap:anywhere}
.ec-resume-haut{display:flex;align-items:flex-start;gap:var(--s4)}
.ec-resume-haut .elv-badge{flex:none;margin-left:auto}
/* Les trois étapes : un numéro encadré (pas un aplat), un verbe, une phrase. */
.ec-etapes{list-style:none;margin:var(--s2) 0 0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s3) var(--s5)}
.ec-etape{display:flex;align-items:flex-start;gap:var(--s3);padding-top:var(--s3);border-top:1px solid var(--border)}
.ec-etape > div{display:flex;flex-direction:column;gap:2px;min-width:0}
.ec-etape b{font-size:13.5px;color:var(--text)}
.ec-etape div span:not(.sr-only){font-size:13px;line-height:1.5;color:var(--text2)}
.ec-num{flex:none;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:1.5px solid var(--accent);border-radius:50%;font:600 13px var(--font);color:var(--accent)}
/* Rien de déposé / contrat signé : l'icône à gauche, le texte à sa droite. */
.ec-attente{flex-direction:row;align-items:flex-start;gap:var(--s4)}
.ec-attente .ec-etapes{margin-top:var(--s3)}
.ec-attente .ea-actions{margin-top:var(--s3)}
.ec-live{min-height:1.4em;font-size:13px!important;color:var(--text)!important}
.ec-live:empty{min-height:0}
.ec-versions{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ec-versions li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--s2) var(--s4);min-height:44px;padding:var(--s2) 0;border-top:1px solid var(--border);font-size:13px;color:var(--text2)}
.ec-versions li:first-child{border-top:0}
/* L'aperçu et la signature. */
.ec-grille{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s4);align-items:start}
.ec-carte-tete{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--s2) var(--s4)}
.ec-carte-tete .ea-actions{margin:0}
.ec-cadre{position:relative;height:75vh;min-height:480px;border:1px solid var(--border2);border-radius:var(--r);background:var(--bg3);overflow:hidden}
.ec-pdf{display:block;width:100%;height:100%;border:0;background:#fff}
.ec-etat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--s3);height:100%;padding:var(--s5);text-align:center;font-size:13.5px;color:var(--text2)}
.ec-etat p{max-width:46ch}
.ec-etat b{color:var(--text)}
.ec-repli{font-size:12.5px!important}
.ec-apercu .ea-contrat-texte{max-height:75vh;min-height:240px}
.ec-apercu .ea-contrat-court{min-height:0}
.ec-signature .ag-champ{max-width:none}
.ec-signature .ea-sig-cadre{max-width:none}
.ec-carte a.btn{text-decoration:none}
.ec-valider{margin-top:var(--s2)}
.ec-valider .btn{flex:1 1 auto;justify-content:center}
@media (min-width:1100px){
  .ec-grille{grid-template-columns:minmax(0,1fr) minmax(360px,440px)}
}
/* La signature suit la lecture à l'écran tant que sa hauteur y tient (sinon son bas serait hors d'atteinte). */
@media (min-width:1100px) and (min-height:820px){
  .ec-signature{position:sticky;top:calc(64px + var(--s4))}
}
@media (max-width:900px){
  .ec-etapes{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:640px){
  .ec-carte{padding:var(--s4)}
  .ec-resume-haut{flex-direction:column;gap:var(--s2)}
  .ec-resume-haut .ec-ico{display:none}
  .ec-resume-haut .elv-badge{margin-left:0;order:-1;width:max-content}
  .ec-attente{flex-direction:column}
  .ec-cadre{height:70vh;min-height:480px}
  .ec-carte-tete .ea-actions{width:100%}
  .ec-carte-tete .ea-actions .btn{flex:1 1 100%;justify-content:center}
  .ec-signature .ea-actions .btn{flex:1 1 auto;justify-content:center}
  .ec-attente .ea-actions .btn,.ec-signe .ea-actions .btn{flex:1 1 100%;justify-content:center}
}

/* ── Les prospects de l'agent, la liste « Prospects » de l'équipe ─────────────────────────── */
.ea-filtres{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end}
.ea-filtres .ag-champ{flex:1 1 180px;min-width:0;max-width:320px}
.ea-filtres .ag-champ-coche{flex:0 1 auto;min-height:44px;display:flex;align-items:flex-end}
.ea-table th[scope="row"] .agt-contact{display:block}
.ea-table .agt-nom{text-align:left}

/* ── Documents ───────────────────────────────────────────────────────────────────────────── */
.ea-docs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--rl);background:var(--bg2);overflow:hidden}
.ea-doc{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:12px 16px;border-top:1px solid var(--border)}
.ea-doc:first-child{border-top:0}
.ea-doc-txt{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 260px;overflow-wrap:anywhere}
.ea-doc-act{display:flex;flex-wrap:wrap;gap:8px}
.ea-depot{display:flex;flex-direction:column;gap:10px}
.ea-depot .ag-champ{max-width:520px}
/* Le champ de fichier est masqué (.sr-only) derrière son libellé-bouton : le focus clavier se voit
   sur le bouton. */
.ea-depot:focus-within > label.btn{outline:2px solid var(--accent);outline-offset:2px}
.ea-depot > label.btn{align-self:flex-start;min-height:36px;cursor:pointer}

/* ── Notifications ───────────────────────────────────────────────────────────────────────── */
.ea-notifs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--rl);background:var(--bg2);overflow:hidden}
.ea-notif{display:flex;gap:12px;align-items:flex-start;padding:12px 16px;border-top:1px solid var(--border)}
.ea-notif:first-child{border-top:0}
.ea-notif-txt{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1 1 auto;overflow-wrap:anywhere}
.ea-notif-t{font-size:13.5px;color:var(--text)}
.ea-notif-c{font-size:12.5px;line-height:1.5;color:var(--text2)}
/* Non lue : un point et un titre en gras (la forme, pas seulement la couleur). */
.ea-point{display:inline-block;width:8px;height:8px;margin:0 8px 0 0;vertical-align:.1em;border-radius:50%;background:transparent}
.ea-non-lue .ea-point{background:var(--accent)}
.ea-non-lue .ea-notif-t{font-weight:700}
.ea-notif .pr-lien{margin-top:2px;font-size:12.5px;align-self:flex-start}

/* ── Côté équipe : la fiche d'un agent ────────────────────────────────────────────────────── */
.ea-fiche .rel-resume .ea-large{grid-column:1 / -1}
.ea-pre{white-space:pre-wrap}
.ea-h4{margin:18px 0 8px;font:600 13.5px var(--font);color:var(--text)}
.ea-etapes{margin:8px 0 0}
.ea-fiche .rel-resume{margin-bottom:0}
.ea-fiche .ea-actions{margin:10px 0 0}
.ea-fiche .agt-kpis + .ea-kpi-pied{margin-top:var(--s3)}
.ea-journal{margin-top:16px}
.ea-journal-liste{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;max-height:420px;overflow:auto}
.ea-journal-liste li{display:flex;flex-wrap:wrap;gap:2px 10px;align-items:baseline;padding:7px 0;border-top:1px solid var(--border);font-size:12.5px}
.ea-journal-liste li:first-child{border-top:0}
.ea-journal-date{font-family:var(--mono);font-size:11.5px;color:var(--text3);min-width:128px}

/* La page des agents : réglages de l'espace. */
.ea-page-agents{display:flex;flex-direction:column;gap:var(--s4)}
.ea-reglage{display:flex;flex-direction:column;gap:6px;padding:12px 0;border-top:1px solid var(--border)}
.ea-reglage:first-child{border-top:0;padding-top:0}
.ea-reglage .agt-fort{margin:0}
.ea-reglage > .btn{align-self:flex-start}
#ae-cmp .agt-sous{margin:0 0 10px}
.ea-reglage .pr-note,.ea-reglage .pr-alerte{margin:0;max-width:78ch}
.ea-ligne{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

/* ── « Prospects / Clients » ─────────────────────────────────────────────────────────────── */
.pcl-onglets{margin-bottom:var(--s4)}
.pcl-panel{display:flex;flex-direction:column;gap:var(--s4)}
.pcl-panel[hidden],#pcl-panel-clients[hidden]{display:none}
.pcl-tete{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:10px 16px}
.pcl-tete .pr-note,.pcl-tete .agt-h3{margin:0;max-width:78ch}
.ea-alertes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.ea-alerte{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border:1px solid var(--border2);border-radius:var(--r);background:var(--bg)}
.ea-alerte-t{margin:0;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;font-size:13px}
.ea-alerte p{margin:0}
.ea-alerte .ea-actions{margin-top:4px}

/* ── La porte d'entrée « Espace partenaire » (écran de connexion) ───────────────────────── */
#ea-porte-bascule{min-height:44px}

/* ── Petits écrans : rien ne déborde à 320 px ───────────────────────────────────────────── */
@media (max-width:640px){
  .ea-bloc{padding:var(--s3) var(--s4)}
  .ea-contrat-texte{max-height:60vh;padding:var(--s3)}
  .ea-sig-cadre{height:170px}
  .ea-filtres .ag-champ{flex:1 1 100%;max-width:none}
  .ea-doc,.ea-notif{padding:12px}
  .ea-doc-act{width:100%}
  .ea-journal-date{min-width:0;width:100%}
  .ea-cmp td,.ea-cmp th{white-space:normal}
}

/* [LD] 03/10/2026 (modification 13, §3) : le bandeau d'une fiche reprise par Elevora. */
.ea-bandeau-reprise{margin:0 0 12px;padding:10px 12px;border-radius:var(--r);background:var(--blue-bg);color:var(--text);font-size:14px;line-height:1.5}
