/* ════════════════════════════════════════════════════════════════════════════
   Dashboard Patientèle V3 : coque et écrans communs.
   Couleurs et polices : uniquement les variables de brand/tokens.css (chargée avant ce fichier). Aucune valeur de couleur ici.

   RÈGLE DE COULEURS (valable pour app.css, prospects.css, acq.css, rdv.css)
   1. Bordeaux (--p-bdx) : la marque (logo) et l'action principale de l'écran, UN seul bouton plein par vue. Rien d'autre :
      ni lien, ni onglet actif, ni pastille, ni compteur, ni sélection, ni titre.
   2. Neutres (encre, gris, filets, aplats rosés) : tout le reste. Sélection, onglet ou filtre actif = encre pleine ; lien = encre soulignée.
   3. Couleurs d'état, chacune avec un sens unique, jamais décoratives :
        à faire / à surveiller  ambre   --p-amber   (« ○ »)
        envoyé / en attente     bleu    --p-info    (« → »)
        relance                 violet  --p-relance (« ↻ »)
        signé / réussi / en ligne  vert --p-ok      (« ✓ »)
        alerte, erreur, à faire maintenant  rouge --p-red  (« ! »)
        perdu / écarté          gris    --p-muted   (« × »)
      Contraste AA (texte de l'état sur son fond clair ≥ 4,5:1). La couleur ne porte jamais seule le sens : chaque pastille a son libellé
      et un signe devant (classe .pill), chaque alerte son titre, chaque variation son signe + ou −.
   4. Un état se déduit de sa couleur par color-mix (fond à 10-13 %), jamais par une nouvelle valeur.
   Mobile d'abord : sous 768 px, la nav devient une barre d'onglets en bas ; cibles tactiles de 44 px ; aucun débordement horizontal.
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  --d-hover: color-mix(in srgb, var(--p-tint) 45%, var(--p-bg));
  --d-line: color-mix(in srgb, var(--p-line) 55%, var(--p-card));
  --d-ok-bg: color-mix(in srgb, var(--p-ok) 12%, var(--p-card));
  --d-amber-bg: color-mix(in srgb, var(--p-amber) 13%, var(--p-card));
  --d-red-bg: color-mix(in srgb, var(--p-red) 10%, var(--p-card));
  --d-hl-bg: color-mix(in srgb, var(--p-hl) 35%, var(--p-card));
  --d-info-bg: color-mix(in srgb, var(--p-info) 11%, var(--p-card));
  --d-relance-bg: color-mix(in srgb, var(--p-relance) 11%, var(--p-card));
  --d-perdu-bg: color-mix(in srgb, var(--p-muted) 14%, var(--p-card));
  --d-r: 12px;
  --d-r-s: 8px;
  --d-side: 232px;
  --d-tab: 64px;
}

/* ─── Polices de la charte, servies par le dashboard (assets/fonts/, sous-ensemble latin, licence OFL) ─────────
   La politique de sécurité n'autorise que font-src 'self' : aucune police externe. L'empreinte (&v=…) est ajoutée au moment de servir. */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url("?a=plus-jakarta-sans-latin-400-normal.woff2&v=221a4135d06a4b33") format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url("?a=plus-jakarta-sans-latin-500-normal.woff2&v=bad081c8dbc15aed") format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url("?a=plus-jakarta-sans-latin-600-normal.woff2&v=8872bb5c9111df9b") format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url("?a=plus-jakarta-sans-latin-700-normal.woff2&v=2050755bf475817c") format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url("?a=ibm-plex-mono-latin-400-normal.woff2&v=08949f728dc52d52") format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url("?a=ibm-plex-mono-latin-500-normal.woff2&v=01d285447409c8a5") format('woff2'); }

/* ─── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.ptd { margin: 0; background: var(--p-bg); color: var(--p-ink); font: 14px/1.5 var(--p-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.ptd h1, .ptd h2, .ptd h3, .ptd p, .ptd ul, .ptd figure { margin: 0; }
.ptd a { color: var(--p-ink); text-decoration-color: var(--p-line2); text-underline-offset: 3px; }
.ptd a:focus-visible, .ptd button:focus-visible, .ptd summary:focus-visible, .ptd select:focus-visible, .ptd input:focus-visible, .ptd textarea:focus-visible {
  outline: 2px solid var(--p-ink); outline-offset: 2px; }
.ptd img, .ptd svg { max-width: 100%; }
.ic { flex: 0 0 auto; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--p-card); padding: 8px 12px; border-radius: var(--d-r-s); }
.skip:focus { left: 8px; }
input[type=radio], input[type=checkbox] { accent-color: var(--p-ink); }
html.js .js-hide { display: none !important; }
.js-only { display: none !important; }
html.js .js-only { display: inline-flex !important; }
.muted { color: var(--p-muted); font-size: 13px; }
.num, .mono { font-family: var(--p-mono); font-variant-numeric: tabular-nums; }
code { font: 12.5px var(--p-mono); background: var(--p-card); border: 1px solid var(--d-line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ─── Coque : nav verticale + colonne principale ──────────────────────────── */
.app { display: grid; grid-template-columns: var(--d-side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px 14px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--p-line); }
.logo, .top-logo { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; text-decoration: none; color: var(--p-ink) !important; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.logo-mark rect { fill: var(--p-bdx); }
.logo-mark path { stroke: var(--p-bg); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: var(--d-r-s); text-decoration: none; color: var(--p-ink) !important; font-weight: 500; }
.nav-i:hover { background: var(--d-hover); }
.nav-i.on { background: var(--p-tint); color: var(--p-ink) !important; font-weight: 700; }
.nav-sub { display: flex; align-items: center; min-height: 32px; padding: 6px 10px 6px 36px; border-radius: var(--d-r-s); text-decoration: none; color: var(--p-muted) !important; font-weight: 500; }
.nav-sub:hover { background: var(--d-hover); }
.nav-sub.on { color: var(--p-ink) !important; font-weight: 700; }
.badge { margin-left: auto; font: 500 11px/1.5 var(--p-mono); background: var(--d-amber-bg); color: var(--p-amber); border-radius: 999px; padding: 0 7px; font-style: normal; }  /* compteur = « à faire » : ambre */
.side-foot { margin-top: auto; padding-top: 40px; display: flex; flex-direction: column; gap: 2px; }
.side-foot .nav-i .ic:last-child { margin-left: auto; color: var(--p-muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--p-line2); flex: 0 0 auto; }
.nav-i > .dot { margin: 0 4px; }
.dot.ok { background: var(--p-ok); }
.dot.warn { background: var(--p-amber); }
.dot.bad { background: var(--p-red); }
.me { border-top: 1px solid var(--p-line); margin-top: 8px; position: relative; }
.me summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px; cursor: pointer; border-radius: var(--d-r-s); }
.me summary::-webkit-details-marker { display: none; }
.me summary:hover { background: var(--d-hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--p-tint); color: var(--p-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.me-t { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.me-t b { font-size: 13px; }
.me-s { font-size: 12px; color: var(--p-muted); display: flex; align-items: center; gap: 5px; }
.me-s .dot { width: 7px; height: 7px; }
.me-menu { position: absolute; bottom: 100%; left: 0; right: 0; background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--d-r); padding: 6px; display: flex; flex-direction: column; box-shadow: 0 8px 24px color-mix(in srgb, var(--p-ink) 12%, transparent); z-index: 20; }
.me-menu a, .me-menu button { display: flex; align-items: center; min-height: 36px; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--p-ink); font: inherit; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.me-menu a:hover, .me-menu button:hover { background: var(--d-hover); }
.me-menu form { margin: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 28px 0; }
.top-logo, .top-search { display: none; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 520px; height: 40px; padding: 0 12px; background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--d-r-s); color: var(--p-muted); }
.search:focus-within { border-color: var(--p-ink); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--p-ink); height: 100%; outline: none; }
.search input::placeholder { color: var(--p-muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search.big { max-width: none; flex: none; height: 48px; font-size: 16px; }
.search.big input { font-size: 16px; }
kbd { font: 11px var(--p-mono); border: 1px solid var(--p-line); border-radius: 4px; padding: 1px 6px; color: var(--p-muted); white-space: nowrap; }
.period { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-sel { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--p-line); border-radius: var(--d-r-s); background: var(--p-card); }
.period-sel:hover { border-color: var(--p-ink); }
.period select { border: 0; background: none; font: 600 13px var(--p-sans); color: var(--p-ink); cursor: pointer; height: 100%; }
.period-cmp { font-size: 12.5px; color: var(--p-muted); }
.content { padding: 20px 32px 56px; display: flex; flex-direction: column; gap: 24px; min-width: 0; outline: none; }
.chips { display: none; }
.tabbar { display: none; }

/* ─── Titres, cartes, sections ────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ptd h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lead { margin-top: 4px !important; color: var(--p-muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--d-r); padding: 18px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ptd h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-h .sub, .sub { font-size: 13px; color: var(--p-muted); margin-top: 2px; }
.kicker { font: 500 11px/1.4 var(--p-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--p-muted); }
.sec-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid2.eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.foot-note { font-size: 12px; color: var(--p-muted); }
.item { display: block; text-decoration: none; color: inherit !important; }
.item:hover { border-color: var(--p-ink); }
.item h2 { margin-bottom: 2px; }
a.card.item .sub { color: var(--p-muted); }

.ptd details.more:not(.me) { border: 0; background: none; padding: 0; border-radius: 0; }
.ptd details.more:not(.me)[open] { padding-bottom: 0; }
.ptd details.more:not(.me) > summary { min-height: 36px; font-size: 13px; font-weight: 600; color: var(--p-muted); }
.ptd details.more:not(.me) > summary:hover { color: var(--p-ink); }
.ptd details > summary { list-style: none; }
.ptd details > summary::-webkit-details-marker { display: none; }
.ptd details:not(.me) > summary::before { content: "+"; font: 500 13px var(--p-mono); width: 14px; flex: 0 0 auto; }
.ptd details[open]:not(.me) > summary::before { content: "−"; }
.ptd details.more:not(.me) > .more-b { margin-top: 6px; }
.ptd details.card:not(.me) { padding: 4px 20px; }
.ptd details.card[open]:not(.me) { padding-bottom: 18px; }
.sum-n { font: 500 12px var(--p-mono); color: var(--p-muted); margin-left: 4px; }

/* ─── Boutons, champs ─────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--d-r-s); font: 600 13px/1.2 var(--p-sans); cursor: pointer; white-space: nowrap; text-decoration: none; background: var(--p-bdx); color: var(--p-bg) !important; border: 1px solid var(--p-bdx); }
.btn:hover { background: var(--p-bdx2); border-color: var(--p-bdx2); }
.btn.sec { background: var(--p-card); color: var(--p-ink) !important; border-color: var(--p-line); }
.btn.sec:hover { border-color: var(--p-ink); background: var(--p-card); }
.btn.ghost { background: transparent; color: var(--p-muted) !important; border-color: transparent; }
.btn.ghost:hover { color: var(--p-ink) !important; background: var(--d-hover); }
.btn.ok { background: var(--p-ok); border-color: var(--p-ok); } /* confirmer un résultat positif (signature, relu) : vert, jamais en plus du bouton bordeaux */
.btn.sm { min-height: 32px; padding: 0 12px; }
.btn.icon { width: 36px; min-height: 36px; padding: 0; } /* bouton secondaire réduit à son icône : toujours un title et un aria-label */
.btn.icon.sm { width: 32px; min-height: 32px; }
.btn.link { background: none; border: 0; color: var(--p-ink) !important; min-height: 0; padding: 2px 4px; text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.done { background: var(--p-ok); border-color: var(--p-ok); color: var(--p-bg) !important; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row form { display: contents; }
.actions { display: grid; gap: 10px; margin-top: 12px; }
.actions .btn { width: 100%; min-height: 44px; }
.ptd label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.ptd label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0; }
.ptd input[type=text], .ptd input[type=email], .ptd textarea, .ptd select.field {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--p-line); border-radius: var(--d-r-s); background: var(--p-card); color: var(--p-ink); }
.ptd textarea { min-height: 120px; resize: vertical; }
.lien { user-select: all; -webkit-user-select: all; font-family: var(--p-mono) !important; font-size: 14px !important; }
.copy-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.copy-row input { flex: 1 1 260px; }
.ptd details:not(.me) { border: 1px solid var(--p-line); border-radius: var(--d-r); background: var(--p-card); padding: 2px 16px; }
.ptd details:not(.me)[open] { padding-bottom: 16px; }
.ptd details:not(.me) > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--p-ink); }

/* ─── Messages, pastilles, états vides ────────────────────────────────────── */
.alert { border-radius: var(--d-r); padding: 12px 16px; font-size: 13.5px; border: 1px solid var(--p-line); background: var(--p-card); }
.alert.ok { background: var(--d-ok-bg); border-color: transparent; color: var(--p-ok); }
.alert.warn { background: var(--d-amber-bg); border-color: transparent; color: var(--p-amber); }
.alert.bad { background: var(--d-red-bg); border-color: transparent; color: var(--p-red); }
.alert b { margin-right: 2px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 10px; white-space: nowrap; background: var(--d-hover); color: var(--p-text); }
.pill.ok { background: var(--d-ok-bg); color: var(--p-ok); }
.pill.warn { background: var(--d-amber-bg); color: var(--p-amber); }
.pill.bad { background: var(--d-red-bg); color: var(--p-red); }
.pill.info { background: var(--d-info-bg); color: var(--p-info); }
.pill.relance { background: var(--d-relance-bg); color: var(--p-relance); }
.pill.perdu { background: var(--d-perdu-bg); color: var(--p-muted); }
/* le signe devant le libellé : l'état ne dépend jamais de la seule couleur */
.pill.ok::before { content: "✓ "; }
.pill.warn::before { content: "○ "; }
.pill.bad::before { content: "! "; }
.pill.info::before { content: "→ "; }
.pill.relance::before { content: "↻ "; }
.pill.perdu::before { content: "× "; }
.pill.salim { background: var(--p-tint); color: var(--p-ink); }
.pill.jeanne { background: var(--d-hl-bg); color: var(--p-ink); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-new { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--d-amber-bg); color: var(--p-amber); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }
.empty { padding: 18px 4px; color: var(--p-text); }
.empty .muted { margin-top: 4px; }
.card .empty { padding: 4px 0; }

/* ─── Aujourd'hui : tuiles, agenda, alertes, chiffres, constat ────────────── */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--d-r); text-decoration: none; min-width: 0; background: var(--p-card); color: var(--p-ink) !important; border: 1px solid var(--p-line); }
.tile:hover { background: var(--d-hover); }
.tile.main { border: 2px solid var(--p-ink); padding: 15px 17px; }
.tile.zero { color: var(--p-muted) !important; }
.tile-n { display: flex; align-items: center; justify-content: space-between; font: 500 26px/1 var(--p-mono); letter-spacing: -.02em; }
.tile-n .ic { opacity: .8; }
.tile b { font-size: 14px; font-weight: 600; }
.tile .tile-s { font-size: 12.5px; color: var(--p-muted); line-height: 1.35; overflow-wrap: anywhere; }
.agenda .ag { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--d-line); }
.agenda .ag:last-child { border-bottom: 0; }
.ag-t { font: 500 14px var(--p-mono); }
.ag-w { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ag-w span { font-size: 12.5px; color: var(--p-muted); }
.ag-x { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ag-slot { grid-column: 2 / -1; min-width: 0; }
.watch { display: flex; flex-direction: column; gap: 12px; }
.watch li { display: flex; gap: 10px; list-style: none; }
.watch .dot { margin-top: 7px; }
.watch span span { font-size: 12.5px; color: var(--p-muted); }
.ptd ul.watch, .ptd ul.rows, .ptd ul.results { padding: 0; list-style: none; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; border-right: 1px solid var(--d-line); }
.kpi:last-child { border-right: 0; }
.kpi-l { font-size: 12.5px; color: var(--p-muted); font-weight: 500; }
.kpi-v { font: 500 24px/1.1 var(--p-mono); letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi-d { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi-d span:not(.delta) { font-size: 12px; color: var(--p-muted); }
.delta { font: 500 12px var(--p-mono); }
.delta.up { color: var(--p-ok); }
.delta.down { color: var(--p-red); }
.delta.muted { color: var(--p-muted); }
.loss { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.loss-n { font: 500 26px var(--p-mono); color: var(--p-red); }
.loss p { max-width: 620px; }

/* ─── Acquisition : filtres, entonnoir, tableaux ──────────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--p-line); background: var(--p-card); color: var(--p-ink); font: 600 12.5px var(--p-sans); cursor: pointer; max-width: 100%; }
.filters select:hover { border-color: var(--p-ink); }
.funnel .f { display: grid; grid-template-columns: 170px minmax(0, 1fr) 90px 60px; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--d-line); }
.funnel .f:last-child { border-bottom: 0; }
.f-l { font-weight: 600; overflow-wrap: anywhere; }
.f-c, .f-r { font: 500 15px var(--p-mono); text-align: right; }
.f-r { font-size: 12.5px; color: var(--p-muted); }
.bar { height: 22px; border-radius: 6px; background: var(--p-tint); min-width: 2px; }
.bar.bad { background: var(--p-red); }
.bar.end { background: var(--p-ok); }
.f-note { font-size: 12px; color: var(--p-muted); margin-top: 3px; }
.f-note.bad { color: var(--p-red); }
.table-wrap { border: 1px solid var(--d-line); border-radius: 10px; overflow-x: auto; background: var(--p-card); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th { font: 500 11px var(--p-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--p-muted); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--d-line); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--d-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--d-hover); }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table tr.best { background: var(--d-ok-bg); }
.table td b { display: block; }
.table td:first-child { min-width: 180px; }
.table td small { font-size: 12px; color: var(--p-muted); }
.ab-vars { display: flex; gap: 12px; flex-wrap: wrap; }
.ab-v { flex: 1 1 120px; padding: 12px; border-radius: 10px; background: var(--p-bg); }
.ab-v .kpi-v { font-size: 22px; }

/* ─── Clients ─────────────────────────────────────────────────────────────── */
.sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--d-r); }
.sum > div { padding: 14px 20px; border-right: 1px solid var(--d-line); min-width: 0; }
.sum > div:last-child { border-right: 0; }
.sum .n { font: 500 26px var(--p-mono); }
.sum .n.ok { color: var(--p-ok); }
.sum .n.warn { color: var(--p-amber); }
.sum .l { font-size: 12.5px; color: var(--p-muted); }
.cl { display: grid; grid-template-columns: minmax(180px, 1.2fr) 170px 150px minmax(160px, 1.3fr) auto; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--d-line); }
.cl:last-child { border-bottom: 0; }
.cl.head { padding: 10px 20px; font: 500 11px var(--p-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--p-muted); }
.cl-who { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.cl-who span, .cl-st div { font-size: 12.5px; color: var(--p-muted); }
.cl-x { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cl-x form { margin: 0; }
.cl-err { grid-column: 1 / -1; }
.steps { display: flex; flex-direction: column; gap: 6px; }
.segs { display: flex; gap: 4px; }
.seg { flex: 1; height: 6px; border-radius: 999px; background: var(--p-tint); }
.seg.on { background: var(--p-ink); }
.steps span { font-size: 12px; color: var(--p-muted); }

/* ─── Réglages : interrupteurs, journal ───────────────────────────────────── */
.rule { background: var(--d-amber-bg); color: var(--p-amber); border-radius: var(--d-r); padding: 12px 18px; font-size: 13.5px; }
.sw { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--d-line); text-decoration: none; color: inherit !important; }
.sw:last-child { border-bottom: 0; }
a.sw:hover { background: var(--d-hover); }
.sw-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sw-t span, .sw-c { font-size: 13px; color: var(--p-muted); }
.sw-c b { color: var(--p-ink); }
.toggle { width: 44px; height: 26px; border-radius: 999px; background: var(--p-line); display: inline-flex; align-items: center; padding: 3px; justify-content: flex-start; flex: 0 0 auto; }
.toggle::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--p-card); }
.toggle.on { background: var(--p-ok); justify-content: flex-end; }
.confirm { border-color: var(--p-ink); max-width: 720px; }
.confirm .muted, .confirm .alert { margin-top: 14px; }
.confirm dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 12px 0 0; }
.confirm dt { color: var(--p-muted); }
.confirm dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rows li { padding: 10px 0; border-bottom: 1px solid var(--d-line); overflow-wrap: anywhere; }
.rows li:last-child { border-bottom: 0; }
.rows .t, .t { font-size: 12px; color: var(--p-muted); }
.results li a { display: flex; flex-direction: column; padding: 12px 4px; border-bottom: 1px solid var(--d-line); text-decoration: none; color: var(--p-ink); min-height: 44px; }
.results li a:hover { background: var(--d-hover); }
.results .result { display: flex; flex-direction: column; padding: 12px 4px; border-bottom: 1px solid var(--d-line); }
.results li span { font-size: 12.5px; color: var(--p-muted); }
.plus-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 4px; border-bottom: 1px solid var(--d-line); text-decoration: none; color: var(--p-ink); font-weight: 600; }
.plus-list a:last-child { border-bottom: 0; }

/* ─── À relire, journal, fiches d'appel (écrans V2) ───────────────────────── */
.txt { background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--d-r); padding: 14px 16px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.txt h3 { font: 500 11px var(--p-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--p-muted); margin-bottom: 6px; }
mark { padding: 0 2px; border-radius: 4px; color: inherit; }
mark.bad { background: var(--d-red-bg); box-shadow: inset 0 -2px 0 var(--p-red); }
mark.warn { background: var(--d-amber-bg); box-shadow: inset 0 -2px 0 var(--p-amber); }
.find { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.find li { padding: 8px 0; border-top: 1px solid var(--d-line); }
.find .rep { color: var(--p-text); }
.corriger { margin-top: 8px; }
.back { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; text-decoration: none; }

/* ─── Connexion ───────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px; gap: 8px; }
.login .card { width: 100%; max-width: 400px; padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; }
.login h1 { font-size: 24px; }
.login .btn { width: 100%; min-height: 44px; margin-top: 8px; }
.login .lead { text-align: left; }

/* ─── Tablette ────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { border-bottom: 1px solid var(--d-line); }
  .grid2, .grid2.eq { grid-template-columns: minmax(0, 1fr); }
  .cl { grid-template-columns: minmax(160px, 1fr) 150px minmax(0, 1fr); }
  .cl.head { display: none; }
  .cl-x { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ─── Mobile (< 768 px) : barre d'onglets en bas, cibles de 44 px ─────────── */
@media (max-width: 767.98px) {
  .app { display: block; }
  .side { display: none; }
  .top { padding: 12px 16px 0; gap: 10px; flex-wrap: nowrap; }
  .top-logo { display: flex; padding: 0; margin-right: auto; font-size: 15px; min-height: 44px; }
  .search { display: none; }
  .search.big { display: flex; }
  .top-search { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--p-line); border-radius: 10px; background: var(--p-card); color: var(--p-muted); }
  .period { margin-left: 0; }
  .period-cmp { display: none; }
  .period-sel { height: 44px; }
  .content { padding: 14px 16px calc(var(--d-tab) + 28px + env(safe-area-inset-bottom)); gap: 14px; }
  .ptd h1 { font-size: 22px; }
  .chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--p-line); background: var(--p-card); text-decoration: none; color: var(--p-text) !important; font-weight: 600; font-size: 13px; }
  .chip.on { background: var(--p-ink); border-color: var(--p-ink); color: var(--p-bg) !important; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--d-tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--p-card); border-top: 1px solid var(--p-line); }
  .tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; font-size: 11px; font-weight: 600; color: var(--p-muted); text-decoration: none; }
  .tabbar a.on { color: var(--p-ink); }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 44px; }
  .btn.link { min-height: 44px; }
  .filters select { height: 44px; }
  .card { padding: 14px 16px; }
  .ptd details.card:not(.me) { padding: 2px 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile-n { font-size: 24px; }
  .tile-n .ic { display: none; }
  .tile .tile-s { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; }
  .kpi-v { font-size: 22px; }
  .kpi-d span:not(.delta) { display: none; }
  .hide-m, .table .hide-m { display: none; }
  .btn.icon { width: 44px; min-height: 44px; }
  .agenda .ag { grid-template-columns: 52px minmax(0, 1fr); }
  .ag-x { grid-column: 2; justify-content: flex-start; }
  .funnel .f { grid-template-columns: minmax(0, 1fr) 64px 48px; gap: 8px; }
  .funnel .f > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .sum .n { font-size: 22px; }
  .sum > div { padding: 12px 14px; }
  .cl { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
  .cl-x .btn { flex: 1 1 140px; }
  .sw { grid-template-columns: minmax(0, 1fr) auto; }
  .sw-c { grid-column: 1; grid-row: 2; }
  .sw .toggle { grid-row: 1 / span 2; grid-column: 2; }
  .me-menu a, .me-menu button, .nav-i, .nav-sub { min-height: 44px; }
  .results li a { padding: 12px 0; }
}
