/* 3DTECHLAB Suivi — trois thèmes (ardoise par défaut, clair, sombre) ; le menu reste toujours foncé. */
/* 3DTECHLAB SalesManagement — charte commune aux quatre programmes (SalesManagement, Vénus, ProjectManagement,
   app de Jaime). Une couleur = une étape du dossier, partout. Thème clair par défaut ; ardoise et sombre au choix.
   Le menu reste toujours foncé. */
:root {
  --menu: #0f1a2c; --menu-texte: #c8d2e3; --menu-actif: #1d2d48; --menu-bord: #1a2840;
  --accent: #1667b3; --accent-fort: #0f4f8a; --ok: #15803d; --erreur: #b91c1c; --alerte: #b45309;
  /* les étapes du dossier */
  --s-attente_traitement: #5b6b85; --s-attente_reponse: #1667b3; --s-relance_7: #d97706; --s-relance_15: #b45309;
  --s-accepte: #15803d; --s-en_production: #c2410c; --s-termine: #0d7268; --s-refus: #8a94a6; --s-sans_suite: #a3adbd;
  --venus: #9b2f6a; --jaime: #0d7268; --atelier: #b8500b;
  --titres: "Space Grotesk", Inter, system-ui, sans-serif;
}
:root, :root[data-theme="clair"] {
  --fond: #eef2f7; --surface: #ffffff; --surface-2: #f4f7fb; --bord: #d8e0eb;
  --texte: #142033; --doux: #55627a; --accent-doux: rgba(22,103,179,.10);
  --ombre: 0 1px 2px rgba(16,24,40,.06); color-scheme: light;
}
:root[data-theme="ardoise"] {
  --fond: #26324b; --surface: #2f3d5b; --surface-2: #384868; --bord: #44567a;
  --texte: #f1f5fb; --doux: #b0bdd3; --accent: #5aa9f0; --accent-doux: rgba(90,169,240,.18);
  --ombre: 0 2px 8px rgba(5,10,20,.25); color-scheme: dark;
}
:root[data-theme="sombre"] {
  --fond: #0e1626; --surface: #141e31; --surface-2: #1a263d; --bord: #24324c;
  --texte: #e8eef8; --doux: #9aa7bf; --accent: #5aa9f0; --accent-doux: rgba(90,169,240,.14);
  --ombre: 0 1px 2px rgba(0,0,0,.25); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; background: var(--fond);
       color: var(--texte); display: flex; overflow: hidden; }
svg { fill: currentColor; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--accent); color: #fff; font-weight: 600; }
button.secondaire { background: transparent; color: var(--texte); border: 1px solid var(--bord); font-weight: 500; }
button.secondaire:hover { border-color: var(--accent); }
button.petit { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: wait; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--surface); color: var(--texte); }
input:focus, select:focus { outline: 2px solid var(--accent-doux); border-color: var(--accent); }
h1 { font-family: var(--titres); font-size: 30px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-family: var(--titres); font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.doux { color: var(--doux); } .petit-texte { font-size: 13px; } .erreur { color: var(--erreur); } .ok { color: var(--ok); }
.vide { color: var(--doux); padding: 28px; text-align: center; }

/* ---------- menu latéral */
.menu { width: 232px; flex: none; background: var(--menu); color: var(--menu-texte); display: flex; flex-direction: column; padding: 18px 12px;
        border-right: 1px solid var(--menu-bord); transition: width .18s ease; overflow: hidden; }
.logo { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 22px; }
.logo-long { width: 150px; height: auto; } .logo-court { display: none; width: 34px; height: 34px; border-radius: 8px; }
.replier { margin-top: auto; display: flex; align-items: center; gap: 12px; background: transparent; color: var(--menu-texte); font-weight: 500; padding: 10px 12px; border-radius: 9px; text-align: left; }
.replier:hover { background: rgba(255,255,255,.06); }
.replier svg { width: 19px; height: 19px; flex: none; transition: transform .18s; }
.menu nav a, .replier, .moteur { white-space: nowrap; }
body.menu-replie .menu { width: 68px; padding: 18px 10px; }
body.menu-replie .menu .libelle, body.menu-replie .logo-long, body.menu-replie .moteur-texte, body.menu-replie #etat-titre,
body.menu-replie #btn-synchro { display: none; }
body.menu-replie .logo-court { display: block; }
body.menu-replie .logo { padding: 0 0 18px; align-items: center; }
body.menu-replie .menu nav a, body.menu-replie .replier { justify-content: center; padding: 11px 0; position: relative; }
body.menu-replie .badge { position: absolute; top: 2px; right: 2px; }
body.menu-replie .replier svg { transform: rotate(180deg); }
body.menu-replie .moteur { align-items: center; padding: 10px 0; }
.logo span { color: #7cc0ff; font-weight: 700; font-size: 12px; letter-spacing: .25em; text-transform: uppercase; padding-left: 2px; }
.menu nav { display: flex; flex-direction: column; gap: 4px; }
.menu nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--menu-texte); font-weight: 500; }
.menu nav a svg { width: 19px; height: 19px; opacity: .85; }
.menu nav a:hover { background: rgba(255,255,255,.05); }
.menu nav a.actif { background: var(--menu-actif); color: #fff; box-shadow: inset 3px 0 0 #5aa9f0; }
.badge { margin-left: auto; background: #ef4444; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.moteur { margin-top: 8px; background: rgba(255,255,255,.04); border: 1px solid #1f2b42; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.moteur-titre { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: #e8eef8; }
.moteur-texte { font-size: 12px; color: #8d9ab3; overflow-wrap: anywhere; }
.moteur button { color: #c7d0e0; border-color: #2a3852; margin-top: 4px; }
.pastille { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex: none; }
.pastille.travail { background: var(--accent); animation: pulse 1.4s infinite; } .pastille.repos { background: var(--ok); } .pastille.erreur { background: var(--erreur); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- zone principale */
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.haut { height: 64px; flex: none; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--bord); background: var(--surface); }
.recherche-globale { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 0 12px; }
.recherche-globale svg { width: 17px; color: var(--doux); }
.recherche-globale input { border: 0; background: transparent; flex: 1; padding: 10px 0; outline: none; }
main { flex: 1; overflow: auto; padding: 26px 28px 40px; }
.entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.entete-page p { margin: 4px 0 0; color: var(--doux); }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; padding: 18px; box-shadow: var(--ombre); }
.bandeau { background: var(--accent-doux); border: 1px solid rgba(46,169,224,.35); color: var(--texte); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 13px; }

/* ---------- tableau de bord */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.indicateur { display: flex; gap: 14px; align-items: center; cursor: pointer; position: relative; overflow: hidden;
              background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--surface)) 0%, var(--surface) 70%);
              border-color: color-mix(in srgb, var(--c) 45%, var(--bord)); transition: transform .12s, box-shadow .12s; }
.indicateur:hover { transform: translateY(-2px); box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 30%, transparent); }
.indicateur .icone { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--c);
                     box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 45%, transparent); }
.indicateur .icone svg { width: 23px; height: 23px; color: #fff; }
.indicateur .valeur { font-size: 30px; font-weight: 800; line-height: 1.05; }
.indicateur .libelle { color: var(--doux); font-size: 13px; font-weight: 500; }
.grille-tdb { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
.grille-tdb-bas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .grille-tdb, .grille-tdb-bas { grid-template-columns: 1fr; } }
.carte h2 { display: flex; align-items: center; gap: 8px; }
.carte h2 .pastille-titre { width: 8px; height: 18px; border-radius: 4px; background: var(--c, var(--accent)); }
.graphique svg { width: 100%; height: auto; display: block; }
.graphique text { fill: var(--doux); font-size: 12px; }
.graphique .valeur-barre { fill: var(--texte); font-weight: 700; }
.icone-activite { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.icone-activite svg { width: 18px; height: 18px; }
.anneau { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.anneau svg { width: 170px; height: 170px; flex: none; }
.legende { display: grid; gap: 7px; flex: 1; min-width: 170px; }
.legende div { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.legende b { margin-left: auto; font-weight: 600; }
.point { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.liste-actions { display: flex; flex-direction: column; }
.ligne-action { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--bord); cursor: pointer; }
.ligne-action:last-child { border-bottom: 0; }
.ligne-action:hover { background: var(--surface-2); }
.ligne-action .texte { flex: 1; min-width: 0; }
.ligne-action .texte strong, .ligne-action .texte small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-action small { color: var(--doux); }

/* ---------- pastilles de statut */
.statut { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
          color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

/* ---------- projets */
.filtres { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filtres input { flex: 1; min-width: 220px; }
.section-titre { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; font-size: 17px; font-weight: 700; }
.compteur { font-size: 12px; font-weight: 600; color: var(--doux); background: var(--surface-2); border: 1px solid var(--bord); border-radius: 999px; padding: 2px 10px; }
.carte-client { display: grid; grid-template-columns: 230px 1fr; gap: 0; padding: 0; margin-bottom: 12px; overflow: hidden; }
.carte-client .identite { padding: 18px; border-right: 1px solid var(--bord); display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.carte-client .identite:hover strong { color: var(--accent); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.identite strong { display: block; font-size: 15px; } .identite small { color: var(--doux); }
.lignes-projets { padding: 6px 18px; }
.ligne-projet { display: grid; grid-template-columns: 1fr auto 130px 16px; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--bord); cursor: pointer; }
.ligne-projet:last-of-type { border-bottom: 0; }
.ligne-projet:hover .titre { color: var(--accent); }
.ligne-projet .titre { font-weight: 600; } .ligne-projet small { display: block; color: var(--doux); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.ligne-projet .date { color: var(--doux); font-size: 12px; text-align: right; }
.chevron { color: var(--doux); }
.voir-plus { display: inline-block; padding: 8px 0 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
@media (max-width: 900px) { .carte-client { grid-template-columns: 1fr; } .carte-client .identite { border-right: 0; border-bottom: 1px solid var(--bord); } }

/* ---------- fiche projet */
.fil-ariane { display: flex; align-items: center; gap: 8px; color: var(--doux); margin-bottom: 14px; font-size: 13px; }
.fil-ariane a { cursor: pointer; }
.entete-projet { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.entete-projet .client { display: flex; gap: 10px; align-items: center; padding-right: 18px; border-right: 1px solid var(--bord); cursor: pointer; }
.entete-projet h1 { cursor: text; } .entete-projet h1:hover { text-decoration: underline dotted; }
.entete-projet .meta { color: var(--doux); font-size: 13px; margin-top: 2px; }
.choix-statut { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.choix-statut select { font-weight: 600; border-width: 2px; border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.grille-projet { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.15fr) minmax(280px, .95fr); gap: 14px; align-items: start; }
@media (max-width: 1250px) { .grille-projet { grid-template-columns: 1fr 1fr; } .grille-projet > :last-child { grid-column: 1 / -1; } }
@media (max-width: 850px) { .grille-projet { grid-template-columns: 1fr; } }
.colonne h2 { display: flex; align-items: center; gap: 8px; }
.historique { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--bord); display: flex; flex-direction: column; gap: 12px; max-height: 640px; overflow: auto; }
.historique li { position: relative; cursor: pointer; }
.historique li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--s-attente_traitement); }
.historique li.envoye::before { border-color: var(--accent); background: var(--accent); }
.historique .quand { font-size: 12px; color: var(--doux); }
.historique .qui { font-weight: 600; font-size: 13px; }
.historique .bulle { margin-top: 5px; background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
.historique li:hover .bulle { border-color: var(--accent); }
.historique .bulle .sujet { font-weight: 600; margin-bottom: 2px; }
.historique .bulle .extrait { color: var(--doux); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.apercu-3d { height: 280px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #24324c, #0e1626); position: relative; overflow: hidden; margin-bottom: 10px; }
.apercu-3d canvas { display: block; width: 100%; height: 100%; }
.apercu-3d .info { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: #c7d0e0; background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 6px; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vignettes img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); cursor: zoom-in; background: var(--surface-2); }
.fichiers { display: flex; flex-direction: column; }
.fichier { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bord); cursor: pointer; font-size: 13px; }
.fichier:last-child { border-bottom: 0; }
.fichier:hover .nom { color: var(--accent); }
.fichier .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-fichier { font-size: 10px; font-weight: 700; color: #fff; border-radius: 5px; padding: 3px 0; text-align: center; }
.etiquette { font-size: 11px; color: var(--doux); border: 1px solid var(--bord); border-radius: 5px; padding: 1px 6px; }
.bloc { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.bloc .titre-bloc { font-size: 12px; color: var(--doux); margin-bottom: 4px; }
.bloc .grand { font-size: 22px; font-weight: 700; }
.bloc.info { background: var(--accent-doux); border-color: rgba(46,169,224,.35); }
.actions-projet { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.colonne-kanban { background: var(--surface); border: 1px solid var(--bord); border-top: 4px solid var(--c); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.colonne-kanban header { padding: 12px 12px 8px; text-align: center; font-weight: 700; }
.colonne-kanban header .nombre { display: inline-block; margin-top: 6px; min-width: 30px; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--c); font-size: 12px; }
.cartes-kanban { padding: 6px 10px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.colonne-kanban.survol { outline: 2px dashed var(--c); outline-offset: -4px; }
.carte-kanban { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 11px; cursor: grab; }
.carte-kanban:hover { border-color: var(--c); }
.carte-kanban .client { font-weight: 700; font-size: 13px; }
.carte-kanban .titre { font-size: 12px; color: var(--doux); margin: 2px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-kanban .bas { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--doux); }
.carte-kanban .jours { font-weight: 700; color: var(--c); }
.carte-kanban .montant { margin-left: auto; font-weight: 600; color: var(--texte); }
.carte-kanban.glisse { opacity: .4; }
.carte-kanban.relance { border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); }
.etiquette-relance { float: right; font-size: 10px; font-weight: 700; color: #fff; background: var(--c); border-radius: 6px; padding: 2px 6px; margin-left: 6px; }
.colonne-kanban header .nombre.relances { background: var(--s-relance_15); margin-left: 4px; }
.options-suivi { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: -8px 0 16px; font-size: 13px; color: var(--doux); }
.legende-relances { display: flex; align-items: center; gap: 6px; } .legende-relances .point { margin-left: 8px; }
.cases { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.case { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--texte); }
.case input { accent-color: var(--accent); width: 16px; height: 16px; }
.plus-kanban { text-align: center; font-size: 12px; padding: 6px; color: var(--accent); cursor: pointer; }

/* ---------- à classer, paramètres, email */
.carte-a-classer { margin-bottom: 12px; }
.carte-a-classer .sujet { font-weight: 600; margin: 2px 0; }
.carte-a-classer .extrait { color: var(--doux); font-size: 13px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; } .actions select { flex: 1; min-width: 240px; }
.page-etroite { max-width: 920px; }
fieldset { border: 1px solid var(--bord); border-radius: 14px; padding: 14px 18px; margin: 0 0 14px; background: var(--surface); }
legend { font-weight: 700; padding: 0 6px; }
fieldset label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; }
fieldset label input { width: 340px; max-width: 60%; }
.grille-reglages label input { width: 110px; }
.grille-reglages { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
@media (max-width: 900px) { .grille-reglages { grid-template-columns: 1fr; } }
.resultat-test { margin-left: 10px; font-size: 13px; color: var(--doux); }
.resultat-test.ok { color: var(--ok); } .resultat-test.erreur { color: var(--erreur); }
.journal { font: 12px ui-monospace, monospace; background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 10px; max-height: 260px; overflow: auto; white-space: pre-wrap; }
.journal .erreur { color: var(--erreur); }
dialog { border: 1px solid var(--bord); border-radius: 14px; background: var(--surface); color: var(--texte); width: min(860px, 92vw); max-height: 88vh; padding: 22px 26px; }
dialog::backdrop { background: rgba(0,0,0,.5); }
.corps-html { width: 100%; height: 56vh; border: 1px solid var(--ligne, #e5e7eb); border-radius: 10px; background: #fff; display: block; }
.corps-html[hidden], .corps[hidden] { display: none; }
.bascule-affichage { display: inline-flex; margin: 6px 0 8px; border: 1px solid var(--ligne, #e5e7eb); border-radius: 8px; overflow: hidden; }
.bascule-affichage button { border: 0; border-radius: 0; padding: 4px 12px; background: transparent; font-size: 12px; cursor: pointer; color: inherit; }
.bascule-affichage button.actif { background: #334155; color: #fff; }
.traduction-sous-html { margin-top: 10px; }
.traduction-sous-html summary { cursor: pointer; font-weight: 600; font-size: 12px; }
.traduction-sous-html .texte-langue { white-space: pre-wrap; font-size: 13px; padding: 10px 14px; background: var(--fond); border-radius: 10px; margin-top: 6px; }
.corps { white-space: pre-wrap; font: 13px/1.55 -apple-system, sans-serif; max-height: 56vh; overflow: auto; background: var(--fond); padding: 14px; border-radius: 10px; }
.pieces { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.image-plein { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto 12px; border-radius: 10px; }

/* ---------- menu : sections */
.titre-menu { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6b7891; padding: 16px 12px 4px; }
.separateur-menu { height: 1px; background: var(--menu-bord); margin: 10px 6px; }
body.menu-replie .titre-menu { display: none; }

/* ---------- onglets génériques */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 18px; flex-wrap: wrap; }
.onglets button { background: transparent; color: var(--doux); border-radius: 8px 8px 0 0; padding: 9px 14px; font-weight: 600; border-bottom: 2px solid transparent; }
.onglets button.actif { color: var(--texte); border-bottom-color: var(--accent); }
.onglets .compte { margin-left: 6px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--bord); border-radius: 999px; padding: 0 7px; color: var(--doux); }
.puces { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.puce { background: var(--surface); color: var(--texte); border: 1px solid var(--bord); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 13px; }
.puce.actif { background: var(--accent); border-color: var(--accent); color: #fff; }
.puce .compte { opacity: .75; margin-left: 4px; font-weight: 500; }

/* ---------- boîte mail (façon Gmail) */
.boite { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 0; height: calc(100vh - 64px - 66px - 70px); min-height: 460px;
         background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; overflow: hidden; }
.boite .liste { border-right: 1px solid var(--bord); overflow-y: auto; }
.boite .lecture { overflow-y: auto; padding: 22px 26px; }
.ligne-email { padding: 11px 14px; border-bottom: 1px solid var(--bord); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.ligne-email:hover { background: var(--surface-2); }
.ligne-email.active { background: var(--accent-doux); box-shadow: inset 3px 0 0 var(--accent); }
.ligne-email .de { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-email.non-lu .de, .ligne-email.non-lu .sujet { font-weight: 800; }
.ligne-email.non-lu .de::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.ligne-email .quand { font-size: 12px; color: var(--doux); white-space: nowrap; }
.ligne-email .sujet { grid-column: 1 / -1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-email .extrait { grid-column: 1 / -1; font-size: 12px; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-email .tags { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 3px; }
.tag { font-size: 11px; border-radius: 6px; padding: 1px 7px; background: var(--surface-2); border: 1px solid var(--bord); color: var(--doux); }
.tag.projet { background: var(--accent-doux); border-color: rgba(46,169,224,.4); color: var(--texte); }
.barre-lecture { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--bord); }
.barre-lecture .danger { color: var(--erreur); border-color: color-mix(in srgb, var(--erreur) 45%, var(--bord)); }
.lecture h2 { font-size: 20px; margin-bottom: 6px; }
.compositeur { margin-top: 18px; border: 1px solid var(--bord); border-radius: 12px; background: var(--surface-2); padding: 14px; }
.compositeur label { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--doux); }
.barre-edition { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--bord); border-bottom: 0;
                 border-radius: 8px 8px 0 0; background: var(--surface); }
.barre-edition button { background: transparent; color: var(--texte); border: 1px solid transparent; padding: 4px 9px; font-weight: 500; font-size: 13px; }
.barre-edition button:hover { border-color: var(--bord); background: var(--surface-2); }
.barre-edition .sep { width: 1px; height: 20px; background: var(--bord); margin: 0 4px; }
.editeur { min-height: 240px; max-height: 520px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 0 0 8px 8px;
           background: #fff; color: #172436; font: 15px/1.55 Arial, Helvetica, sans-serif; outline: none; }
.editeur:focus { border-color: var(--accent); }
.editeur p { margin: 0 0 10px; } .editeur a { color: #2ea9e0; }
.editeur:empty::before { content: attr(data-vide); color: #8a94a6; }
.images-email { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.images-email img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--bord); cursor: zoom-in; background: #fff; }
.compositeur .actions { justify-content: flex-end; }

/* ---------- clients */
.clients { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 14px; align-items: start; }
.clients .liste-clients { max-height: calc(100vh - 230px); overflow-y: auto; padding: 6px; }
.ligne-client { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.ligne-client:hover { background: var(--surface-2); } .ligne-client.actif { background: var(--accent-doux); }
.ligne-client .texte { flex: 1; min-width: 0; } .ligne-client strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-client small { color: var(--doux); font-size: 12px; }
.ligne-client .pastille-nb { font-size: 11px; font-weight: 700; color: #fff; background: var(--s-attente_traitement); border-radius: 999px; padding: 1px 7px; }
/* Fiche client : identité + coordonnées alignées en haut, chiffres sur une rangée, projets et historique en dessous. */
.fiche-client { display: flex; flex-direction: column; gap: 14px; }
.entete-client { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 18px 28px; align-items: start; }
.identite-client { display: flex; gap: 14px; align-items: center; }
.identite-client h2 { font-size: 20px; line-height: 1.2; }
.entete-client .coordonnees { margin: 0; display: flex; flex-direction: column; }
.entete-client .coordonnees > div { display: grid; grid-template-columns: 130px 1fr; column-gap: 16px; align-items: baseline;
                                    padding: 7px 0; border-bottom: 1px solid var(--bord); }
.entete-client .coordonnees > div:first-child { padding-top: 0; }
.entete-client .coordonnees > div:last-child { border-bottom: 0; }
.entete-client .coordonnees dt { grid-column: 1; font-size: 12px; color: var(--doux); margin: 0; }
.entete-client .coordonnees dd { grid-column: 2; margin: 0; min-width: 0; overflow-wrap: normal; word-break: normal; }
.entete-client .coordonnees dd + dd { margin-top: 4px; }
.entete-client .coordonnees dd a { white-space: nowrap; }
.nom-contact { display: block; }
.aide-coord { cursor: help; opacity: .7; }
.entete-client .chiffres { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.entete-client .chiffres div { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; }
.entete-client .chiffres b { display: inline; font-size: 20px; }
.bas-client { display: grid; grid-template-columns: 1fr; gap: 14px; }
.bas-client > * { min-width: 0; }
@media (max-width: 1250px) { .entete-client { grid-template-columns: 1fr; } .entete-client .chiffres { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .clients, .boite { grid-template-columns: 1fr; } }
.coordonnees dt { font-size: 12px; color: var(--doux); margin-top: 10px; } .coordonnees dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.chiffres div { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 10px; }
.chiffres b { display: block; font-size: 18px; }

/* ---------- validation */
.brouillon { margin-bottom: 14px; }
.brouillon .origine { background: var(--surface-2); border-left: 3px solid var(--s-attente_traitement); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--doux); white-space: pre-line; max-height: 140px; overflow: auto; margin: 8px 0 12px; }
.brouillon .entete { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.etiquette-ia { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 8px; background: var(--s-sans_suite); color: #fff; }

/* ---------- atelier des prix */
.question-prix { border-left: 4px solid var(--s-relance_7); }
.question-prix textarea, .regle textarea { width: 100%; min-height: 64px; margin-top: 8px; }
.regle { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--bord); }
.regle:last-child { border-bottom: 0; }
.groupe-tarifs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.groupe-tarifs fieldset { margin: 0; }
.clients > *, .fiche-client > *, .boite > *, .grille-projet > *, .grille-tdb > *, .grille-tdb-bas > * { min-width: 0; }
.historique .bulle .sujet { overflow-wrap: anywhere; }
.entete-client .coordonnees dt { font-size: 12px; color: var(--doux); } .entete-client .coordonnees dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* ---------- à facturer */
.entete-fiche-facture { display: flex; gap: 12px; align-items: center; }
.grille-facture { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.champ-facture { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--doux); }
.champ-facture.large { grid-column: span 2; }
.avec-copie { display: flex; gap: 4px; } .avec-copie input { flex: 1; min-width: 0; }
.lignes-facture { width: 100%; border-collapse: collapse; }
.lignes-facture th { text-align: left; font-size: 12px; color: var(--doux); font-weight: 600; padding: 4px; }
.lignes-facture td { padding: 4px; } .lignes-facture input { width: 100%; }
.lignes-facture td:nth-child(2) { width: 80px; } .lignes-facture td:nth-child(3) { width: 130px; }
.lignes-facture .l-total { width: 120px; text-align: right; font-weight: 600; white-space: nowrap; }
.totaux-facture { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; margin: 10px 0; }
.totaux-facture label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--doux); }
.totaux { text-align: right; } .totaux div { margin: 2px 0; } .totaux .ttc { font-size: 17px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
@media (max-width: 900px) { .totaux-facture { grid-template-columns: 1fr; } .champ-facture.large { grid-column: auto; } }

.puces .puce { display: inline-flex; align-items: center; gap: 6px; }
.puces .puce .point { width: 8px; height: 8px; }
.separateur-puces { width: 1px; align-self: stretch; background: var(--bord); margin: 2px 4px; }
.compte-relance { font-size: 11px; font-weight: 700; color: #fff; background: var(--s-relance_15); border-radius: 999px; padding: 1px 7px; }

.pieces-origine { margin: 0 0 12px; } .pieces-origine .images-email { margin-top: 6px; } .pieces-origine .images-email img { max-height: 260px; }
.historique-brouillon { margin: 0 0 12px; background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; }
.historique-brouillon summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.historique-brouillon .historique { margin-top: 10px; max-height: 420px; }

.bloc-illustration { margin: 12px 0; } .bloc-illustration img { display: block; max-width: 100%; max-height: 460px; border-radius: 10px; border: 1px solid var(--bord); margin: 6px 0; }
.c-illustration .actions input { flex: 1; min-width: 220px; }

.indicateur .valeur-montant { font-size: clamp(17px, 1.6vw, 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indicateur > div { min-width: 0; }
.legende-flux { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--doux); margin: -4px 0 8px; }
.legende-flux > span { display: inline-flex; align-items: center; gap: 6px; }
.totaux-flux { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.totaux-flux div { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; font-size: 12px; }
.totaux-flux b { font-size: 17px; }
@media (max-width: 900px) { .totaux-flux { grid-template-columns: 1fr 1fr; } }

.entete-flux { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ca-annee { text-align: right; display: flex; flex-direction: column; line-height: 1.15; }
.ca-annee span { font-size: 12px; color: var(--doux); } .ca-annee b { font-size: 26px; color: var(--s-accepte); } .ca-annee small { color: var(--doux); }
.indicateur .libelle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dialogue-apercu { width: min(920px, 94vw); height: 90vh; padding: 0; display: none; flex-direction: column; overflow: hidden; }
.dialogue-apercu[open] { display: flex; }
.apercu-titre { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--bord); }
.apercu-titre form { margin: 0; }
.apercu-entete { padding: 10px 18px; font-size: 13px; display: grid; gap: 3px; border-bottom: 1px solid var(--bord); background: var(--surface-2); }
.apercu-entete .doux { display: inline-block; width: 50px; }
.dialogue-apercu iframe { flex: 1; width: 100%; border: 0; background: #fff; }

.boite-brouillons { height: calc(100vh - 64px - 200px); min-height: 520px; grid-template-columns: minmax(300px, 380px) 1fr; }
.boite-brouillons .lecture .brouillon { margin: 0; }

.commandes-flux { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.interrupteur { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.interrupteur input { display: none; }
.interrupteur span { width: 38px; height: 22px; border-radius: 999px; background: var(--bord); position: relative; transition: background .15s; flex: none; }
.interrupteur span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.interrupteur input:checked + span { background: var(--s-accepte); }
.interrupteur input:checked + span::after { left: 19px; }
.ca-annee-inline { margin-left: auto; color: var(--texte); }
.table-comparaison { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.table-comparaison th, .table-comparaison td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--bord); }
.table-comparaison th:first-child, .table-comparaison td:first-child { text-align: left; }
.evolution { font-weight: 700; } .evolution.hausse { color: var(--s-accepte); } .evolution.baisse { color: var(--s-refus); }

.icone-cube { width: 15px; height: 15px; fill: currentColor; flex: none; }
.piece-3d { display: inline-flex; align-items: center; gap: 6px; }
.piece-3d .icone-cube { color: var(--accent); }
.piece-3d .dims-3d { font-size: 11px; padding-left: 6px; border-left: 1px solid var(--bord); }
.fichier.fichier-3d { grid-template-columns: 30px 1fr auto auto auto; }
.fichier-3d .type-fichier { display: grid; place-items: center; color: #fff; }
.fichier-3d .type-fichier .icone-cube { width: 16px; height: 16px; }
.fichier-3d .dims-3d { white-space: nowrap; }
.apercu-3d .agrandir-3d { position: absolute; right: 10px; top: 10px; }
.dialogue-3d { width: min(1180px, 95vw); height: min(780px, 90vh); padding: 0; display: none; flex-direction: column; overflow: hidden; }
.dialogue-3d[open] { display: flex; }
.actions-3d { display: flex; gap: 8px; align-items: center; } .actions-3d form { margin: 0; }
.corps-3d { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.corps-3d .scene-3d { height: auto; margin: 0; border-radius: 0; }
.infos-3d { padding: 16px 18px; overflow: auto; border-left: 1px solid var(--bord); background: var(--surface); }
.infos-3d h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 16px 0 8px; }
.infos-3d h3:first-child { margin-top: 0; }
.dims-grille { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.dims-grille dt { color: var(--doux); } .dims-grille dd { margin: 0; display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; }
.machine-3d { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }

.ligne-email.prioritaire { box-shadow: inset 0 0 0 2px var(--s-refus); border-radius: 10px; margin: 6px 8px; border-bottom: 0; }
.ligne-email.prioritaire.active { box-shadow: inset 0 0 0 2px var(--s-refus), inset 5px 0 0 var(--s-refus); }
.raison-prioritaire { grid-column: 1 / -1; color: var(--s-refus); font-size: 12px; font-weight: 600; }
.entete-prioritaires { padding: 10px 14px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--s-refus); }
.bandeau-prioritaire { border: 2px solid var(--s-refus); border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; font-size: 13px; }
.bandeau-prioritaire b { color: var(--s-refus); }
.tag-chiffre { color: var(--s-accepte); }
.chiffrage-auto { border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; background: var(--surface-2); }
.ligne-chiffrage { display: grid; grid-template-columns: 16px 1fr auto auto auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.ligne-chiffrage .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-chiffrage .icone-cube { color: var(--accent); }

.traduction-cote { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 12px; }
.traduction-cote > div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.titre-langue { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); margin-bottom: 6px; }
.texte-langue { white-space: pre-wrap; font-size: 13px; max-height: 320px; overflow: auto; overflow-wrap: anywhere; }
.texte-langue.traduit { border-left: 3px solid var(--accent); padding-left: 10px; }
.barre-tri { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 13px; }
.barre-tri select { margin-left: 6px; }
.langue-envoi { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0; font-size: 13px; }
.langue-envoi select { margin-left: 6px; }
.brouillon .origine.origine-courte { max-height: 44px; overflow: hidden; }

.apercu-pdf { display: inline-flex; flex-direction: column; margin: 0; cursor: pointer; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid var(--bord); max-width: 260px; }
.apercu-pdf img { max-height: 300px; width: auto; display: block; }
.apercu-pdf figcaption { font-size: 12px; padding: 5px 8px; color: #172436; background: #f4f7fb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-admin { color: var(--s-relance_7); }
#cherche-brouillons { min-width: 240px; }

.note-calcul { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--doux); padding: 4px 0 6px; }
.avertissement-calcul { padding: 8px 18px; font-size: 13px; background: var(--accent-doux); border-bottom: 1px solid var(--bord); }
.brouillon-pret { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }

#onglets-boite .non-lus { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--s-refus); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* Suivi d'ouverture des emails envoyés */
.ouverture { margin-top: 6px; font-size: 12px; color: var(--doux, #8a94a3); }
.ouverture::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; opacity: .7; }
.ouverture.ouvert { color: var(--s-accepte, #2f9e66); font-weight: 600; }
.ouverture.auto { color: var(--s-relance_7, #c9892b); }

.traduction-cote .corps-html { height: 48vh; }
.corps-origine > .corps-html { height: 48vh; margin-top: 8px; }

/* Fiche projet : résumé de la commande et production */
.carte-commande { margin-bottom: 14px; }
.entete-commande { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.entete-commande h2 { margin: 0; }
.actions-production { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grille-commande { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; align-items: stretch; }
.grille-commande > * { min-width: 0; margin-bottom: 0; }
@media (max-width: 1100px) { .grille-commande { grid-template-columns: 1fr 1fr; } .grille-commande > :first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .grille-commande { grid-template-columns: 1fr; } }
.grille-commande p { margin: 6px 0; }
.type-projet { display: inline-block; background: var(--accent-doux); color: var(--texte); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.articles { margin: 8px 0; padding-left: 18px; } .articles li { margin-bottom: 6px; } .articles small { display: block; color: var(--doux); }
.paires { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-top: 8px; font-size: 13px; } .paires span { color: var(--doux); }
.grand-texte { font-size: 16px; font-weight: 700; }
.manque { color: var(--s-relance_7); font-weight: 600; }
.alerte-commande { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.12); margin-bottom: 12px; }
.fichiers-commande { display: flex; flex-direction: column; gap: 6px; }
.fichier-commande { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.fichier-commande .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.fichier-commande .nom:hover { text-decoration: underline; }
.titre-fichiers { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ligne-projet.avec-actions { grid-template-columns: 1fr auto auto 130px 16px; }
.actions-ligne { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.actions-ligne:empty { display: none; }
.ligne-partie { opacity: 0; transition: opacity .3s; }
.etiquette-tripo { display: inline-block; background: rgba(139,92,246,.22); color: var(--texte); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; margin-right: 4px; }
.actions-entete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ligne-projet.avec-actions.avec-coche { grid-template-columns: 22px 1fr auto auto 130px 16px; }
.case-ligne { display: flex; align-items: center; justify-content: center; }
.case-ligne input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--accent); }
.barre-selection { position: sticky; bottom: 14px; margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.35); z-index: 5; }
.barre-selection #p-nb { font-weight: 700; margin-right: auto; }
.bloc-pieces-images { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; } .bloc-pieces-images figure { margin: 0; flex: 1 1 260px; max-width: 420px; } .bloc-pieces-images img { display: block; width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond, #fff); }
.bloc-pieces { margin: 10px 0; padding: 8px 10px; border: 1px dashed var(--bord); border-radius: 10px; }
.c-pieces.survol .bloc-pieces { border-color: var(--accent, #2ea9e0); background: rgba(46, 169, 224, .06); }
.c-joindre { cursor: pointer; display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--bord); border-radius: 8px; }
.liste-pieces { list-style: none; margin: 6px 0 0; padding: 0; } .liste-pieces li { padding: 3px 0; }
.c-retirer-piece { background: none; border: 0; color: #c0392b; cursor: pointer; font-size: .85em; margin-left: 8px; padding: 0; }

/* ---- tri des projets */
.tri-filtres { align-items: center; }
.tri-filtres button.actif { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tri-filtres .nb { opacity: .7; margin-left: 4px; }
.tri-aide { font-size: 12px; margin-left: auto; }
.tri-liste { display: flex; flex-direction: column; gap: 12px; }
.tri-carte { border-left: 4px solid var(--c); padding: 14px 18px; outline: none; transition: opacity .2s; }
.tri-carte:focus { box-shadow: 0 0 0 2px var(--accent), var(--ombre); }
.tri-tete { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tri-client { font-size: 12px; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; }
.tri-titre { font-weight: 700; font-size: 16px; color: var(--texte); text-decoration: none; }
.tri-titre:hover { text-decoration: underline; }
.tri-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.tri-meta .etiquette-statut { background: var(--c); color: #fff; border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.tri-jours { font-weight: 600; }
.tri-resume { margin: 10px 0 4px; font-size: 13px; line-height: 1.45; }
.tri-action { margin: 0 0 8px; font-size: 12px; }
.tri-proposition { font-size: 13px; margin: 8px 0; }
.tri-boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.tri-boutons kbd { font: 600 10px/1 ui-monospace, monospace; opacity: .65; margin-left: 4px; border: 1px solid currentColor; border-radius: 3px; padding: 1px 3px; }
.tri-carte.traite > :not(.tri-fait) { display: none; }
.tri-carte.traite { opacity: .6; padding: 8px 18px; }
.tri-fait { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }

/* ============================================================== tableau de bord (charte commune) */
.tdb { display: flex; flex-direction: column; gap: 22px; max-width: 1400px; }
.tdb-entete { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.tdb-entete p { margin: 4px 0 0; color: var(--doux); font-size: 15px; }
.direct { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface);
          border: 1px solid var(--bord); font-weight: 600; font-size: 13px; }
.direct i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tuile { text-align: left; background: var(--surface); color: var(--texte); border: 1px solid var(--bord); border-top: 5px solid var(--c);
         border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; font-weight: 400; }
.tuile:hover { box-shadow: 0 4px 14px rgba(16,24,40,.08); }
.tuile b { font-family: var(--titres); font-size: 38px; line-height: 1; color: var(--c); }
.tuile strong { font-size: 15px; }
.tuile small { color: var(--doux); font-size: 13px; }
.tuile.calme { border-top-color: var(--bord); } .tuile.calme b { color: var(--doux); }
.carte-tdb { background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; padding: 18px 20px; }
.carte-tdb .titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.carte-tdb .titre h2 { margin: 0; }
.carte-tdb .titre span { color: var(--doux); font-size: 13px; }
.etapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.etape { text-align: left; color: var(--texte); background: var(--surface-2); border-radius: 10px; padding: 12px;
         border-bottom: 4px solid var(--c); display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.etape b { font-family: var(--titres); font-size: 24px; } .etape span { font-size: 13px; }
.deux-colonnes { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.deux-colonnes > .large { flex: 3 1 520px; min-width: 0; } .deux-colonnes > .etroite { flex: 2 1 340px; min-width: 0; }
.ligne-tdb { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--bord); cursor: pointer; }
.ligne-tdb:hover .quoi strong { color: var(--accent); }
.ligne-tdb .quoi { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne-tdb .quoi strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-tdb .quoi small { color: var(--doux); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquette { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
             color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.point { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.lien-bas { display: inline-block; padding-top: 10px; border-top: 1px solid var(--bord); width: 100%; font-weight: 600; }
.table-projets { overflow-x: auto; }
.table-projets .rang { display: grid; grid-template-columns: 2.4fr 1.3fr 2.4fr 1.1fr; gap: 14px; padding: 11px 0;
                       border-top: 1px solid var(--bord); align-items: center; min-width: 760px; cursor: pointer; }
.table-projets .rang.entete { cursor: default; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); }
.table-projets .rang:not(.entete):hover strong { color: var(--accent); }
.table-projets small { color: var(--doux); }
details.chiffres > summary { cursor: pointer; font-family: var(--titres); font-weight: 600; font-size: 17px; padding: 4px 0; }
details.chiffres[open] > summary { margin-bottom: 14px; }

/* ============================================================== écrans simplifiés (Aujourd'hui, Dossiers, fiche) */
.simple { display: flex; flex-direction: column; gap: 18px; max-width: 1280px; }
.simple-entete p { margin: 4px 0 0; color: var(--doux); font-size: 15px; }
.onglets { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--bord); }
.onglet { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--doux); font-weight: 600;
          border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglet span { background: var(--surface-2); color: var(--texte); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.onglet.actif { color: var(--texte); border-bottom-color: var(--accent); }
.liste-simple { background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; overflow: hidden; }
.ligne-simple { display: grid; grid-template-columns: 110px minmax(180px, 1.3fr) minmax(0, 2fr) 110px; gap: 14px;
                align-items: center; padding: 13px 18px; border-top: 1px solid var(--bord); color: var(--texte); }
.ligne-simple:first-child { border-top: 0; }
.ligne-simple:hover { background: var(--surface-2); }
.ligne-simple .quoi { display: flex; flex-direction: column; min-width: 0; }
.ligne-simple .quoi span, .ligne-simple .detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-simple .quoi span, .ligne-simple .detail, .ligne-simple .quand { color: var(--doux); font-size: 13px; }
.ligne-simple .quand { text-align: right; }
.ligne-simple .etiquette { justify-self: start; }
@media (max-width: 800px) { .ligne-simple { grid-template-columns: 1fr; gap: 4px; } .ligne-simple .quand { text-align: left; } }
.grande-recherche { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--bord);
                    border-radius: 14px; padding: 4px 18px; }
.grande-recherche:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-doux); }
.grande-recherche svg { width: 24px; height: 24px; color: var(--doux); flex-shrink: 0; }
.grande-recherche input { border: 0; outline: none; background: transparent; font-size: 19px; padding: 14px 0; width: 100%; }
.pastilles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pastilles .separe { width: 1px; height: 24px; background: var(--bord); margin: 0 4px; }
.pastille-etape { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--texte);
                  border: 1px solid var(--bord); border-radius: 999px; padding: 7px 14px; font-weight: 600; }
.pastille-etape::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pastille-etape span { color: var(--doux); font-weight: 500; }
.pastille-etape.actif { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.resultat-recherche { font-size: 13px; }
.cartes-dossiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.carte-dossier { display: flex; flex-direction: column; gap: 4px; background: var(--surface); color: var(--texte);
                 border: 1px solid var(--bord); border-left: 5px solid var(--c); border-radius: 12px; padding: 14px 16px; min-height: 128px; }
.carte-dossier:hover { box-shadow: 0 4px 14px rgba(16,24,40,.09); }
.carte-dossier .haut-carte { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.carte-dossier .haut-carte small, .carte-dossier .prochaine { color: var(--doux); font-size: 13px; }
.carte-dossier strong { font-size: 16px; }
.carte-dossier .objet { font-size: 14px; }
.carte-dossier .prochaine { margin-top: auto; padding-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fiche .retour { font-weight: 600; }
.fiche-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ou-on-en-est { background: var(--surface); border: 1px solid var(--bord); border-left: 6px solid var(--c); border-radius: 14px; padding: 18px 20px; }
.ou-on-en-est > b { font-family: var(--titres); font-size: 17px; }
.ou-on-en-est p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; }
.ou-on-en-est .qui { color: var(--doux); font-size: 14px; }
.boutons-fiche { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
a.bouton { display: inline-block; padding: 9px 16px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 600; }
a.bouton.secondaire { background: transparent; color: var(--texte); border: 1px solid var(--bord); font-weight: 500; }
.frise { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.frise li { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--doux); }
.frise li i { height: 8px; border-radius: 99px; background: var(--bord); }
.frise li.fait i { background: color-mix(in srgb, var(--c) 45%, var(--bord)); }
.frise li.actuel i { background: var(--c); height: 10px; }
.frise li.actuel span { color: var(--texte); font-weight: 700; }
.evenement { display: flex; gap: 12px; width: 100%; text-align: left; background: transparent; color: var(--texte);
             border: 0; border-top: 1px solid var(--bord); border-radius: 0; padding: 12px 0; font-weight: 400; }
.evenement:hover .quoi strong { color: var(--accent); }
.evenement .point { margin-top: 6px; }
.evenement .quoi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evenement .quoi span { font-size: 14px; } .evenement .quoi small { color: var(--doux); font-size: 13px; }
.resume-fiche { margin: 0; font-size: 14px; line-height: 1.55; }
.fichiers-fiche { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.autre-dossier { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--texte); font-size: 13px; }
.anciens-ecrans { margin-top: 14px; }
.anciens-ecrans > summary { cursor: pointer; color: #8fa0b9; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px; }
.anciens-ecrans .anciens-liens { opacity: .8; }
body.menu-replie .anciens-ecrans { display: none; }

/* ============================================================== Vénus, la secrétaire (avatar + conversation) */
.venus { position: fixed; right: 22px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.venus-avatar { position: relative; width: 92px; height: 92px; padding: 0; border-radius: 50%; background: #1a1230;
                box-shadow: 0 6px 22px rgba(80, 30, 90, .35), 0 0 0 3px rgba(155, 47, 106, .35); overflow: visible; }
.venus-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.venus-avatar:hover { transform: translateY(-2px); }
.venus-bulle { position: absolute; right: 100px; top: 28px; white-space: nowrap; background: var(--surface); color: var(--texte);
               border: 1px solid var(--bord); border-radius: 12px; padding: 6px 12px; font-size: 13px; font-weight: 600;
               box-shadow: var(--ombre); opacity: 0; transition: opacity .2s; pointer-events: none; }
.venus-avatar:hover .venus-bulle { opacity: 1; }
.venus.ouvert .venus-bulle { display: none; }
.venus-panneau { width: min(430px, calc(100vw - 32px)); height: min(620px, calc(100vh - 150px)); background: var(--surface);
                 border: 1px solid var(--bord); border-radius: 18px; box-shadow: 0 18px 50px rgba(16, 24, 40, .25);
                 display: flex; flex-direction: column; overflow: hidden; }
.venus-panneau header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #1a1230; color: #fff; }
.venus-panneau header div { flex: 1; display: flex; flex-direction: column; }
.venus-panneau header small { color: #d9c3e6; font-size: 12px; }
.venus-panneau header .venus-fermer { color: #fff; border-color: rgba(255,255,255,.3); }
.venus-mini { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.venus-fil { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--fond); }
.venus-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.venus-msg p { margin: 0 0 6px; } .venus-msg p:last-child { margin: 0; }
.venus-msg ul { margin: 4px 0 6px; padding-left: 18px; } .venus-msg li { margin: 3px 0; }
.venus-msg.moi { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.venus-msg.elle { align-self: flex-start; background: var(--surface); border: 1px solid var(--bord); border-bottom-left-radius: 4px; }
.venus-msg.erreur { border-color: var(--erreur); }
.venus-lien { display: block; margin-top: 8px; font-weight: 600; font-size: 13px; }
.venus-fait { display: block; margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 13px;
              background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); font-weight: 600; }
.venus-msg.attente { color: var(--doux); }
.points { display: inline-flex; gap: 3px; margin-right: 6px; }
.points i { width: 6px; height: 6px; border-radius: 50%; background: var(--venus); animation: venus-point 1s infinite ease-in-out; }
.points i:nth-child(2) { animation-delay: .15s; } .points i:nth-child(3) { animation-delay: .3s; }
@keyframes venus-point { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.venus-suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0; background: var(--surface); }
.venus-suggestions button { font-size: 12px; }
.venus-saisie { display: flex; gap: 8px; padding: 10px 14px 14px; background: var(--surface); }
.venus-saisie textarea { flex: 1; resize: none; font-size: 14px; }
.venus-saisie button { align-self: flex-end; background: var(--venus); }
.evenement .traduit { font-style: normal; font-size: 12px; color: var(--accent); background: var(--accent-doux); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
