/* ==========================================================================
   ProspectClient — feuille de style unique
   Direction : CRM façon HubSpot. Menu latéral ardoise à gauche, barre du
   haut blanche avec une grande recherche, fond gris très clair, tableaux
   nets, un seul accent corail pour les actions principales et une couleur
   par étape du parcours (à contacter → démo → devis → gagné).
   Police : Lexend Deca (texte) et Geist Mono (chiffres).
   ========================================================================== */

:root {
  --teams: #5b5fc7; /* violet Microsoft Teams */
  --bg: #f5f8fa;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --surface-3: #eaf0f6;
  --line: #dfe3eb;
  --line-2: #cbd6e2;
  --text: #33475b;
  --text-2: #516f90;
  --text-3: #7c98b6;
  --navy: #213343;
  --navy-2: #2d3e50;
  --navy-3: #3e5468;
  --navy-text: #b6c6d6;
  --accent: #ff5c35;
  --accent-2: #e8481f;
  --accent-soft: #fff1ee;
  --accent-ring: rgba(255, 92, 53, 0.22);
  --on-accent: #ffffff;
  --link: #0091ae;
  --focus: #00a4bd;
  /* Une couleur par étape du parcours */
  --st-new: #516f90;       --st-new-bg: #eaf0f6;
  --st-meeting: #0068b1;   --st-meeting-bg: #e5f1fb;
  --st-demo: #00857a;      --st-demo-bg: #e0f5f2;
  --st-quote: #b25f00;     --st-quote-bg: #fef1de;
  --st-won: #00804c;       --st-won-bg: #e2f6ec;
  --st-lost: #c43a2b;      --st-lost-bg: #fde8e5;
  --shadow: 0 1px 3px rgba(45, 62, 80, 0.08);
  --shadow-lg: 0 18px 44px -14px rgba(33, 51, 67, 0.35), 0 2px 6px rgba(33, 51, 67, 0.08);
  --radius: 8px;
  --radius-sm: 4px;
  --side-w: 236px;
  --top-h: 60px;
  --f-body: "Lexend Deca", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1923;
    --surface: #17242f;
    --surface-2: #1c2b38;
    --surface-3: #23384a;
    --line: #2a3d4f;
    --line-2: #3a5167;
    --text: #e6edf4;
    --text-2: #a9bbcd;
    --text-3: #7189a2;
    --navy: #0b141c;
    --navy-2: #15212c;
    --navy-3: #22364a;
    --accent: #ff7a59;
    --accent-2: #ff9478;
    --accent-soft: #3a1a12;
    --accent-ring: rgba(255, 122, 89, 0.28);
    --on-accent: #1f0b05;
    --link: #4fd1e6;
    --focus: #4fd1e6;
    --st-new: #a9bbcd;     --st-new-bg: #22313f;
    --st-meeting: #6cb6f2; --st-meeting-bg: #13304a;
    --st-demo: #4fd1c1;    --st-demo-bg: #0f2e2d;
    --st-quote: #f2b451;   --st-quote-bg: #33260e;
    --st-won: #5fd39a;     --st-won-bg: #0f2e20;
    --st-lost: #f28b7f;    --st-lost-bg: #361714;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px -16px rgba(0, 0, 0, 0.75);
  }
}

* { box-sizing: border-box; }
/* Un élément masqué reste masqué, même s'il a un style d'affichage */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: 14px; line-height: 1.55; font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; color: var(--text); }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

/* --- Menu latéral (gauche) -------------------------------------------------- */

.app { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--side-w);
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
}
.brand {
  display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px; flex: none;
  color: #fff; font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark .i { width: 19px; height: 19px; }
/* Logo importé dans Réglages : fond blanc pour rester lisible sur le menu sombre */
.brand-logo { height: 32px; max-width: 110px; object-fit: contain; background: #fff; border-radius: 5px; padding: 2px 4px; flex: none; }
.brand-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.side-titre {
  padding: 16px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #7f95ab;
}
.tab {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 6px;
  color: var(--navy-text); font-size: 14px; font-weight: 400; transition: background .15s, color .15s;
}
.tab .i { width: 18px; height: 18px; opacity: .85; }
.tab:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.tab.actif { color: #fff; background: var(--navy-3); font-weight: 500; }
.tab.actif .i { opacity: 1; color: #ff8f73; }
.tab.actif::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.tab .badge { margin-left: auto; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; font-family: var(--f-mono);
}

.side-user {
  display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; flex: none;
  border-top: 1px solid rgba(255, 255, 255, .07); background: rgba(0, 0, 0, .12);
}
.side-user-nom { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role { font-size: 11.5px; color: var(--navy-text); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #ff8f73, var(--accent)); color: #fff; font-size: 12px; font-weight: 600;
}
.logout { background: none; border: 0; color: var(--navy-text); cursor: pointer; padding: 7px; border-radius: 6px; display: grid; }
.logout:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* --- Barre du haut (blanche) ------------------------------------------------- */

.main { flex: 1; min-width: 0; margin-left: var(--side-w); display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: -8px; border-radius: 6px; color: var(--text); }
.menu-btn:hover { background: var(--surface-3); }
.top-search { position: relative; flex: 1; max-width: 520px; }
.top-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.top-search input {
  width: 100%; padding: 9px 14px 9px 38px; border-radius: 6px; font: inherit; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.top-search input::placeholder { color: var(--text-3); }
.top-search input:focus { outline: none; background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-cloche { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; color: var(--text-2); }
.top-cloche:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.top-cloche .badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; border: 2px solid var(--surface); }

/* --- Page ---------------------------------------------------------------- */

.page { width: 100%; max-width: 1360px; margin: 0 auto; padding: 26px 32px 64px; }
.page > * { animation: apparition .35s var(--ease) both; }
.page > *:nth-child(2) { animation-delay: .03s; }
.page > *:nth-child(3) { animation-delay: .06s; }
.page > *:nth-child(n+4) { animation-delay: .09s; }
@keyframes apparition { from { opacity: 0; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .page > * { animation: none; } }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 70ch; }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; font-weight: 500; }
.back .i { width: 16px; height: 16px; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }

/* --- Boutons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  padding: 8.5px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer; line-height: 1.25;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(232, 72, 31, .25);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn-lg { padding: 12px 20px; font-size: 15px; border-radius: 6px; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-won { color: var(--st-won); }
.btn-lost { color: var(--st-lost); }
.top .btn-primary { padding: 9px 16px; }

/* --- Cartes -------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .cols-2, .cols-main { grid-template-columns: 1fr; } }

.grow { flex: 1; min-width: 0; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .94em; }
.strong { font-weight: 500; }
td a.strong { color: var(--link); }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* --- Étapes du parcours -------------------------------------------------- */

.statut {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--st-new-bg); color: var(--st-new);
}
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut.new { background: var(--st-new-bg); color: var(--st-new); }
.statut.meeting { background: var(--st-meeting-bg); color: var(--st-meeting); }
.statut.demo { background: var(--st-demo-bg); color: var(--st-demo); }
.statut.quote { background: var(--st-quote-bg); color: var(--st-quote); }
.statut.won { background: var(--st-won-bg); color: var(--st-won); }
.statut.lost { background: var(--st-lost-bg); color: var(--st-lost); }

/* Compteurs du parcours (accueil et liste) */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pipe {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); position: relative; overflow: hidden;
  transition: border-color .15s, transform .15s var(--ease), box-shadow .15s;
}
.pipe::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--st-new)); }
.pipe:hover { text-decoration: none; border-color: var(--c); transform: translateY(-1px); box-shadow: var(--shadow); }
.pipe.actif { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.pipe .n { font-size: 26px; font-weight: 500; letter-spacing: -0.03em; font-family: var(--f-mono); line-height: 1.1; }
.pipe .l { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.pipe.new { --c: var(--st-new); } .pipe.meeting { --c: var(--st-meeting); } .pipe.demo { --c: var(--st-demo); }
.pipe.quote { --c: var(--st-quote); } .pipe.won { --c: var(--st-won); } .pipe.lost { --c: var(--st-lost); }
@media (max-width: 980px) { .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Frise des étapes sur la fiche cabinet */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 550; color: var(--text-3); }
.step + .step::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--line-2); }
.step .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); font-size: 11px; background: var(--surface); }
.step.fait { color: var(--text-2); }
.step.fait .dot { background: var(--st-won); border-color: var(--st-won); color: #fff; }
.step.encours { color: var(--text); }
.step.encours .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }

/* --- Listes et tableaux --------------------------------------------------- */

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line);
  color: inherit; transition: background .12s;
}
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface-2); text-decoration: none; }
.row .grow { flex: 1; min-width: 0; }
.row .titre { font-weight: 600; }
.row .sous { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { flex: none; width: 58px; text-align: center; }
.when .h { font-family: var(--f-mono); font-weight: 600; font-size: 14px; }
.when .d { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.ico-rond { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.ico-rond.accent { background: var(--accent-soft); color: var(--accent); }
.ico-rond.bleu { background: var(--st-meeting-bg); color: var(--st-meeting); }
.ico-rond.vert { background: var(--st-demo-bg); color: var(--st-demo); }
.ico-rond.jaune { background: var(--st-quote-bg); color: var(--st-quote); }
.empty { padding: 26px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty .i { width: 26px; height: 26px; display: block; margin: 0 auto 8px; opacity: .6; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap { overflow-x: auto; }
th {
  text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  font-weight: 500; padding: 11px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); white-space: nowrap; color: var(--text-2);
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr[data-href] { cursor: pointer; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* Définitions (fiche cabinet) */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.fact .k { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 2px; }
.fact .v { font-weight: 550; }
.fact .v.vide { color: var(--text-3); font-weight: 400; }
.fact.large { grid-column: 1 / -1; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

/* --- Formulaires ----------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .large { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: 13px; color: var(--text); font-weight: 500; }
.field input, .field select, .field textarea, form input, form select, form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
form input:hover, form select:hover, form textarea:hover { border-color: var(--text-3); }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
form input::placeholder, form textarea::placeholder { color: var(--text-3); }
form textarea { resize: vertical; line-height: 1.55; }
.field select, form select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
form input[type="checkbox"], form input[type="radio"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; margin: 0; flex: none; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.field:has(.errorlist) input, .field:has(.errorlist) select { border-color: var(--st-lost); }
/* Champ mot de passe avec bouton œil */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--text); outline: none; background: var(--accent-ring); }
.password-toggle svg { width: 18px; height: 18px; }
.errorlist { color: var(--st-lost); font-size: 12.5px; margin: 0; padding: 0; list-style: none; }
.errorlist li::before { content: "⚠ "; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; margin-top: 16px; padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
details.plie summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.plie summary::-webkit-details-marker { display: none; }
details.plie summary::after { content: "Afficher"; margin-left: auto; font-size: 12.5px; color: var(--accent); font-weight: 550; }
details.plie[open] summary::after { content: "Masquer"; }

/* Choix en « pastilles » : logiciels (cases à cocher) et boutons radio */
[data-outils] > div, .choix > div { display: flex; flex-wrap: wrap; gap: 7px; }
[data-outils] > div > div, .choix > div > div { display: contents; }
[data-outils] label, .choix label {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none; transition: border-color .12s, background .12s, color .12s;
}
[data-outils] label:hover, .choix label:hover { border-color: var(--accent); }
[data-outils] input, .choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
[data-outils] label:has(input:checked), .choix label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-outils] label:has(input:checked)::before, .choix label:has(input:checked)::before { content: "✓"; font-weight: 700; }
[data-outils] label:has(input:focus-visible), .choix label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choix.grand label { padding: 11px 18px; border-radius: 12px; font-size: 14px; }
.ajout-outil { display: flex; gap: 8px; margin-top: 10px; max-width: 420px; }

/* Logo de l'entreprise (Réglages) */
.logo-zone { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-apercu {
  width: 180px; height: 90px; flex: none; border: 1px dashed var(--line-2); border-radius: 12px;
  display: grid; place-items: center; background: #fff; padding: 10px;
}
.logo-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-zone input[type="file"] { padding: 8px; background: var(--surface-2); max-width: 340px; }

/* Aide pas à pas (Réglages > Google Agenda) */
.aide { border-top: 1px solid var(--line); }
.aide > summary { padding: 14px 20px; font-weight: 600; font-size: 14px; color: var(--text); }
.aide > summary .i { color: var(--st-meeting); }
.aide-corps { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.aide h3 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.aide h3 .tag { font-weight: 600; }
.etapes { margin: 0; padding: 0; list-style: none; counter-reset: etape; display: flex; flex-direction: column; gap: 10px; }
.etapes li { counter-increment: etape; position: relative; padding-left: 36px; color: var(--text-2); line-height: 1.55; }
.etapes li::before {
  content: counter(etape); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--st-meeting-bg); color: var(--st-meeting); font-size: 12px; font-weight: 700;
}
.etapes b { color: var(--text); }
.copie { display: flex; gap: 6px; margin-top: 6px; max-width: 520px; }
.copie input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--f-mono); font-size: 12.5px; background: var(--surface-2); color: var(--text); }
.code-env { font-family: var(--f-mono); font-size: 12.5px; background: var(--navy); color: #dfe6f0; border-radius: 8px; padding: 10px 12px; margin-top: 6px; white-space: pre; overflow-x: auto; }
.avertissement { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--st-quote-bg); color: var(--st-quote); font-size: 13px; }

/* --- Rappels des démos (fenêtres en bas à droite) --------------------------- */
.rappels { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 12px; width: min(380px, calc(100vw - 32px)); }
.rappel {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px;
  animation: rappel-entree .35s var(--ease);
}
.rappel.urgent { border-left-color: var(--st-lost); }
.rappel-haut { display: flex; gap: 12px; align-items: flex-start; }
.rappel-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.rappel.urgent .rappel-ico { background: var(--st-lost-bg); color: var(--st-lost); animation: sonnerie 1s ease 2; }
.rappel-delai { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.rappel.urgent .rappel-delai { color: var(--st-lost); }
.rappel-titre { font-weight: 650; font-size: 15px; }
.rappel-fermer { background: none; border: 0; cursor: pointer; color: var(--text-3); padding: 2px; border-radius: 6px; }
.rappel-fermer:hover { color: var(--text); background: var(--surface-3); }
.rappel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rappel-notif { background: none; border: 0; padding: 0; text-align: left; font-size: 12px; color: var(--text-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@keyframes rappel-entree { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes sonnerie { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@media (max-width: 860px) { .rappels { right: 16px; bottom: 80px; } }

/* --- Messages -------------------------------------------------------------- */

.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.message {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 400;
  background: var(--st-won-bg); color: var(--st-won); border: 1px solid color-mix(in srgb, var(--st-won) 22%, transparent);
}
.message::before { content: "✓"; width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--st-won); color: #fff; font-size: 11px; font-weight: 800; }
.message.error { background: var(--st-lost-bg); color: var(--st-lost); border-color: color-mix(in srgb, var(--st-lost) 25%, transparent); }
.message.error::before { content: "!"; background: var(--st-lost); }
.message.info { background: var(--st-meeting-bg); color: var(--st-meeting); border-color: color-mix(in srgb, var(--st-meeting) 22%, transparent); }
.message.info::before { content: "i"; background: var(--st-meeting); }

/* --- Fenêtres ---------------------------------------------------------------- */

.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(9, 16, 28, .5); backdrop-filter: blur(3px); animation: fondu .15s; }
.overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; animation: montee .2s var(--ease); }
.modal > form { display: flex; flex-direction: column; min-height: 0; }
.modal-top { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-top h3 { font-size: 18px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fondu { from { opacity: 0; } }
@keyframes montee { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* --- Connexion ------------------------------------------------------------- */

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: radial-gradient(700px 400px at 100% 100%, rgba(255, 92, 53, .30), transparent 60%), var(--navy);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden;
}
.login-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px;
}
.login-art > * { position: relative; }
.login-art h2 { font-size: 40px; line-height: 1.1; max-width: 14ch; letter-spacing: -0.035em; }
.login-art h2 span { color: #ff8f73; }
.login-art p { color: var(--navy-text); font-size: 15px; max-width: 42ch; margin-top: 14px; }
.parcours { display: flex; flex-direction: column; gap: 12px; }
.parcours div { display: flex; align-items: center; gap: 12px; color: #dfe6f0; font-size: 14px; }
.parcours b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: 12.5px; font-family: var(--f-mono); color: #ff9a66; }
.login-side { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { font-size: 30px; }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-art { display: none; } }

/* --- Mobile : le menu latéral devient un tiroir ------------------------------ */

.side-fond { position: fixed; inset: 0; z-index: 35; background: rgba(15, 25, 35, .5); backdrop-filter: blur(2px); }
@media (max-width: 960px) {
  .side { transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg); }
  body.menu-ouvert .side { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .top { padding: 0 16px; gap: 10px; }
  .top .btn-primary .lib { display: none; }
  .page { padding: 20px 16px 72px; }
  .page-head h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ============================================================
   Agenda façon Google Agenda
   ============================================================ */
.agenda { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: start; }
.agenda-side { display: flex; flex-direction: column; gap: 18px; }
.agenda-creer { align-self: flex-start; }
.agenda-google { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.agenda-legende { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.agenda-legende span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.mini-titre { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; padding-left: 4px; text-transform: capitalize; }
.mini-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 11.5px; }
.mini-jour-nom { color: var(--text-3); font-weight: 600; padding: 3px 0; }
.mini-jour { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; color: var(--text); }
.mini-jour:hover { background: var(--surface-3); text-decoration: none; }
.mini-jour.hors-mois { color: var(--text-3); }
.mini-jour.semaine-choisie { background: var(--accent-soft); }
.mini-jour.aujourdhui { background: var(--accent); color: var(--on-accent); font-weight: 700; }

.agenda-barre { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.agenda-fleche { padding: 7px 9px; }
.agenda-titre { font-size: 24px; margin-left: 8px; text-transform: capitalize; }

.agenda-cadre { overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.agenda-grille { display: grid; grid-template-columns: 56px repeat(7, minmax(108px, 1fr)); min-width: 820px; }
.agenda-coin, .agenda-entete { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.agenda-entete { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 7px; border-left: 1px solid var(--line); }
.agenda-nom-jour { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .06em; }
.agenda-num-jour { font-size: 21px; font-weight: 600; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.agenda-entete.aujourdhui .agenda-nom-jour { color: var(--accent); }
.agenda-entete.aujourdhui .agenda-num-jour { background: var(--accent); color: var(--on-accent); }
.agenda-heure { height: var(--hauteur-heure); position: relative; }
.agenda-heure span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--text-3); font-family: var(--f-mono); }
.agenda-heure:first-child span { display: none; }
.agenda-jour {
  position: relative; height: var(--hauteur-grille); border-left: 1px solid var(--line); cursor: cell;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hauteur-heure));
}
.agenda-jour:hover { background-color: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.agenda-jour.aujourdhui { background-color: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.agenda-rdv {
  position: absolute; z-index: 1; overflow: hidden; text-align: left; cursor: pointer; font: inherit;
  font-size: 12px; line-height: 1.3; padding: 4px 7px; border: 1px solid var(--surface); border-left: 3px solid; border-radius: 7px;
}
.agenda-rdv:hover { z-index: 3; box-shadow: var(--shadow-lg); }
.agenda-rdv b, .agenda-rdv span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-rdv.visio { background: var(--st-meeting-bg); border-left-color: var(--st-meeting); color: var(--st-meeting); }
.agenda-rdv.phone { background: var(--st-demo-bg); border-left-color: var(--st-demo); color: var(--st-demo); }
.agenda-rdv.google { background: var(--surface-3); border-left-color: var(--text-3); color: var(--text-2); }
.agenda-rdv.teams { background: var(--surface-3); border-left-color: var(--teams); color: var(--text-2); }
.agenda-rdv.fait { opacity: .6; }
.agenda-rdv.annule { opacity: .9; }
.agenda-rdv.court { display: flex; gap: 5px; align-items: center; padding-top: 1px; padding-bottom: 1px; }
.agenda-rdv.court b { flex-shrink: 0; max-width: 60%; }
.agenda-maintenant { position: absolute; left: -1px; right: 0; height: 2px; background: var(--st-lost); z-index: 2; pointer-events: none; }
.agenda-maintenant::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--st-lost); }
.agenda-carte {
  position: fixed; z-index: 50; width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 5px;
  padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.agenda-carte[hidden] { display: none; }
.agenda-fuseau { display: flex; gap: 4px; margin-left: auto; }
.agenda-fuseau .actif { background: var(--text); color: var(--surface); border-color: var(--text); }
.agenda-partage { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.agenda-partage[hidden], .agenda-supprimer[hidden] { display: none; }
.agenda-supprimer { align-self: flex-start; margin-top: 4px; color: var(--st-lost); }
.agenda-carte-fermer { position: absolute; top: 10px; right: 10px; background: none; border: 0; cursor: pointer; color: var(--text-2); padding: 4px; }
@media (max-width: 980px) { .agenda { grid-template-columns: 1fr; } .agenda-side { order: 2; } }

/* ============================================================
   Devis
   ============================================================ */
#lignes td { padding: 9px 8px; }
#lignes td:first-child { padding-left: 16px; }
#lignes input[type="number"] { min-width: 92px; padding-left: 8px; padding-right: 8px; text-align: right; font-family: var(--f-mono); font-size: 13.5px; }
#lignes td:nth-child(4) input { min-width: 108px; }
.totaux { min-width: 280px; display: flex; flex-direction: column; gap: 8px; margin-left: auto; }
.totaux div { display: flex; justify-content: space-between; gap: 20px; }
.totaux .ttc { padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 700; }

/* --- Barres d'outils des listes (filtres, attribution) : sur une seule ligne --- */
.card-head > form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head > form input[type="search"] { flex: 1 1 240px; width: auto; min-width: 0; }
.card-head > form select { flex: 0 1 200px; width: auto; min-width: 150px; padding-top: 8px; padding-bottom: 8px; }
.card-head > form .btn { flex: none; }
#selection-form { background: var(--surface-2); }
#selection-form select { flex: 0 1 240px; }
#selection-form .check { margin-right: 2px; }
#selection-form [data-nb-coches] { margin-right: 8px; }
.pipe .n { font-family: var(--f-body); }

/* --- Analyse IA : chances de signature ----------------------------------------- */
.analyse {
  --c: var(--st-quote); --c-bg: var(--st-quote-bg);
  display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: var(--radius);
  background: var(--c-bg); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
}
.analyse.likely { --c: var(--st-won); --c-bg: var(--st-won-bg); }
.analyse.unlikely { --c: var(--st-lost); --c-bg: var(--st-lost-bg); }
.analyse-score {
  flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: conic-gradient(var(--c) calc(var(--score, 0) * 1%), var(--surface) 0); color: var(--c);
  font-weight: 600; line-height: 1; border: 4px solid var(--surface);
}
.analyse-score span { font-size: 24px; }
.analyse-score small { font-size: 11px; }
.analyse-titre { font-weight: 600; color: var(--c); margin-bottom: 4px; }
.analyse ul { margin: 0 0 6px; padding-left: 18px; color: var(--text); }
.analyse li + li { margin-top: 2px; }
.pastille-ia {
  flex: none; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; font-family: var(--f-mono);
  background: var(--st-quote-bg); color: var(--st-quote);
}
.pastille-ia.likely { background: var(--st-won-bg); color: var(--st-won); }
.pastille-ia.unlikely { background: var(--st-lost-bg); color: var(--st-lost); }

/* --- Visionneuse de devis -------------------------------------------------------- */
.visionneuse { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.visionneuse-pdf { overflow: hidden; }
.visionneuse-pdf iframe { display: block; width: 100%; height: calc(100vh - 210px); min-height: 520px; border: 0; background: var(--surface-3); }
@media (max-width: 1100px) { .visionneuse { grid-template-columns: 1fr; } .visionneuse-pdf iframe { height: 70vh; } }

/* Lien « Lancer app.licornne.com » : mis en avant, s'ouvre dans un nouvel onglet */
.tab-demo { color: #fff; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tab-demo .i { color: #ff8f73; opacity: 1; }
.tab-demo:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.tab-demo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-externe { width: 14px !important; height: 14px !important; margin-left: auto; transform: rotate(135deg); opacity: .7 !important; }

/* --- Aide à la saisie des adresses (suggestions sous le champ) ------------------- */
.suggestions-zone { position: relative; }
.suggestions {
  position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
}
.suggestions li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggestions li b { font-weight: 500; font-size: 14px; color: var(--text); }
.suggestions li span { font-size: 12px; color: var(--text-3); }
.suggestions li:hover, .suggestions li.actif { background: var(--surface-3); }

/* --- Statistiques de l'accueil : classements en barres horizontales -------------- */
.titre-section { font-size: 18px; margin: 28px 0 12px; }
.stats-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) { .stats-grille { grid-template-columns: 1fr; } }
.classement { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.classement li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 76px; align-items: center; gap: 12px; padding: 2px 0; border-radius: 4px; }
.classement li:hover { background: var(--surface-2); }
.classement-nom { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.classement-piste { height: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
/* Une seule couleur : la longueur porte l'information, le chiffre est écrit à côté */
.classement-barre { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--link); }
.classement-n { font-family: var(--f-mono); font-size: 13px; text-align: right; min-width: 34px; display: flex; flex-direction: column; line-height: 1.2; }
.classement-n small { font-family: var(--f-body); font-size: 11px; color: var(--st-won); white-space: nowrap; }

/* --- Suppression ------------------------------------------------------------------ */
.btn-danger { background: var(--st-lost); border-color: var(--st-lost); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--st-lost) 85%, #000); border-color: transparent; color: #fff; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-corbeille { color: var(--text-3); padding: 6px; }
.btn-corbeille:hover { color: var(--st-lost); background: var(--st-lost-bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Recherche en direct (barre du haut, choix d'un cabinet) ---------------------- */
.top-search .suggestions { min-width: 360px; }
.suggestions-titre { padding: 8px 10px 4px !important; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); cursor: default !important; }
.suggestions-titre:hover { background: none !important; }
.suggestions-vide { padding: 10px !important; font-size: 13px; color: var(--text-3); cursor: default !important; }
.suggestions-vide:hover { background: none !important; }
.select-recherche {
  width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c98b6' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") no-repeat 11px center / 17px;
  color: var(--text); font: inherit; font-size: 14.5px;
}

/* --- Pastille de potentiel : Sûr / Peut-être / Pas la peine ----------------------- */
.pastille {
  --c: var(--text-3); --c-bg: var(--surface-3);
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
  background: var(--c-bg); color: var(--c); border: 1px solid transparent;
}
.pastille::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pastille.vide::before { background: transparent; border: 1.5px dashed var(--c); width: 7px; height: 7px; }
.pastille.sure { --c: var(--st-won); --c-bg: var(--st-won-bg); }
.pastille.maybe { --c: var(--st-quote); --c-bg: var(--st-quote-bg); }
.pastille.no { --c: var(--st-lost); --c-bg: var(--st-lost-bg); }
.pastille-menu { position: relative; display: inline-block; }
.pastille-menu > summary { list-style: none; }
.pastille-menu > summary::-webkit-details-marker { display: none; }
.pastille-menu > summary:hover { border-color: var(--c); }
.pastille-choix {
  position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.pastille-choix .pastille { justify-content: flex-start; }
.pastille-choix .pastille:hover { border-color: var(--c); }
.pastille-choix .pastille.choisie { border-color: var(--c); font-weight: 600; }

/* --- Messagerie interne (façon WhatsApp) ------------------------------------------ */
.chat {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - var(--top-h) - 52px);
  min-height: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.page:has(> .chat) { padding-bottom: 26px; }
.chat-liste { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.chat-liste-haut { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.chat-liste-haut h1 { font-size: 20px; }
.chat-filtre { width: 100%; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; font-size: 13.5px; background: var(--surface-2); color: var(--text); }
.chat-contacts { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.chat-contact { display: flex; gap: 12px; align-items: center; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.chat-contact:hover { background: var(--surface-2); }
.chat-contact.actif { background: var(--surface-3); }
.chat-ligne { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
.chat-ligne b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-heure { font-size: 11.5px; color: var(--text-3); flex: none; }
.chat-apercu { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-avatar {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-3); color: #fff; font-size: 13px; font-weight: 600;
}
.chat-avatar.equipe { background: var(--accent); }
.chat-point { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #25d366; border: 2px solid var(--surface); }
.chat-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-vide { margin: auto; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chat-vide .i { width: 40px; height: 40px; opacity: .45; }
.chat-ouverte { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-entete { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-entete .en-ligne { color: #128c4b; }
.chat-retour { display: none; }
.chat-fil {
  flex: 1; overflow-y: auto; padding: 18px 6%; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2);
  background-image: radial-gradient(color-mix(in srgb, var(--line) 80%, transparent) 1px, transparent 1px); background-size: 18px 18px;
}
.chat-jour { align-self: center; margin: 10px 0 4px; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); }
.chat-bulle {
  align-self: flex-start; max-width: min(560px, 78%); padding: 7px 10px 5px; border-radius: 10px 10px 10px 2px;
  background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere;
}
.chat-bulle.moi { align-self: flex-end; border-radius: 10px 10px 2px 10px; background: #dcf8c6; }
.chat-auteur { font-size: 12px; font-weight: 600; color: var(--link); margin-bottom: 2px; }
.chat-texte { white-space: pre-wrap; font-size: 14px; color: #1f2c34; }
.chat-pied { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: #667781; margin-top: 2px; }
.chat-coches { letter-spacing: -3px; }
.chat-coches.lu { color: #34b7f1; }
.chat-fichier { display: flex; align-items: center; gap: 8px; padding: 8px; margin-bottom: 4px; border-radius: 6px; background: rgba(0, 0, 0, .05); color: #1f2c34; font-size: 13.5px; }
.chat-fichier img { display: block; max-width: 100%; max-height: 260px; border-radius: 6px; }
.chat-fichier:has(img) { padding: 0; background: none; }
.chat-saisie { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-saisie textarea { width: 100%; resize: none; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 20px; font: inherit; font-size: 14px; background: var(--surface-2); color: var(--text); max-height: 140px; }
.chat-piece { padding: 0 6px 6px; color: var(--text-2); }
.chat-joindre { cursor: pointer; padding: 10px; }
.chat-envoyer { border-radius: 50%; width: 42px; height: 42px; padding: 0; }
.chat-envoyer .i { transform: rotate(180deg); }
.chat-erreur { padding: 6px 16px 10px; color: var(--st-lost); background: var(--surface); }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - var(--top-h) - 40px); }
  .chat .chat-conv { display: none; }
  .chat.conv-ouverte .chat-liste { display: none; }
  .chat.conv-ouverte .chat-conv { display: flex; }
  .chat-retour { display: inline-flex; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chat-bulle.moi { background: #005c4b; }
  :root:not([data-theme="light"]) .chat-texte, :root:not([data-theme="light"]) .chat-fichier { color: var(--text); }
}

/* Popup « Nouveau rendez-vous » (pris dans Google Agenda) */
.rappel [data-r="detail"] { white-space: pre-line; }
.rappel.nouveau { border-left-color: var(--st-won); }
.rappel.nouveau .rappel-ico { background: var(--st-won-bg); color: var(--st-won); }
.rappel.nouveau .rappel-delai { color: var(--st-won); }

/* Centre de notifications */
.row.notif { align-items: flex-start; }
.row.notif.non-lue { background: color-mix(in srgb, var(--st-won-bg) 60%, transparent); }
.row.notif.non-lue .titre::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* Vérifier si un e-mail est déjà dans la base (page Cabinets) */
.verif-email { display: flex; gap: 6px; align-items: center; }
.verif-email input { width: 230px; padding: 8px 12px; }
.message.warning { background: var(--st-quote-bg); color: var(--st-quote); border-color: color-mix(in srgb, var(--st-quote) 25%, transparent); }
.message.warning::before { content: "!"; background: var(--st-quote); }

/* Remises et choses offertes dans les devis */
.totaux .economie { color: var(--st-won); font-weight: 500; }
.rubrique-promo { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.rubrique-promo h2 { font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rubrique-promo .sub { font-size: 12.5px; font-weight: 400; color: var(--text-3); }

/* Page Activité (super admin) */
.presence { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.presence::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.presence.en-ligne { color: #128c4b; font-weight: 500; }
.presence.en-ligne::before { background: #25d366; box-shadow: 0 0 0 3px rgba(37, 211, 102, .2); }
.annotation-modif { color: var(--st-quote); font-weight: 500; font-size: 12.5px; }

/* Cadre « Clés Google » (super admin) */
.cles-google { border-top: 1px solid var(--line); background: var(--surface-2); }
.cles-google h3 { font-size: 14px; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cles-google .sub { font-size: 12px; font-weight: 400; color: var(--text-3); }

/* Erreur Google : la cause et la procédure pour corriger */
.erreur-google { border-top: 1px solid var(--line); background: var(--st-lost-bg); display: flex; flex-direction: column; gap: 8px; }
.erreur-google h3 { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--st-lost); }
.erreur-google p { color: var(--text); }
.erreur-google .etapes li { color: var(--text); overflow-wrap: anywhere; }

/* Version de l'application, en pied du menu */
.side-version { padding: 6px 16px 10px; font-size: 11px; color: #7f95ab; font-family: var(--f-mono); background: rgba(0, 0, 0, .12); }

/* Démo annulée / reportée */
.step { flex-wrap: wrap; }
.step-note { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.step-note.annulee { background: var(--st-lost-bg); color: var(--st-lost); font-weight: 700; }
/* « Annulée » partout en rouge et en gras */
.annulee-texte { color: var(--st-lost) !important; font-weight: 700 !important; }
.reportee-texte { color: var(--st-quote); font-weight: 600; }
.choix label:has(input[value="cancelled"]) { color: var(--st-lost); font-weight: 700; }
.agenda-rdv.annule { opacity: .85; }
.agenda-rdv.annule > b:first-child { text-decoration: line-through; }
.agenda-rdv.annule .annulee-texte { text-decoration: none; display: inline; }
.agenda-rdv.annule.court > b:first-child { flex: 1 1 auto; min-width: 0; max-width: none; }
.agenda-rdv.annule.court > span { flex: none; overflow: visible; }
.step-note.reportee { background: var(--st-quote-bg); color: var(--st-quote); }
.cadre-annulation { border-color: var(--st-lost); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-lost) 18%, transparent); }
.cadre-annulation .eyebrow { color: var(--st-lost); }

/* Page Cabinets : accès aux démos annulées */
.pipe-annulees {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 16px; padding: 10px 16px;
  border-radius: var(--radius); background: var(--st-lost-bg); color: var(--st-lost);
  border: 1px solid color-mix(in srgb, var(--st-lost) 30%, transparent);
}
.pipe-annulees b { font-weight: 700; }
.pipe-annulees span { color: var(--text-2); font-size: 13px; }
.pipe-annulees:hover { text-decoration: none; border-color: var(--st-lost); }
.pipe-annulees.actif { box-shadow: 0 0 0 2px var(--st-lost); }

/* Historique des démos (fiche cabinet) */
.histo-demo { display: flex; align-items: flex-start; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.histo-demo:last-child { border-bottom: 0; }
.histo-demo.planned { border-left-color: var(--st-meeting); }
.histo-demo.done { border-left-color: var(--st-won); }
.histo-demo.cancelled { border-left-color: var(--st-lost); }
.histo-demo.postponed, .histo-demo.noshow { border-left-color: var(--st-quote); }
.histo-demo .titre { font-weight: 500; }
.histo-demo .sous { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.histo-resume { color: var(--text-2); margin-top: 6px; }
.histo-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.statut-demo { font-weight: 600; }
.statut-demo.planned { color: var(--st-meeting); }
.statut-demo.done { color: var(--st-won); }
.statut-demo.noshow { color: var(--st-quote); }

/* Rendez-vous Google à contrôler (accueil) */
.cadre-rdv-google { border-color: var(--st-won); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-won) 15%, transparent); }
.row.rdv-google { align-items: center; }
/* Effacer le suivi d'une démo */
.effacer-suivi { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; max-width: 860px; }
/* Icône Meet cliquable sur les rendez-vous de l'agenda */
.agenda-meet {
  position: absolute; top: 3px; right: 3px; z-index: 2; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 5px; background: var(--st-meeting); color: #fff; cursor: pointer;
}
.agenda-meet .i { width: 13px; height: 13px; }
.agenda-meet:hover, .agenda-meet:focus-visible { background: var(--accent); outline: none; }
.agenda-rdv:has(.agenda-meet) { padding-right: 26px; }

/* --- Page Commerciaux ---------------------------------------------------- */

.equipe-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.equipe-stat {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.equipe-stat-icone { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.equipe-stat b { display: block; font-family: var(--f-mono); font-size: 24px; font-weight: 600; line-height: 1.1; }
.equipe-stat b small { font-size: 14px; color: var(--text-3); font-weight: 500; }
.equipe-stat span { font-size: 12.5px; color: var(--text-2); }
.equipe-stat.eteint .equipe-stat-icone { background: var(--surface-3); color: var(--text-3); }

.equipe-barre { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.equipe-recherche {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.equipe-recherche:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(0, 164, 189, .18); }
.equipe-recherche .i { color: var(--text-3); flex: none; }
.equipe-recherche input { border: 0; outline: 0; background: none; padding: 10px 0; width: 100%; font: inherit; color: var(--text); }
.equipe-filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.equipe-filtres .btn.actif { background: var(--navy); border-color: var(--navy); color: #fff; }

.equipe-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.equipier {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
  animation: equipier-entree .35s var(--ease) both;
}
.equipier:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); transform: translateY(-2px); }
.equipier.eteint { opacity: .62; }
.equipier.eteint:hover { opacity: 1; }
.equipier[hidden] { display: none; }
@keyframes equipier-entree { from { opacity: 0; transform: translateY(6px); } }
.equipier:nth-child(2) { animation-delay: .04s; } .equipier:nth-child(3) { animation-delay: .08s; }
.equipier:nth-child(4) { animation-delay: .12s; } .equipier:nth-child(n+5) { animation-delay: .16s; }

.equipier-tete { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.equipier-tete .avatar { width: 42px; height: 42px; font-size: 14px; background: linear-gradient(140deg, #6fa8d6, var(--st-meeting)); }
.equipier-tete .avatar.admin { background: linear-gradient(140deg, #ff8f73, var(--accent)); }
.equipier-nom { min-width: 0; }
.equipier-nom .strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.equipier-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 4px 18px 16px; margin: 0; flex: 1; }
.equipier-infos div:first-child { grid-column: 1 / -1; }
.equipier-infos dt { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.equipier-infos dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.equipier-infos dd.num { font-family: var(--f-mono); font-size: 16px; font-weight: 600; }
.equipier-agendas { display: flex; gap: 6px; flex-wrap: wrap; }
.pastille-agenda { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; }
.pastille-agenda .i { width: 12px; height: 12px; }
.pastille-agenda.google { background: var(--st-won-bg); color: var(--st-won); }
.pastille-agenda.teams { background: rgba(91, 95, 199, .12); color: var(--teams); }

.equipier-actions { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.equipier-plus { position: relative; margin-left: auto; }
.equipier-plus > summary { list-style: none; }
.equipier-plus > summary::-webkit-details-marker { display: none; }
.equipier-plus > summary .i { transition: transform .15s var(--ease); }
.equipier-plus[open] > summary .i { transform: rotate(90deg); }
.equipier-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: equipier-entree .15s var(--ease) both;
}
.equipier-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.equipier-menu button:hover, .equipier-menu button:focus-visible { background: var(--surface-3); outline: 0; }
.equipier-menu button.danger { color: var(--st-lost); }
.equipier-menu button.danger:hover { background: var(--st-lost-bg); }

.equipe-fenetre {
  width: min(720px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.equipe-fenetre::backdrop { background: rgba(33, 51, 67, .45); }
.equipe-fenetre[open] { animation: equipier-entree .2s var(--ease) both; }
.equipe-fenetre .card-head .right { margin-left: auto; }
.equipe-fenetre-pied { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); }
.equipe-fenetre-pied .small { flex: 1; min-width: 200px; }

@media (max-width: 600px) {
  .equipe-grille { grid-template-columns: 1fr; }
  .equipier-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .equipier, .equipier-menu, .equipe-fenetre[open] { animation: none; }
  .equipier:hover { transform: none; }
}

/* --- Photos de l'équipe ------------------------------------------------------ */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xl { width: 72px; height: 72px; font-size: 22px; }
.membre-photo { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

/* --- Bloc « Ma prime » (accueil du commercial) -------------------------------- */
.prime {
  display: grid; grid-template-columns: minmax(200px, 1.1fr) 1fr 1fr; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.prime-titre { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--navy); color: #fff; }
.prime-titre h2 { font-size: 16px; color: #fff; }
.prime-titre .muted { color: var(--navy-text); }
.prime-icone { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); flex: none; }
.prime-chiffre { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-left: 1px solid var(--line); }
.prime-libelle { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.prime-chiffre b { font-family: var(--f-mono); font-size: 26px; font-weight: 600; line-height: 1.2; }
.prime-chiffre.potentielle b { color: var(--st-quote); }
.prime-chiffre.gagnee b { color: var(--st-won); }
@media (max-width: 760px) {
  .prime { grid-template-columns: 1fr; }
  .prime-chiffre { border-left: 0; border-top: 1px solid var(--line); }
}

/* --- « Connecter mon agenda » ----------------------------------------------- */
.agenda-connecte { display: flex; align-items: center; gap: 10px; }
.agenda-boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.agenda-boutons form { flex: 1; }
.agenda-boutons .btn { width: 100%; justify-content: center; }
.agenda-logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 15px; color: #fff;
}
.agenda-logo.google { background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.agenda-logo.outlook { background: linear-gradient(140deg, #28a8ea, #0364b8); }
.connexion-fenetre {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.connexion-fenetre::backdrop { background: rgba(33, 51, 67, .45); }
.connexion-fenetre[open] { animation: equipier-entree .2s var(--ease) both; }
.connexion-choix { display: flex; flex-direction: column; gap: 10px; }
.connexion-option {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-2);
  border-radius: var(--radius); color: var(--text); text-decoration: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.connexion-option:hover, .connexion-option:focus-visible { border-color: var(--accent); background: var(--accent-soft); transform: translateX(2px); outline: 0; }
.connexion-option .agenda-logo { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
.connexion-option b { display: block; }
.connexion-option .small { display: block; }
.connexion-option > .i { color: var(--text-3); }

/* --- Inviter quelqu'un d'autre (carte d'une démo dans l'agenda) --------------- */
.partage-lien { display: flex; gap: 6px; }
.partage-lien input {
  flex: 1; min-width: 0; padding: 6px 10px; font: inherit; font-size: 12.5px; font-family: var(--f-mono);
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
.partage-boutons { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Fenêtre « Résumé IA » (historique des démos) ------------------------------ */
.fenetre-resume {
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.fenetre-resume[open] { display: flex; flex-direction: column; animation: equipier-entree .2s var(--ease) both; }
.fenetre-resume::backdrop { background: rgba(33, 51, 67, .45); }
.fenetre-resume h2 { display: flex; align-items: center; gap: 8px; }
.fenetre-resume h2 .i { color: var(--accent); }
.resume-corps { overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.resume-score { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--surface-2); border-radius: var(--radius); }
.resume-score .pastille-ia { font-size: 16px; padding: 6px 10px; flex: none; }
.resume-raisons { margin: 6px 0 0 18px; font-size: 13.5px; color: var(--text-2); }
.resume-texte { font-size: 14px; line-height: 1.65; }
.resume-texte p + p { margin-top: 10px; }
.resume-pied { border-top: 1px solid var(--line); border-bottom: 0; gap: 8px; flex-wrap: wrap; }
.resume-pied .small { flex: 1; }

/* --- Fiche cabinet ------------------------------------------------------------ */
.fiche-hero { margin-bottom: 16px; overflow: hidden; }
.fiche-hero-haut {
  display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 22px 24px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.fiche-monogramme {
  width: 60px; height: 60px; border-radius: 14px; display: grid; place-items: center; flex: none;
  font-size: 21px; font-weight: 600; letter-spacing: .02em; color: #fff;
  background: linear-gradient(140deg, #6fa8d6, var(--st-meeting)); box-shadow: var(--shadow);
}
.fiche-monogramme.new { background: linear-gradient(140deg, #8fa7c0, var(--st-new)); }
.fiche-monogramme.demo { background: linear-gradient(140deg, #4cc2b6, var(--st-demo)); }
.fiche-monogramme.quote { background: linear-gradient(140deg, #f0a64a, var(--st-quote)); }
.fiche-monogramme.won { background: linear-gradient(140deg, #3fbf87, var(--st-won)); }
.fiche-monogramme.lost { background: linear-gradient(140deg, #e27a6d, var(--st-lost)); }
.fiche-identite { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.fiche-titre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fiche-titre h1 { font-size: 24px; font-weight: 600; line-height: 1.2; }
.fiche-contact { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.fiche-contact .i { width: 16px; height: 16px; color: var(--text-3); }
.fiche-puces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.fiche-puce {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
}
.fiche-puce .i { width: 13px; height: 13px; color: var(--text-3); }
.fiche-puce.rappel { background: var(--st-quote-bg); border-color: transparent; color: var(--st-quote); }
.fiche-puce.rappel .i { color: currentColor; }
.fiche-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fiche-parcours { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }

.prochaine-action {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 18px 22px;
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); border-left-width: 4px;
}
.prochaine-action.won { border-color: var(--st-won); box-shadow: 0 0 0 3px rgba(0, 128, 76, .15); }
.prochaine-action.lost { border-color: var(--line-2); box-shadow: none; }
.prochaine-icone {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.prochaine-action.won .prochaine-icone { background: var(--st-won-bg); color: var(--st-won); }
.prochaine-action.lost .prochaine-icone { background: var(--surface-3); color: var(--text-3); }
.prochaine-action .strong { font-size: 15.5px; }
.prochaine-detail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.prochaine-boutons { display: flex; gap: 8px; flex-wrap: wrap; }

.fiche-grille { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .fiche-grille { grid-template-columns: 1fr; } }
.fiche-devis-icone { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--st-quote-bg); color: var(--st-quote); }

.coords { margin: 0; padding: 6px 0; }
.coord {
  display: grid; grid-template-columns: 18px 96px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 9px 20px; font-size: 13.5px;
}
.coord + .coord { border-top: 1px dashed var(--line); }
.coord .i { width: 16px; height: 16px; color: var(--text-3); }
.coord dt { color: var(--text-3); font-size: 12.5px; }
.coord dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.coord dd.vide, .coords-lieu b.vide, .fiche-chiffre b.vide { color: var(--text-3); font-weight: 400; }
.coords-lieu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.coords-lieu div { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; }
.coords-lieu div + div { border-left: 1px solid var(--line); }
.coords-lieu span { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.coords-lieu b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }

.fiche-cabinet { display: flex; flex-direction: column; gap: 16px; }
.fiche-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fiche-chiffre { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.fiche-chiffre b { font-family: var(--f-mono); font-size: 22px; font-weight: 600; line-height: 1.2; }
.fiche-chiffre span { font-size: 12px; color: var(--text-2); }
.fiche-notes .card-body { font-size: 13.5px; line-height: 1.6; color: var(--text-2); background: var(--surface-2); }
.fiche-zone-sensible { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .fiche-hero-haut { padding: 18px 16px; }
  .fiche-parcours { padding: 12px 16px; }
  .coord { grid-template-columns: 18px minmax(0, 1fr); }
  .coord dt { display: none; }
  .coords-lieu { grid-template-columns: 1fr; }
  .coords-lieu div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.fiche-notes { overflow: hidden; }
.fiche-grille > * { min-width: 0; }
@media (max-width: 600px) {
  /* Historique : les boutons passent sous le texte au lieu de l'écraser */
  .histo-demo { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .histo-demo .grow { flex: 1 1 calc(100% - 70px); }
  .histo-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .fiche-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* --- Agenda, version lisible ------------------------------------------------ */
.agenda { grid-template-columns: 250px minmax(0, 1fr); }
/* Les jours de semaine prennent la place, le week-end est plus étroit */
.agenda-grille { grid-template-columns: 56px repeat(5, minmax(128px, 1.35fr)) repeat(2, minmax(78px, .65fr)); min-width: 900px; }
.agenda-cadre { max-height: calc(100vh - 170px); }
.agenda-entete { padding: 10px 0 8px; }
.agenda-heure span { font-size: 11.5px; }
.agenda-rdv {
  display: flex; flex-direction: column; gap: 1px; padding: 5px 8px 5px 9px;
  border: 0; border-left: 4px solid; border-radius: 8px; color: var(--text);
  box-shadow: 0 1px 2px rgba(33, 51, 67, .12); transition: box-shadow .15s var(--ease), transform .15s var(--ease);
}
.agenda-rdv:hover { transform: translateY(-1px); }
.agenda-rdv b, .agenda-rdv span { white-space: normal; }
.agenda-rdv > b {
  font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.agenda-rdv .rdv-heure { font-family: var(--f-mono); font-size: 11px; font-weight: 600; opacity: .9; white-space: nowrap; }
.agenda-rdv .rdv-sous { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-rdv.visio { background: #e3f0fb; border-left-color: var(--st-meeting); }
.agenda-rdv.visio .rdv-heure { color: var(--st-meeting); }
.agenda-rdv.phone { background: #ddf3ef; border-left-color: var(--st-demo); }
.agenda-rdv.phone .rdv-heure { color: var(--st-demo); }
.agenda-rdv.google { background: var(--surface-3); border-left-color: var(--text-3); }
.agenda-rdv.google .rdv-heure { color: var(--text-2); }
.agenda-rdv.teams { background: rgba(91, 95, 199, .12); border-left-color: var(--teams); }
.agenda-rdv.teams .rdv-heure { color: var(--teams); }
.agenda-rdv.fait { opacity: 1; background: var(--surface-2); border-left-color: var(--st-won); }
.agenda-rdv.fait > b, .agenda-rdv.fait .rdv-sous { color: var(--text-3); }
.agenda-rdv.fait .rdv-heure { color: var(--st-won); }
/* Rendez-vous très court : tout sur une ligne */
.agenda-rdv.court { flex-direction: row; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.agenda-rdv.court > b { -webkit-line-clamp: 1; flex: 1 1 auto; min-width: 0; max-width: none; }
.agenda-rdv.court .rdv-sous { display: none; }
.agenda-rdv.eclaire { box-shadow: 0 0 0 3px var(--accent), var(--shadow-lg); z-index: 5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .agenda-rdv.visio { background: rgba(0, 104, 177, .22); }
  :root:not([data-theme="light"]) .agenda-rdv.phone { background: rgba(0, 133, 122, .22); }
}

/* Liste « Cette semaine » (colonne de gauche) */
.semaine-liste { display: flex; flex-direction: column; gap: 10px; }
.semaine-jour { display: flex; flex-direction: column; gap: 3px; }
.semaine-date { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: capitalize; letter-spacing: .02em; }
.semaine-jour.aujourdhui .semaine-date { color: var(--accent); }
.semaine-rdv {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; text-align: left; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--text-3); border-radius: 6px; transition: background .15s var(--ease), border-color .15s var(--ease);
}
.semaine-rdv:hover, .semaine-rdv:focus-visible { background: var(--surface-2); border-color: var(--line-2); outline: 0; }
.semaine-rdv.visio { border-left-color: var(--st-meeting); }
.semaine-rdv.phone { border-left-color: var(--st-demo); }
.semaine-rdv.teams { border-left-color: var(--teams); }
.semaine-rdv.fait { border-left-color: var(--st-won); color: var(--text-3); }
.semaine-rdv.annule .semaine-nom { text-decoration: line-through; color: var(--text-3); }
.semaine-heure { font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; color: var(--text-2); flex: none; }
.semaine-nom { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-rdv.annule > b { text-decoration: line-through; color: var(--text-3); }
.agenda-grille { grid-template-columns: 56px repeat(5, minmax(104px, 1.35fr)) repeat(2, minmax(62px, .65fr)); min-width: 720px; }
/* Hauteur du rendez-vous → quantité de texte affichée */
.agenda-rdv.moyen > b, .agenda-rdv.compact > b { -webkit-line-clamp: 1; }
.agenda-rdv.compact .rdv-sous { display: none; }
.semaine-liste .mini-titre { text-transform: none; }
/* 45 min : le nom passe sur 2 lignes, la ligne du dessous est cachée */
.agenda-rdv.moyen > b { -webkit-line-clamp: 2; }
.agenda-rdv.moyen .rdv-sous { display: none; }

/* --- Page Cabinets ------------------------------------------------------------ */
.cab-onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cab-onglet {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.cab-onglet:hover { border-color: var(--line-2); color: var(--text); }
.cab-onglet.actif { background: var(--navy); border-color: var(--navy); color: #fff; }
.cab-compte { font-family: var(--f-mono); font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.cab-onglet.actif .cab-compte { background: rgba(255, 255, 255, .16); color: #fff; }
.cab-point { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.cab-onglet.new .cab-point { background: var(--st-new); }
.cab-onglet.meeting .cab-point { background: var(--st-meeting); }
.cab-onglet.demo .cab-point { background: var(--st-demo); }
.cab-onglet.quote .cab-point { background: var(--st-quote); }
.cab-onglet.won .cab-point { background: var(--st-won); }
.cab-onglet.lost .cab-point { background: var(--st-lost); }
.cab-onglet.annulees { color: var(--st-lost); background: var(--st-lost-bg); border-color: transparent; }
.cab-onglet.annulees .i { width: 14px; height: 14px; }
.cab-onglet.annulees.actif { background: var(--st-lost); color: #fff; }

.cab-recherche { margin-bottom: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.cab-filtres { display: flex; flex-direction: column; gap: 12px; }
.cab-champ-recherche {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px;
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 12px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.cab-champ-recherche:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.cab-champ-recherche > .i { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.cab-champ-recherche input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 10px 0; font: inherit; font-size: 15px; color: var(--text);
}
.cab-champ-recherche input::-webkit-search-cancel-button { cursor: pointer; }
.cab-selects { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cab-select {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; height: 36px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--text-3);
}
.cab-select:focus-within { border-color: var(--focus); }
.cab-select select {
  border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 550; color: var(--text);
  padding: 6px 4px; cursor: pointer; max-width: 180px; box-shadow: none;
}
.cab-resultat { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.cab-verif { border-top: 1px dashed var(--line); padding-top: 10px; }
.cab-verif > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 550; color: var(--link);
}
.cab-verif > summary::-webkit-details-marker { display: none; }
.cab-verif > summary .i { width: 14px; height: 14px; }
.cab-verif .verif-email { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cab-verif .verif-email input { flex: 1; min-width: 220px; max-width: 360px; }

.cab-selection { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cab-selection-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.cab-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.cab-table tbody tr { transition: background .12s var(--ease); }
.cab-table tbody tr.coche { background: var(--accent-soft); }
.cab-table td { vertical-align: middle; }
.cab-nom { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.cab-nom .strong { white-space: nowrap; }
.cab-mono {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-size: 12.5px; font-weight: 600; color: #fff; background: var(--st-new);
}
.cab-mono.meeting { background: var(--st-meeting); }
.cab-mono.demo { background: var(--st-demo); }
.cab-mono.quote { background: var(--st-quote); }
.cab-mono.won { background: var(--st-won); }
.cab-mono.lost { background: var(--st-lost); }
.cab-tel { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; white-space: nowrap; }
.cab-tel .i { width: 12px; height: 12px; }
.cab-table .btn-corbeille { opacity: .35; transition: opacity .15s var(--ease); }
.cab-table tr:hover .btn-corbeille, .cab-table .btn-corbeille:focus-visible { opacity: 1; }
@media (max-width: 760px) {
  .cab-table .col-sec { display: none; }
  .cab-nom { min-width: 0; }
  .cab-nom .strong { white-space: normal; }
  .cab-champ-recherche .btn { padding-left: 12px; padding-right: 12px; }
  .cab-resultat { width: 100%; margin-left: 0; }
}
.cab-selection select { width: auto; min-width: 190px; height: 34px; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 760px) {
  /* Les étapes défilent sur une ligne au lieu de s'empiler */
  .cab-onglets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .cab-onglet { flex: none; }
  /* Le tableau devient une liste de fiches */
  .cab-table thead { display: none; }
  .cab-table, .cab-table tbody { display: block; }
  .cab-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .cab-table td { display: block; padding: 0; border: 0; }
  .cab-table td:nth-child(2) { flex: 1 1 calc(100% - 80px); }
  .cab-table td:nth-child(3) { flex-basis: 100%; padding-left: 32px; font-size: 13px; }
  .cab-table td:nth-child(6) { padding-left: 32px; }
  .cab-table td:last-child { margin-left: auto; }
  .cab-table .btn-corbeille { opacity: .6; }
  .cab-selection-actions { margin-left: 0; }
}

/* --- Messages : photos, pièces jointes, glisser-déposer ---------------------- */
.chat-avatar { overflow: visible; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.chat-ouverte { position: relative; }
.chat-depot {
  position: absolute; inset: 60px 12px 12px; z-index: 10; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; text-align: center; pointer-events: none;
  border: 2.5px dashed #25d366; border-radius: 16px; background: rgba(37, 211, 102, .10); color: #128c4b;
  backdrop-filter: blur(2px); animation: equipier-entree .15s var(--ease) both;
}
.chat-depot[hidden] { display: none; }
.chat-depot .i { width: 40px; height: 40px; }
.chat-depot b { font-size: 17px; }
.chat-pieces { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 2px 8px; }
.chat-pieces[hidden] { display: none; }
.chat-piece {
  display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 6px 6px 6px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2);
}
.chat-piece img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.chat-piece-ico, .chat-fichier-ico {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex: none;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: #fff; background: var(--text-3);
}
.chat-piece-infos, .chat-fichier-infos { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.chat-piece-infos b, .chat-fichier-infos b { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-piece-infos span, .chat-fichier-infos span { font-size: 11.5px; color: var(--text-3); }
.chat-piece-retirer {
  width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; flex: none; font-size: 15px; line-height: 1;
  background: var(--surface-3); color: var(--text-2);
}
.chat-piece-retirer:hover { background: var(--st-lost); color: #fff; }
.chat-fichier { min-width: 220px; padding: 8px 10px; }
.chat-fichier-ico.pdf { background: #d93025; }
.chat-fichier-ico.doc, .chat-fichier-ico.docx, .chat-fichier-ico.odt { background: #2b579a; }
.chat-fichier-ico.xls, .chat-fichier-ico.xlsx, .chat-fichier-ico.csv, .chat-fichier-ico.ods { background: #217346; }
.chat-fichier-ico.ppt, .chat-fichier-ico.pptx { background: #d24726; }
.chat-joindre .i { transform: rotate(-45deg); }
.chat-joindre:hover { color: var(--accent); }
.chat-envoyer .i { transform: none; margin-left: -2px; }

/* --- Menu d'une adresse e-mail (Gmail, Outlook, copier…) --------------------- */
.mail-menu {
  position: fixed; z-index: 200; min-width: 250px; padding: 6px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: equipier-entree .15s var(--ease) both;
}
.mail-menu-adresse { padding: 6px 10px 8px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }
.mail-menu-choix {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: 13.5px; text-align: left; color: var(--text); text-decoration: none; cursor: pointer;
}
.mail-menu-choix:hover, .mail-menu-choix:focus-visible { background: var(--surface-3); outline: 0; }

/* --- Formulaire de la fiche cabinet ------------------------------------------ */
.fiche-form-tete {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.fiche-form-tete h1 { font-size: 22px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.fiche-form-boutons { display: flex; gap: 8px; }
.fiche-form-corps { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.fiche-sommaire {
  position: sticky; top: calc(var(--top-h) + 18px); display: flex; flex-direction: column; gap: 2px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.fiche-progression { padding: 4px 6px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.fiche-progression-texte { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.fiche-progression-texte b { font-family: var(--f-mono); color: var(--text); }
.fiche-progression-barre { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.fiche-progression-barre span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ff8f73); transition: width .3s var(--ease); }
.fiche-sommaire-lien {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: var(--text-2); text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease);
}
.fiche-sommaire-lien:hover { background: var(--surface-2); color: var(--text); }
.fiche-sommaire-lien.actif { background: var(--accent-soft); color: var(--accent-2); }
.fiche-sommaire-num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.fiche-sommaire-lien.actif .fiche-sommaire-num { background: var(--accent); color: #fff; }
.fiche-sommaire-compte { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.fiche-sommaire-compte.complet { color: var(--st-won); font-weight: 600; }
.fiche-rubrique { scroll-margin-top: calc(var(--top-h) + 18px); }
.fiche-rubrique-tete { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fiche-rubrique-tete h2 { font-size: 15.5px; }
.fiche-rubrique-icone {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.fiche-rubrique .card-body { padding: 20px; }
.fiche-rubrique .field input, .fiche-rubrique .field select, .fiche-rubrique .field textarea {
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.fiche-rubrique .field input:focus, .fiche-rubrique .field select:focus, .fiche-rubrique .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); outline: 0;
}
.fiche-rubrique .errorlist { color: var(--st-lost); font-size: 12.5px; animation: equipier-entree .2s var(--ease) both; }
.fiche-rubrique .errorlist li::before { content: "⚠ "; }
.obligatoire { color: var(--accent); }
@media (max-width: 900px) {
  .fiche-form-corps { grid-template-columns: 1fr; }
  .fiche-sommaire { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; }
  .fiche-progression { display: none; }
  .fiche-sommaire-lien { flex: none; }
  .fiche-form-boutons { width: 100%; }
}

/* --- Enregistrer la démo (page Suivi) ---------------------------------------- */
.enreg { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.enreg-tete { display: flex; align-items: center; gap: 12px; }
.enreg-icone { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--st-lost-bg); }
.enreg-point { width: 14px; height: 14px; border-radius: 50%; background: var(--st-lost); }
.enreg.en-cours { border-color: var(--st-lost); box-shadow: 0 0 0 3px rgba(196, 58, 43, .14); background: var(--surface); }
.enreg.en-cours .enreg-point { animation: enreg-pulse 1.2s ease-in-out infinite; }
@keyframes enreg-pulse { 50% { opacity: .25; transform: scale(.75); } }
.enreg-chrono { font-family: var(--f-mono); font-size: 20px; font-weight: 600; color: var(--text-3); }
.enreg.en-cours .enreg-chrono { color: var(--st-lost); }
.enreg-niveau { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: none; }
.enreg.en-cours .enreg-niveau { display: block; }
.enreg-niveau span { display: block; height: 100%; background: var(--st-won); transform-origin: left; transform: scaleX(0); transition: transform .08s linear; }
.enreg-accord { font-size: 13px; }
.enreg-boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.enreg-rond { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.enreg-carre { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.enreg-importer { cursor: pointer; }
.enreg-statut { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--surface-3); color: var(--text-2); }
.enreg-statut[hidden] { display: none; }
.enreg-statut.ok { background: var(--st-won-bg); color: var(--st-won); }
.enreg-statut.alerte, .enreg-statut.attente { background: var(--st-quote-bg); color: var(--st-quote); }
.enreg-statut.erreur { background: var(--st-lost-bg); color: var(--st-lost); }
.enreg-aide summary { cursor: pointer; color: var(--link); font-weight: 550; }
.enreg-aide ol { margin: 8px 0 6px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text-2); }
.enreg-aide p { color: var(--text-2); }

/* --- Associer un rendez-vous Google à un cabinet ------------------------------- */
.associer-rdv { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 14px; }
.associer-rdv h1 { font-size: 21px; font-weight: 600; }
.associer-grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; margin-top: 14px; }
.associer-ligne { gap: 12px; align-items: center; }
.associer-creer .card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
@media (max-width: 860px) { .associer-grille { grid-template-columns: 1fr; } }

/* --- Grande fenêtre 15 minutes avant un rendez-vous ---------------------------- */
.rdv-imminent {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(33, 51, 67, .55);
}
.rdv-imminent[open] { animation: rdv-arrivee .35s var(--ease) both; }
@keyframes rdv-arrivee { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.rdv-imminent::backdrop { background: rgba(33, 51, 67, .6); backdrop-filter: blur(3px); }
.rdv-imminent-bandeau { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: linear-gradient(120deg, var(--accent), #ff8f73); color: #fff; }
.rdv-imminent-cloche { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .22); }
.rdv-imminent-cloche .i { width: 24px; height: 24px; animation: rdv-cloche 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes rdv-cloche { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-16deg); } }
.rdv-imminent-delai { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.rdv-imminent-heure { font-size: 14px; opacity: .95; }
.rdv-imminent-fermer { background: rgba(255, 255, 255, .2); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.rdv-imminent-fermer:hover { background: rgba(255, 255, 255, .35); }
.rdv-imminent-corps { padding: 20px 22px 6px; }
.rdv-imminent-corps h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.rdv-imminent-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.rdv-imminent-infos dt { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.rdv-imminent-infos dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.rdv-imminent-notes { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--text-2); white-space: pre-line; }
.rdv-imminent-alerte { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--st-quote-bg); color: var(--st-quote); font-size: 13px; font-weight: 550; }
.rdv-imminent-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 22px 22px; }
@media (max-width: 520px) { .rdv-imminent-infos { grid-template-columns: 1fr; } .rdv-imminent-actions .btn { flex: 1 1 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .rdv-imminent[open], .rdv-imminent-cloche .i { animation: none; } }

/* --- Rendez-vous Google de l'accueil : bleu à venir, orange en cours, rouge terminé --- */
.row.rdv-google { border-left: 4px solid var(--st-meeting); }
.row.rdv-google.en_cours { border-left-color: var(--accent); background: var(--accent-soft); }
.row.rdv-google.termine { border-left-color: var(--st-lost); background: color-mix(in srgb, var(--st-lost-bg) 55%, transparent); }
.row.rdv-google.termine .titre, .row.rdv-google.termine .when { color: var(--st-lost); }
.rdv-etat {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; vertical-align: middle; white-space: nowrap;
}
.rdv-etat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rdv-etat.a_venir { background: var(--st-meeting-bg); color: var(--st-meeting); }
.rdv-etat.en_cours { background: var(--accent); color: #fff; }
.rdv-etat.en_cours::before { animation: enreg-pulse 1.2s ease-in-out infinite; }
.rdv-etat.termine { background: var(--st-lost-bg); color: var(--st-lost); }
.rdv-legende { display: flex; gap: 4px; flex-wrap: wrap; }
.rdv-legende .rdv-etat { margin-left: 0; }

/* --- Recherche SIRET / SIREN ------------------------------------------------ */
.entreprise-etat { padding: 6px 10px; border-radius: var(--radius-sm); max-width: 360px; background: var(--surface-3); color: var(--text-2); }
.entreprise-etat[hidden] { display: none; }
.entreprise-etat.ok { background: var(--st-won-bg); color: var(--st-won); }
.entreprise-etat.attente { background: var(--st-meeting-bg); color: var(--st-meeting); }
.entreprise-etat.erreur { background: var(--st-lost-bg); color: var(--st-lost); }
.field input.rempli-auto, .field select.rempli-auto { background: var(--st-won-bg); border-color: var(--st-won); transition: background .4s var(--ease); }

/* --- Historique complet du dossier (frise) ------------------------------------ */
.journal-ajout > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--accent-2); border-bottom: 1px solid var(--line);
}
.journal-ajout > summary::-webkit-details-marker { display: none; }
.journal-ajout > summary .i { width: 16px; height: 16px; }
.journal-ajout[open] > summary { background: var(--accent-soft); }
.journal-form { display: flex; flex-direction: column; gap: 12px; }
.journal-form-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.journal-form-ligne [hidden] { display: none; }
.journal-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.frise { list-style: none; margin: 0; padding: 18px 20px 10px; position: relative; }
.frise-pas { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.frise-pas::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.frise-pas:last-child::before { display: none; }
.frise-point {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; z-index: 1;
  background: var(--surface-3); color: var(--text-2); border: 2px solid var(--surface);
}
.frise-point .i { width: 15px; height: 15px; }
.frise-pas.g-creation .frise-point { background: var(--st-new-bg); color: var(--st-new); }
.frise-pas.g-appel .frise-point, .frise-pas.g-rappel .frise-point { background: var(--st-demo-bg); color: var(--st-demo); }
.frise-pas.g-email .frise-point { background: var(--st-meeting-bg); color: var(--st-meeting); }
.frise-pas.g-note .frise-point { background: var(--surface-3); color: var(--text-2); }
.frise-pas.g-demo .frise-point { background: var(--st-meeting); color: #fff; }
.frise-pas.g-devis .frise-point { background: var(--st-quote-bg); color: var(--st-quote); }
.frise-pas.g-cloture .frise-point { background: var(--st-won); color: #fff; }
.frise-pas.futur .frise-point { background: var(--surface); color: var(--st-meeting); border: 2px dashed var(--st-meeting); }
.frise-contenu { flex: 1; min-width: 0; padding-top: 4px; }
.frise-tete { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.frise-tete b a { color: var(--text); }
.frise-tete b a:hover { color: var(--accent); }
.frise-date { font-size: 12px; color: var(--text-3); }
.frise-texte { margin-top: 4px; font-size: 13.5px; color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.frise-supprimer { margin-top: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--text-3); cursor: pointer; }
.frise-supprimer:hover { color: var(--st-lost); text-decoration: underline; }
.frise-courte { padding-bottom: 0; }
.connexion-aide { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.connexion-aide summary { cursor: pointer; font-weight: 600; color: var(--link); }
.connexion-aide p, .connexion-aide ol { margin: 8px 0 0; color: var(--text-2); }
.connexion-aide ol { padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }

/* --- Page « Suivi de la démo » ---------------------------------------------------- */
.suivi-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 16px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.suivi-hero h1 { font-size: 23px; font-weight: 600; margin: 2px 0 8px; }
.suivi-hero-texte { min-width: 240px; }
.suivi-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.suivi-statut { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--surface-3); }
.suivi-grille { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.suivi-principal { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.suivi-cote { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 14px; }
.suivi-etape { scroll-margin-top: calc(var(--top-h) + 16px); }
.suivi-etape-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.suivi-etape-tete h2 { font-size: 15.5px; }
.suivi-num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent);
}
.suivi-etape .card-body { padding: 20px; }
.suivi-ia { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.suivi-ia-tete { display: flex; align-items: center; gap: 12px; }
.suivi-ia-icone { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent); color: #fff; }
.suivi-ia textarea { background: var(--surface); }
.suivi-actions { z-index: 5; }
.suivi-sommaire { display: flex; flex-direction: column; padding: 8px; }
.suivi-sommaire a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--text-2); text-decoration: none; }
.suivi-sommaire a:hover { background: var(--surface-2); color: var(--text); }
.suivi-sommaire a.actif { background: var(--accent-soft); color: var(--accent-2); }
.suivi-sommaire .suivi-num { width: 24px; height: 24px; font-size: 11.5px; }
.suivi-sommaire .cab-compte { margin-left: auto; }
.suivi-coche { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: transparent; border: 2px solid var(--line-2); }
.suivi-coche.fait { background: var(--st-won); border-color: var(--st-won); color: #fff; }
.suivi-cabinet .coord { grid-template-columns: 16px 72px minmax(0, 1fr); padding: 8px 16px; font-size: 13px; }
.suivi-notes { color: var(--text-2); background: var(--surface-2); line-height: 1.5; }
.suivi-cabinet-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); }
@media (max-width: 1080px) {
  .suivi-grille { grid-template-columns: 1fr; }
  .suivi-cote { position: static; order: -1; }
  .suivi-sommaire { flex-direction: row; overflow-x: auto; }
  .suivi-sommaire a { flex: none; }
  .suivi-coche { margin-left: 4px; }
}
/* Score de l'IA : un anneau coloré autour d'un disque clair, le chiffre reste lisible */
.analyse-score {
  background:
    radial-gradient(closest-side, var(--surface) 74%, transparent 75% 100%),
    conic-gradient(var(--c) calc(var(--score, 0) * 1%), var(--surface-3) 0);
}
.analyse-score span { font-family: var(--f-mono); }
@media (max-width: 600px) {
  .suivi-cabinet .coord { grid-template-columns: 16px minmax(0, 1fr); }
  .suivi-hero { padding: 16px; }
}
.suivi-grille > *, .suivi-cote > * { min-width: 0; }

/* Agenda : rendez-vous déplaçables par glisser-déposer */
.agenda-rdv[data-deplacer] { cursor: grab; touch-action: none; user-select: none; }
.agenda-rdv.en-deplacement {
  cursor: grabbing;
  opacity: .85;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

/* Pages publiques (présentation, confidentialité) exigées par Google */
.page-publique { max-width: 820px; margin: 0 auto; padding: 24px 20px 40px; }
.public-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.public-contenu h1 { margin-bottom: 12px; }
.public-contenu h2 { margin: 26px 0 8px; font-size: 18px; }
.public-contenu p, .public-contenu li { line-height: 1.6; }
.public-contenu ul { padding-left: 22px; display: grid; gap: 6px; }
.public-intro { font-size: 17px; }
.public-pied { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.public-entete .brand { color: var(--text); text-decoration: none; }

/* Choix de l'adresse du cabinet (E-mail, E-mail 2 ou les deux) */
.choix-destinataire { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.choix-destinataire legend { float: left; margin-right: 4px; }
.choix-destinataire label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }

/* Accueil : les 3 raccourcis du commercial (prendre un RDV, compte rendu, à faire) */
.raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.raccourci {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.raccourci:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.raccourci b { display: block; font-size: 14.5px; }
.raccourci small { display: block; color: var(--text-3); font-size: 12.5px; }
.raccourci .badge { margin-left: auto; }
.raccourci-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.raccourci-ico .i { width: 20px; height: 20px; }
.raccourci-ico.bleu { background: var(--st-meeting-bg); color: var(--st-meeting); }
.raccourci-ico.vert { background: var(--st-won-bg); color: var(--st-won); }
.raccourci-ico.jaune { background: var(--st-quote-bg); color: var(--st-quote); }

/* Réglages : choix du design (aperçu miniature de chaque design) */
.choix-design { display: flex; gap: 14px; flex-wrap: wrap; }
.design-carte {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; cursor: pointer; width: 200px;
  border: 2px solid var(--line); border-radius: var(--radius);
}
.design-carte.actif { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.design-carte input { position: absolute; opacity: 0; }
.design-apercu { position: relative; display: block; height: 100px; border-radius: 4px; overflow: hidden; background: #f5f8fa; }
.design-apercu i { position: absolute; inset: 0 auto 0 0; width: 34%; background: #213343; }
.design-apercu b { position: absolute; left: 42%; top: 12px; width: 30%; height: 10px; border-radius: 3px; background: #ff5c35; }
.design-apercu em { position: absolute; left: 42%; right: 8px; height: 22px; border-radius: 3px; background: #fff; border: 1px solid #dfe3eb; }
.design-apercu em:nth-of-type(1) { top: 32px; }
.design-apercu em:nth-of-type(2) { top: 62px; }
.design-apercu.salesforce { background: #f3f3f3; border-top: 3px solid #0176d3; }
.design-apercu.salesforce i { background: #fff; border-right: 1px solid #e5e5e5; }
.design-apercu.salesforce b { background: #0176d3; }
.design-apercu.salesforce em { border-color: #e5e5e5; }

/* Réglages : boutons « Remplir pour OVH / Microsoft 365 / Gmail » */
.presets-mail { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
