/* Portefeuille Assurances — styles de l'application (CRM + écrans d'accès SaaS) */
/* Layout: outil sobre — barre latérale, espace de travail neutre, fiche client en panneau latéral */
/* Charte VotreCRM (commune à la vitrine site.css et à l'admin admin.css) : papier clair, encre bleu nuit,
   surligneur jaune pour ce qui compte, formes arrondies, sans dégradé. Thème clair ou sombre selon l'appareil. */
:root {
  --bg: #F6F4EE; --surface: #FFFFFF; --sunk: #F0EDE5; --ink: #22314A; --strong: #16243A; --muted: #5B6575; --line: #E4E0D6;
  --accent: #1E3A66; --accent-ink: #FBFAF6; --accent-soft: #E3E8F1;
  --mark: #F3D649; --mark-ink: #16243A;
  --ok: #2E7150; --ok-soft: #E2EEE7; --warn: #865A1C; --warn-soft: #F1EADF; --danger: #9E463E; --danger-soft: #F2E4E2;
  --inactive: #7A5C8E; --inactive-soft: #ECE5F1;
  --f-display: "Google Sans", sans-serif;  /* titres */
  --f-body: "Arimo", sans-serif;           /* textes */
  --f-data: "Arimo", sans-serif;           /* chiffres (alignés avec tabular-nums) */
  --r: 14px;
  --shadow: 0 1px 2px rgba(22, 36, 58, 0.04);
  color-scheme: light dark;
}
/* Thème sombre (selon l'appareil) : anthracite légèrement chaud, surfaces en relief par paliers plus clairs,
   texte blanc cassé atténué, bleu clair pour les accents (lisible sur fond sombre) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1C20; --surface: #24262B; --sunk: #2C2F35; --ink: #DAD7CF; --strong: #EEEBE3; --muted: #A4A39D; --line: #383B42;
    --accent: #8EA9DA; --accent-ink: #14213A; --accent-soft: #2A3550;
    --mark: #D9C060; --mark-ink: #1B1C20;
    --ok: #74C495; --ok-soft: #213429; --warn: #DDAA5E; --warn-soft: #3A3021; --danger: #E68F84; --danger-soft: #3E2826;
    --inactive: #BB9BD0; --inactive-soft: #342A3D;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -0.02em; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
p { margin: 0; }

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.brand strong { font-family: var(--f-display); font-size: 19px; font-weight: 700; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.brand img { max-width: 160px; max-height: 48px; object-fit: contain; align-self: flex-start; }
.brand img[hidden] { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { all: unset; cursor: pointer; padding: 8px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.nav button:hover { background: var(--surface); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
/* Déconnexion, juste sous « Paramètres » */
.nav .nav-logout { color: var(--danger); }
.nav .nav-logout:hover { background: var(--danger-soft); color: var(--danger); }
.nav button:focus-visible { outline: 2px solid var(--accent); }
.nav .count { font-family: var(--f-data); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.nav .count.alert { color: var(--danger); font-weight: 500; }
.nav .sep { height: 1px; background: var(--line); margin: 6px 10px; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; display: flex; flex-direction: column; gap: 8px; }

main { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top h1 { font-size: 28px; font-weight: 700; }
.top p { margin: 2px 0 0; color: var(--muted); max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--ink); }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.55; cursor: default; }
/* Fonctions réservées à une formule supérieure : visibles mais grisées (infobulle de la formule minimale) */
[data-locked], button[data-locked] { opacity: 0.55; cursor: not-allowed; }
.nav button[data-locked]:hover { background: transparent; color: var(--muted); }
.lockwrap { display: inline-flex; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--sunk); }
.btn.danger { color: var(--danger); }
.btn.danger.armed { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn.sm { padding: 3px 8px; font-size: 12.5px; }
a.btn { text-decoration: none; display: inline-block; }

.banner { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.kpi .val { font-family: var(--f-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 16px 10px; flex-wrap: wrap; }
.panel > header h2 { font-size: 16px; font-weight: 700; }
.panel > header span { color: var(--muted); font-size: 12.5px; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; }
.row:hover { background: var(--sunk); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--sunk); }
.row .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 12.5px; grid-column: 1; }
.row .end { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; align-items: center; }
.empty { padding: 18px 16px 20px; color: var(--muted); border-top: 1px solid var(--line); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.prospect { background: var(--sunk); color: var(--muted); }
.pill.rdv { background: var(--accent-soft); color: var(--accent); }
.pill.devis { background: var(--warn-soft); color: var(--warn); }
.pill.client { background: var(--ok-soft); color: var(--ok); }
.pill.perdu { background: var(--danger-soft); color: var(--danger); }
/* Inactif / résilié : tous les contrats du client sont terminés (attribué par le serveur) */
.pill.inactif_resilie { background: var(--inactive-soft); color: var(--inactive); }
.pill.inactif_resilie::before { border-radius: 1px; }
/* Fiche : date de destruction légale prévue (RGPD) */
.rgpd-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; background: var(--inactive-soft); color: var(--inactive); }
.rgpd-note strong { font-weight: 600; }
.rgpd-note.due { background: var(--danger-soft); color: var(--danger); }
.chip { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.late { color: var(--danger); border-color: var(--danger); }
.chip.soon { color: var(--warn); border-color: var(--warn); }
.chip.opp, .chip.in { color: var(--accent); border-color: var(--accent); }
.chip.ok { color: var(--ok); border-color: var(--ok); }
.chip.ex { border-style: dashed; }
.chip.prio { min-width: 2.2em; text-align: center; font-weight: 600; }

/* Pastille du statut du DER à côté du nom de la fiche */
.der-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 0; vertical-align: middle; }
.der-dot.ok { background: var(--ok); }
.der-dot.warn { background: #C2680A; }
@media (prefers-color-scheme: dark) { .der-dot.warn { background: #F0A040; } }
.der-dot.bad { background: var(--danger); }
.f-head .contact .der-info { font-weight: 600; }
/* Fin de la pastille du DER */

.f-prio ul { margin: 6px 0 6px 18px; }

.funnel { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--sunk); }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend strong { color: var(--ink); font-family: var(--f-data); font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 220px; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 70px; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.fgrid .wide { grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--sunk); }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.sub2 { color: var(--muted); font-size: 12.5px; }

.board { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.col h3 { font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 2px 2px 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.card:hover { border-color: var(--muted); }
.card .nm { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; width: auto; align-self: flex-start; font-weight: 600; }
.card .ln { font-size: 12.5px; color: var(--muted); }
.card .mv { display: flex; justify-content: space-between; gap: 6px; }
.card .mvsel { font-size: 12.5px; width: 100%; }
.card .mvgo { width: 100%; }
.card .nm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card[aria-busy="true"] { opacity: .6; }
.card[draggable="true"] { cursor: grab; }
.card.drag { opacity: .5; }
.col.drop-ok { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col[aria-disabled="true"] { opacity: .55; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .board { grid-template-columns: repeat(5, 85%); scroll-snap-type: x mandatory; }
  .board .col { scroll-snap-align: start; }
  .board .card .mv .btn.sm { min-width: 44px; min-height: 44px; }
  .board .card .mvsel { min-height: 44px; }
  .board .card .mvgo { min-height: 44px; }
  .card[draggable="true"] { cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) { .board { scroll-behavior: auto; } }
.pipe-filtres select { min-width: 150px; }
.pipe-ind { display: block; padding: 0 2px 4px; }
.pipe-alerte { border-color: var(--danger); margin-bottom: 10px; }
.pipe-relance { margin-bottom: 10px; }
@media (max-width: 760px) {
  .pipe-filtres select, .pipe-filtres input[type=search] { min-height: 44px; }
}
#pipe-motif { max-width: min(480px, 94vw); } #pipe-motif form { padding: 18px; display: grid; gap: 10px; } #pipe-motif fieldset { border: 0; padding: 0; display: grid; gap: 8px; } #pipe-motif .hint[role="alert"] { color: var(--danger); min-height: 1.2em; }
@media (max-width: 760px) { #pipe-motif .btn { min-height: 44px; } }
#pipe-alerte-der { max-width: min(520px, 94vw); } #pipe-alerte-der form { padding: 18px; display: grid; gap: 10px; }
@media (max-width: 760px) { #pipe-alerte-der .btn { min-height: 44px; } }
#pipe-stats { max-width: min(760px, 96vw); } #pipe-stats form { padding: 18px; display: grid; gap: 12px; } #pipe-stats-corps { display: grid; gap: 10px; overflow-x: auto; }
.pipe-stats-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.pipe-stats-tab caption { text-align: left; font-weight: 600; padding: 4px 0; }
.pipe-stats-tab th, .pipe-stats-tab td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { #pipe-stats .btn, #pipe-stats select { min-height: 44px; } }
@media (max-width: 760px) { #bx-panel input[type=month], #bx-panel input[type=date] { min-height: 44px; } }

/* Agenda */
.day { display: flex; flex-direction: column; }
.day > h3 { font-size: 13px; text-transform: capitalize; padding: 12px 16px 6px; color: var(--muted); font-family: var(--f-body); font-weight: 600; border-top: 1px solid var(--line); }
.day:first-child > h3 { border-top: 0; }
.ev { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 16px; align-items: center; cursor: pointer; }
.ev:hover { background: var(--sunk); }
.ev .h { font-family: var(--f-data); font-size: 12.5px; }
.ev .t { min-width: 0; }
.ev .t strong { font-weight: 600; }
.ev .t div { color: var(--muted); font-size: 12.5px; }

/* Apporteurs & réglages */
.apgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.ap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ap h3 { font-size: 17px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ap .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ap .stats div { display: flex; flex-direction: column; }
.ap .stats strong { font-family: var(--f-data); font-weight: 500; font-size: 15px; }
.ap .stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.copyrow { display: flex; gap: 6px; align-items: center; min-width: 0; }
.copyrow code { flex: 1; min-width: 0; font-family: var(--f-data); font-size: 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.names { display: flex; flex-wrap: wrap; gap: 6px; }
.names button { border: 1px solid var(--line); background: var(--sunk); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; cursor: pointer; }
.panel .pad { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel .pad p, .ap p { color: var(--muted); max-width: 72ch; }
ol.steps { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; max-width: 72ch; }
ol.steps strong { color: var(--ink); }
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
@media (max-width: 560px) {
  .settings .inline { flex-direction: column; align-items: stretch; }
  .settings .inline .f { flex: 1 1 auto !important; }
  .settings .btn { min-height: 44px; }
  .billing-box .inline .btn { width: 100%; }
}

/* Paramètres : onglets (Cabinet, Équipe, Abonnement, Données et sécurité, Préférences et aide) */
.rg-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.rg-tab { flex: 0 0 auto; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 10px 14px; min-height: 44px; font: inherit; cursor: pointer; white-space: nowrap; }
.rg-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.rg-t { display: flex; flex-direction: column; gap: 16px; }
.rg-t[hidden] { display: none; }

/* Fiche client */
.scrim { position: fixed; inset: 0; background: rgba(8, 18, 22, 0.42); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); border-left: 1px solid var(--line); z-index: 21; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.d-head { padding: 16px 20px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.d-head .t { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.d-head h2 { font-size: 22px; font-weight: 700; }
.d-head .contact { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.d-head .contact span { user-select: all; }
.d-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.d-head .st { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-head .st select { width: auto; }
.d-body { overflow-y: auto; padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.sec > h3 { font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sec > h3 small { font-family: var(--f-body); font-weight: 500; color: var(--muted); font-size: 12.5px; }
.sec.conc { background: var(--sunk); border-style: dashed; }
.sec.conc .contract { background: var(--surface); }
.klist { display: flex; flex-direction: column; gap: 8px; }
.contract { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.contract .l1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.contract .l1 strong { font-size: 14.5px; }
.contract .l2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.contract .l3 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.contract.off { opacity: 0.6; }
details.add > summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 10px; }
.hist ul { margin: 0; padding: 0; }
.hist li { list-style: none; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: start; }
.hist li:first-child { border-top: 0; }
.hist .d { font-family: var(--f-data); font-size: 12px; color: var(--muted); padding-top: 2px; }
.hist .k { font-weight: 600; font-size: 12.5px; }
.hist .x { white-space: pre-wrap; overflow-wrap: anywhere; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.lien { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); cursor: pointer; }
.lien:first-child { border-top: 0; }
.lien:hover strong { color: var(--accent); }
.lien .role { font-size: 12.5px; color: var(--muted); }
.lien strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail { border-top: 1px solid var(--line); padding: 8px 0; }
.mail:first-child { border-top: 0; }
.mail summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 92px auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; }
.mail summary::-webkit-details-marker { display: none; }
.mail .d { font-family: var(--f-data); font-size: 12px; color: var(--muted); }
.mail .obj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .res { grid-column: 2 / 4; color: var(--muted); font-size: 12.5px; }
.mail .body { margin: 8px 0 2px 102px; padding: 10px 12px; background: var(--sunk); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; max-height: 320px; overflow-y: auto; }
.mail .mfoot { display: flex; justify-content: flex-end; margin-top: 4px; }
.rdvs { display: flex; flex-direction: column; }
.rdvi { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.rdvi:first-child { border-top: 0; }
.rdvi.past { opacity: 0.6; }
.rdvi .when { font-family: var(--f-data); font-size: 12.5px; }
.rdvi .act { display: flex; gap: 4px; align-items: center; }
.synth { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.synth.placeholder { color: var(--muted); }
.stale { font-size: 12.5px; color: var(--warn); }
textarea.copybox { font-family: var(--f-data); font-size: 12px; min-height: 120px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 8px; z-index: 40; font-size: 13px; max-width: calc(100% - 32px); }

/* Compagnies & produits */
.ciegrid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.cielist .rows { max-height: 520px; overflow-y: auto; }
.cierow { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 9px 16px; border-top: 1px solid var(--line); width: 100%; }
.cierow:hover { background: var(--sunk); }
.cierow[aria-current="true"] { background: var(--accent-soft); }
.cierow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cierow strong { font-weight: 600; }
.cathead { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 6px; letter-spacing: 0; }
.prow { display: grid; grid-template-columns: 30px minmax(0, 1fr) 120px 150px 130px; gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); }
.prow.head { border-top: 0; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.prow .pn { color: var(--muted); }
.prow.on .pn { color: var(--strong); font-weight: 500; }
.tick { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--muted); background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 13px; line-height: 1; padding: 0; color: var(--accent-ink); user-select: none; }
.tick[data-state="1"] { background: var(--accent); border-color: var(--accent); }
.tick[data-state="2"] { background: transparent; border-color: transparent; color: var(--warn); font-size: 20px; }
.pct { display: flex; align-items: center; gap: 4px; }
.pct input { width: 76px; padding: 4px 8px; text-align: right; font-family: var(--f-data); font-size: 13px; }
.pct span { color: var(--muted); font-size: 12.5px; }
.catgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 4px 16px 16px; }
.catcol { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.catcol h3 { font-size: 14px; }
.catcol ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.catcol li { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid var(--line); }
.catcol li:first-child { border-top: 0; }
.matrix th, .matrix td { text-align: center; padding: 6px 10px; font-size: 13px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; white-space: nowrap; }
.matrix tbody tr { cursor: default; }
.matrix .grp td { font-weight: 600; color: var(--accent); background: var(--sunk); text-align: left; }
.matrix .ok { color: var(--accent); }
.matrix .star { color: var(--warn); font-size: 15px; }
.k-assist { font-size: 12.5px; color: var(--muted); }
.k-assist:empty { display: none; }
.linkbtn { all: unset; cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 500; }
.linkbtn:focus-visible { outline: 2px solid var(--accent); }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.f > span:first-child { font-size: 12px; color: var(--muted); font-weight: 500; }
.livgrid > .f > span:first-child { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Tableau de bord compagnies & produits */
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cattiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cattile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.cattile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cattile .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cattile .val { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--strong); font-variant-numeric: tabular-nums; }
.cattile .share { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.cattile .share i { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; }
.bars { display: flex; flex-direction: column; gap: 2px; padding: 4px 16px 16px; }
.brow { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 4px; border-radius: 6px; cursor: default; }
.brow:hover, .brow:focus-visible { background: var(--sunk); outline: none; }
.brow .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.brow .bt { height: 12px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.brow .bt i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.brow.other .bt i { background: var(--muted); opacity: 0.5; }
.brow .bv { font-size: 12.5px; text-align: right; white-space: nowrap; }
.brow .bv span { color: var(--muted); }
table.heat td, table.heat th { text-align: center; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; }
table.heat th:first-child, table.heat td:first-child { text-align: left; }
table.heat tbody tr { cursor: default; }
table.heat td.cell { font-family: var(--f-data); font-variant-numeric: tabular-nums; border-left: 2px solid var(--surface); }
table.heat td.zero { color: var(--muted); opacity: 0.6; }
table.heat .tot { font-weight: 600; color: var(--strong); }
.heatlegend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.heatlegend i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 6%, var(--surface)), color-mix(in oklab, var(--accent) 48%, var(--surface))); }
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--strong); color: var(--surface); font-size: 12.5px; padding: 7px 10px; border-radius: 8px; max-width: 260px; line-height: 1.45; white-space: pre-line; box-shadow: 0 4px 14px rgba(41, 50, 63, 0.18); }
@media (max-width: 1100px) { .dgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .cattiles { grid-template-columns: minmax(0, 1fr); } }

/* Gestion du cabinet */
table.fin td, table.fin th { white-space: nowrap; }
table.fin tbody tr { cursor: default; }
table.fin td.pos { color: var(--ok); }
table.fin td.neg { color: var(--danger); }
table.fin tr.total td { font-weight: 600; color: var(--strong); background: var(--sunk); }
.postes { display: flex; flex-direction: column; }
.poste { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: center; }
.poste strong { font-weight: 600; color: var(--strong); }
.poste .act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.docs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.docs a.chip { text-decoration: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.docs .x { all: unset; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0 2px; }
.docs .x:hover { color: var(--danger); }
table.lettrage input.occmt { width: 96px; padding: 3px 6px; text-align: right; font-family: var(--f-data); font-size: 12.5px; }
details.fees > summary { list-style: none; cursor: pointer; }
details.fees > summary::-webkit-details-marker { display: none; }
details.fees > summary .lnk { color: var(--accent); font-size: 12px; margin-left: 6px; }
table.mini { margin: 6px 0 2px; }
table.fin tr.prev td { color: var(--muted); font-style: italic; }
table.fin tr.prev td:first-child { font-style: normal; }
table.mini tr.cur td { background: var(--accent-soft); }
details.phist > summary { list-style: none; cursor: pointer; padding-top: 4px; }
details.phist > summary::-webkit-details-marker { display: none; }
details.phist .lnk, details.fees .lnk { color: var(--accent); font-size: 12.5px; font-weight: 500; }
select.occmode { width: auto; padding: 3px 6px; font-size: 12.5px; }
/* Colonnes alignées d'un tableau à l'autre (charges, entrées, fournisseurs) */
/* Chaque tableau fixe sa largeur minimale (style inline) : la colonne du libellé garde au moins ~220 px, le tableau défile sur petit écran */
table.cols { table-layout: fixed; width: 100%; }
table.cols th, table.cols td { text-align: left; vertical-align: top; overflow-wrap: break-word; white-space: normal; }
table.cols th.r, table.cols td.r { text-align: right; }
table.cols .c-chk { width: 40px; }
table.cols .c-cat { width: 160px; }
table.cols .c-tiers { width: 135px; }
table.cols .c-date { width: 120px; }
table.cols .c-mode { width: 120px; }
table.cols .c-docs { width: 190px; }
table.cols .c-mt { width: 120px; }
table.cols .c-ryt { width: 180px; }
table.cols .c-act { width: 170px; }
table.cols .c-orig { width: 130px; }
table.cols .c-via { width: 180px; }
table.cols input.ltdate { width: 100%; }
table.cols select.occmode { width: 100%; }
table.cols td.c-act .act { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
table.cols td.c-mt .sub2 { text-align: right; }
strong.lib { font-weight: 600; color: var(--strong); }

/* Gestion du cabinet : barre d'actions, tableau des dépenses triable, suivi des paiements compact */
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-actions .g-tvabox { margin-left: auto; font-size: 13px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.g-h2 { font-size: 15px; font-weight: 600; color: var(--strong); margin: 8px 0 -4px; }
table.postes-t { min-width: 900px; }
table.postes-t td { padding-top: 9px; padding-bottom: 9px; }
table.postes-t tr.editing > td { background: var(--surface-2, var(--bg)); padding: 14px 16px 18px; }
table.postes-t .c-cat { width: 170px; }
table.postes-t .c-tiers { width: 150px; }
table.postes-t .c-mode { width: 110px; }
table.postes-t .c-mt { width: 140px; }
.sortbtn { all: unset; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; font: inherit; color: inherit; }
.sortbtn:hover { color: var(--accent); }
.sortbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
th.r .sortbtn { justify-content: flex-end; width: 100%; }
.sortic { font-size: 10px; opacity: 0.55; }
th[aria-sort="ascending"] .sortic, th[aria-sort="descending"] .sortic { opacity: 1; color: var(--accent); }
table.compact { min-width: 1120px; }
table.compact.hist { min-width: 720px; }
table.compact td, table.compact th { padding-top: 7px; padding-bottom: 7px; }
table.compact .c-tiers { width: 125px; }
table.compact .c-date { width: 108px; }
table.compact .c-mode { width: 112px; }
table.compact .c-docs { width: 150px; }
table.cols .c-note { width: 140px; }
table.compact .c-docs .btn.sm { padding: 3px 8px; font-size: 12px; }
input.occnote { width: 100%; padding: 3px 6px; font-size: 12.5px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
details.mois .tot .apointer { color: var(--warn); }
.echeancier { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Dépenses prévisionnelles : un bloc par mois */
.prevgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.prevm { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.prevh { display: flex; justify-content: space-between; gap: 8px; text-transform: capitalize; margin-bottom: 6px; }
.prevm ul, .slist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.prevm li, .slist li { display: flex; justify-content: space-between; gap: 10px; }
.prevm li .linkbtn { text-align: left; font-size: 12.5px; }
/* Synthèse : mois dépliables */
table.synth tr.smonth { cursor: pointer; }
table.synth tr.smonth:hover td { background: var(--accent-soft); }
table.synth tr.smonth.open td { background: var(--accent-soft); font-weight: 500; }
table.synth .caret { color: var(--muted); display: inline-block; width: 12px; }
table.synth tr.sdet > td { background: var(--surface); padding: 12px 16px 16px; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: min(880px, calc(100vw - 340px)); position: sticky; left: 16px; }
.sgrid h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; color: var(--strong); }
.slist li.prev { color: var(--muted); font-style: italic; }
@media (max-width: 760px) { .sgrid { grid-template-columns: 1fr; width: calc(100vw - 64px); } .g-actions .g-tvabox { margin-left: 0; } }
/* Contrôle de cohérence de la mensualité d'un crédit */
.ctl { border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.45; }
.ctl.ok { background: var(--ok-soft); color: var(--ok); }
.ctl.warn { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); }
.ctl.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.ctl .linkbtn { margin-left: 6px; }
table.cols .c-ed { width: 46px; text-align: center; }
[hidden] { display: none !important; }
/* Menu : intitulé sur une ligne, compteur en dessous en plus petit ; sections titrées */
.nav button { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
.nav .nl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav .count { font-size: 11px; line-height: 1.2; }
.nav .count:empty { display: none; }
/* première section : compteur en bout de ligne (sauf Tableau de bord, dont le compteur est un texte) */
.nav button.inl { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.nav button.inl .nl { flex: 1 1 auto; min-width: 0; }
.nav button.inl .count { font-size: 12px; flex: none; }
.nav .sep { margin: 10px 10px 2px; }
.nav-sec.nav-first { padding-top: 4px; }
.nav button.idle:not([aria-current]) .nl { color: var(--muted); opacity: 0.6; }
.panel.idle { opacity: 0.65; box-shadow: none; }
.notaux .pct, .notaux .prow.head span:nth-child(n+3), .notaux label.f:has(> [data-cf="decalage"]), .notaux label.f:has(> [data-cf="jourPaiement"]) { display: none !important; }
.notaux .prow { grid-template-columns: 30px minmax(0, 1fr); }
.modrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.modrow:first-of-type { border-top: 0; }
.modrow input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.modrow strong { color: var(--strong); }
.panel.idle h2 { color: var(--muted); }
.nav-sec { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
.brand strong { overflow-wrap: anywhere; }
@media (max-width: 760px) { .nav-sec { display: none; } .nav button { flex: none; } }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rolechip { font-size: 11.5px; }
/* Bulle « Mon compte » et panneau du compte */
.acct { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.acct:hover { border-color: var(--accent); }
.acct:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; background-size: cover; background-position: center; }
.acct-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.acct-t strong { font-weight: 600; color: var(--strong); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-t span { font-size: 11.5px; color: var(--muted); }
.acct-drawer { width: min(460px, 100%); }
/* panneaux latéraux au-dessus du bandeau d'essai (version SaaS) */
.scrim { z-index: 35; }
.drawer { z-index: 36; }
.acct-drawer .av { width: 48px; height: 48px; font-size: 17px; }
.acct-head { display: flex; gap: 14px; align-items: center; }
@media (max-width: 760px) { .acct { padding: 6px 8px; } .acct .av { width: 28px; height: 28px; font-size: 11px; } }
output.ttc-out { display: block; padding: 7px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--strong); font-weight: 600; font-size: 15px; }
.iconbtn { all: unset; box-sizing: border-box; cursor: pointer; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 7px; color: var(--muted); }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vdetail { display: flex; flex-direction: column; gap: 12px; padding: 8px 4px 6px; }
.brow.go { cursor: pointer; }
.brow.go:hover .bl { color: var(--accent); }
table.mini td, table.mini th { padding: 4px 8px; font-size: 12px; }

/* Commissions & lettrage */
.cfilters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.cfilters .f { flex: 0 1 170px; }
/* Formulaire « Saisir un virement reçu » : grille alignée en haut, libellés sur une ligne, aide sous le champ sans décaler les voisins */
.vir-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; align-items: start; min-width: 0; }
.vir-grid .f > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vir-grid .f > input, .vir-grid .f > select { box-sizing: border-box; height: 36px; max-width: 100%; }
.vir-grid .wide { grid-column: 1 / -1; }
details.mois { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
details.mois > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
details.mois > summary::-webkit-details-marker { display: none; }
details.mois > summary::before { content: "›"; color: var(--muted); font-size: 18px; line-height: 1; transition: transform 0.15s; }
details.mois[open] > summary::before { transform: rotate(90deg); }
details.mois > summary strong { font-weight: 600; text-transform: capitalize; min-width: 130px; color: var(--strong); }
details.mois .tot { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); flex: 1; }
details.mois .tot .num { color: var(--ink); }
details.mois .tot .reste { color: var(--danger); }
details.mois .tot .solde { color: var(--ok); }
table.lettrage tbody tr { cursor: default; }
table.lettrage td { padding: 7px 14px; }
table.lettrage tr.paid td { color: var(--muted); }
table.lettrage tr.paid .num { text-decoration: line-through; text-decoration-color: var(--muted); }
table.lettrage tr.grp td { background: var(--sunk); font-weight: 600; font-size: 12.5px; color: var(--accent); }
table.lettrage input.ltdate { width: 140px; padding: 3px 6px; font-size: 12.5px; font-family: var(--f-data); }
table.bxres td { vertical-align: top; font-size: 13px; }
table.bxres tbody tr { cursor: default; }
table.bxres tr.off td { opacity: 0.55; }
.bxsum { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.bxsum strong { color: var(--strong); font-weight: 600; }
table.lettrage input[type=checkbox], table.bxres input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.cname { cursor: pointer; }
.cname:hover { color: var(--accent); }
.kpi .val.reste { color: var(--danger); }

/* Finitions sobres : moins de couleur, moins de traits, hiérarchie par la typographie */
.side { background: var(--surface); }
.brand strong { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.nav button { font-weight: 500; }
.nav button:hover { background: var(--sunk); }
.nav button[aria-current="page"] { background: var(--sunk); box-shadow: none; }
.top h1 { font-size: 26px; }
.panel, .kpi, .sec, .ap, .card { box-shadow: var(--shadow); }
.kpi { padding: 16px 18px; gap: 6px; }
.kpi .val { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.kpi .lbl, th, .ap .stats span { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; }
.panel > header h2 { font-size: 15px; font-weight: 600; }
.btn { box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: none; opacity: 0.9; }
h1, h2, h3, .kpi .val { color: var(--strong); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.toast { background: var(--strong); color: var(--surface); }
.scrim { background: rgba(58, 61, 69, 0.18); }
.drawer { box-shadow: -8px 0 24px rgba(58, 61, 69, 0.06); border-left-color: var(--line); }
.side { border-color: var(--line); }
.btn.ghost { box-shadow: none; }
.pill, .chip { font-weight: 500; }
.chip { border-radius: 6px; }
.banner { background: var(--sunk); }
.sec.conc { border-style: solid; }
.sec > h3 { font-size: 14.5px; font-weight: 600; }
.d-head h2 { font-size: 21px; }
.col { border-color: transparent; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.seg button { box-shadow: var(--shadow); }
.dot { border-radius: 50%; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .ciegrid { grid-template-columns: minmax(0, 1fr); }
  .catgrid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .prow { grid-template-columns: 30px minmax(0, 1fr); }
  .prow .pct { grid-column: 2; }
  .prow.head span:nth-child(n+3) { display: none; }
  .pct::before { content: attr(data-l); font-size: 12px; color: var(--muted); flex: 1; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px 10px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .nav .sep { display: none; }
  #store-note, .legal-links { display: none; }
  main { padding: 18px 16px 40px; }
  .top h1 { font-size: 23px; }
  .kpi .val { font-size: 22px; }
  .hide-sm { display: none; }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .hist li { grid-template-columns: minmax(0, 1fr) auto; }
  .hist .d { grid-column: 1 / -1; }
  .lien { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lien .role { grid-column: 1 / -1; }
  .mail summary { grid-template-columns: auto minmax(0, 1fr); }
  .mail .obj, .mail .res { grid-column: 1 / -1; }
  .mail .body { margin-left: 0; }
  .rdvi { grid-template-columns: minmax(0, 1fr) auto; }
  .rdvi .when { grid-column: 1 / -1; }
  .ap .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: slide 0.18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: 0.6; } }
}
/* ---- Version SaaS : base de page, écrans d'accès, bandeau d'essai ---- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.gate { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
.gate-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 10px 30px rgba(41, 50, 63, 0.08); }
.gate-card .brand { padding: 0; }
.gate-card h2 { font-size: 20px; }
.gate-card p { color: var(--muted); }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-form .btn.primary, .gate-card > .btn.primary { padding: 10px 14px; text-align: center; }
.gate-card .seg { align-self: flex-start; }
.gate-card .inline .btn { white-space: normal; }
.auth-msg { margin: 0; font-size: 13px; min-height: 1em; }
.auth-msg.err { color: var(--danger); }
.auth-msg.ok { color: var(--ok); }
.trialbar { position: sticky; top: 0; z-index: 30; background: var(--accent-soft); color: var(--ink); font-size: 13px; padding: 7px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.trialbar a { color: var(--accent); font-weight: 600; }
.trialbar.urgent { background: var(--warn-soft); }
/* Rappel : adresse email à confirmer (accès libre pendant 7 jours après l'inscription) */
.verifybar { background: var(--warn-soft); color: var(--ink); font-size: 13px; padding: 7px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.verifybar .linkbtn { margin-left: 8px; }
.plans { display: grid; gap: 10px; }
.gate-card.wide { width: min(880px, 100%); }
.gate-card.wide .plans { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan .feats { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; display: flex; flex-direction: column; gap: 3px; }
.plan .opt { font-size: 13.5px; }
.plan.current { border-color: var(--accent); }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.plan strong { color: var(--strong); }
.plan span { font-size: 13px; color: var(--muted); }
.plan .btn { align-self: flex-start; }
.plan .price { color: var(--strong); font-weight: 600; font-size: 13px; }
.plan.chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
/* Page de connexion : choix de l'offre, code promo, invitation */
.gate-card.wide { width: min(460px, 100%); }
.gate-card .brand-link { color: inherit; text-decoration: none; align-self: flex-start; }
.offers { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.offers legend { padding: 0; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.offer { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--surface); }
.offer:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.offer input { width: auto; padding: 0; margin: 3px 0 0; accent-color: var(--accent); flex: none; box-shadow: none; }
.offer > span { flex: 1; min-width: 0; }
.offer strong { display: block; color: var(--strong); }
.offer .o-price { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.offer .o-sub { display: block; font-size: 12.5px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink); cursor: pointer; }
.check input { width: auto; padding: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); box-shadow: none; }
/* Abonnement (Paramètres > Équipe) */
.billing-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.billing-box p { margin: 0; }
#paywall-interval { align-self: center; }
/* Fiche client : numéro, bouton GED, devis */
.d-head .numero { margin-top: 2px; }
.chip.num { font-family: var(--f-data); letter-spacing: 0.02em; background: var(--sunk); color: var(--strong); }
.ged-btn { gap: 6px; }
details.resilies { margin-top: 8px; }
details.resilies > summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.contract.demande { border-style: dashed; }
/* GED, aperçu et email : fenêtres au-dessus de la fiche */
.ged-dlg { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(41, 50, 63, 0.3); width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.ged-dlg[open] { display: flex; flex-direction: column; }
#ecr-dlg .pad, #bib-dlg .pad, #rcl-dlg .pad { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
#ecr-dlg > h2, #bib-dlg > h2, #rcl-dlg > h2 { margin: 0; padding: 14px 16px 4px; font-size: 17px; }
.ged-dlg::backdrop { background: rgba(41, 50, 63, 0.45); }
.ged-dlg.preview { width: min(1000px, calc(100vw - 24px)); height: calc(100vh - 24px); }
.ged-dlg.mail { width: min(640px, calc(100vw - 24px)); }
.ged-dlg.mail .mail-body code { overflow-wrap: anywhere; word-break: break-all; }
.ged-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ged-head h2 { font-size: 17px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ged-head .sub2.warn { color: var(--warn); font-weight: 600; }
.ged-head .sub2.okc { color: var(--ok); }
.ged-body { display: grid; grid-template-columns: 260px 1fr; min-height: 0; flex: 1; height: min(720px, calc(100vh - 100px)); }
.ged-tree { border-right: 1px solid var(--line); padding: 10px; overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.ged-node { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13.5px; }
.ged-node.child { padding-left: 26px; }
.ged-node:hover { background: var(--sunk); }
.ged-node[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ged-node .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ged-node .ct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ged-main { padding: 16px 18px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ged-path { font-size: 13px; color: var(--muted); }
.ged-path strong { color: var(--strong); }
.ged-required h3 { font-size: 14px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.req-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.req { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.req.missing { border-color: var(--danger); background: var(--danger-soft); }
.req.done { border-color: var(--ok); background: var(--ok-soft); }
.req-t { display: flex; flex-direction: column; gap: 4px; }
.ged-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; font-size: 14px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ged-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.ged-files { min-width: 560px; }
.factions { display: inline-flex; gap: 4px; justify-content: flex-end; align-items: center; }
.btn.icon { min-width: 30px; justify-content: center; text-decoration: none; }
.pad0 { margin: 0; }
.pv-body { flex: 1; overflow: auto; background: #525659; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pv-body .pad, .pv-body .pv-info { color: #fff; margin: 0; }
.pv-page { background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); max-width: 100%; height: auto; }
.pv-img { max-width: 100%; height: auto; background: #fff; }
.ged-mailform { display: flex; flex-direction: column; min-height: 0; }
.mail-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.mail-body textarea { font-family: inherit; line-height: 1.5; }
.mail-docs { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mail-docs legend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
#mail-files { display: flex; flex-direction: column; gap: 4px; }
.mail-mode { gap: 16px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.mail-warn { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.ged-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .ged-body { grid-template-columns: 1fr; height: auto; }
  .ged-tree { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; }
  .ged-node.child { padding-left: 10px; }
  .ged-node { width: auto; flex: none; }
  .req-grid { grid-template-columns: 1fr; }
}
/* Recueil de besoins : fenêtre d'envoi et statuts dans la fiche (classes .rq-* ; couleurs par variables : thèmes clair et sombre) */
.ged-dlg.rq-dlg { width: min(560px, calc(100vw - 24px)); }
.rq-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-width: 0; }
.rq-body p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.rq-body select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.rq-note { padding: 8px 12px; border-radius: 10px; background: var(--sunk); color: var(--ink); font-size: 13px; }
.rq-note.warn { background: var(--warn-soft); color: var(--warn); }
.rq-msg { font-size: 13px; color: var(--ink); }
.rq-msg.err { color: var(--danger); font-weight: 600; }
.rq-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.rq-actions .btn { min-height: 44px; text-decoration: none; justify-content: center; }
.rq-link { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.rq-url { flex: 1 1 220px; min-width: 0; font-family: var(--f-data); font-size: 13px; }
#d-recueils .rq-list { display: flex; flex-direction: column; gap: 8px; }
#d-recueils .contract .l3 .btn { text-decoration: none; }
#d-recueils.rq-locked { opacity: 0.6; }
.rq-slot { display: inline-flex; }
@media (max-width: 560px) {
  .rq-actions { flex-direction: column-reverse; }
  .rq-actions .btn { width: 100%; }
  #d-recueils .contract .l3 .btn { min-height: 44px; }
}
#d-recueils .contract .l3 a.btn { display: inline-flex; align-items: center; }
/* Inscription : force du mot de passe, confirmation, code promo vérifié en direct */
.pw-rules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12.5px; }
.pw-rules li { display: flex; gap: 6px; align-items: center; color: var(--danger); }
.pw-rules li::before { content: "✗"; font-weight: 700; width: 1em; text-align: center; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓"; }
.with-status { position: relative; display: block; }
/* Assistance à distance : bandeau permanent (support connecté, session en cours, ou code demandé au cabinet) */
.supportbar { position: sticky; top: 0; z-index: 32; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 16px; font-size: 13px; background: var(--danger); color: #fff; text-align: center; }
.supportbar.ask { background: var(--accent); }
.supportbar button { background: #fff; color: var(--strong); border: 0; border-radius: 999px; padding: 4px 12px; font-weight: 600; cursor: pointer; }
.supportbar .assist-code { font-size: 15px; letter-spacing: 2px; background: rgba(255, 255, 255, 0.18); padding: 1px 8px; border-radius: 6px; }
/* Deux champs côte à côte (SIRET, ORIAS), l'un sous l'autre sur téléphone */
.f-row { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }
@media (max-width: 420px) { .f-row { grid-template-columns: 1fr; } }
/* Recherche du cabinet par son nom : liste de correspondances (combobox ARIA) sous le champ */
.combo { position: relative; }
.combo-list { position: absolute; top: 100%; left: 0; right: 0; max-width: 100%; z-index: 10; list-style: none; margin: 4px 0 0; padding: 0; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); }
.combo-list[hidden] { display: none; }
.combo-list [role="option"] { padding: 8px 12px; cursor: pointer; }
.combo-list [role="option"] strong { display: block; }
.combo-list [role="option"] small { display: block; color: var(--muted); }
.combo-list [role="option"][aria-selected="true"] { background: var(--accent-soft); color: var(--strong); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.linklike:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.with-status input { padding-right: 34px; }
.status-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: 15px; pointer-events: none; }
.status-icon.ok { color: var(--ok); }
.status-icon.ok::before { content: "✓"; }
.status-icon.err { color: var(--danger); }
.status-icon.err::before { content: "✗"; }
.status-icon.wait::before { content: "…"; color: var(--muted); }
.hint.ok { color: var(--ok); }
.hint.err { color: var(--danger); }
.btn.primary:disabled { opacity: 0.55; cursor: not-allowed; }
#verify-known { display: flex; flex-direction: column; gap: 10px; }
#verify-known p { margin: 0; }
.edit-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--sunk); }
.edit-box[hidden] { display: none; }
.mail-badge { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 24px; }
#verify-wait p { margin: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.legal-links a { color: var(--muted); }
/* Application : bandeaux de maintenance et de mode support, écran de cabinet suspendu */
.announce { position: sticky; top: 0; z-index: 31; padding: 7px 16px; text-align: center; font-size: 13px; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--line); }
.announce.critical { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.side-foot .who { display: flex; flex-direction: column; gap: 2px; }
.side-foot .who strong { color: var(--ink); font-weight: 600; }

.envbadge { position: fixed; left: 12px; bottom: 12px; z-index: 70; background: var(--warn); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; letter-spacing: 0.02em; pointer-events: none; }

/* Paramètres > Offres compagnies : étoile jaune = en tête des listes, grise = masqué */
table.ins-table .c-star { width: 46px; text-align: center; }
table.ins-table tbody tr { cursor: default; }
table.ins-table tr.ins-cie td { background: var(--sunk); }
table.ins-table td.ins-pname { padding-left: 28px; }
/* Favori : nom en gras ; les autres lignes restent normales (rien n'est grisé ni masqué) */
table.ins-table tr.ins-prod.fav td.ins-pname { font-weight: 600; color: var(--strong); }
.ins-star { border: 0; background: none; padding: 2px 6px; font-size: 19px; line-height: 1; cursor: pointer; color: #B9C3D3; border-radius: 6px; }
.ins-star.on { color: #E2A600; }
.ins-star:hover { background: var(--line); }
.ins-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
table.ins-table tr.ins-seg td { padding-top: 6px; padding-bottom: 2px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); border-bottom: 0; }

/* Thème sombre : textes foncés sur les aplats colorés (couleurs d'état éclaircies pour le fond sombre) */
@media (prefers-color-scheme: dark) {
  .supportbar, .envbadge { color: #1B1C20; }
  .supportbar .assist-code { background: rgba(0, 0, 0, 0.14); }
  .ins-star { color: #5D626B; }
}

/* Espace client sécurisé (dépôt de pièce, mise à jour des informations) et pièce d'identité dans la GED */
.client-gate .gate-card { width: min(520px, 100%); }
.client-h { font-size: 22px; margin: 2px 0 0; }
.client-cab { margin: 0; }
.client-contact { border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.client-ppe { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.client-ppe legend { font-size: 13px; color: var(--ink); font-weight: 600; padding: 0 4px; }
.f-missing input { border-color: var(--warn); background: var(--warn-soft); }
.idform { display: flex; flex-direction: column; gap: 8px; }
.req-v { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip.warn { color: var(--warn); border-color: var(--warn); }

/* Import des données : modèle Excel, pré-validation ligne par ligne */
.imp-dlg { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(41, 50, 63, 0.3); width: min(1240px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.imp-dlg[open] { display: flex; flex-direction: column; }
.imp-dlg::backdrop { background: rgba(41, 50, 63, 0.45); }
.imp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.imp-head h2 { margin: 0; font-size: 18px; }
.imp-head p { margin: 2px 0 0; }
.imp-body { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.imp-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.imp-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.imp-steps div { margin-top: 6px; }
.imp-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; }
.imp-sum-req { color: var(--danger); }
.imp-sum-kyc { color: var(--warn); }
.imp-map summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.imp-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.imp-table { max-height: 52vh; }
.imp-table table { font-size: 12.5px; }
.imp-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.imp-table td { vertical-align: top; }
td.imp-req, .imp-legend.imp-req { background: var(--danger-soft); box-shadow: inset 3px 0 0 var(--danger); }
td.imp-kyc, .imp-legend.imp-kyc { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
.imp-legend { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; }
.imp-empty { color: var(--muted); font-style: italic; font-size: 11.5px; }
td.imp-req .imp-empty { color: var(--danger); }
td.imp-kyc .imp-empty { color: var(--warn); }
.imp-bad { text-decoration: line-through; color: var(--danger); }
.imp-off td:not(.imp-req) { opacity: 0.6; }
.imp-chk { text-align: center; width: 1%; }
.imp-k { margin: 6px 0 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.imp-kyc-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.imp-kyc-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

/* LCB-FT : alerte critique du tableau de bord */
.lcb-alert { border: 1px solid var(--danger); background: var(--danger-soft); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.lcb-alert h2 { margin: 0; font-size: 15px; color: var(--danger); display: flex; gap: 8px; align-items: center; }
.lcb-alert ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lcb-alert li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; }
.lcb-alert .lcb-d { font-size: 12.5px; color: var(--muted); max-width: 70ch; }
.lcb-alert .chip { white-space: normal; }
.lcb-alert li > div { min-width: 0; }
.lcb-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 12px; line-height: 1.3; border: 1px solid currentColor; cursor: pointer; vertical-align: middle; text-align: left; max-width: 100%; white-space: normal; min-height: 24px; }
.lcb-pill.gel { background: var(--danger-soft); color: var(--danger); }
.lcb-pill.warn { background: var(--warn-soft); color: var(--warn); }
.lcb-pill.sm { font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.lcb-pill:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.f-head.lcb-gel { background: var(--danger-soft); border-left: 6px solid var(--danger); border-bottom-color: var(--danger); }
.f-head.lcb-gel .f-title h2 { color: var(--danger); }
.f-head.lcb-gel .contact { color: var(--ink); }
@media (max-width: 760px) { .f-head.lcb-gel { border-left-width: 4px; } .lcb-pill { font-size: 12px; } }
@media (forced-colors: active) { .lcb-pill, .f-head.lcb-gel { border: 2px solid CanvasText; } }
.f-l { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Civilité : deux cases exclusives (M. / Mme) sur la fiche et dans le formulaire client */
fieldset.civ { border: 0; padding: 0; margin: 0; }
fieldset.civ legend { font-size: 12px; color: var(--muted); font-weight: 500; padding: 0; margin-bottom: 6px; }
.civ-opts { display: flex; gap: 18px; min-height: 34px; align-items: center; }

/* ---------- Fiche client en pleine page (app.js : renderDrawer) ----------
   Recouvre la zone principale (le menu reste visible sur grand écran), texte agrandi pour la lecture. */
.fiche { position: fixed; top: 0; right: 0; bottom: 0; left: 220px; z-index: 30; background: var(--bg); overflow-y: auto; font-size: 15.5px; padding-bottom: env(safe-area-inset-bottom, 0px); }
body.fiche-open { overflow: hidden; }
.fiche .f { font-size: 13.5px; }
.fiche input, .fiche select, .fiche textarea { font-size: 15px; }
.f-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 32px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.f-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.f-top .st { display: flex; gap: 8px; align-items: center; }
.f-top .st select { width: auto; }
.f-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.f-title h2 { font-size: 28px; font-weight: 700; line-height: 1.15; }
.f-head .contact { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 15px; }
.f-head .contact span { user-select: all; }
.f-head .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.f-head .numero { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.f-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.f-body { padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 18px; }
.f-cols { display: grid; grid-template-columns: minmax(0, 11fr) minmax(460px, 10fr); gap: 18px; align-items: start; }
.f-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.f-main .branches { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (max-width: 1260px) { .f-cols { grid-template-columns: minmax(0, 1fr); } .f-main .branches { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } }
#d-immo table.cols { min-width: 0; }
#d-immo table.cols th:nth-child(4), #d-immo table.cols td:nth-child(4) { width: 44px; }
#d-immo table.cols th:nth-child(2), #d-immo table.cols td:nth-child(2) { width: 112px; white-space: nowrap; }
#d-immo table.cols th:nth-child(3), #d-immo table.cols td:nth-child(3) { width: 96px; white-space: nowrap; }
#d-immo table.cols td:nth-child(1) { overflow-wrap: normal; }
/* Identité et famille : panneaux rattachés à l'en-tête, juste sous la barre collante (eux-mêmes non collants) */
.f-headpanels { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 32px 14px; display: flex; flex-direction: column; gap: 8px; }
.f-headpanels .f-panel { background: var(--sunk); box-shadow: none; }
.f-sub .f-sub { border-top: 0; padding-top: 4px; }
.f-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.f-panel > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.f-panel > summary::-webkit-details-marker { display: none; }
.f-panel > summary h3 { font-size: 17px; }
.f-panel > summary h3::before { content: '▸'; display: inline-block; width: 18px; color: var(--muted); transition: transform .15s; }
.f-panel[open] > summary h3::before { transform: rotate(90deg); }
.f-panel > :not(summary) { margin: 0 18px 16px; }
.f-panel form#f-coord { display: flex; flex-direction: column; gap: 12px; }
.blk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.f-head, .f-panel, .blk { box-shadow: none; }
.blk.conc { background: var(--sunk); }
.blk > h3 { font-size: 19px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.blk > h3 small, .f-sub h4 small, .branche h4 small { font-family: var(--f-body); font-weight: 500; color: var(--muted); font-size: 13.5px; }
.blk > h3 .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--accent); color: var(--accent-ink, #fff); font-size: 14px; font-weight: 700; flex: none; }
.f-sub { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.blk > h3 + .f-sub { border-top: 0; padding-top: 0; }
.f-side .blk > h3 { font-size: 17px; }
.f-side .f-panel > summary { padding: 18px 20px; }
.f-side .f-panel > :not(summary) { margin: 0 20px 18px; }
.f-side .f-panel > summary h3 { font-size: 17px; }
.f-panel > .hint { display: block; }
.f-side #f-lien { flex-wrap: wrap; align-items: end; }
.f-side #f-lien > .f { flex: 1 1 100% !important; }
/* Bloc « Historique, notes et relances » dans la colonne droite, plus étroite : grilles à colonnes adaptatives, listes compactes */
.f-side .b-suivi .fgrid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.f-side .b-suivi .fgrid .wide { grid-column: 1 / -1; }
.f-side .b-suivi .hist li { grid-template-columns: minmax(0, 1fr) auto; }
.f-side .b-suivi .hist .d { grid-column: 1 / -1; }
.f-side .b-suivi .rdvi { grid-template-columns: minmax(0, 1fr) auto; }
.f-side .b-suivi .rdvi .when { grid-column: 1 / -1; }
.f-side .b-suivi .mail summary { grid-template-columns: auto minmax(0, 1fr); }
.f-side .b-suivi .mail .obj, .f-side .b-suivi .mail .res { grid-column: 1 / -1; }
.f-side .b-suivi .mail .body { margin-left: 0; }
.f-side .b-suivi #f-hist > label.f { flex: 1 1 130px !important; }
.f-side .b-suivi #f-hist > label.f:last-of-type { flex-basis: 100% !important; }
.f-sub h4, .branche h4 { font-size: 15.5px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.branche { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--sunk); border-top: 3px solid var(--line); }
.blk.conc .branche { background: var(--surface); }
.branche.b-iard { border-top-color: #4F7CAC; }
.branche.b-prev { border-top-color: #8A6FB0; }
.branche.b-epargne { border-top-color: #3E8E6E; }
/* Fiche : rubriques de contrats empilées, un contrat par ligne (portefeuille et concurrence) */
.fiche #d-nous, .fiche #d-conc { container-type: inline-size; }
.fiche .f-main .branches { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 440px) {
  .fiche :is(#d-nous, #d-conc) .contract:has(> .l1) { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(46%); column-gap: 16px; row-gap: 3px; align-items: center; }
  .fiche :is(#d-nous, #d-conc) .contract:has(> .l1) > .l1 { grid-column: 1; grid-row: 1; justify-content: flex-start; gap: 2px 16px; }
  .fiche :is(#d-nous, #d-conc) .contract:has(> .l1) > .l2 { grid-column: 1; grid-row: 2; }
  .fiche :is(#d-nous, #d-conc) .contract:has(> .l1) > .l3 { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; }
}
.projets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 16px; }
.livgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.livgrid > .f:last-child { grid-column: 1 / -1; }
@media (max-width: 1260px) { .livgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .livgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { #d-immo table.cols { min-width: 440px; } }
form.livrets { display: flex; flex-direction: column; gap: 10px; }
.req { color: var(--danger); }
span.req { display: inline; border: 0; border-radius: 0; padding: 0; background: none; margin-left: 2px; }
/* Cible Particulier / Professionnel : champs de l'autre cible masqués */
.fiche.is-part .only-pro, .fiche.is-pro .only-part, .fiche.is-pro .only-part-panel { display: none; }
/* Pro : la sous-partie « Logement » étant masquée, « Immobilier » devient la première et n'a pas de trait sous le titre */
.fiche.is-pro .blk > h3 + .f-sub.only-part + .f-sub { border-top: 0; padding-top: 0; }
.seg-badge { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 13px; cursor: pointer; background: var(--sunk); color: var(--ink); }
.seg-badge.part { background: #E3EEF9; color: #1E3A66; border-color: #B8CCE4; }
.seg-badge.pro { background: #F3E9D7; color: #6A4A12; border-color: #DEC9A2; }
.minor-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #FBE3E8; color: #8A1F35; border: 1px solid #E9B4C0; }
.minor-pill.sm, .ged-pill.sm { font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.ged-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; border: 1px solid transparent; cursor: pointer; vertical-align: middle; margin-left: 6px; }
.ged-pill.orange { background: #FDEBD2; color: #7A4300; border-color: #F2C88E; }
.ged-pill.red { background: #FBDADA; color: #8E1B1B; border-color: #EBA9A9; }
.f-title .ged-pill { font-size: 13px; margin-left: 0; }
.lien { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lien .role { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .seg-badge.part { background: #1F3350; color: #CFE0F5; border-color: #35507A; }
  :root:not([data-theme="light"]) .seg-badge.pro { background: #3F3220; color: #F1DDB8; border-color: #6A5434; }
  :root:not([data-theme="light"]) .minor-pill { background: #4A1F2A; color: #F6C9D3; border-color: #7A3446; }
  :root:not([data-theme="light"]) .ged-pill.orange { background: #47331A; color: #F7D3A1; border-color: #7A5A2C; }
  :root:not([data-theme="light"]) .ged-pill.red { background: #4C2020; color: #F5C2C2; border-color: #7D3333; }
}
@media (max-width: 1100px) { .branches { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .fiche { left: 0; font-size: 15px; }
  .f-head { padding: 12px 16px 14px; position: static; }
  .f-actions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .f-actions > * { flex: none; }
  .f-body { padding: 14px 16px 40px; }
  .f-headpanels { padding: 0 16px 12px; }
  .f-title h2 { font-size: 23px; }
}

/* Vague 3 : modules front (début) */
/* Alertes automatiques et workflow (preferences.js) */
.pref-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pref-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.pref-row.pref-locked { color: var(--muted); }
.pref-journal { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 12.5px; }
.pref-wf input[type=number] { width: 88px; }
.pref-wf select { width: auto; }
.pref-dlg-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
.pref-ack { display: flex; align-items: flex-start; gap: 8px; }
.pref-ack input { width: auto; margin-top: 3px; }
/* Démarchage commercial (demarchage.js) */
.dem-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.dem-pill.restreint { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.dem-pill.bloque { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.dem-pill.sm { font-size: 11px; margin-left: 6px; }
.chip.dem-off { color: var(--danger); border-color: var(--danger); }
.dem-grey { color: var(--muted); }
#f-dem { display: flex; flex-direction: column; gap: 8px; }
#f-dem > label { display: flex; flex-direction: column; gap: 4px; }
#f-dem > label:has(> input[type=checkbox]) { flex-direction: row; align-items: center; gap: 8px; }
#f-dem input[type=checkbox] { width: auto; }
/* Bandeau de délai de grâce (paybar.js) */
.paybar { background: var(--warn-soft); color: var(--ink); }
.paybar.urgent { background: var(--danger-soft); color: var(--ink); }
.paybar .btn { margin-left: 8px; }
/* Centre de sécurité du compte (securite.js) */
#sec-securite > h4 { font-size: 14px; margin: 0; color: var(--strong); }
#sec-securite > ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
#sec-securite > p { color: var(--muted); font-size: 13px; }
/* Confidentialité et données (confidentialite.js, confidentialite-actions.js) */
#sec-confidentialite table th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--ink); }
#sec-confidentialite > label:not(:has(> input[type=checkbox])) { display: flex; flex-direction: column; gap: 4px; }
#sec-confidentialite input[type=checkbox] { width: auto; }
#sec-confidentialite progress { width: 100%; height: 8px; border: 0; border-radius: 4px; accent-color: var(--accent); }
#sec-confidentialite progress::-webkit-progress-bar { background: var(--sunk); border-radius: 4px; }
#sec-confidentialite progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
#sec-confidentialite progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
/* Droits de la personne, RGPD (droits.js) */
.droits-personne { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.droits-personne > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.droits-personne > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.droits-personne > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* Vague 3 : modules front (fin) */
/* Formulaire client en ligne (espace-client.js : renderForm) */
.client-form .client-sec { font-size: 17px; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.client-form .client-sub { font-size: 14px; margin: 4px 0 0; color: var(--ink); }
.client-gate .fgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.client-form .frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) auto; gap: 10px; align-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--sunk); }
.client-form .btn.sm { align-self: flex-start; }
.client-projets { display: grid; gap: 6px; }
.client-legal { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.55; }
.client-legal p { margin: 6px 0 0; color: var(--ink); }
.client-form .f-missing input, .client-form .f-missing select { border-color: var(--danger); }
@media (max-width: 560px) { .client-gate .fgrid2 { grid-template-columns: minmax(0, 1fr); } }
.client-gate .gate-card:has(.client-form) { width: min(720px, 100%); }
/* DER à signer (espace-client.js : renderDer) */
.client-gate .gate-card:has(.der-doc) { width: min(760px, 100%); }
.der-doc { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--sunk); font-size: 14px; line-height: 1.55; }
.der-doc p { margin: 0 0 8px; color: var(--ink); }
.der-h { font-size: 15px; margin: 12px 0 6px; }
/* Demande de documents (espace-client.js : renderDocuments) */
.doc-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--sunk); }
.doc-item .doc-l { display: flex; flex-direction: column; gap: 2px; }
/* Indicateur de la file d'écriture (index.html #save-state, fileecriture.js : filRender) */
.save-state { display: block; font-size: 12px; padding: 2px 0; }
.save-state[data-tone="ok"] { color: var(--ok, #2e7d32); }
.save-state[data-tone="warn"] { color: var(--accent); }
.save-state[data-tone="bad"] { color: var(--danger); font-weight: 600; }
/* Indicateur cliquable pendant un conflit (fenêtre « Fiche modifiée en même temps ») */
.save-state[role="button"] { cursor: pointer; text-decoration: underline; }
.save-state[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Bandeau du verrou de fiche (en tête de fiche, reste visible au défilement) */
.lock-banner { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--line); padding: 10px 16px; font-size: 13px; }
.lock-banner[data-kind="free"] { background: var(--ok-soft); }
.lock-banner button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px; font: inherit; cursor: pointer; }
.lock-banner button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Demandes de devis : lignes cliquables, bloc « Demande reçue » de la fiche (app.js : demandeBloc) */
table tr.clic { cursor: pointer; }
table tr.clic:hover { background: var(--sunk); }
.dem-card { margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunk); }
.dem-card h3 { margin: 0 8px 6px 0; display: inline-block; font-size: 14px; }
.dem-card dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.dem-card dt { color: var(--muted); font-size: 12.5px; }
.dem-card dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 700px) { .dem-card dl { grid-template-columns: 1fr; } }
/* Inscription par étapes (insérée avant le bloc « appel », que appelFront.test.js garde en fin de fichier) */
.su-progress { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(max-content, 1fr)); gap: 6px; margin: 0 0 14px; padding: 0; }
.su-progress li { font-size: 12px; padding-top: 8px; border-top: 4px solid var(--line); color: var(--muted); }
.su-progress li.is-done, .su-progress li.is-on { border-top-color: var(--accent); color: var(--strong); }
.su-progress.is-3 { grid-template-columns: repeat(3, minmax(max-content, 1fr)); }
.su-step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.su-step[hidden] { display: none; }
.su-step > legend { font: 600 20px/1.2 var(--f-display); padding: 0; margin-bottom: 10px; }
.su-nav, [data-su-prev], [data-su-next] { min-height: 44px; }
.appel-btn { margin-left: 8px; padding: 4px 10px; min-height: 44px; display: inline-flex; align-items: center; }
.appel-dialog { max-width: 520px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 20px; }
.appel-dialog label { display: block; margin-top: 12px; font-weight: 500; }
.appel-dialog select, .appel-dialog textarea { width: 100%; box-sizing: border-box; }
.appel-alerte { margin: 12px 0 0; color: var(--danger); }
.appel-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.lnm { display: inline-flex; align-items: center; font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.lnm:hover { color: var(--accent); }
.liste-contacts tbody tr:focus-within td { background: var(--sunk); }
@media (max-width: 760px) {
  .liste-contacts .lnm, .liste-contacts .sortbtn { min-height: 44px; }
  .liste-contacts td { padding: 8px 10px; }
}
.liste-contacts .pchk { width: 40px; text-align: center; }
.liste-contacts .pchk input { width: 20px; height: 20px; }
.pbulk { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; padding: 10px 14px; margin: 0 0 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); }
.pbulk[hidden] { display: none; }
@media (max-width: 640px) { .pbulk .btn { min-height: 44px; } .liste-contacts .pchk { width: 44px; } }

/* Tableau de bord TB-04 (début) */
.row .who .lnm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .lnm:focus-visible, .row .btn:focus-visible, .row .linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row.more { cursor: default; grid-template-columns: minmax(0, 1fr); }
.row.more:hover { background: transparent; }
.row .btn { touch-action: manipulation; }
@media (hover: none) { .row:hover { background: transparent; } }
@media (max-width: 760px) {
  .row { padding: 12px 14px; }
  .row .who { white-space: normal; overflow: visible; }
  .row .who .lnm { white-space: normal; text-align: left; min-height: 44px; }
  .row .end { flex-wrap: wrap; justify-content: flex-end; }
  .row .btn.sm, .row .linkbtn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .row.more .linkbtn { justify-content: flex-start; }
  .lcb-alert .inline { width: 100%; }
  .lcb-alert .inline .btn { flex: 1 1 140px; min-height: 44px; }
  .lcb-alert li { flex-direction: column; }
}
/* Tableau de bord TB-04 (fin) */

/* Tableau de bord TB-15 (début) */
.tb-jour-liste { list-style: none; margin: 0; padding: 0; }
.tb-jour-liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .tb-jour-liste .linkbtn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
}
/* Tableau de bord TB-15 (fin) */

/* Demandes de devis DV-22 (début) */
table.dq-table { min-width: 900px; }
@media (max-width: 640px) {
  table.dq-table { min-width: 0; }
  table.dq-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.dq-table, table.dq-table tbody, table.dq-table tr { display: block; }
  table.dq-table tr { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 8px 10px; }
  table.dq-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  table.dq-table td::before { content: attr(data-l); font-weight: 600; color: var(--muted); text-align: left; }
  table.dq-table td { flex-wrap: wrap; }
  table.dq-table td.c-ed { justify-content: flex-end; }
  table.dq-table .c-cat, table.dq-table .c-tiers { width: auto; }
  .toolbar input#dq-q { flex: 1 1 100%; }
}
@media (max-width: 640px), (pointer: coarse) {
  table.dq-table .btn.sm, table.dq-table .linkbtn, table.dq-table select { min-height: 44px; min-width: 44px; }
  #dq-q { width: 100%; }
  .toolbar [data-dq-mes] { min-height: 44px; }
}
table.dq-table select:focus-visible, table.dq-table .linkbtn:focus-visible, #dq-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Demandes de devis DV-22 (fin) */
/* Commissions : cartes sur petit écran, cibles tactiles de 44 px */
@media (max-width: 640px) {
  table.lettrage thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.lettrage, table.lettrage tbody, table.lettrage tr { display: block; }
  table.lettrage tr { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 8px 10px; }
  table.lettrage tr.grp { border: 0; padding: 4px 0; font-weight: 600; }
  table.lettrage td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  table.lettrage td::before { content: attr(data-l); font-weight: 600; color: var(--muted); text-align: left; }
  table.lettrage td.hide-sm { display: flex; }
}
@media (max-width: 640px), (pointer: coarse) {
  table.lettrage input[type="checkbox"] { width: 24px; height: 24px; }
  table.lettrage td:first-child, table.lettrage .btn.sm, table.lettrage .lpay input, table.lettrage .lpay button, table.lettrage .ltdate, table.bxres input[type="checkbox"] { min-height: 44px; min-width: 44px; }
}
