:root {
  /* Identité YD Partners : bleu nuit du monogramme (dégradé #2b3a92 → #16113f) et gris anthracite. */
  --fond: #f5f6fa; --surface: #ffffff; --encre: #1a1d2b; --encre-2: #4a4e5c; --encre-3: #7a7f90;
  --ligne: #e2e4ec; --ligne-2: #eef0f6; --accent: #24307f; --accent-2: #eceefa; --accent-3: #3a4ab0;
  --marque-haut: #2b3a92; --marque-bas: #16113f;
  --rouge: #b42318; --rouge-2: #fdecea; --ambre: #9a6700; --ambre-2: #fff4d6; --vert: #1a7f4b; --vert-2: #e6f5ec;
  --rayon: 10px; --ombre: 0 1px 2px rgba(22, 17, 63, .06), 0 4px 16px rgba(22, 17, 63, .05);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--encre); background: var(--fond);
  font-size: 15px; line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
code { background: var(--ligne-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--ligne); }
.marque { color: var(--encre); font-weight: 600; font-size: 17px; white-space: nowrap; }
.marque { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .01em; }
.marque svg { width: 30px; height: 30px; }
.marque span { color: var(--encre-3); font-weight: 500; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.dossiers { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.chip { padding: 5px 12px; border: 1px solid var(--ligne); border-radius: 999px; color: var(--encre-2); font-weight: 600; font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.barre-droite { display: flex; align-items: center; gap: 12px; }
.periode label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--encre-3); }
select, input[type=search], textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--ligne);
  border-radius: 8px; padding: 6px 10px; }
select:focus, input:focus, textarea:focus, .btn:focus-visible, tr:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 1px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { background: var(--vert-2); color: var(--vert); }
.pill.off { background: var(--rouge-2); color: var(--rouge); }

.cadre { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 56px); align-content: start; }
@media (min-width: 901px) { .cadre { align-content: stretch; } }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--ligne); background: var(--surface); }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--encre-2); font-weight: 500; }
.nav a:hover { background: var(--ligne-2); }
.nav a[aria-current=page] { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.nav-bas { margin-top: auto; border-top: 1px solid var(--ligne); padding-top: 10px; }
.nav-bas a { font-size: 13px; color: var(--encre-3); }
main { padding: 26px 32px 60px; max-width: 1360px; width: 100%; min-width: 0; }

.titre-page { margin-bottom: 18px; }
.titre-page h1 { font-size: 26px; font-weight: 650; }
.titre-page p, .discret { color: var(--encre-3); margin: 4px 0 0; font-size: 13.5px; }
.bandeau { padding: 10px 14px; border-radius: var(--rayon); margin-bottom: 18px; font-size: 14px; }
.bandeau.ok { background: var(--vert-2); color: #14532d; }
.bandeau.alerte, .alerte .btn { background: var(--ambre-2); color: #6b4700; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpis > div { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); }
.kpis small { display: block; color: var(--encre-3); font-size: 12.5px; }
.kpis b { display: block; font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpis.petits b { font-size: 15px; }
progress.jauge { width: 100%; height: 6px; margin-top: 10px; border: 0; border-radius: 99px; background: var(--ligne-2); overflow: hidden; appearance: none; }
progress.jauge::-webkit-progress-bar { background: var(--ligne-2); }
progress.jauge::-webkit-progress-value { background: var(--accent-3); border-radius: 99px; }
progress.jauge::-moz-progress-bar { background: var(--accent-3); }

.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.deux-colonnes > *, .controle, .tuile { min-width: 0; }
.soldes a > span { min-width: 0; overflow-wrap: anywhere; }
.deux-colonnes.large-gauche { grid-template-columns: 1.4fr 1fr; }
.panneau { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); }
.panneau h2 { font-size: 16px; margin-bottom: 12px; }
.discret-panneau { color: var(--encre-3); }
.tache { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 10px; margin: 0 -10px;
  border-radius: 8px; color: var(--encre); }
.tache:hover { background: var(--ligne-2); }
.tache > b { display: grid; place-items: center; height: 36px; border-radius: 8px; background: var(--accent-2); color: var(--accent); font-size: 16px; }
.tache strong { display: block; font-size: 14.5px; }
.tache small { color: var(--encre-3); font-size: 12.5px; }
.tache i { color: var(--encre-3); font-style: normal; }
.cycles { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cycle { display: grid; grid-template-columns: 44px 1fr; column-gap: 10px; padding: 7px 8px; border-radius: 8px; }
.cycle span { grid-row: span 2; display: grid; place-items: center; font-size: 12px; font-weight: 700; border-radius: 6px; background: var(--ligne-2); color: var(--encre-3); }
.cycle b { font-size: 14px; font-weight: 600; }
.cycle small { color: var(--encre-3); font-size: 12.5px; }
.cycle.en_cours span { background: var(--ambre-2); color: var(--ambre); }
.cycle.fait span { background: var(--vert-2); color: var(--vert); }
.cycle.non b { color: var(--encre-3); font-weight: 500; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; margin-top: 12px; border: 1px solid var(--ligne);
  border-radius: 8px; background: var(--surface); color: var(--encre); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:hover { border-color: var(--encre-3); }
.btn.primaire { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--encre-2); margin-top: 0; }
form.inline { display: inline; }

.onglets { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--ligne); margin-bottom: 10px; }
.onglet { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--encre-2); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglet b { min-width: 24px; padding: 1px 7px; border-radius: 99px; background: var(--ligne-2); font-size: 12px; text-align: center; }
.onglet.on { color: var(--accent); border-color: var(--accent); }
.onglet.on b { background: var(--accent); color: #fff; }
.onglet.zero { color: var(--encre-3); font-weight: 500; }
.aide { color: var(--encre-2); font-size: 13.5px; margin: 6px 0 12px; }
.outils { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.outils input { width: min(420px, 100%); }

.table-cadre { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: auto; box-shadow: var(--ombre); }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; background: #fafbfd; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; color: var(--encre-3); padding: 9px 14px; border-bottom: 1px solid var(--ligne); }
td { padding: 10px 14px; border-bottom: 1px solid var(--ligne-2); vertical-align: top; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.liste tbody tr[data-ouvrir], .liste tbody tr[data-href] { cursor: pointer; }
.liste tbody tr:hover, .liste tbody tr.on { background: #f4f5fb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.date { white-space: nowrap; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.neg { color: var(--encre); }
.pos { color: var(--vert); }
.lib { display: block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; color: var(--encre-2); }
td small { display: block; margin-top: 2px; font-weight: 600; font-size: 13px; color: var(--encre); }
.tiers { display: block; font-weight: 600; font-size: 13.5px; }
.tiers small { display: block; font-weight: 400; color: var(--encre-3); font-size: 12px; margin: 0; }
.tiers.suggere { color: var(--ambre); }
.tiers.sans { color: var(--encre-2); font-weight: 500; }
.vide-ligne { text-align: center; color: var(--encre-3); padding: 28px; }
.etiquette { padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.etiquette.rouge { background: var(--rouge-2); color: var(--rouge); }
.etiquette.vert { background: var(--vert-2); color: var(--vert); }
.etiquette.ambre { background: var(--ambre-2); color: var(--ambre); }
td small .etiquette { display: inline-block; margin-left: 6px; font-weight: 600; font-size: 11px; }
.niveau { margin: 12px 0 0; font-size: 13.5px; color: var(--encre-2); }
.code { color: var(--encre-3); font-size: 12px; font-weight: 600; }
table.compact td, table.compact th { padding: 6px 8px; font-size: 13px; }

.tiroir { position: fixed; top: 0; right: 0; z-index: 40; width: min(520px, 100vw); height: 100vh; overflow-y: auto; padding: 22px 24px;
  background: var(--surface); border-left: 1px solid var(--ligne); box-shadow: -12px 0 40px rgba(16, 32, 28, .12); }
.tiroir header { display: flex; justify-content: space-between; gap: 12px; }
.tiroir header small { color: var(--encre-3); font-size: 12.5px; }
.tiroir h2 { font-size: 19px; margin-top: 4px; }
.tiroir h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--encre-3); margin: 20px 0 8px; }
.fermer { border: 0; background: var(--ligne-2); width: 32px; height: 32px; border-radius: 8px; font-size: 20px; cursor: pointer; color: var(--encre-2); }
.montant-grand { font-size: 28px; font-weight: 650; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.libelle-banque { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--encre-2); margin: 0 0 14px; }
.explication { background: var(--fond); border-radius: 8px; padding: 12px; margin: 0; }
.action-attendue { font-weight: 600; color: var(--accent); }
.candidats { margin: 0; padding-left: 18px; }
.candidats small { display: block; color: var(--encre-3); }
.decision { background: var(--accent-2); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; }
.decision.perimee { background: var(--ambre-2); color: var(--ambre); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { display: contents; }
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(16, 32, 28, .25); }

.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.carte { display: block; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; color: var(--encre); box-shadow: var(--ombre); }
.carte.cliquable:hover { border-color: var(--accent-3); }
.carte header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.carte h2 { font-size: 17px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 0; }
.mini dt { font-size: 12px; color: var(--encre-3); }
.mini dd { margin: 2px 0 0; font-size: 18px; font-weight: 650; }
.alerte-texte { color: var(--rouge); }

.groupe h3 { font-size: 14px; margin: 12px 0 6px; }
.groupe ul { list-style: none; margin: 0; padding: 0; }
.groupe li { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--ligne-2); font-size: 13.5px; }
.groupe li span:nth-child(2) { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--encre-2); }
textarea { width: 100%; font-size: 13.5px; line-height: 1.5; resize: vertical; }
.vide { max-width: 720px; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 26px; }
.vide h1, .vide h2 { margin-bottom: 8px; }

@media (max-width: 1200px) { .deux-colonnes.large-gauche { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .cadre { grid-template-columns: minmax(0, 1fr); }
  .nav { flex-direction: row; align-items: center; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ligne); padding: 8px; }
  .nav a { white-space: nowrap; }
  .nav-bas { margin: 0; border: 0; padding: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .deux-colonnes, .deux-colonnes.large-gauche { grid-template-columns: 1fr; }
  main { padding: 18px 16px 40px; }
  .barre { gap: 8px 10px; padding: 8px 12px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .barre-droite { flex-wrap: wrap; gap: 8px; }
  .dossiers { order: 3; flex-basis: 100%; }
  .barre { position: static; }
  .pill { display: none; }
  .marque span { display: none; }
}

.cycle-bloc { margin-top: 22px; }
.cycle-bloc h2 { font-size: 18px; margin-bottom: 10px; }
.point { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--ombre); }
.point header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.point .note { font-weight: 600; margin: 4px 0 8px; }
.precedent { font-size: 13px; color: var(--encre-2); background: var(--fond); border-radius: 8px; padding: 8px 10px; }
details.panneau summary { cursor: pointer; }

/* ---- Tableau de bord · intelligence comptable ---------------------------------------------- */
:root { --bleu: #1d4ed8; --bleu-2: #e8efff; --gris-n1: #c9cde0; }
.sur-titre { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-3); }
.titre-tableau { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.provenance { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.provenance small { color: var(--encre-3); font-size: 12px; }
.synthese { background: linear-gradient(120deg, var(--marque-haut) 0%, var(--marque-bas) 100%); color: #eef0fb; border-radius: 14px;
  padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 8px 28px rgba(22, 17, 63, .25); }
.synthese h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-bottom: 6px; }
.synthese p { margin: 0; font-size: 15.5px; line-height: 1.6; max-width: 980px; }
.synthese b { color: #fff; }
.compteurs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.synthese .etiquette { background: rgba(255, 255, 255, .14); color: #fff; }
.synthese .etiquette.rouge { background: #fde2df; color: var(--rouge); }
.synthese .etiquette.ambre { background: #ffefc2; color: #6b4700; }

.tuiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tuile { background: var(--surface); border: 1px solid var(--ligne); border-radius: 12px; padding: 14px 14px 12px;
  box-shadow: var(--ombre); display: flex; flex-direction: column; min-width: 0; }
.tuile header { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tuile header small { color: var(--encre-3); font-size: 12px; font-weight: 600; }
.tuile > b { font-size: 23px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.tuile p { margin: auto 0 0; font-size: 12px; color: var(--encre-3); }
.evol { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.evol.bon { background: var(--vert-2); color: var(--vert); }
.evol.mauvais { background: var(--rouge-2); color: var(--rouge); }
.evol.stable { background: var(--ligne-2); color: var(--encre-2); }
svg.spark { width: 100%; height: 30px; margin: 4px 0 6px; overflow: visible; }
svg.spark polyline { fill: none; stroke: var(--accent-3); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.spark circle { fill: var(--accent); }

.entete-graphe { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.entete-graphe h2 { margin: 0; }
.legende { display: flex; gap: 12px; font-size: 12px; color: var(--encre-2); }
.leg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.leg.n::before { background: var(--accent-3); }
.leg.n1::before { background: var(--gris-n1); }
.leg.ebe::before, .leg.treso::before { height: 3px; vertical-align: 3px; background: var(--ambre); width: 14px; }
.leg.treso::before { background: var(--accent); }
.leg.min::before { height: 0; border-top: 2px dashed var(--rouge); width: 14px; vertical-align: 3px; border-radius: 0; }
svg.graphe { width: 100%; height: auto; display: block; }
svg.graphe .grille { stroke: var(--ligne-2); stroke-width: 1; }
svg.graphe .grille.zero { stroke: var(--encre-3); }
svg.graphe .axe { fill: var(--encre-3); font-size: 11px; font-family: inherit; }
svg.graphe .b-n { fill: var(--accent-3); }
svg.graphe .b-n:hover { fill: var(--accent); }
svg.graphe .b-n1 { fill: var(--gris-n1); }
svg.graphe .l-ebe { fill: none; stroke: var(--ambre); stroke-width: 2.2; stroke-linejoin: round; }
svg.graphe .p-ebe { fill: var(--surface); stroke: var(--ambre); stroke-width: 2; }
svg.graphe .aire { fill: var(--accent-2); }
svg.graphe .l-treso { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
svg.graphe .l-min { fill: none; stroke: var(--rouge); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .7; }
svg.graphe .p-treso { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
details.donnees { margin-top: 10px; font-size: 13px; overflow-x: auto; }
details.donnees summary { color: var(--encre-3); cursor: pointer; }

.postes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.postes li { display: grid; grid-template-columns: minmax(120px, 1.1fr) 1.4fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.poste small, .valeur small { display: block; color: var(--encre-3); font-size: 11.5px; }
.valeur { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.valeur small.var.hausse { color: var(--rouge); }
.valeur small.var.baisse { color: var(--vert); }
.piste { display: grid; gap: 3px; }
.piste meter { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 99px; background: var(--ligne-2); }
.piste meter.m-n1 { height: 4px; }
meter::-webkit-meter-bar { background: var(--ligne-2); border: 0; border-radius: 99px; height: inherit; }
meter.m-n::-webkit-meter-optimum-value { background: var(--accent-3); border-radius: 99px; }
meter.m-n1::-webkit-meter-optimum-value { background: var(--gris-n1); border-radius: 99px; }
meter.m-n::-moz-meter-bar { background: var(--accent-3); border-radius: 99px; }
meter.m-n1::-moz-meter-bar { background: var(--gris-n1); border-radius: 99px; }

.soldes { list-style: none; margin: 0; padding: 0; }
.soldes a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; color: var(--encre); font-size: 14px; }
.soldes a:hover { background: var(--ligne-2); }
.soldes small { display: block; color: var(--encre-3); font-size: 12px; }
.soldes b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg-rouge { color: var(--rouge); }
.note-ambre { background: var(--ambre-2); color: #6b4700; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.deux-colonnes + .deux-colonnes, .deux-colonnes + .bloc-controles, .bloc-controles + .deux-colonnes { margin-top: 16px; }

.bloc-controles { margin-top: 16px; }
.controles { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.controle { background: var(--surface); border: 1px solid var(--ligne); border-left: 4px solid var(--ligne); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--ombre); display: flex; flex-direction: column; }
.controle.rouge { border-left-color: var(--rouge); }
.controle.ambre { border-left-color: #e0a100; }
.controle.bleu { border-left-color: var(--bleu); }
.controle.vert { border-left-color: var(--vert); }
.controle header { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.controle h3 { font-size: 14px; font-weight: 650; }
.controle .montant { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controle dl { margin: 10px 0 0; display: grid; gap: 6px; }
.controle dl div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; font-size: 13px; }
.controle dt { color: var(--encre-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; padding-top: 1px; }
.controle dd { margin: 0; color: var(--encre-2); }
.controle dd.calcul { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--encre); }
.controle footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.puce { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--accent-2); color: var(--accent); }
.puce:hover { background: var(--accent); color: #fff; }
.etiquette.bleu { background: var(--bleu-2); color: var(--bleu); }
table.sig td { padding: 7px 10px; font-size: 13.5px; }
table.sig tr.fort td { font-weight: 650; background: #f7f8fc; }
table.sig span[title] { border-bottom: 1px dotted var(--encre-3); cursor: help; }
.table-cadre.plat { box-shadow: none; }
.reserves { margin-top: 18px; padding: 14px 18px; border: 1px dashed var(--ligne); border-radius: 10px; color: var(--encre-2); font-size: 13px; }
.reserves h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-3); margin-bottom: 6px; }
.reserves ul { margin: 0; padding-left: 18px; }
.reserves li.reserve { color: #6b4700; }

@media (max-width: 1600px) { .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tuile > b { font-size: 19px; }
  .postes li { grid-template-columns: 1fr auto; }
  .postes .piste { grid-column: 1 / -1; grid-row: 2; }
  .controles { grid-template-columns: 1fr; }
  .controle dl div { grid-template-columns: 1fr; gap: 0; }
  .provenance { align-items: flex-start; }
}

/* ---- Doublons de factures ---- */
.paires { display: grid; gap: 12px; }
.paire { background: var(--surface); border: 1px solid var(--ligne); border-left: 4px solid var(--ligne); border-radius: 10px; padding: 14px 16px; box-shadow: var(--ombre); }
.paire.rouge { border-left-color: var(--rouge); } .paire.ambre { border-left-color: #e0a100; } .paire.vert { border-left-color: var(--vert); }
.paire header { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.paire h3 { font-size: 15px; } .paire .montant { font-variant-numeric: tabular-nums; font-size: 16px; }
.paire .motif { margin: 6px 0 10px; color: var(--encre-2); font-size: 13.5px; }
.cote-a-cote { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.facture { background: var(--fond); border-radius: 8px; padding: 10px 12px; display: grid; gap: 3px; font-size: 13.5px; min-width: 0; }
.facture small { color: var(--encre-3); font-size: 12px; }
.paire footer { margin-top: 10px; }
@media (max-width: 700px) { .cote-a-cote { grid-template-columns: 1fr; } }

/* ---- Justificatif GED ---- */
.piece { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.piece figure { margin: 0; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px; box-shadow: var(--ombre); }
.piece img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--ligne-2); min-height: 200px; }
.piece figcaption { display: flex; justify-content: space-between; margin-top: 8px; }
dl.meta { margin: 0; display: grid; gap: 8px; }
dl.meta div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 13.5px; }
dl.meta dt { color: var(--encre-3); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
a.etiquette:hover { filter: brightness(.95); text-decoration: underline; }
@media (max-width: 900px) { .piece { grid-template-columns: minmax(0, 1fr); } }

/* ---- Avancement de la saisie (portefeuille) ---- */
.avancement { margin: 12px 0 4px; }
.avancement small { display: block; color: var(--encre-2); font-size: 12.5px; margin-bottom: 6px; }
.avancement div { display: flex; flex-wrap: wrap; gap: 5px; }
.saisie { display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.saisie b { font-size: 11px; }
.saisie.vert { background: var(--vert-2); color: var(--vert); }
.saisie.ambre { background: var(--ambre-2); color: var(--ambre); }
.saisie.rouge { background: var(--rouge-2); color: var(--rouge); }
.saisie.gris { background: var(--ligne-2); color: var(--encre-3); }

/* ---- Assistant TVA ---- */
.marge-haut { margin-top: 16px; }
table.tva td, table.tva th { padding: 7px 9px; font-size: 13px; }
table.tva tr.fort td { background: #fff8e6; }
td.ecart-alerte { color: var(--rouge); font-weight: 700; }
td.ecart-ok { color: var(--vert); }
svg.graphe .b-n.alerte { fill: var(--rouge); }
table.tva td:first-child { white-space: nowrap; font-weight: 600; }

/* ---- Modifications ---- */
input[type=date] { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; padding: 5px 8px; margin-left: 6px; }
ul.lignes-ecriture { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--encre-2); }
ul.lignes-ecriture li { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; }
ul.lignes-ecriture span { font-family: ui-monospace, Consolas, monospace; color: var(--encre-3); }
ul.lignes-ecriture b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- Portefeuille : indicateurs ---- */
.mini.indicateurs { margin: 10px 0 6px; padding-top: 10px; border-top: 1px solid var(--ligne-2); }
.mini.indicateurs dd { font-size: 15px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rouge-texte { color: var(--rouge); }

/* ---- Exports ---- */
.exports { display: flex; gap: 4px; }
.exports .btn { margin: 0; padding: 4px 10px; border: 1px solid var(--ligne); font-size: 13px; }
@media print {
  .barre, .nav, .exports, details.donnees, .outils { display: none !important; }
  .cadre { display: block; } main { padding: 0; max-width: none; }
  .panneau, .controle, .tuile, .paire { break-inside: avoid; box-shadow: none; }
  .deux-colonnes, .deux-colonnes.large-gauche { grid-template-columns: 1.4fr 1fr !important; }
  .tuiles { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .controles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .synthese { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Clients : balance âgée ---- */
svg.pile { width: 100%; max-width: 260px; height: 14px; display: block; border-radius: 4px; background: var(--ligne-2); }
.pile .t0, .leg.t0::before { fill: #8fa3e8; background: #8fa3e8; }
.pile .t1, .leg.t1::before { fill: #3a4ab0; background: #3a4ab0; }
.pile .t2, .leg.t2::before { fill: #e0a100; background: #e0a100; }
.pile .t3, .leg.t3::before { fill: #d9622b; background: #d9622b; }
.pile .t4, .leg.t4::before { fill: #b42318; background: #b42318; }
.repartition { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.repartition div { background: var(--fond); border-radius: 8px; padding: 8px 10px; }
.repartition small { display: block; color: var(--encre-3); font-size: 12px; }
.repartition b { font-size: 17px; font-variant-numeric: tabular-nums; }
.repartition span { display: block; color: var(--encre-3); font-size: 12px; }
.note-ambre-texte { display: block; color: var(--ambre) !important; font-weight: 500 !important; }
@media (max-width: 700px) { .repartition { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Demande au client : points internes ---- */
.panneau.interne { margin-top: 16px; border-left: 4px solid var(--ambre); }
.points-internes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.points-internes li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13.5px; }
.points-internes small { grid-column: 2; color: var(--encre-3); }

/* ---- Programme de révision ---- */
.sommaire-cycles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.etape { display: grid; gap: 1px; background: var(--surface); border: 1px solid var(--ligne); border-top: 3px solid var(--ligne);
  border-radius: 10px; padding: 9px 11px; color: var(--encre); box-shadow: var(--ombre); min-width: 0; }
.etape b { font-size: 12px; color: var(--encre-3); }
.etape span { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etape small { font-size: 12px; color: var(--encre-3); }
.etape.rouge { border-top-color: var(--rouge); } .etape.ambre { border-top-color: #e0a100; }
.etape.vert { border-top-color: var(--vert); } .etape.gris { border-top-color: var(--ligne); opacity: .8; }
.etape:hover { border-color: var(--accent-3); }
.fiche-cycle { background: var(--surface); border: 1px solid var(--ligne); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--ombre); scroll-margin-top: 70px; }
.fiche-cycle > header { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.fiche-cycle h2 { font-size: 17px; }
.fiche-cycle .discret { margin: 0; }
.code-cycle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-2);
  color: var(--accent); font-weight: 700; font-size: 13px; }
.fiche-cycle.rouge .code-cycle { background: var(--rouge-2); color: var(--rouge); }
.fiche-cycle.ambre .code-cycle { background: var(--ambre-2); color: var(--ambre); }
.fiche-cycle.vert .code-cycle { background: var(--vert-2); color: var(--vert); }
.fiche-cycle.gris { opacity: .75; }
.etiquette.gris { background: var(--ligne-2); color: var(--encre-3); }
.indic-cycle { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.indic-cycle div { background: var(--fond); border-radius: 8px; padding: 7px 11px; }
.indic-cycle small { display: block; color: var(--encre-3); font-size: 11.5px; }
.indic-cycle b { font-variant-numeric: tabular-nums; }
.cycle.bloquant span { background: var(--rouge-2); color: var(--rouge); }
@media (max-width: 1100px) { .sommaire-cycles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Analyse du solde ---- */
.puce.forte { background: var(--accent); color: #fff; }
ul.mois-solde { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
ul.mois-solde li { display: grid; grid-template-columns: 70px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; }
ul.mois-solde b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
meter.m-n.neg::-webkit-meter-optimum-value { background: var(--ambre); }
meter.m-n.neg::-moz-meter-bar { background: var(--ambre); }

/* Mode Intelligence */
.question { display: grid; gap: 6px; margin: 16px 0 10px; }
.question label { font-weight: 700; }
.ligne-question { display: flex; gap: 8px; }
.ligne-question input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: var(--rayon); font: inherit; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.reponse-ia { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px 20px; }
.reponse-ia p { margin: 0 0 8px; line-height: 1.55; }
.hypotheses { margin-top: 12px; padding: 10px 16px; background: var(--ambre-2); border-radius: var(--rayon); color: var(--encre); }
.hypotheses h3 { margin: 0 0 4px; font-size: 14px; }
.faits { margin-top: 12px; }
.faits summary { cursor: pointer; font-weight: 600; }
.faits table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.faits td, .faits th { padding: 6px 8px; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: top; }
.provenance-ia { margin-top: 10px; }
@media (max-width: 640px) { .ligne-question { flex-direction: column; } }
