/* =============================================================================
   PERFORMANCE (views/performance.js) et barres / cascade (js/graphe-barres.js)
   Nouvelle identité : accent #0071E3 (variable locale), pas de jaune ; une alerte est toujours rouge (--danger).
   Thème sombre par défaut (:root), clair sous :root[data-theme="light"].
   ============================================================================= */
.pf-page, .pf-tete, .pf-trois, .pf-tuiles, .pf-grille, .pf-bloc, .pf-sugg, .pf-alerte, .pf-pied, .pf-vide, .pf-duo,
.pn-fond, .gb { --accent: #2f8cf0; --accent-soft: rgba(47, 140, 240, .14); }
:root[data-theme="light"] :is(.pf-tete, .pf-trois, .pf-tuiles, .pf-grille, .pf-bloc, .pf-sugg, .pf-alerte, .pf-pied, .pf-vide, .pf-duo, .pn-fond, .gb) {
  --accent: #0071e3; --accent-soft: rgba(0, 113, 227, .10); }

/* ---------- en-tête : phrase de réponse, choix du mois ---------- */
.pf-tete { margin-bottom: 18px; align-items: flex-end; }
.pf-tete > div:first-child { min-width: 0; flex: 1 1 420px; }
.pf-tete p { max-width: 760px; }
.pf-choix { display: inline-flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.pf-choix-l { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pf-choix .input { height: 42px; min-width: 210px; border-radius: 12px; padding: 0 40px 0 16px; font-weight: 600; }

/* ---------- les trois questions ---------- */
.pf-trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pf-q { min-width: 0; padding: 18px 20px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--panel-line); box-shadow: var(--sh-card); }
.pf-q-t { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.pf-q p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.pf-q.faire { background: var(--card); border-color: var(--line); box-shadow: inset 3px 0 0 var(--ink); }   /* « Que faire ? » : filet d'encre, pas de bleu */
.pf-q.faire .pf-q-t { color: var(--ink); }

/* ---------- tuiles de chiffres ---------- */
.pf-tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.pf-tuiles.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-tuile { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--card);
  border: 1px solid var(--panel-line); box-shadow: var(--sh-card); }
.pf-tk { display: flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.pf-tv { display: flex; align-items: baseline; font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; white-space: nowrap; }
.pf-tv small { font-size: 16px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.pf-tv .nv { align-self: center; }
.pf-tuile.negatif .pf-tv { color: var(--danger); }
.pf-tuile.prevu { background: var(--card-2); }
.pf-tuile.alerte { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.pf-ts { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.pf-taux { color: var(--ink-2); font-weight: 600; }
.pf-tl { display: inline-flex; align-items: center; gap: 2px; margin-top: auto; align-self: flex-start; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.pf-tl svg.i { width: 14px; height: 14px; }
.pf-ecart { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: var(--pill); background: var(--card-2); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.pf-ecart small { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.pf-ecart.hausse { color: var(--green); }
.pf-ecart.baisse { color: var(--danger); }

/* dépendance : trois jauges */
.pf-dep { display: flex; flex-direction: column; gap: 7px; }
.pf-dep > div { display: grid; grid-template-columns: 82px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.pf-dep-b { height: 8px; border-radius: var(--pill); background: var(--card-2); overflow: hidden; }
.pf-dep-b i { display: block; height: 100%; border-radius: inherit; background: var(--ink-2); }
.pf-tuile.alerte .pf-dep > div:first-child .pf-dep-b i { background: var(--danger); }
.pf-dep b { text-align: right; color: var(--ink); font-size: 13px; }

/* ---------- les quatre graphiques ---------- */
.pf-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pf-gr { display: flex; flex-direction: column; min-width: 0; padding: 20px 22px 16px; }
.pf-gr-tete h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.pf-reponse { margin: 6px 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
.pf-reponse.alerte { color: var(--danger); font-weight: 600; }
.pf-gr-zone { min-width: 0; min-height: 230px; flex: 1; }
.pf-gr-pied { display: flex; justify-content: flex-end; margin-top: 8px; }
.pf-gr-pied a { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 6px 4px; }
.pf-gr-pied svg.i { width: 14px; height: 14px; }
.pf-gr-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.pf-gr-note > .nv:first-child { margin: 0 8px 0 0; }
.pf-unite { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pf-gr-note a { margin-left: 6px; color: var(--accent); font-weight: 700; }
.pf-pied { display: flex; flex-direction: column; gap: 6px; margin: 18px 4px 0; }
.pf-pied p { margin: 0; }

/* ---------- blocs ---------- */
.pf-bloc { margin-top: 14px; }
.pf-bloc .card-head h2 { display: flex; align-items: center; gap: 0; }
.pf-bloc .pf-reponse { margin-top: 0; }
.pf-h3 { margin: 18px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.pf-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pf-duo > .pf-bloc { margin-top: 14px; }

.pf-alerte { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 14px 18px; border-radius: var(--r-md); background: var(--danger-soft);
  color: var(--ink); font-size: 13.5px; line-height: 1.5; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.pf-alerte > svg.i { color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.pf-alerte b { color: var(--danger); }

.pf-sugg { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 16px 14px 18px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-card); }
.pf-sugg-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--on-black); }
.pf-sugg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-sugg-t b { font-size: 14px; }
.pf-sugg-t small { font-size: 12.5px; color: var(--ink-2); }

/* ---------- tableaux (ordinateur) et cartes (téléphone) ---------- */
.pf-table-box { min-width: 0; }
.pf-table-box.defile { overflow-x: auto; scrollbar-width: thin; margin: 0 -8px; padding: 0 8px; }
.pf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pf-table th, .pf-table td { padding: 11px 9px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pf-table thead th { font-size: 12px; font-weight: 700; color: var(--ink-3); padding-top: 4px; vertical-align: bottom; }
.pf-table thead th small { display: block; font-size: 10.5px; font-weight: 600; }
.pf-table .num { text-align: right; }
.pf-table tbody th { font-weight: 600; }
.pf-table .faint { color: var(--ink-3); }
.pf-table .fort { font-weight: 700; }
.pf-table .negatif { color: var(--danger); }
.pf-table .lent { color: var(--danger); font-weight: 700; }
.pf-clients-t tbody tr { cursor: pointer; transition: background .15s; }
.pf-clients-t tbody tr:hover, .pf-clients-t tbody tr:focus-visible { background: var(--card-2); outline: none; }
.pf-clients-t tbody tr:focus-visible th { box-shadow: inset 2px 0 0 var(--accent); }
.pf-clients-t tbody th { white-space: normal; min-width: 150px; }
.pf-part { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.pf-part i { position: relative; width: 64px; height: 6px; border-radius: var(--pill); background: var(--card-2); overflow: hidden; }
.pf-part i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: var(--ink-2); }
.pf-part b { font-size: 12.5px; }
.pf-part.large { display: block; min-width: 0; }
.pf-part.large i { display: block; width: 100%; }

/* compte de résultat */
.pf-cr { font-size: 13px; }
.pf-cr th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 160px; padding-left: 4px; }
.pf-cr tbody th { display: table-cell; }
.pf-cr tbody th .nv { margin-left: 6px; }
.pf-cr td { padding: 0; }
.pf-cr td.cumul, .pf-cr td.n1 { padding: 11px 8px; }
.pf-cr th.cumul, .pf-cr td.cumul { background: color-mix(in srgb, var(--accent) 6%, transparent); font-weight: 700; }
.pf-cr th.n1, .pf-cr td.n1 { color: var(--ink-3); }
.pf-cel { width: 100%; padding: 11px 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: right; cursor: pointer; white-space: nowrap; }
.pf-cel:hover { background: var(--card-2); }
.pf-cel:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pf-cr tr.sous-total th, .pf-cr tr.sous-total td { font-weight: 700; border-top: 1px solid var(--line-2); }
.pf-cr tr.total th, .pf-cr tr.total td { font-weight: 800; border-bottom: 0; }
.pf-cr tr.total th { font-family: var(--display); font-size: 15px; }
.pf-cr tr.fort td { font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.pf-cartes { display: none; }
.pf-carte { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pf-carte:active { transform: scale(.99); }
.pf-carte-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pf-carte-h b { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.pf-carte-m { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-family: var(--display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-carte-m small { font-family: var(--text); font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.pf-carte-m.negatif { color: var(--danger); }
.pf-carte-d { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-3); }
.pf-carte-d b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-carte-d .lent b, .pf-carte-d .negatif b { color: var(--danger); }
.pf-encours { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }

/* déjà assuré */
.pf-as-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pf-as { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card-2); }
.pf-as-n { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.pf-as b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.pf-as small { font-size: 12px; color: var(--ink-3); }
.pf-as-c { height: 6px; border-radius: var(--pill); background: var(--card-3); overflow: hidden; }
.pf-as-c i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.pf-as-l { list-style: none; margin: 14px 0 0; padding: 0; }
.pf-as-l li + li { border-top: 1px solid var(--line); }
.pf-as-l a { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 6px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.pf-as-l a:hover { background: var(--card-2); }
.pf-as-t, .pf-as-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-as-t { font-size: 13.5px; font-weight: 600; }
.pf-as-t small, .pf-as-m small { font-size: 12px; font-weight: 500; color: var(--ink-3); overflow-wrap: anywhere; }
.pf-as-m { align-items: flex-end; text-align: right; flex-shrink: 0; }
.pf-as-m b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* prévisionnel et point mort */
.pf-prevu { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.pf-prevu > div:not(.op) { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px; border-radius: var(--r-md); background: var(--card-2); }
.pf-prevu span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.pf-prevu b { display: flex; align-items: baseline; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.pf-prevu b .nv { align-self: center; }
.pf-prevu small { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.pf-prevu .op { align-self: center; font: 600 18px var(--display); color: var(--ink-3); }
.pf-prevu .tot { background: var(--card-3) !important; }
.pf-prevu .tot.negatif b { color: var(--danger); }
.pf-hyp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pf-hyp li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.pf-hyp li .nv { margin: 0; flex-shrink: 0; position: relative; top: -1px; }
.pf-pm { margin: 6px 0 14px; }
.pf-pm-b { position: relative; height: 14px; border-radius: var(--pill); background: var(--card-2); }
.pf-pm-b i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--green); }
.pf-pm-m { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -3px; border-radius: 2px; background: var(--ink); }
.pf-pm-l { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.pf-pm-l b { color: var(--ink); }
.pf-pm-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pf-pm-chiffres > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--r-md); background: var(--card-2); }
.pf-pm-chiffres span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.pf-pm-chiffres b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- page vide accueillante ---------- */
.pf-vide { padding: 8px; }
.pf-vide-in { max-width: 560px; margin: 0 auto; padding: 42px 24px 38px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pf-vide-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); color: var(--ink); margin-bottom: 18px; }
.pf-vide-ico svg.i { width: 28px; height: 28px; }
.pf-vide h2 { margin: 0 0 8px; font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.pf-vide p { margin: 0 0 22px; color: var(--ink-2); line-height: 1.55; }
.pf-vide-act { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.pf-vide-l { list-style: none; margin: 0; padding: 18px 20px; border-radius: var(--r-md); background: var(--card-2); text-align: left; display: flex; flex-direction: column; gap: 10px;
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.pf-vide-l b { color: var(--ink); }

/* ---------- panneau de détail ---------- */
.pn-montant.negatif b { color: var(--danger); }
.pn-montant b { display: flex; align-items: baseline; }
.pn-montant b .nv { align-self: center; }
.pn-dl dd .nv { margin-left: 6px; }
.pf-pn-l { list-style: none; margin: 4px 0 0; padding: 0; }
.pf-pn-l li + li { border-top: 1px solid var(--line); }
.pf-pn-l a, .pf-pn-l li > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 6px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.pf-pn-l a:hover { background: var(--card-2); }
.pf-pn-l span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pf-pn-l small { font-size: 12px; color: var(--ink-3); }
.pf-pn-l b { flex-shrink: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-pn-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.pf-mini { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; height: 92px; padding: 10px 10px 6px; border-radius: 16px; background: var(--card-2); }
.pf-mini span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.pf-mini i { display: block; width: 100%; max-width: 18px; border-radius: 4px 4px 2px 2px; background: var(--green); }
.pf-mini small { font-size: 9.5px; color: var(--ink-3); }
.pf-sg-l { list-style: none; margin: 12px 0 0; padding: 0; }
.pf-sg-l li + li { border-top: 1px solid var(--line); }
.pf-sg { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; cursor: pointer; }
.pf-sg input { width: 18px; height: 18px; accent-color: var(--accent); }
.pf-sg-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-sg-t b { font-size: 13.5px; overflow-wrap: anywhere; }
.pf-sg-t small { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.pf-sg-t em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); }

/* =============================================================================
   graphe-barres.js : colonnes, lignes et cascade (le cadre, la bulle et le plein écran viennent de graphe.css)
   ============================================================================= */
.gb .gb-outils.sans-modes { justify-content: flex-end; }
.gb .gb-modes[hidden] { display: none; }
.gb-svg { cursor: default; }
.gb-case { fill: transparent; cursor: pointer; transition: fill .15s; }
.gb-case.on { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.gb-barre { pointer-events: none; transition: opacity .15s; }
.gb-barre.s-plein { fill: var(--green); }
.gb-barre.total { fill: var(--ink); }
.gb-barre.s-fantome { fill: var(--gr-neutre); opacity: .45; }
.gb-barre.s-pointille { fill: color-mix(in srgb, var(--ink) 6%, transparent); stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 3 3; }
.gb-barre.negatif, .gb-barre.total.negatif { fill: var(--danger); }
.gb-barre.sous-total { fill: var(--gr-neutre); }
.gb-barre.baisse { fill: var(--danger); }
.gb-barre.hausse { fill: var(--green); }
.gb-rail { fill: var(--card-2); pointer-events: none; }
.gb-lien { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.gb-axe { fill: var(--ink-3); font: 600 11.5px var(--text); pointer-events: none; }
.gb-val { fill: var(--ink-2); font: 700 11px var(--text); font-variant-numeric: tabular-nums; pointer-events: none; }
.gb-val.negatif { fill: var(--danger); }
.gb-lib { fill: var(--ink); font: 600 13px var(--text); pointer-events: none; }
.gb-val-l { fill: var(--ink); font: 700 13px var(--text); font-variant-numeric: tabular-nums; pointer-events: none; }
.gb-val-l.negatif { fill: var(--danger); }
.gb.gb-horizontal .gb-svg { overflow: visible; }
.gb-cle { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; box-sizing: border-box; }
.gb-cle.s-plein { background: var(--green); }
.gb-cle.s-fantome { background: var(--gr-neutre); opacity: .55; }
.gb-cle.s-pointille { border: 1.5px dashed var(--ink-2); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.gb .gr-b-l { grid-template-columns: 14px minmax(0, 1fr) auto; }
.gb-b-v { font: 700 20px var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gb-b-v.negatif { color: var(--danger); }
.gb-b-n { margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.gb-b-e { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 2px 0; color: var(--ink-2); }
.gb-b-e b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gb-b-e.fort { margin-top: 3px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.gb-b-ec { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-weight: 700; font-size: 12px; }
.gb-b-ec.hausse { color: var(--green); }
.gb-b-ec.baisse { color: var(--danger); }
.gb .gr-legende:empty { display: none; }
.gb.plein .gb-zone { overflow-y: auto; }

/* ---------- écrans moyens et téléphone ---------- */
@media (max-width: 1180px) {
  .pf-grille, .pf-duo { grid-template-columns: minmax(0, 1fr); }
  .pf-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .pf-tete { margin-bottom: 14px; }
  .pf-choix { width: 100%; margin-top: 4px; }
  .pf-choix .input { width: 100%; min-width: 0; }
  .pf-trois { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pf-q { padding: 14px 16px; border-radius: var(--r-md); }
  .pf-q p { font-size: 14px; }
  .pf-tuiles, .pf-tuiles.trois { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .pf-tuiles.trois .pf-tuile:first-child { grid-column: 1 / -1; }
  .pf-tuile { padding: 14px 14px; border-radius: var(--r-md); gap: 6px; }
  .pf-tv { font-size: 22px; }
  .pf-tv small { font-size: 13px; }
  .pf-ecart { white-space: normal; }
  .pf-unite { display: none; }
  .pf-gr { padding: 16px 14px 12px; border-radius: var(--r-md); }
  .pf-gr-tete h2 { font-size: 17px; }
  .pf-reponse { font-size: 13.5px; margin-bottom: 12px; }
  .pf-table-box:not(.defile), .pf-table-box.defile { display: none; }
  .pf-cartes { display: flex; flex-direction: column; gap: 8px; }
  .pf-bloc .card-body { padding: 10px 14px 16px; }
  .pf-bloc .card-head { padding: 16px 16px 4px; }
  .pf-bloc .card-head h2 { font-size: 17px; }
  .pf-as-grille { grid-template-columns: minmax(0, 1fr); }
  .pf-as { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 10px; }
  .pf-as-c { flex-basis: 100%; order: 3; }
  .pf-as small { order: 4; }
  .pf-prevu { grid-template-columns: minmax(0, 1fr); }
  .pf-prevu .op { display: none; }
  .pf-pm-chiffres { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pf-pm-chiffres > div:last-child { grid-column: 1 / -1; }
  .pf-sugg { flex-wrap: wrap; }
  .pf-sugg .btn { width: 100%; }
  .pf-vide-in { padding: 30px 8px 24px; }
}
.pf-tv small { margin-left: 4px; }
.pf-carte .pf-part i { background: var(--card-3); }

/* =============================================================================
   TEMPS 2 « PERSONNALISER » : objectifs de l'année (en avance / en retard) et seuils des quatre indicateurs du profil
   ============================================================================= */
.pf-ob { --accent: #2f8cf0; --accent-soft: rgba(47, 140, 240, .14); }
:root[data-theme="light"] .pf-ob { --accent: #0071e3; --accent-soft: rgba(0, 113, 227, .10); }
.pf-ob { padding: 18px 22px 18px; margin-bottom: 12px; }
.pf-ob-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-ob-tete h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.pf-ob-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--pill); font-size: 12px; font-weight: 700; }
.pf-ob-pill.avance { background: var(--card-3); color: var(--ink); }
.pf-ob-pill.retard { background: var(--danger-soft); color: var(--danger); }
.pf-ob-pill.conforme { background: var(--card-3); color: var(--ink); }
.pf-ob-aj { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding: 6px 4px; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.pf-ob-aj svg.i { width: 14px; height: 14px; }
.pf-ob .pf-reponse { margin: 8px 0 14px; }
.pf-ob-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pf-ob-j { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card-2); }
.pf-ob-l { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.pf-ob-j > b { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.pf-ob-j > b .nv { align-self: center; }
.pf-ob-j > b small { font-family: var(--text); font-size: 12.5px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
.pf-ob-b { position: relative; height: 8px; border-radius: var(--pill); background: var(--card-3); margin: 3px 0 1px; }
.pf-ob-b i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--green); }
.pf-ob-b em { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.pf-ob-e, .pf-ob-t { font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.45; }
.pf-ob-t { font-weight: 500; }
.pf-ob-j.avance .pf-ob-e { color: var(--green); }
.pf-ob-j.retard .pf-ob-e, .pf-ob-j.retard .pf-ob-t { color: var(--danger); }
.pf-ob-q { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.pf-ob-q > div { min-width: 0; padding: 0 2px; }
.pf-ob-q > div > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.pf-ob-q .faire > span { color: var(--ink); }
.pf-ob-q p { margin: 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.pf-ob-court { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 18px; }
.pf-ob-court p { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.pf-ob-court p b { color: var(--ink); }
.pf-ob-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--on-black); }
.pf-ob-court .btn { flex-shrink: 0; }
.pf-seuil { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--pill); background: var(--card-2); font-size: 11.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.pf-t-alerte { flex-basis: 100%; font-size: 12.5px; font-weight: 700; color: var(--danger); }
.pf-tuile.alerte .pf-tv { color: var(--danger); }
.pf-tuile.alerte .pf-seuil { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 820px) {
  .pf-ob { padding: 16px 14px 14px; border-radius: var(--r-md); }
  .pf-ob-tete h2 { font-size: 17px; }
  .pf-ob-grille { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pf-ob-q { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pf-ob-court { flex-wrap: wrap; padding: 14px; }
  .pf-ob-court p { flex-basis: calc(100% - 48px); }
  .pf-ob-court .btn { width: 100%; }
}

/* ---------- carte thermique « Qui me paie en retard, et quand ? » (Clients) ----------
   Encre pâle = à l'heure ; rouge de plus en plus franc avec le retard (une alerte est toujours rouge) ; jamais de bleu.
   Le nombre de jours est écrit dans la case. Téléphone : la colonne des clients reste fixe, les mois défilent. */
.pf-th-box { overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.pf-th { width: 100%; border-collapse: separate; border-spacing: 4px 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pf-th tbody th { width: 1%; }
.pf-th thead th { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center; padding: 0 0 2px; vertical-align: bottom; white-space: nowrap; }
.pf-th thead th small { display: block; font-size: 9.5px; font-weight: 600; }
.pf-th thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: -4px 0 0 var(--card), 4px 0 0 var(--card); }
.pf-th tbody th { position: sticky; left: 0; z-index: 1; background: var(--card); padding: 0 8px 0 0; text-align: left;
  box-shadow: -4px 0 0 var(--card), 4px 0 0 var(--card); }   /* couvre l'espacement : rien ne dépasse sous les noms */
.pf-th-n { all: unset; box-sizing: border-box; display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; padding: 6px 0; border-radius: 6px; }
.pf-th-n:hover { color: var(--accent); }
.pf-th-n:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-th td { padding: 0; }
.pf-th-c { all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; width: 100%; min-width: 34px; height: 30px;
  border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.pf-th-c:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.pf-th-c:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-th-c.p-heure { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.pf-th-c.p-leger { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--ink); }
.pf-th-c.p-net { background: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--ink); }
.pf-th-c.p-fort { background: var(--danger); color: #fff; }
.pf-th-c.du::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 1.5px var(--card); }
.pf-th-c.p-fort.du::after { background: #fff; box-shadow: none; }
.pf-th-v { min-width: 34px; height: 30px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--line); opacity: .55; }
.pf-th-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.pf-th-leg span { display: inline-flex; align-items: center; gap: 6px; }
.pf-th-leg .pf-th-c { width: 14px; min-width: 14px; height: 14px; border-radius: 4px; cursor: default; }
.pf-th-leg .pf-th-c:hover { transform: none; box-shadow: none; }
.pf-th-leg .pf-th-c.du::after { top: 4px; right: 4px; width: 6px; height: 6px; }
@media (max-width: 820px) {
  .pf-th-n { max-width: 104px; font-size: 12.5px; }
  .pf-th-c, .pf-th-v { min-width: 36px; height: 30px; font-size: 11.5px; }
}
