/* Agent de migration — couche applicative au-dessus du design system Charlie.
   Aucune valeur inventée : tout vient de /ds/tokens et de /ds/components/primitives.css. */
@import url("/ds/tokens/fonts.css");
@import url("/ds/tokens/colors.css");
@import url("/ds/tokens/typography.css");
@import url("/ds/tokens/spacing.css");
@import url("/ds/tokens/radius-shadow.css");
@import url("/ds/tokens/motion.css");
@import url("/ds/tokens/base.css");
@import url("/ds/components/primitives.css");

[hidden] { display: none !important; }
body { font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
a { cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.ic { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.sm { width: 13px; height: 13px; flex-basis: 13px; }

/* ── Chrome ─────────────────────────────────────────────────────────────── */
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--page-padding-x); background: var(--paper); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 30; }
.marque { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
a.marque { cursor: pointer; transition: opacity var(--dur-select); }
a.marque:hover { opacity: .72; }
.marque img { height: 20px; width: auto; }
.marque span { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.01em; }
/* La barre a une hauteur fixe et ne peut pas grandir : un nom de cabinet long doit donc se couper,
   jamais passer à la ligne. Sans `min-width: 0`, ce bloc flex refuse de rétrécir et pousse le
   bouton « Signaler un problème » hors de l'écran sur un téléphone. */
.topbar .ctx { color: var(--muted); font-size: var(--text-meta); padding-left: var(--space-3); border-left: 1px solid var(--line-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pousse { flex: 1; }

/* ── Espace cabinet ─────────────────────────────────────────────────────── */
.parcours { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--cream); padding: var(--space-4) var(--page-padding-x) var(--space-3); display: flex; overflow-x: auto; }
.parcours .cw-stepper { margin: 0 auto; flex: 0 0 auto; }
.cw-step[data-state="future"] { cursor: default; }
.page { max-width: 780px; margin: 0 auto; padding: var(--space-5) var(--page-padding-x) var(--page-inset-bottom); display: flex; flex-direction: column; gap: var(--gap); }
.entete { display: flex; flex-direction: column; gap: 6px; margin: var(--space-3) 0 var(--space-2); }
.entete p { color: var(--ink-2); font-size: var(--text-body-lg); max-width: 620px; }

.tache { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-card); transition: border-color var(--dur-select); }
.tache[data-etat="fait"] { border-color: var(--accent-line); }
.tache > summary { list-style: none; display: flex; align-items: center; gap: var(--space-3); padding: 14px 18px; cursor: pointer; }
.tache > summary::-webkit-details-marker { display: none; }
.tache > summary:hover { background: var(--paper-2); border-radius: var(--radius-card); }
.tache[open] > summary:hover { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.tache .num { width: 22px; height: 22px; border-radius: var(--radius-full); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; color: var(--muted); flex: 0 0 22px; }
.tache[data-etat="fait"] .num { background: var(--accent); border-color: transparent; color: var(--paper); }
.tache[data-etat="bloque"] .num { background: var(--danger-soft); border-color: transparent; color: var(--err-ink); }
.tache .titre { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.tache .corps { padding: 4px 18px 18px 52px; display: flex; flex-direction: column; gap: var(--gap); }
/* Sur mobile, on redéfinit la VARIABLE plutôt que d'écraser les paddings un par un. La version
   précédente laissait `--page-padding-x` à 32 px : `.pied`, qui s'étend d'un bord à l'autre avec
   `margin: … calc(-1 * var(--page-padding-x))`, sortait donc de 16 px de chaque côté et faisait
   scroller toute la page latéralement — sur cinq des six étapes. Tout ce qui lit la variable
   (`.topbar`, `.parcours`, `.page`, `.cw-progress`, `.pied`) reste cohérent d'un seul endroit. */
@media (max-width: 640px) { :root { --page-padding-x: 16px; } .tache .corps { padding-left: 18px; } }
/* Au doigt, les pas du parcours faisaient 28 px de haut : au-dessus du seuil AA (24 px), mais
   assez petits pour qu'on vise à côté — et ce sont eux qui servent à revenir sur une étape déjà
   faite. On les monte à 44 px sur écran tactile sans toucher au design system, que le back-office
   partage. `pointer: coarse` plutôt qu'une largeur : c'est le doigt qui pose la contrainte. */
@media (pointer: coarse) { .cw-step { min-height: 44px; padding-top: 0; padding-bottom: 0; } }
/* Barre de progression du parcours, sous le stepper */
.cw-progress { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; padding: 0 var(--page-padding-x) var(--space-3); }
.cw-progress-barre { flex: 1; height: 6px; background: var(--line-soft); border-radius: var(--radius-full); overflow: hidden; }
.cw-progress-barre > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width 640ms var(--ease-out); }
.cw-progress-txt { font-size: var(--text-label); color: var(--muted); font-weight: 500; white-space: nowrap; }
@media (max-width: 640px) { .cw-progress { padding-left: 16px; padding-right: 16px; } }
/* Bouton « Signaler un problème » plus visible dans la barre du haut */
.cw-btn[data-role="alerte"] { border: 1px solid var(--line); color: var(--ink-2); gap: 6px; }
.cw-btn[data-role="alerte"] svg { color: var(--warn-ink); }
.cw-btn[data-role="alerte"]:hover { border-color: var(--warn-ink); background: var(--warn-soft); color: var(--warn-ink); }

.pas { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: pas; }
.pas li { counter-increment: pas; display: flex; gap: 10px; font-size: var(--text-body); color: var(--ink-2); }
.pas li::before { content: counter(pas); font-family: var(--font-mono); font-size: 11px; color: var(--muted); width: 16px; flex: 0 0 16px; padding-top: 1px; }
.pas b, .note b { color: var(--ink); font-weight: 600; }
.chemin { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-ink); background: var(--accent-tint); border-radius: var(--radius-tag); padding: 5px 9px; align-self: flex-start; }
/* La hiérarchie disait l'inverse de l'importance : l'avertissement « lancez-la le soir, sans
   rouvrir votre ancien logiciel » — la chose la plus coûteuse à rater de tout le parcours —
   s'affichait à 12,5 px, sous les 13,5 px des instructions ordinaires qu'il qualifie. Une note
   neutre reste au niveau du texte courant ; un avertissement passe au-dessus. 12,5 px ne venait
   d'aucun token, au passage : l'échelle a 12 et 13. */
.note { background: var(--paper-2); border-radius: var(--radius-btn); padding: 10px 12px; font-size: var(--text-body); color: var(--ink-2); line-height: 1.5; }
.note[data-ton="warn"], .note[data-ton="danger"] { font-size: var(--text-body-lg); }
.note[data-ton="warn"] { background: var(--warn-soft); color: var(--warn-ink); }
.note[data-ton="danger"] { background: var(--danger-soft); color: var(--err-ink); }
.note[data-ton="ok"] { background: var(--accent-tint); color: var(--accent-ink); }

/* Réplique d'un écran Wealthcome : libellé de l'outil, valeur, copier. */
.fiche { border: 1px solid var(--line-soft); border-radius: var(--radius-btn); overflow: hidden; }
.fiche .ligne { display: grid; grid-template-columns: 210px 1fr auto; gap: var(--space-3); align-items: center; padding: 7px 8px 7px 12px; border-bottom: 1px solid var(--line-soft); min-height: var(--row); }
.fiche .ligne:last-child { border-bottom: none; }
.fiche .ligne:hover { background: var(--paper-2); }
.fiche .l { color: var(--muted); font-size: var(--text-meta); }
.fiche .v { font-weight: 500; overflow-wrap: anywhere; }
.fiche .v.vide { color: var(--muted-2); font-weight: 400; }
@media (max-width: 640px) { .fiche .ligne { grid-template-columns: 1fr auto; } .fiche .l { grid-column: 1 / -1; } }

.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.champ { display: flex; flex-direction: column; gap: 5px; font-size: var(--text-label); font-weight: 500; color: var(--muted); }
.champ.large { grid-column: 1 / -1; }
.champ[data-manque="true"] input, .champ[data-manque="true"] select { border-color: var(--warn); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], input[type=tel], input[type=password], select, textarea {
  height: var(--row); padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--paper); font-size: var(--text-body); color: var(--ink); width: 100%; transition: border-color var(--dur-select); }
textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: var(--leading-body); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; accent-color: var(--accent); }
/* Le sélecteur de fichier : le bouton gris du navigateur, redessiné comme nos boutons secondaires,
   et le nom du fichier choisi en texte discret à côté. */
input[type=file] { font: inherit; font-size: var(--text-meta); color: var(--muted); max-width: 100%; cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-btn);
  padding: 8px 14px; margin-right: 12px; cursor: pointer;
  transition: border-color var(--dur-hover, 120ms), background var(--dur-hover, 120ms);
}
input[type=file]:hover::file-selector-button { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
input[type=file]:focus-visible { outline: none; }
input[type=file]:focus-visible::file-selector-button { outline: 2px solid var(--accent); outline-offset: 2px; }
.coche { display: flex; align-items: center; gap: 8px; font-size: var(--text-body); color: var(--ink-2); cursor: pointer; }
.rang { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rang.fin { justify-content: flex-end; }
.sep { height: 1px; background: var(--line-soft); }
.muet { color: var(--muted); }
.petit { font-size: var(--text-meta); }
.mono { font-family: var(--font-mono); }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.option { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line-soft); border-radius: var(--radius-btn); background: var(--paper); cursor: pointer; font-weight: 500; transition: border-color var(--dur-select); }
.option:hover { background: var(--paper-2); }
.option[data-on="true"] { border-color: var(--accent); background: var(--accent-tint); }
.motif { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-btn); background: var(--paper); cursor: pointer; transition: border-color var(--dur-select), background var(--dur-hover); }
.motif:hover { background: var(--paper-2); }
.motif:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.rech { position: relative; display: flex; align-items: center; }
.rech svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.rech-champ { width: 100%; height: var(--row); padding: 0 11px 0 34px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--paper); font-size: var(--text-body); color: var(--ink); transition: border-color var(--dur-select); }
.rech-champ:focus { outline: none; border-color: var(--accent); }
.option[hidden] { display: none; }
.motif input { margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
.motif > span { display: flex; flex-direction: column; gap: 2px; }
.motif b { font-weight: 600; color: var(--ink); font-size: var(--text-body); }
.motif .aide { color: var(--muted); font-size: 12px; line-height: 1.4; }
.partenaire { border: 1px solid var(--line-soft); border-radius: var(--radius-card); padding: 14px 16px; display: flex; flex-direction: column; gap: var(--space-3); background: var(--paper); }
.partenaire[data-etat="remonte"] { border-color: var(--accent-line); }
.partenaire .nom { font-size: 14px; font-weight: 600; }
/* Quatre colonnes dont trois de chiffres : sur un téléphone le tableau réclame ~390 px et faisait
   scroller la page entière. Il scrolle désormais dans sa propre boîte — `display: block` est ce
   qui rend `overflow-x` effectif sur un <table>. La largeur minimale garde les colonnes lisibles
   plutôt que d'empiler « 87 400 000 » sur trois lignes. */
.comparatif { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.comparatif > tbody, .comparatif > thead { display: table; width: 100%; min-width: 380px; }
.chiffre { font-family: var(--font-display); font-size: var(--text-title-lg); letter-spacing: var(--text-title-lg-letter-spacing); line-height: 1.2; }

.pied { position: sticky; bottom: 0; background: var(--cream); border-top: 1px solid var(--line-soft); margin: var(--space-4) calc(-1 * var(--page-padding-x)) 0; padding: var(--space-3) var(--page-padding-x); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.reste { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
/* Sur téléphone, les deux blocs du pied ne tiennent pas côte à côte : `flex: 1` + `min-width: 0`
   ramène `.reste` à ~110 px quand ses pastilles en réclament près du double, et rien ne les rogne
   — elles débordent donc sous le bouton, les deux textes se superposant au moment même où le
   cabinet valide son étape. En colonne, chacun prend toute la largeur. */
@media (max-width: 640px) { .pied { flex-direction: column; align-items: stretch; } .reste { flex: none; } }
.ecran-fin { text-align: center; padding: var(--space-14) var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }

/* ── Modale, messages ───────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 10, .2); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--paper); border-radius: var(--radius-2xl); width: 100%; max-width: 620px; box-shadow: var(--shadow-popover); animation: charlie-pop 180ms var(--ease-out) both; }
.modal-head { padding: 20px 22px 0; }
.modal-title { font-family: var(--font-display); font-size: var(--text-title-lg); letter-spacing: var(--text-title-lg-letter-spacing); }
.modal-body { padding: 16px 22px; display: flex; flex-direction: column; gap: var(--gap); }
.modal-foot { padding: 0 22px 20px; display: flex; gap: var(--space-2); justify-content: flex-end; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { background: var(--surface-dark); color: #fff; border-radius: var(--radius-btn); padding: 9px 14px; font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-tooltip); animation: charlie-slide-up var(--dur-enter-slow) var(--ease-out) both; max-width: 420px; }
.toast.err { background: var(--danger); }
.toast.win { background: var(--accent); }

/* ── Back-office : mêmes fondations, noms de classes historiques ────────── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 208px; flex: 0 0 208px; background: var(--paper); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { height: var(--topbar-h); padding: 0 18px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.brand img { height: 20px; width: auto; }
.brand-name { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.01em; }
.brand-sub { display: none; }
.nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border-radius: var(--radius-btn); font-weight: 500; color: var(--ink-2); transition: background var(--dur-hover); }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { background: var(--accent-tint); color: var(--accent-ink); }
.nav a .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.nav a .ico svg { width: 16px; height: 16px; stroke-width: 1.6; }
.nav a .count { margin-left: auto; font-size: 10.5px; font-weight: 600; background: var(--ink); color: var(--paper); min-width: 18px; text-align: center; padding: 1px 5px; border-radius: var(--radius-full); }
.sidebar-foot { padding: 14px 18px; font-size: var(--text-label); color: var(--muted); border-top: 1px solid var(--line-soft); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main .topbar { position: sticky; }
.page-title { font-family: var(--font-display); font-size: var(--text-title-lg); letter-spacing: var(--text-title-lg-letter-spacing); line-height: 1.2; }
.page-sub { font-size: var(--text-meta); color: var(--muted); }
.spacer { flex: 1; }
.content { padding: var(--page-padding-y) var(--page-padding-x) var(--page-inset-bottom); max-width: var(--content-max-wide); width: 100%; }
.card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-card); }
.card-pad { padding: 18px; }
.card-head { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 600; }
.section-title { font-size: 10.5px; font-weight: 500; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted); }
.grid { display: grid; gap: var(--gap); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.kpi { background: var(--paper); border: 1px solid var(--line-soft); padding: 14px 18px; border-radius: var(--radius-card); }
.kpi.accent { background: var(--accent-tint); border-color: transparent; }
.kpi-label { font-size: var(--text-label); color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-display); font-size: var(--text-display); letter-spacing: var(--text-display-letter-spacing); line-height: var(--text-display-line-height); margin-top: 2px; }
.kpi-hint { font-size: var(--text-label); color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-btn); background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background var(--dur-hover), transform var(--dur-hover); }
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn:active { transform: translateY(var(--press-translate)); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }
.btn-dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-strong); color: var(--paper); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-md); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-danger { color: var(--err-ink); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: var(--text-label); font-weight: 500; color: var(--muted); }
label.field.wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-3); }
.checkline { display: flex; align-items: center; gap: 8px; color: var(--ink-2); cursor: pointer; }
.hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 8px 12px; font-size: 10px; font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; transition: background var(--dur-row-hover); }
tbody tr.clickable:hover { background: var(--paper-2); }
.table-wrap { overflow-x: auto; }
.cell-titre { font-weight: 600; }
td input, td select { height: 30px; font-size: 12.5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-full); padding: 3px 9px; font-size: 11.5px; font-weight: 500; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.danger { background: var(--danger-soft); color: var(--err-ink); }
.badge.dark { background: var(--ink); color: var(--paper); }
.progress { height: 4px; background: var(--paper-3); border-radius: var(--radius-full); overflow: hidden; min-width: 64px; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: var(--text-meta); }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 12.5px; line-height: 1.6; background: var(--paper-2); border-radius: var(--radius-btn); padding: 12px 14px; margin: 0; max-height: 380px; overflow-y: auto; }
.lien { color: var(--accent); cursor: pointer; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tab { padding: 0 0 9px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); white-space: nowrap; transition: color var(--dur-select); }
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.taches { display: flex; flex-direction: column; }
/* Légende des pastilles de priorité, dans l'en-tête « À traiter » */
.legende { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-label); color: var(--muted); font-weight: 500; }
.legende .pt { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legende .pt.p1 { background: var(--danger); }
.legende .pt.p2 { background: var(--warn); margin-left: 8px; }
.tache-l { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.tache-l:last-child { border-bottom: none; }
.tache-l .pt { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; background: var(--line); }
.tache-l .pt.p1 { background: var(--danger); }
.tache-l .pt.p2 { background: var(--warn); }
.tache-l .cab { font-weight: 600; white-space: nowrap; }
.tache-l .txt { flex: 1; min-width: 0; color: var(--ink-2); }
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.step:last-child { border-bottom: none; }
.step-mark { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; color: var(--muted); }
.step.fait .step-mark { background: var(--accent); border-color: transparent; color: var(--paper); }
.step.en_cours .step-mark { background: var(--ink); border-color: transparent; color: var(--paper); }
.step.bloque .step-mark { background: var(--danger-soft); border-color: transparent; color: var(--err-ink); }
.step.verrouille { opacity: .55; }
.step-body { flex: 1; min-width: 0; }
.step-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-hint { font-size: var(--text-meta); color: var(--muted); margin-top: 3px; }
.step-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mini-check { display: flex; gap: 8px; align-items: center; padding: 4px 0; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.mini-check .m { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); flex: 0 0 14px; display: flex; align-items: center; justify-content: center; color: var(--paper); }
.mini-check.ok .m { background: var(--accent); border-color: var(--accent); }
.mini-check.ko .m { background: var(--danger); border-color: var(--danger); }
.mini-check .c { color: var(--muted); font-size: 11.5px; }
.timeline { display: flex; flex-direction: column; }
.tl-item { padding: 8px 0; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.tl-item:last-child { border-bottom: none; }
.tl-date { font-size: 11.5px; color: var(--muted); }
.tl-text { white-space: pre-wrap; }
.split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.5fr); gap: var(--gap); align-items: start; }
.liste-item { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background var(--dur-row-hover); }
.liste-item:last-child { border-bottom: none; }
.liste-item:hover { background: var(--paper-2); }
.liste-item.active { background: var(--accent-tint); }
.liste-item .o { font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.liste-item .m { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mail-meta { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: 12.5px; }
.mail-meta .k { color: var(--muted); }
.dir { display: inline-flex; align-items: center; justify-content: center; height: 18px; padding: 0 6px; border-radius: var(--radius-tag); font-size: 10px; font-weight: 600; letter-spacing: .02em; background: var(--paper-2); color: var(--muted); }
.dir.in { background: var(--accent-soft); color: var(--accent-ink); }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.filtres .f { padding: 6px 12px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--paper); font-size: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all var(--dur-select); }
.filtres .f.on { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.pieces { display: flex; flex-direction: column; gap: 6px; }
.piece { display: flex; gap: 10px; align-items: center; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius-btn); flex-wrap: wrap; }
.piece .n { font-weight: 600; }
.piece .s { color: var(--muted); font-size: 11.5px; flex: 1; }
.bandeau { background: var(--paper-2); border-radius: var(--radius-card); padding: 14px 18px; color: var(--ink-2); }
.bandeau.urgent { background: var(--danger-soft); color: var(--err-ink); }
.copie { background: var(--paper-2); border-radius: var(--radius-btn); padding: 12px 14px; }
.docs { display: flex; gap: 6px; flex-wrap: wrap; }
.manque { font-size: var(--text-meta); color: var(--muted); }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 880px) { .sidebar { display: none; } .content { padding: 18px 16px 48px; } }

/* Tableau de bord : colonnes par étape */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); }
.kanban .col { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-card); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 84px; }
.kanban .col-head { display: flex; justify-content: space-between; font-size: var(--text-label); font-weight: 500; color: var(--muted); padding: 2px 4px 6px; }
.kcard { display: block; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); text-decoration: none; color: var(--ink); transition: border-color var(--dur-select); }
.kcard:hover { border-color: var(--accent); }
.kcard.alert { border-color: var(--danger); }
.kcard .n { font-weight: 600; font-size: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .m { font-size: var(--text-meta); color: var(--muted); margin-top: 2px; }
.dir { display: inline-flex; color: var(--muted); }
.dir.in { color: var(--accent); }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Tableau de bord : KPI cliquables, pipeline titré, colonnes vides discrètes */
.kpi-link { text-decoration: none; color: inherit; display: block; transition: border-color var(--dur-select), transform var(--dur-hover), box-shadow var(--dur-hover); }
.kpi-link:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-popover); }
.kpi.accent .kpi-value { color: var(--accent-ink); }
.pipeline-head { border: none; padding: 4px 2px 0; }
.kanban .col.vide { background: var(--paper-2); border-style: dashed; }
.col-n { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); font-size: 9px; font-weight: 700; margin-right: 6px; vertical-align: middle; }
.tache-l { transition: background var(--dur-hover); }
.tache-l:hover { background: var(--paper-2); }
.pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--accent-tint); color: var(--accent-ink); font-size: 11px; font-weight: 600; }

/* Pas-à-pas illustré : un pas, son écran, le repère de l'endroit où cliquer */
.guide { list-style: none; margin: 0; padding: 0; counter-reset: g; display: flex; flex-direction: column; gap: var(--space-5); }
.guide > li { counter-increment: g; position: relative; padding-left: 34px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.guide > li::before { content: counter(g); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: var(--radius-full); background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.guide > li:not(:last-child)::after { content: ''; position: absolute; left: 10.5px; top: 27px; bottom: calc(-1 * var(--space-5) + 4px); width: 1px; background: var(--line-soft); }
.g-texte { font-size: var(--text-body); line-height: 1.5; color: var(--ink-2); }
.g-texte b { color: var(--ink); font-weight: 600; }
.ecran { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ecran .vue, .visionneuse .vue { position: relative; display: inline-block; line-height: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-btn); overflow: hidden; background: var(--paper); max-width: 100%; }
.ecran .vue { cursor: zoom-in; transition: border-color var(--dur-select); }
.ecran .vue:hover { border-color: var(--accent); }
.ecran .vue img { display: block; max-width: 100%; max-height: 460px; width: auto; height: auto; }
.ecran figcaption { font-size: var(--text-meta); color: var(--muted); }
.repere { position: absolute; border: 2px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 3px var(--accent-soft); pointer-events: none; }
.visionneuse { align-items: center; padding: 24px; cursor: zoom-out; background: rgba(10, 10, 10, .55); }
.visionneuse .vue img { display: block; max-width: min(94vw, 1500px); max-height: 90vh; width: auto; height: auto; }
@media (max-width: 640px) { .guide > li { padding-left: 30px; } .fiche .ligne { grid-template-columns: 120px 1fr auto; } }

/* Partenaires : logo officiel, mail prêt à relire */
.logo-p { height: 22px; width: auto; max-width: 84px; object-fit: contain; flex: 0 0 auto; }
.option { gap: 10px; }
.option .logo-p { width: 52px; height: 22px; max-width: none; flex: 0 0 52px; display: block; }
.option .nom-p { min-width: 0; line-height: 1.3; }
.options { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tache .titre { display: flex; align-items: center; gap: 10px; }
/* Corps du mail au partenaire : visible d'emblée, copiable d'un clic */
.corps-mail { border: 1px solid var(--line-soft); border-radius: var(--radius-btn); background: var(--paper); overflow: hidden; }
.corps-mail .cm-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line-soft); }
.corps-mail .cm-tete .l { color: var(--muted); font-size: var(--text-meta); }
.corps-mail pre { margin: 0; padding: 10px 12px; white-space: pre-wrap; font-family: var(--font-ui, inherit); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); max-height: 220px; overflow-y: auto; }
/* Fin de parcours : la signature Charlie */
.signature { margin-top: var(--space-10); display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font-size: var(--text-meta); transition: opacity var(--dur-select); }
.signature img { width: 200px; max-width: 60vw; height: auto; display: block; }
.signature .sig-nom { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--ink); letter-spacing: -0.01em; }
.signature:hover { opacity: .7; }

/* Logos des partenaires dans le back-office */
.logo-a { width: 42px; height: 22px; object-fit: contain; flex: 0 0 42px; }
.logo-a.lg { width: 66px; height: 30px; flex-basis: 66px; }
.nom-a { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.nom-a .tronq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page de fin : le sceau qui se dessine et les confettis */
.fin-sceau { width: 68px; height: 68px; margin-bottom: 6px; }
.fin-sceau svg { width: 100%; height: 100%; }
.fin-sceau circle { fill: none; stroke: var(--accent); stroke-width: 3; transform-origin: center; animation: sceau-pop 480ms var(--ease-out) both; }
.fin-sceau path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: sceau-trace 420ms var(--ease-out) 360ms both; }
.ecran-fin h1 { animation: fin-monte 520ms var(--ease-out) 300ms both; }
@keyframes sceau-pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes sceau-trace { to { stroke-dashoffset: 0; } }
@keyframes fin-monte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -20px; display: block; opacity: 0; animation-name: confetti-chute; animation-timing-function: cubic-bezier(.2, .6, .5, 1); animation-fill-mode: forwards; }
@keyframes confetti-chute { 0% { transform: translateY(-20px) rotate(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(102vh) rotate(600deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fin-sceau circle, .fin-sceau path, .ecran-fin h1 { animation: none; } .fin-sceau path { stroke-dashoffset: 0; } }

/* Sous-titres des sections de la fiche cabinet (Général / Juridique / Intermédiation) */
.section-sous { font-size: var(--text-label); font-weight: 600; color: var(--muted); margin: var(--space-4) 0 var(--space-2); text-transform: uppercase; letter-spacing: 0.04em; }

/* Partenaires : la procédure en images n'est qu'une option, proposée tout en bas. */
.a-la-main { align-items: center; margin-top: var(--space-4); }

/* Le sablier du remplissage : il tourne tant que l'agent écrit dans Wealthcome. */
.cw-btn .sablier { border-color: rgba(255,255,255,.45); border-top-color: #fff; margin-right: 8px; vertical-align: -2px; }
.sablier { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); display: inline-block; animation: sablier 900ms linear infinite; }
@keyframes sablier { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sablier { animation-duration: 2400ms; } }
/* Le signe d'alerte en tête d'un message : aligné sur la première ligne, jamais au-dessus du texte. */
.note .note-ic { float: left; margin: 1px 8px 0 0; display: inline-flex; }
.note .note-ic svg { display: block; }
/* La marque de Charlie dans un bouton : le PNG sert de pochoir, la couleur vient du texte du bouton. */
.cw-btn .marque-ic { width: 15px; height: 16px; margin-right: 9px; display: inline-block; vertical-align: -3px; background: currentColor;
  -webkit-mask: url(/charlie.png) center / contain no-repeat; mask: url(/charlie.png) center / contain no-repeat; }
/* La liste des cabinets : les six étapes en ligne, un point par étape. */
.etapes-ligne { display: inline-flex; gap: 4px; align-items: center; }
.etapes-ligne .et { width: 14px; height: 8px; border-radius: 4px; background: var(--line); display: inline-block; }
.etapes-ligne .et.fait { background: var(--accent); }
.etapes-ligne .et.en_cours { background: var(--ink); }
.etapes-ligne .et.bloque { background: var(--danger); }
.step-hint.alerte { color: var(--err-ink); }
a.tache-l { text-decoration: none; color: inherit; }

/* Temps & usage : graphes en HTML, texte à taille fixe, barres qui s'allongent seules. */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.tps-cmp { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 24px 40px; align-items: center; }
.tps-cmp .kpi-value { color: var(--accent-ink); }
.tps-barres, .tps-lignes { display: flex; flex-direction: column; gap: 10px; }
.tps-ligne { display: grid; grid-template-columns: 120px 1fr 56px; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-2); }
.tps-lignes .tps-ligne { grid-template-columns: 150px 1fr 48px; }
.tps-ligne.fort .tps-lib, .tps-ligne.fort .tps-val { color: var(--ink); font-weight: 600; }
.tps-ligne.pale .tps-barre { background: var(--ink); opacity: .16; }
.tps-lib { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tps-piste { display: block; height: 8px; border-radius: 4px; background: var(--accent-tint); overflow: hidden; }
.tps-barre { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.tps-val { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; white-space: nowrap; }
.tps-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 150px; padding-top: 4px; }
.tps-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.tps-n { font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1; min-height: 12px; }
.tps-tige { display: block; width: 100%; max-width: 28px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--accent); }
.tps-tige.vide { background: var(--accent-tint); height: 2px !important; }
.tps-date { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .tps-cmp { grid-template-columns: 1fr; gap: 14px; } .tps-ligne { grid-template-columns: 90px 1fr 48px; } .tps-lignes .tps-ligne { grid-template-columns: 110px 1fr 40px; } }

/* ── Portail de connexion de l'espace : le lien ne suffit plus, un code part à l'adresse du cabinet ── */
.porte { max-width: 480px; margin: var(--space-12, 56px) auto 0; display: flex; flex-direction: column; gap: 14px; }
.porte-texte { color: var(--ink-2); font-size: var(--text-body-lg); line-height: 1.55; }
.porte-form { display: flex; align-items: flex-end; gap: var(--space-2); flex-wrap: wrap; }
.porte-form .champ { width: 220px; }
.porte-form #code { font-size: 20px; letter-spacing: .12em; text-align: center; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.porte-aide { font-size: 13px; }
.porte .lien { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
