/* Thème : clair par défaut ; « sombre » ou « auto » (suit le système) via l'attribut data-theme posé sur <html>
   par le bouton de la barre (mémorisé dans le navigateur). */
:root {
  --fond: #f5f6f8; --carte: #fff; --texte: #1d2330; --muet: #6b7385; --bord: #e2e5eb;
  --accent: #0a66c2; --accent-fonce: #084d92; --vert: #1f8a4c; --rouge: #c0392b; --orange: #c77c02;
  --rayon: 12px; --ombre: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --bulle-envoye: #e3edf9; --bulle-note: #fff8e6; --partage-fond: #e3edf9; --partage-texte: #1d5ba3;
  --t-prospect: #1d5ba3; --t-client: #17693a; --t-candidat: #8a4dbd; --t-partenaire: #8a5a00; --t-interne: #6b7385;
}
:root[data-theme="sombre"] {
  --fond: #14171d; --carte: #1c2029; --texte: #e6e8ee; --muet: #9098aa; --bord: #2d3340;
  --accent: #4c9ee8; --accent-fonce: #6fb2ee; --ombre: none;
  --bulle-envoye: #1f3450; --bulle-note: #3a3220; --partage-fond: #1f3550; --partage-texte: #9cc4f0;
  --t-prospect: #6fb2ee; --t-client: #5cc98a; --t-candidat: #c49bea; --t-partenaire: #e0b04f;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --fond: #14171d; --carte: #1c2029; --texte: #e6e8ee; --muet: #9098aa; --bord: #2d3340;
    --accent: #4c9ee8; --accent-fonce: #6fb2ee; --ombre: none;
    --bulle-envoye: #1f3450; --bulle-note: #3a3220; --partage-fond: #1f3550; --partage-texte: #9cc4f0;
    --t-prospect: #6fb2ee; --t-client: #5cc98a; --t-candidat: #c49bea; --t-partenaire: #e0b04f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
h1 small, h2 small { font-weight: 400; color: var(--muet); font-size: .8rem; }
h3 { font-size: .9rem; margin: 1rem 0 .3rem; }
code { background: var(--fond); padding: 0 .3em; border-radius: 4px; }

.barre { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: var(--carte);
         border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.marque { display: flex; align-items: center; } .marque img { height: 30px; width: auto; display: block; }
.logo-connexion { display: block; margin: 0 auto .75rem; border-radius: 14px; }
nav { display: flex; gap: .3rem; }
nav a { color: var(--muet); padding: .35rem .7rem; border-radius: 6px; }
nav a.actif, nav a:hover { color: var(--texte); background: var(--fond); }
.recherche { margin-left: auto; }
main { max-width: 1150px; margin: 0 auto; padding: 1.5rem; }

input, select, textarea { font: inherit; color: var(--texte); background: var(--carte); border: 1px solid var(--bord);
  border-radius: 7px; padding: .45rem .6rem; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muet); }
label small { font-size: .75rem; }

.bouton { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 7px; padding: .5rem 1rem;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.bouton:hover { background: var(--accent-fonce); }
.bouton:disabled { opacity: .5; cursor: default; }
.bouton.secondaire { background: transparent; color: var(--texte); border: 1px solid var(--bord); }
.bouton.secondaire:hover { background: var(--fond); }
.bouton.vert { background: var(--vert); }
.lien { background: none; border: 0; color: var(--muet); cursor: pointer; font: inherit; padding: 0 .2rem; }
.lien.danger { color: var(--rouge); font-size: .85rem; margin-top: .5rem; }
.puce { display: inline-block; font-size: .8rem; border: 1px solid var(--bord); border-radius: 99px; padding: .1rem .6rem;
  background: var(--carte); color: var(--texte); cursor: pointer; margin: 0 .2rem .2rem 0; }
.puce:hover { border-color: var(--accent); }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sous-titre { margin: 0; color: var(--muet); }
.actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .8rem; }
.entete .actions { margin-top: 0; }
.actions.gauche { justify-content: flex-start; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.grille .large { grid-column: 1 / -1; }
.formulaire h2 { margin-top: .5rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stats div { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; }
.stats b { display: block; font-size: 1.6rem; }
.stats span { color: var(--muet); font-size: .85rem; }

.ligne { display: grid; grid-template-columns: 1fr auto 8.5rem; align-items: center; gap: .8rem; padding: .55rem .4rem;
  border-top: 1px solid var(--bord); color: var(--texte); }
.ligne:first-of-type { border-top: 0; }
.ligne:hover { background: var(--fond); }
.qui small { display: block; color: var(--muet); }
.date { text-align: right; font-size: .85rem; color: var(--muet); }
.vide { color: var(--muet); margin: 0; }
.muet { color: var(--muet); font-size: .85rem; }
.retard { color: var(--rouge); font-weight: 600; }
.jour { color: var(--orange); font-weight: 600; }
.repartition { display: flex; flex-wrap: wrap; gap: .5rem; }
.repartition a { border: 1px solid var(--bord); border-radius: 7px; padding: .3rem .7rem; color: var(--texte); }

.prio { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: .75rem; font-weight: 700; }
.p-A { background: #fde2e0; color: #a8281b; } .p-B { background: #e3edf9; color: #1d5ba3; } .p-C { background: #eceef2; color: #5d6474; }
.badge { font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: #eceef2; color: #4a5162; white-space: nowrap; }
.s-a-contacter { background: #fff1d6; color: #8a5a00; }
.s-en-discussion { background: #e3edf9; color: #1d5ba3; }
.s-client { background: #dcf3e5; color: #17693a; }
.s-partenaire { background: #efe4fb; color: #6a3aa8; }
.s-ne-plus-contacter { background: #fde2e0; color: #a8281b; }

.filtres { display: flex; gap: .5rem; margin-bottom: 1rem; }
.filtres input { flex: 1; } .filtres select { width: auto; }
.tableau { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muet); font-weight: 600; padding: .7rem .8rem; }
td { padding: .6rem .8rem; border-top: 1px solid var(--bord); vertical-align: middle; }
td small { color: var(--muet); }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--fond); }
.li { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 5px; background: #0a66c2; color: #fff; font-weight: 700; font-size: .8rem; }

.colonnes { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.redaction textarea[name=message] { font-size: .95rem; line-height: 1.55; }
.redaction > label { margin-top: 1rem; }
.etat { margin-left: .8rem; font-size: .85rem; color: var(--vert); }
.etat.erreur { color: var(--rouge); }
.infos dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem .8rem; margin: 0; font-size: .9rem; }
.infos dt { color: var(--muet); }
.infos dd { margin: 0; }
.reporter { margin-top: .9rem; font-size: .85rem; color: var(--muet); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.texte { white-space: pre-wrap; overflow-wrap: anywhere; }

.ajout summary { cursor: pointer; color: var(--accent); margin-bottom: .6rem; }
.ajout form { padding: .8rem 0 1rem; border-bottom: 1px solid var(--bord); margin-bottom: 1rem; }
.fil { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .7rem; }
.fil li { padding: .7rem .9rem; border-radius: 10px; max-width: 85%; }
.fil li.envoye { background: var(--bulle-envoye); align-self: flex-end; }
.fil li.recu { background: var(--fond); border: 1px solid var(--bord); align-self: flex-start; }
.fil li.note { background: var(--bulle-note); align-self: center; max-width: 95%; font-size: .9rem; }
.fil .meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muet); margin-bottom: .2rem; }
.fil .meta form { display: inline; }

.type { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 5px; white-space: nowrap;
  border: 1px solid currentColor; }
.t-prospect { color: var(--t-prospect); } .t-client { color: var(--t-client); } .t-candidat { color: var(--t-candidat); }
.t-partenaire { color: var(--t-partenaire); } .t-interne { color: var(--t-interne); }
select.choix { width: auto; appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit;
  font-size: .72rem; font-weight: 700; padding: .12rem 1.2rem .12rem .5rem; border-radius: 5px; line-height: 1.4;
  background-repeat: no-repeat; background-position: right .35rem center; background-size: .5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E"); }
select.choix.type { background-color: transparent; }
select.choix.badge { border: 0; border-radius: 99px; padding-left: .6rem; }
select.choix:hover { filter: brightness(1.1); outline: 1px solid var(--accent); }
select.choix option { color: var(--texte); background: var(--carte); font-weight: 400; }
.pastilles { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.chaleur b { font-size: .75rem; margin-left: .35rem; color: var(--texte); }
.onglets { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .8rem; border-bottom: 1px solid var(--bord); }
.onglets a { padding: .45rem .8rem; color: var(--muet); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets a.actif { color: var(--texte); border-bottom-color: var(--accent); font-weight: 600; }
.onglets a small { color: var(--muet); font-weight: 400; margin-left: .2rem; }
.entete .pastilles { margin-top: .4rem; }
.chaleur { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: .3rem; }
.chaleur i { width: 7px; height: 7px; border-radius: 50%; background: var(--bord); }
.chaleur i.on { background: var(--orange); }
.chaleur.c5 i.on, .chaleur.c4 i.on { background: #d9480f; }
.qui small.resume { color: var(--texte); opacity: .75; font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.relation .categorie { font-weight: 600; }
.relation p { margin: .4rem 0; font-size: .9rem; }
.infos-acces { display: grid; grid-template-columns: 220px 1fr; gap: .6rem 1rem; margin: 0; font-size: .9rem; }
.infos-acces dt { color: var(--muet); }
.infos-acces dd { margin: 0; }
@media (max-width: 820px) { .infos-acces { grid-template-columns: 1fr; } }
.connexion { max-width: 380px; margin: 4rem auto; }
.jeton { font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-all; }
.groupes { display: flex; gap: .5rem; flex-wrap: wrap; padding-bottom: .8rem; border-bottom: 1px solid var(--bord); margin-bottom: .2rem; }
.bouton.rouge { background: var(--rouge); }
.valider { border-color: var(--orange); }
.alerte-ligne { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0;
  border-top: 1px solid var(--bord); flex-wrap: wrap; }
.alerte-ligne:first-of-type { border-top: 0; }
.alerte-ligne .qui { color: var(--texte); flex: 1; min-width: 240px; }
.alerte-ligne form { display: flex; gap: .4rem; flex-wrap: wrap; }
.avertissement { background: #fff1d6; color: #7a4f00; padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.avertissement form { display: inline-flex; gap: .4rem; margin-left: .5rem; }
.alerte, .succes { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.alerte { background: #fde2e0; color: #8f2317; }
.succes { background: #dcf3e5; color: #17693a; }
.aide ol { padding-left: 1.2rem; }

@media (max-width: 820px) {
  .colonnes { grid-template-columns: 1fr; }
  .barre { padding: .6rem 1rem; gap: .6rem; } .marque img { height: 24px; }
  .recherche { margin-left: 0; width: 100%; }
  main { padding: 1rem; }
  .ligne { grid-template-columns: 1fr auto; } .ligne .reporter { display: none; }
  .ligne .date { display: none; }
  .fil li { max-width: 100%; }
}

/* Menus-pastilles (type, étape) : toujours compacts, jamais étirés par la règle générale des champs */
.pastilles { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.pastilles select.choix, td select.choix { flex: 0 0 auto; width: auto; min-width: 0; max-width: 11rem; height: auto;
  margin: 0; font-size: .75rem; }
/* Écran étroit : le menu du haut passe à la ligne au lieu de déborder */
nav { flex-wrap: wrap; }

/* Loupe : recherche approfondie sur l'entreprise (coin supérieur droit de la fiche) */
.loupe-form { display: inline; }
.loupe { position: relative; display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte); cursor: pointer; }
.loupe:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.loupe:disabled { opacity: .45; cursor: default; }
.loupe::after { content: attr(data-info); position: absolute; right: 0; top: calc(100% + .4rem); white-space: nowrap;
  background: var(--texte); color: var(--carte); font-size: .78rem; padding: .3rem .6rem; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 10; }
.loupe:hover::after, .loupe:focus-visible::after { opacity: 1; }

/* Encart du rapport */
.recherche summary { cursor: pointer; list-style: none; }
.recherche summary::-webkit-details-marker { display: none; }
.recherche summary h2 { display: inline; }
.recherche .angle { background: var(--fond); border-left: 3px solid var(--accent); padding: .5rem .8rem; border-radius: 4px; }
.fiche-entreprise { width: 100%; border-collapse: collapse; font-size: .88rem; margin: .6rem 0; }
.fiche-entreprise th { text-align: left; font-weight: 600; color: var(--muet); width: 13rem; padding: .35rem .6rem .35rem 0; vertical-align: top;
  text-transform: none; letter-spacing: 0; font-size: .85rem; }
.fiche-entreprise td { padding: .35rem .4rem; border-top: 1px solid var(--bord); vertical-align: top; }
.fiche-entreprise tr:first-child td { border-top: 0; }
.ref { display: inline-block; font-size: .68rem; min-width: 1.1rem; text-align: center; padding: 0 .25rem; margin-left: .15rem;
  border-radius: 4px; background: var(--fond); border: 1px solid var(--bord); color: var(--accent); vertical-align: 1px; }
.fiab { font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 99px; white-space: nowrap; }
.f-confirme { background: #dcf3e5; color: #17693a; } .f-une-source { background: #fff1d6; color: #8a5a00; }
.f-contradictoire { background: #fde2e0; color: #a8281b; }
.actus { margin: .3rem 0; padding-left: 1.1rem; font-size: .88rem; }
.sources { font-size: .82rem; padding-left: 1.4rem; margin: .3rem 0; }
.sources small { color: var(--muet); margin-left: .3rem; }
.en-cours { display: flex; align-items: center; gap: .6rem; margin: 0; }
.rond { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent;
  animation: tourne 1s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (max-width: 820px) { .fiche-entreprise th { width: 8rem; } }

/* Fiche : conversation + rédaction à gauche (2/3), à faire / relation / entreprise / suivi à droite (1/3) */
main:has(.fiche-grille) { max-width: 1300px; }
.fiche-grille { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.discussion { display: flex; flex-direction: column; padding-bottom: .9rem; }
.discussion-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.discussion-tete h2 { margin-bottom: .4rem; }
.discussion-tete .ajout { flex: 1 1 100%; }
.discussion-tete .ajout[open] summary { margin-bottom: .4rem; }
.discussion .fil { max-height: max(260px, calc(100vh - 470px)); overflow-y: auto; padding: .4rem .2rem .8rem; }
.discussion .redaction { border-top: 1px dashed var(--bord); padding-top: .8rem; margin-top: .2rem; display: flex; flex-direction: column; gap: .5rem; }
.objectifs { display: flex; flex-wrap: wrap; gap: .35rem; }
.objectif { position: relative; }
.objectif input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.objectif span { display: inline-block; font-size: .8rem; padding: .2rem .7rem; border-radius: 99px; border: 1px solid var(--bord); cursor: pointer; color: var(--texte); }
.objectif input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.objectif input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.redaction .consigne { font-size: .88rem; }
.barre-envoi { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.barre-envoi .lien { color: var(--muet); font-size: .85rem; text-decoration: underline; text-underline-offset: 2px; }
.redaction .etat { margin-left: 0; }
.redaction > .muet { margin: 0; font-size: .8rem; }
.a-faire { border: 2px solid var(--accent); }
.a-faire p { margin: .3rem 0; }
.a-faire .echeance { font-size: .88rem; color: var(--muet); }
.relation h2 .chaleur { margin-left: .4rem; }
.relation .lien, .relation p { font-size: .88rem; }
.resume-entreprise { display: grid; grid-template-columns: auto 1fr; gap: .25rem .7rem; margin: .3rem 0 .6rem; font-size: .85rem; }
.resume-entreprise dt { color: var(--muet); }
.resume-entreprise dd { margin: 0; }
.voir-rapport { font-size: .88rem; }
.entreprise p { margin: .3rem 0; font-size: .88rem; }
.infos .lien.danger { margin-top: .8rem; }
@media (max-width: 900px) {
  .fiche-grille { grid-template-columns: minmax(0, 1fr); }
  .fiche-grille > aside { display: contents; }
  .fiche-grille .a-faire { order: -1; }
  .fiche-grille .discussion { order: 0; }
  .fiche-grille > aside > :not(.a-faire) { order: 1; }
  .discussion .fil { max-height: 55vh; }
}
@media (max-width: 820px) {
  .fiche-entreprise, .fiche-entreprise tbody, .fiche-entreprise tr, .fiche-entreprise th, .fiche-entreprise td { display: block; width: auto; }
  .fiche-entreprise tr { border-top: 1px solid var(--bord); padding: .4rem 0; }
  .fiche-entreprise td { border-top: 0; padding: .1rem 0; }
}
.fiche-entreprise td, .sources li, .resume-entreprise dd { overflow-wrap: anywhere; }

/* Discussion plus haute : la carte occupe la hauteur de l'écran, le fil prend toute la place libre */
.discussion { height: calc(100vh - 165px); min-height: 560px; }
.discussion .fil { flex: 1 1 auto; min-height: 0; max-height: none; gap: .45rem; }
.discussion .fil li { padding: .45rem .75rem; font-size: .9rem; line-height: 1.45; }
.discussion .fil .meta { margin-bottom: .1rem; font-size: .72rem; }
.discussion .redaction { flex: none; gap: .4rem; padding-top: .6rem; }
.discussion .redaction textarea[name=message] { min-height: 3.2rem; max-height: 16rem; resize: none; overflow-y: auto; }
.objectif span { padding: .12rem .6rem; font-size: .76rem; }
.redaction .consigne { padding: .3rem .6rem; }
@media (max-width: 900px) { .discussion { height: auto; min-height: 0; } .discussion .fil { max-height: 60vh; } }
.objectifs .consigne { flex: 1 1 14rem; min-width: 10rem; width: auto; font-size: .82rem; padding: .2rem .6rem; }
.discussion .redaction textarea[name=message] { min-height: 2.6rem; }
.discussion-tete { flex-wrap: nowrap; }
.discussion-tete .ajout { flex: 0 1 auto; text-align: right; font-size: .85rem; }
.discussion-tete .ajout[open] { position: relative; }
.discussion-tete .ajout[open] form { position: absolute; right: 0; top: 1.8rem; z-index: 5; width: min(34rem, 80vw); text-align: left;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: .8rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.fiche-grille { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
.discussion { height: calc(100vh - 180px); }
.discussion .fil li { max-width: 90%; }

/* Séparateurs de jour dans la discussion */
.fil li.jour { align-self: center; max-width: none; background: none; border: 0; padding: .35rem 0 0; font-size: .74rem;
  color: var(--muet); display: flex; align-items: center; gap: .6rem; width: 100%; }
.fil li.jour::before, .fil li.jour::after { content: ""; flex: 1; border-top: 1px solid var(--bord); }
.fil li.jour span { white-space: nowrap; font-weight: 600; }
.fil li.jour small { font-weight: 400; font-size: inherit; }
.fil .meta time { cursor: help; }

/* Dépôt de l'export LinkedIn : zone de glisser-déposer, progression, phases */
.depot { padding: .8rem; }
.depot .zone { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2rem 1rem; text-align: center;
  border: 2px dashed var(--bord); border-radius: 10px; cursor: pointer; color: var(--texte); font-size: 1rem;
  transition: border-color .15s, background .15s; }
.depot .zone svg { color: var(--accent); margin-bottom: .3rem; }
.depot .zone strong { font-size: 1.1rem; }
.depot .zone span { color: var(--muet); font-size: .9rem; }
.depot .zone small { margin-top: .5rem; font-size: .8rem; }
.depot .zone:hover, .depot .zone:focus-visible, .depot.survol .zone { border-color: var(--accent); background: var(--fond); outline: none; }
.depot.survol .zone { border-style: solid; }
.depot.occupe .zone { display: none; }
.etat-depot { padding: 1rem 1.2rem; }
.ligne-fichier { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; margin-bottom: .6rem; }
.ligne-fichier .taille { font-weight: 400; }
.progression { height: .55rem; border-radius: 99px; background: var(--fond); overflow: hidden; }
.avancement { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s; }
.avancement.indetermine { width: 35%; animation: glisse 1.1s ease-in-out infinite alternate; }
@keyframes glisse { from { margin-left: 0; } to { margin-left: 65%; } }
.etat-depot .phase { margin: .6rem 0 0; font-size: .9rem; color: var(--muet); }
.erreur-depot { margin: .8rem 0 0; }

/* Multi-comptes : utilisateur courant, administration */
.qui-suis-je { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muet); white-space: nowrap; }
.qui-suis-je span { color: var(--texte); font-weight: 600; }
.barre .recherche { margin-left: 0; }
form.inline { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.bouton.petit { padding: .25rem .6rem; font-size: .8rem; }
.infos-acces dd form.inline { margin-left: .6rem; vertical-align: middle; }
tr.inactif td { opacity: .55; }
.actions-ligne { white-space: nowrap; } .actions-ligne form { margin-right: .3rem; }
.mdp-provisoire { border-color: var(--vert); }

/* Partage entre collègues : un même contact suivi par plusieurs comptes */
.partage-bandeau { background: var(--partage-fond); color: var(--partage-texte); padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.partage-bandeau b, .alerte b { font-weight: 700; }
.partage { font-size: .9em; margin-left: .3rem; cursor: help; }

/* Bouton de thème (barre du haut) : clair → sombre → auto */
.theme { margin-left: 0; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); border-radius: 7px;
  width: 2.1rem; height: 2.1rem; display: inline-grid; place-items: center; cursor: pointer; font-size: 1rem; padding: 0; }
.theme:hover { border-color: var(--accent); }

/* Aujourd'hui : listes de travail à gauche (3/5), décisions et agenda à droite (2/5) */
main:has(.tableau-bord) { max-width: 1400px; }
.tableau-bord { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.1rem; align-items: start; }
.tableau-bord > div, .tableau-bord > aside { min-width: 0; }
.carte { box-shadow: var(--ombre); }
.tableau-bord h2 { font-size: 1.3rem; letter-spacing: -.01em; margin-bottom: .5rem; }
.tableau-bord h2 small { font-size: .9rem; margin-left: .3rem; }
.tableau-bord .ligne { padding: .7rem .5rem; grid-template-columns: 1fr auto 9rem auto; }
.tableau-bord .qui strong { font-size: 1.03rem; }
.tableau-bord .qui small { font-size: .88rem; }
.tableau-bord .date { font-size: .9rem; }
.tableau-bord .date .jour, .tableau-bord .date .retard { font-size: 1rem; }
/* À valider : nom et boutons sur la première ligne, explication en dessous sur toute la largeur */
.valider .alerte-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nom boutons" "desc desc";
  gap: .2rem 1rem; align-items: center; padding: .75rem 0; }
.valider .alerte-ligne .qui { display: contents; }
.valider .alerte-ligne .qui strong { grid-area: nom; font-size: 1.03rem; color: var(--texte); }
.valider .alerte-ligne .qui:hover strong { color: var(--accent); }
.valider .alerte-ligne .qui small { grid-area: desc; display: block; color: var(--muet); font-size: .88rem; }
.valider .alerte-ligne form { grid-area: boutons; justify-content: flex-end; }
.valider .alerte-ligne .bouton { padding: .4rem .8rem; font-size: .9rem; }
.stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.stats div { padding: .6rem .9rem; }
.stats b { font-size: 1.35rem; }
.stats span { font-size: .8rem; }
nav a { padding: .4rem .8rem; border-radius: 8px; }
@media (max-width: 1100px) { .tableau-bord { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .valider .alerte-ligne { grid-template-columns: 1fr; } .valider .alerte-ligne form { justify-content: flex-start; } }

/* Accueil d'un nouveau compte : trois étapes, l'extension obligatoire */
.etape-accueil { border-left: 4px solid var(--bord); }
.etape-accueil.a-faire { border-left-color: var(--accent); }
.etape-accueil.faite { border-left-color: var(--vert); }
.etape-accueil .num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .9rem; margin-right: .4rem; }
.etape-accueil.faite .num { background: var(--vert); }
.etape-accueil h2 small { margin-left: .4rem; }
.pas { padding-left: 1.3rem; margin: .4rem 0 .8rem; } .pas li { margin: .55rem 0; }
.pas .bouton { margin-right: .5rem; }
.jeton-ligne { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .4rem 0; }
.attente { display: flex; align-items: center; gap: .6rem; color: var(--muet); margin: .3rem 0 0; }

/* Notifications (cloche) et blocs secondaires repliés du tableau de bord */
.qui-suis-je .notif { text-decoration: none; color: var(--muet); display: inline-flex; align-items: center; gap: .15rem; }
.qui-suis-je .notif.pleine { color: var(--texte); }
.qui-suis-je .notif b { background: var(--rouge); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .4rem; line-height: 1.3rem; }
details.secondaire { margin-top: .6rem; border-top: 1px dashed var(--bord); padding-top: .4rem; }
details.secondaire summary { cursor: pointer; color: var(--muet); font-size: .85rem; padding: .3rem 0; }
details.secondaire summary:hover { color: var(--texte); }
.partage-bandeau form.inline { margin-left: .6rem; vertical-align: middle; }

/* Bandeau « extension à mettre à jour » (sous la barre) et file d'import */
.bandeau-maj { background: #fff1d6; color: #7a4f00; padding: .55rem 1.5rem; font-size: .9rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.bandeau-maj a { color: inherit; font-weight: 600; }
:root[data-theme="sombre"] .bandeau-maj { background: #4a3410; color: #ffd98a; }

/* Aujourd'hui : une couleur par liste pour les distinguer d'un coup d'œil (liseré gauche + titre) */
.carte.repondre { border-left: 4px solid var(--accent); }   .carte.repondre > h2 { color: var(--accent); }
.carte.relancer { border-left: 4px solid var(--vert); }     .carte.relancer > h2 { color: var(--vert); }
.carte.reactiver { border-left: 4px solid var(--t-partenaire); } .carte.reactiver > h2 { color: var(--t-partenaire); }
.carte.candidats { border-left: 4px solid var(--t-candidat); }   .carte.candidats > h2 { color: var(--t-candidat); }
.carte > h2 small { color: var(--muet); }
/* Admin : indicateurs */
table.compacte { font-size: .88rem; } table.compacte th { white-space: nowrap; }
tr.total td { border-top: 2px solid var(--bord); font-weight: 600; }
/* Avancement d'un lot d'analyse */
.barre-progres { display: block; height: 6px; background: rgba(0,0,0,.08); border-radius: 3px; margin: .4rem 0; overflow: hidden; }
.barre-progres i { display: block; height: 100%; background: var(--orange); transition: width .4s; }

/* ---------- Admin : indicateurs et graphiques ----------
   Palette de visualisation (catégories en ordre fixe, dégradé séquentiel bleu pour la chaleur), variante sombre. */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-gris: #c9ccd3;
  --viz-s1: #86b6ef; --viz-s2: #5598e7; --viz-s3: #2a78d6; --viz-s4: #1c5cab; --viz-s5: #104281; --viz-s6: #0d366b; --viz-grille: #e6e8ec; }
:root[data-theme="sombre"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-gris: #3a4050;
  --viz-s1: #184f95; --viz-s2: #1c5cab; --viz-s3: #256abf; --viz-s4: #2a78d6; --viz-s5: #3987e5; --viz-s6: #5598e7; --viz-grille: #2a303c; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-gris: #3a4050;
  --viz-s1: #184f95; --viz-s2: #1c5cab; --viz-s3: #256abf; --viz-s4: #2a78d6; --viz-s5: #3987e5; --viz-s6: #5598e7; --viz-grille: #2a303c; } }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tuile { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem 1rem .7rem; box-shadow: var(--ombre);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "etiquette etiquette" "valeur spark" "delta spark"; gap: .1rem .6rem; align-items: end; }
.tuile .etiquette { grid-area: etiquette; color: var(--muet); font-size: .8rem; }
.tuile b { grid-area: valeur; font-size: 1.9rem; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.tuile .delta { grid-area: delta; font-size: .8rem; color: var(--muet); }
.tuile .delta.bon { color: var(--vert); } .tuile .delta.mauvais { color: var(--rouge); }
.tuile .delta small { color: var(--muet); font-size: .75rem; }
.tuile .spark { grid-area: spark; width: 96px; height: 32px; align-self: center; }
.tuile.alerte-tuile b { color: var(--rouge); }
.meter { display: block; height: 6px; background: color-mix(in srgb, var(--viz-1) 18%, transparent); border-radius: 3px; overflow: hidden; margin-top: .4rem; grid-column: 1 / -1; }
.meter i { display: block; height: 100%; background: var(--viz-1); border-radius: 3px; }
.meter.petit { display: inline-block; width: 70px; height: 5px; margin: 0 .4rem 0 0; vertical-align: middle; }
.graphiques { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.graphiques > .carte { margin-bottom: 1rem; min-width: 0; }
.carte.graphe h2.espace { margin-top: 1.2rem; }
.viz-legende { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--muet); margin: .2rem 0 .6rem; }
.viz-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.viz-panneau { margin: 0; } .viz-panneau figcaption { font-size: .85rem; font-weight: 600; margin-bottom: .2rem; }
.viz-grille { stroke: var(--viz-grille); stroke-width: 1; }
.viz-axe { font-size: 10px; fill: var(--muet); font-variant-numeric: tabular-nums; }
.viz-nom { font-size: 12px; fill: var(--texte); font-weight: 600; }
.viz-etiquette { font-size: 11px; fill: var(--texte); font-variant-numeric: tabular-nums; }
.viz-dans { font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz-bulle { position: fixed; z-index: 50; background: var(--texte); color: var(--carte); font-size: .8rem; padding: .4rem .6rem; border-radius: 8px;
  pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 260px; line-height: 1.35; }
.viz-donnees { margin-top: .6rem; } .viz-donnees summary { cursor: pointer; font-size: .8rem; color: var(--muet); }
.viz-donnees table { margin-top: .4rem; }
table.chiffres td, table.chiffres th { text-align: right; font-variant-numeric: tabular-nums; }
table.chiffres td.texte, table.chiffres th.texte, table.chiffres td:first-child, table.chiffres th:first-child { text-align: left; }
.puce { display: inline-block; padding: 0 .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.5rem; }
.puce.serieuse { background: #fde2e0; color: #8f2317; }
:root[data-theme="sombre"] .puce.serieuse { background: #4a1f1a; color: #f5a8a0; }
@media (max-width: 900px) { .graphiques { grid-template-columns: 1fr; } }
/* Admin : une carte par personne (3 indicateurs en tête, détail déplié au clic) */
.titre-section { font-size: 1.05rem; margin: .4rem 0 .6rem; } .titre-section small { color: var(--muet); font-weight: 400; font-size: .85rem; }
.personnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: .8rem; margin-bottom: 1rem; align-items: start; }
.personne { padding: 0; }
.personne summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto auto auto auto auto; gap: .9rem; align-items: center; padding: .9rem 1rem; }
.personne summary::-webkit-details-marker { display: none; }
.personne .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--partage-fond); color: var(--partage-texte); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.personne .identite { display: flex; flex-direction: column; min-width: 0; } .personne .identite b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.personne .identite small { font-size: .75rem; display: flex; white-space: nowrap; }
.personne .identite small .id { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.personne .identite small .role { flex: none; margin-left: .3em; }
.kpi-mini { display: flex; flex-direction: column; align-items: flex-end; min-width: 86px; }
.kpi-mini b { font-size: 1.25rem; font-weight: 600; line-height: 1.1; } .kpi-mini small { color: var(--muet); font-size: .72rem; white-space: nowrap; }
.kpi-mini .meter.petit { width: 60px; margin: .25rem 0 0; }
.kpi-mini.alerte-kpi b { color: var(--rouge); }
.personne .chevron { color: var(--muet); font-size: 1.3rem; transition: transform .2s; }
.personne[open] .chevron { transform: rotate(90deg); }
.personne .detail { border-top: 1px solid var(--bord); padding: .9rem 1rem 1rem; }
.grille-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem .8rem; }
.grille-kpi div { display: flex; flex-direction: column; padding: .5rem .6rem; background: var(--fond); border-radius: 8px; }
.grille-kpi b { font-size: 1.1rem; font-weight: 600; } .grille-kpi .sur { color: var(--muet); font-weight: 400; font-size: .85rem; }
.grille-kpi small { color: var(--muet); font-size: .72rem; }
.tendance { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: .6rem; align-items: center; margin-top: .8rem; }
.tendance .spark { width: 100%; height: 36px; }
@media (max-width: 600px) { .personne summary { grid-template-columns: auto 1fr auto; } .personne .kpi-mini:nth-of-type(n+2) { display: none; } }
/* Admin, tableau des comptes : tient dans sa carte quel que soit l'identifiant (tronqué, complet au survol, sans
   élargir la colonne) ; montants sur une ligne ; sur écran plus étroit, les boutons passent l'un sous l'autre */
.tableau > h2 { padding: 1.1rem 1.2rem 0; margin-bottom: .3rem; }
table.comptes th, table.comptes td { padding-left: .6rem; padding-right: .6rem; }
table.comptes .compte { min-width: 10rem; }
table.comptes .compte small { display: block; }
table.comptes .identifiant { width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.comptes .nombre { white-space: nowrap; }
@media (max-width: 1150px) {
  table.comptes .actions-ligne { white-space: normal; }
  table.comptes .actions-ligne form { margin: .15rem .3rem .15rem 0; }
}
/* Aujourd'hui : bloc Candidats replié par défaut (hors des actions du jour) */
details.carte.repliee > summary { list-style: none; cursor: pointer; }
details.carte.repliee > summary::-webkit-details-marker { display: none; }
details.carte.repliee > summary h2 { margin: 0; }
details.carte.repliee > summary h2::before { content: "›"; display: inline-block; margin-right: .4rem; color: var(--muet); transition: transform .2s; }
details.carte.repliee[open] > summary h2::before { transform: rotate(90deg); }
details.carte.repliee[open] > summary h2 { margin-bottom: .6rem; }
/* Aujourd'hui : sous-groupes par type dans les listes ; case à cocher dans Paramètres */
h3.groupe { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muet); margin: .9rem 0 .2rem; font-weight: 600; }
h3.groupe a { color: inherit; text-decoration: none; } h3.groupe small { font-weight: 400; }
h3.groupe:first-of-type { margin-top: .2rem; }
label.case { display: flex; align-items: center; gap: .5rem; } label.case input[type=checkbox] { width: auto; margin: 0; }
/* RDV booké : note mise en avant dans le fil, tuile dédiée dans Admin */
.fil li.rdv .texte { border-left: 3px solid var(--vert); }
.fil li.rdv .meta > span:first-child { color: var(--vert); font-weight: 600; }
.tuile.rdv b { color: var(--vert); }
/* Lignes des listes du jour : la ligne entière ouvre la fiche (lien étendu), boutons « reporter » au bord droit */
.ligne { position: relative; grid-template-columns: 1fr auto 8.5rem auto; }
.ligne > a.qui { color: inherit; text-decoration: none; }
.ligne > a.qui::after { content: ""; position: absolute; inset: 0; }
.ligne .pastilles, .ligne .date { position: relative; pointer-events: none; }
.ligne .reporter { position: relative; z-index: 1; display: flex; gap: .25rem; opacity: .6; transition: opacity .15s; }
.ligne:hover .reporter { opacity: 1; }
.ligne .reporter form { margin: 0; }
.ligne .reporter button { font: inherit; font-size: .72rem; padding: .15rem .45rem; border: 1px solid var(--bord); border-radius: 999px; background: var(--carte); color: var(--muet); cursor: pointer; }
.ligne .reporter button:hover { color: var(--texte); border-color: var(--texte); }
/* Bande de chiffres cliquable */
.stats a { display: block; text-decoration: none; color: inherit; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; }
.stats a:hover { border-color: var(--accent); } .stats a.sans-lien { pointer-events: none; }
.carte.clients { border-left: 4px solid var(--t-client); } .carte.clients > h2 { color: var(--t-client); }
.carte .ligne .date .jour { color: var(--muet); }
@media (max-width: 820px) { .ligne .reporter { display: none; } }
