/* Rapport client imprimable (A4) – charte Dividom. S'ajoute à style.css. */
body.rapport { background: #E9E6DF; }
.barre-rapport { position: sticky; top: 0; z-index: 50; background: var(--nuit); color: #fff; }
.barre-rapport .conteneur { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; padding-top: 14px; padding-bottom: 14px; }
.barre-rapport label { display: flex; flex-direction: column; gap: 5px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: rgba(255,255,255,.75); }
.barre-rapport input, .barre-rapport select { min-height: 40px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; border-radius: var(--rayon); padding: 6px 10px; font: inherit; font-size: .92rem; font-weight: 600; letter-spacing: 0; text-transform: none; min-width: 170px; }
.barre-rapport select option { color: var(--nuit); }
.barre-rapport .btn { min-height: 40px; }
.barre-rapport .retour { color: #fff; font-weight: 600; font-size: .9rem; margin-right: auto; align-self: center; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.4); }

.document { padding: 28px 0 60px; }
.feuille { width: 210mm; min-height: 297mm; margin: 0 auto 24px; background: var(--ivoire); padding: 16mm 15mm 20mm; position: relative; box-shadow: 0 10px 30px rgba(20,37,56,.12); font-size: 10.5pt; line-height: 1.5; }
.feuille.suite { min-height: 0; }
@media (max-width: 860px) { .feuille { width: auto; min-height: 0; margin: 0 12px 16px; padding: 24px 20px; } }

/* En-tête courant de chaque feuille */
.entete-feuille { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--trait-moyen); padding-bottom: 8px; margin-bottom: 10mm; }
.entete-feuille img { height: 30px; width: auto; }
.entete-feuille span { font-size: 7.5pt; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--texte-3); }
.pied-ecran { position: absolute; left: 15mm; right: 15mm; bottom: 8mm; display: flex; justify-content: space-between; font-size: 7.5pt; color: var(--texte-3); border-top: 1px solid var(--trait); padding-top: 6px; }

.feuille h2 { font-size: 26pt; line-height: 1.05; margin: 0 0 8mm; max-width: 15ch; }
.feuille h3 { font-size: 13pt; margin: 8mm 0 3mm; padding-top: 3mm; border-top: 1px solid var(--nuit); }
.feuille h4 { font-size: 10.5pt; font-weight: 700; margin: 5mm 0 1.5mm; color: var(--nuit); }
.feuille p, .feuille li { color: var(--texte); }
.feuille .intro { font-size: 11.5pt; color: var(--texte-2); max-width: 62ch; }
.feuille ul { padding-left: 1.1em; margin: 0 0 3mm; }
.feuille li { margin: 0 0 1.2mm; }
.feuille .repere { font-size: 7.5pt; margin-bottom: 5mm; }
.deux-colonnes { columns: 2; column-gap: 9mm; }
.deux-colonnes > * { break-inside: avoid; }
.deux-colonnes h4:first-child { margin-top: 0; }

/* Couverture */
.couverture { background: var(--nuit); color: #fff; display: flex; flex-direction: column; overflow: hidden; padding: 20mm 18mm 18mm; }
.couverture .logo-cv img { height: 58px; width: auto; }
.couverture .repere { color: rgba(255,255,255,.8); margin-top: 40mm; }
.couverture h1 { color: #fff; font-size: 40pt; line-height: 1.02; max-width: 12ch; margin: 0; }
.couverture .filet { width: 18mm; height: 3px; background: var(--bleu); margin: 9mm 0; }
.couverture .lieu { font-size: 14pt; color: rgba(255,255,255,.88); font-weight: 600; }
.couverture .infos { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--trait-clair); position: relative; z-index: 2; max-width: 118mm; }
.couverture .infos div { padding: 4mm 4mm 0 0; }
.couverture .infos div + div { padding-left: 4mm; border-left: 1px solid var(--trait-clair); }
.couverture .infos .l { display: block; font-size: 7pt; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.65); font-weight: 600; }
.couverture .infos .v { display: block; font-size: 11pt; font-weight: 700; margin-top: 1mm; }
.couverture .mention { font-size: 7.5pt; color: rgba(255,255,255,.6); margin-top: 8mm; position: relative; z-index: 2; max-width: 118mm; }
.couverture .motif-cv { position: absolute; right: -26mm; bottom: -34mm; width: 92mm; pointer-events: none; z-index: 0; }
.couverture .motif-cv path { fill: var(--bleu); }

/* Chiffres clés */
.cles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--nuit); margin: 2mm 0 6mm; }
.cles > div { padding: 3.5mm 4mm 3.5mm 0; border-bottom: 1px solid var(--trait); }
.cles > div:not(:nth-child(3n+1)) { padding-left: 4mm; border-left: 1px solid var(--trait); }
.cles .l { display: block; font-size: 6.8pt; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--texte-3); }
.cles .v { display: block; font-size: 17pt; font-weight: 800; letter-spacing: -0.01em; color: var(--nuit); margin-top: 1mm; font-variant-numeric: tabular-nums; }
.cles .v.bleu { color: var(--bleu); }
.cles .s { display: block; font-size: 7.5pt; color: var(--texte-3); }

/* Tableaux */
.feuille table { font-size: 8.4pt; width: 100%; border-collapse: collapse; margin: 1mm 0 4mm; }
.feuille th, .feuille td { padding: 1.7mm 2mm; border-bottom: 1px solid var(--trait); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.feuille th:first-child, .feuille td:first-child { text-align: left; padding-left: 0; position: static; background: transparent; font-weight: 600; }
.feuille thead th { font-size: 6.3pt; letter-spacing: .1em; text-transform: uppercase; color: var(--texte-3); font-weight: 600; border-bottom: 1px solid var(--nuit); white-space: normal; vertical-align: bottom; min-width: 0; line-height: 1.3; }
.feuille tr.total td { font-weight: 800; border-top: 1px solid var(--nuit); border-bottom: 0; }
.feuille tbody tr:hover td { background: transparent; }
.feuille td.neg { color: var(--nuit); }
.table-deux { width: 100%; }
.table-deux td:last-child { font-weight: 700; color: var(--nuit); }
.grille-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 0 9mm; }
.grille-tables h4 { margin-top: 3mm; padding-top: 2mm; border-top: 1px solid var(--nuit); font-size: 9.5pt; }

/* Encadrés */
.encadre-r { background: var(--brume); padding: 4mm 5mm; margin: 4mm 0; break-inside: avoid; }
.encadre-r .repere { margin-bottom: 1.5mm; }
.encadre-r p:last-child { margin-bottom: 0; }
.bande-r { display: flex; justify-content: space-between; align-items: center; background: var(--bleu); color: #fff; padding: 4mm 5mm; font-weight: 600; margin-top: 6mm; break-inside: avoid; }
.bande-r a { color: #fff; text-decoration: none; }
.liste-controles { list-style: none; padding: 0 !important; margin: 0 0 4mm; }
.liste-controles li { display: grid; grid-template-columns: 6mm 1fr auto; gap: 2mm; padding: 1.6mm 0; border-bottom: 1px solid var(--trait); margin: 0; font-size: 9pt; }
.liste-controles .i { width: 4mm; height: 4mm; border-radius: 50%; display: grid; place-items: center; font-size: 6pt; color: #fff; font-weight: 800; margin-top: .6mm; }
.liste-controles .ok .i { background: var(--ok); } .liste-controles .ko .i { background: var(--ko); } .liste-controles .verif .i { background: #D08A1C; }
.liste-controles .d { color: var(--texte-3); font-size: 8.5pt; }

/* Bilan de revente */
.bilan { display: grid; grid-template-columns: 1fr 1fr; gap: 0 9mm; }
.bilan .poste { break-inside: avoid; }
.bilan .poste h4 { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--nuit); padding-top: 2.5mm; margin-top: 3mm; font-size: 10pt; }
.bilan .poste h4 b { color: var(--bleu); font-size: 13pt; font-weight: 800; font-variant-numeric: tabular-nums; }
.bilan dl { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 9pt; }
.bilan dt, .bilan dd { margin: 0; padding: 1.2mm 0; border-bottom: 1px solid var(--trait); }
.bilan dt { color: var(--texte-2); }
.bilan dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Barre de répartition */
.repartition { display: flex; height: 14mm; margin: 4mm 0 3mm; }
.repartition > div { display: flex; align-items: center; padding: 0 3mm; color: #fff; font-weight: 700; font-size: 9pt; white-space: nowrap; overflow: hidden; }
.legende-r { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; font-size: 9pt; }
.legende-r div { border-top: 3px solid var(--c); padding-top: 2mm; }
.legende-r b { display: block; font-size: 13pt; font-variant-numeric: tabular-nums; }

.graph-r svg { width: 100%; height: auto; }
.legende-g { display: flex; gap: 6mm; font-size: 8pt; color: var(--texte-2); margin-top: 2mm; }
.legende-g span::before { content: ""; display: inline-block; width: 8mm; height: 2px; vertical-align: 3px; margin-right: 2mm; background: var(--c); }

.signature-r { margin-top: 8mm; display: grid; grid-template-columns: 1fr 1fr; gap: 9mm; font-size: 9pt; }
.signature-r div { border-top: 1px solid var(--nuit); padding-top: 2mm; min-height: 22mm; }
.petit { font-size: 8pt; color: var(--texte-3); }

@media print {
  body.rapport { background: #fff; }
  .barre-rapport, .entete, .pied, #avertissement { display: none !important; }
  .document { padding: 0; }
  .feuille { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; background: transparent; break-before: page; }
  .feuille:first-child { break-before: auto; }
  .feuille.suite { break-before: auto; }
  .pied-ecran { display: none; }
  .couverture { -webkit-print-color-adjust: exact; print-color-adjust: exact; height: 297mm; padding: 20mm 18mm 18mm; }
  .bande-r, .encadre-r, .repartition, .liste-controles .i, .feuille thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  h3, h4 { break-after: avoid; }
}

/* Ajustements d'impression */
.table-deux td { padding-top: 1.15mm; padding-bottom: 1.15mm; font-size: 8.2pt; }
@media print {
  .feuille.couverture { background: var(--nuit) !important; padding: 20mm 18mm 18mm; height: 297mm; overflow: hidden; }
}

/* Dispositifs clos : mentions visibles sur la couverture, en tête de feuille et dans le texte */
.encadre-archive { border: 1px solid var(--nuit); border-left: 4px solid var(--nuit); background: #fff; padding: 3mm 4mm; margin: 0 0 5mm; font-size: 9pt; break-inside: avoid; }
.entete-feuille .clos { color: var(--nuit); font-weight: 800; }
.archive-cv { display: flex; gap: 4mm; align-items: flex-start; border: 1px solid rgba(255,255,255,.5); padding: 3.5mm 4mm; margin: 2mm 0 0; max-width: 130mm; position: relative; z-index: 2; }
.archive-cv span { flex: none; background: #fff; color: var(--nuit); font-size: 7pt; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; padding: 1.2mm 2mm; }
.archive-cv p { margin: 0; color: #fff; font-size: 9pt; line-height: 1.45; }
.btn-contour-clair { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); min-height: 40px; }
.porte-rapport { min-height: 0; text-align: left; }

/* Rapport simplifié : une page A4 paysage */
.feuille.simplifie { width: 297mm; min-height: 210mm; padding: 9mm 10mm; font-size: 7.6pt; }
.s-tete { display: flex; align-items: center; gap: 8mm; border-bottom: 1px solid var(--nuit); padding-bottom: 3mm; margin-bottom: 3mm; }
.s-tete img { height: 24px; }
.s-tete h1 { font-size: 15pt; margin: 0; line-height: 1.1; }
.s-tete p { margin: 1mm 0 0; color: var(--texte-2); font-size: 8.5pt; }
.s-archive { margin-left: auto; border: 1px solid var(--nuit); border-left: 4px solid var(--nuit); padding: 1.5mm 3mm; font-size: 7.2pt; max-width: 110mm; line-height: 1.35; background: #fff; }
.s-archive b { display: block; text-transform: uppercase; letter-spacing: .14em; font-size: 6.5pt; }
.s-blocs { display: grid; grid-template-columns: repeat(4, 1fr) 1.1fr; gap: 0 5mm; margin-bottom: 2mm; }
.s-blocs h4 { margin: 0 0 1mm; font-size: 7pt; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-3); font-weight: 700; }
.s-blocs dl { display: grid; grid-template-columns: 1fr auto; margin: 0; }
.s-blocs dt, .s-blocs dd { margin: 0; padding: .6mm 0; border-bottom: 1px solid var(--trait); }
.s-blocs dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.s-blocs .fort { background: var(--nuit); color: #fff; padding: 2.5mm 3mm; }
.s-blocs .fort h4 { color: rgba(255,255,255,.75); }
.s-blocs .fort b { display: block; font-size: 16pt; font-weight: 800; }
.s-blocs .fort span { font-size: 7pt; color: rgba(255,255,255,.75); }
.feuille.simplifie table { font-size: 7pt; margin: 1mm 0 2mm; }
.feuille.simplifie th, .feuille.simplifie td { padding: .75mm 1.2mm; }
.feuille.simplifie thead th { font-size: 5.6pt; }
.s-bas { display: grid; grid-template-columns: 2fr repeat(4, 1fr); border-top: 1px solid var(--nuit); }
.s-bas > div { padding: 2mm 3mm 0 0; }
.s-bas > div + div { padding-left: 3mm; border-left: 1px solid var(--trait); }
.s-bas h4 { margin: 0; font-size: 6.5pt; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-3); }
.s-bas b { font-size: 12pt; font-weight: 800; color: var(--nuit); font-variant-numeric: tabular-nums; }
.s-bas p { margin: 1mm 0 0; font-size: 8pt; } .s-bas p b { font-size: 9pt; color: var(--bleu); }
.s-pied { font-size: 6.5pt; color: var(--texte-3); margin: 2.5mm 0 0; border-top: 1px solid var(--trait); padding-top: 1.5mm; }
@media screen and (max-width: 1180px) { .feuille.simplifie { width: auto; margin: 0 12px 16px; } .s-blocs { grid-template-columns: 1fr 1fr; gap: 3mm 5mm; } .s-bas { grid-template-columns: 1fr 1fr; } .feuille.simplifie .defile, .feuille.simplifie table { overflow-x: auto; } }
@media print {
  .feuille.simplifie { width: auto; min-height: 0; padding: 0; }
  .s-blocs .fort, .s-archive, .encadre-archive, .archive-cv span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
