/* ─────────────────────────────────────────────────────────────
   Les trois A4. Zéro teal : l'information doit tenir en noir seul.
   Mêmes styles à l'écran (aperçu 794 × 1123) et à l'impression.
   ───────────────────────────────────────────────────────────── */

.a4 {
  width: 794px; min-height: 1123px;
  background: #FFFFFF; color: #1A1A1A;
  padding: 56px 48px;
  display: flex; flex-direction: column; gap: 26px;
  border: 1px solid var(--line);
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}

.a4-tete {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  border-bottom: 2px solid #1A1A1A; padding-bottom: 14px;
}
.a4-tete-g { display: flex; flex-direction: column; gap: 6px; }
.a4-sur {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; color: #6E6868;
}
.a4-titre { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.a4-tete-d {
  text-align: right; font-size: 11px; text-transform: uppercase;
  letter-spacing: .10em; color: #6E6868; line-height: 1.7;
}
.a4-corps { display: flex; flex-direction: column; gap: 20px; }
.a4-corps:has(.a4-rg-groupe) { gap: 22px; }

.a4-legende {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #6E6868;
}
.a4:has(.a4-rg-cols) .a4-legende { border-top: 1px solid #1A1A1A; padding-top: 10px; }

.a4-pied {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #1A1A1A; padding-top: 12px;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .14em; color: #6E6868;
}

/* ── 1. conduite détaillée ───────────────────────────────────── */
.a4-num {
  display: grid; grid-template-columns: 56px 1fr 1fr; gap: 20px;
  border-bottom: 1px solid #1A1A1A; padding-bottom: 16px;
}
.a4-num-chiffre { font-size: 40px; font-weight: 900; letter-spacing: -.05em; line-height: .85; }
.a4-num-milieu { display: flex; flex-direction: column; gap: 8px; }
.a4-num-titre { font-size: 17px; font-weight: 900; letter-spacing: -.02em; }
.a4-num-meta {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: #6E6868;
}
.a4-matos { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.a4-matos-ligne { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.a4-matos-ligne.a4-fort { font-weight: 700; }
.a4-case {
  width: 15px; height: 15px; flex: none; border: 1.5px solid #1A1A1A;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; line-height: 1;
}
.a4-case-pleine { background: #1A1A1A; color: #FFFFFF; border-color: #1A1A1A; }
.a4-case-alerte { color: #1A1A1A; }
.a4-num-notes { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; line-height: 1.5; }
.a4-note { display: flex; gap: 10px; }
.a4-note-cat {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #6E6868; min-width: 42px; padding-top: 3px; flex: none;
}

/* ── 2. feuille d'ordre ──────────────────────────────────────── */
.a4-ordre { gap: 32px; }
.a4-ordre-liste { display: flex; flex-direction: column; }
.a4-ordre-ligne {
  display: grid; grid-template-columns: 88px 1fr 120px; align-items: baseline; gap: 16px;
  padding: 20px 0; border-bottom: 1px solid #1A1A1A;
}
.a4-ordre-ligne.a4-ordre-fin { border-bottom-width: 2px; }
.a4-ordre-num { font-size: 56px; font-weight: 900; letter-spacing: -.05em; line-height: .8; font-variant-numeric: tabular-nums; }
.a4-ordre-titre { font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.a4-ordre-duree {
  text-align: right; font-size: 13px; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase;
}

/* ── 3. conduite régie ───────────────────────────────────────── */
.a4-rg-cols, .a4-rg-ligne {
  display: grid; grid-template-columns: 62px 68px 1fr 1fr; gap: 16px;
}
.a4-rg-cols {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  color: #6E6868; border-bottom: 1px solid #1A1A1A; padding-bottom: 8px;
}
.a4-rg-groupe { display: flex; flex-direction: column; gap: 10px; }
.a4-rg-tete {
  display: flex; align-items: baseline; gap: 14px;
  border-bottom: 1px solid #1A1A1A; padding-bottom: 6px;
}
.a4-rg-num { font-size: 30px; font-weight: 900; letter-spacing: -.05em; line-height: .9; }
.a4-rg-titre { font-size: 15px; font-weight: 900; letter-spacing: -.02em; }
.a4-rg-compte {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  color: #6E6868; margin-left: auto;
}
.a4-rg-ligne { align-items: start; padding-bottom: 8px; border-bottom: 1px solid #D8D4D4; }
.a4-rg-code { font-size: 16px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.a4-rg-dept {
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid #1A1A1A; padding: 2px 0; text-align: center;
}
.a4-rg-dept-plein { background: #1A1A1A; color: #FFFFFF; }
.a4-rg-top { font-size: 13px; font-weight: 700; line-height: 1.4; }
.a4-rg-action { font-size: 13px; line-height: 1.4; }

/* ── aperçu à l'écran sur petite fenêtre ─────────────────────── */
@media (max-width: 880px) {
  .doc-scene { overflow-x: auto; justify-content: flex-start; padding: 0 12px 12px; }
  .a4 { flex: none; }
}

/* ── impression ──────────────────────────────────────────────── */
@media print {
  @page { size: A4; margin: 0; }

  html, body { background: #FFFFFF; }
  .shell, .doc-barre { display: none !important; }
  #vue > *:not(.doc-page) { display: none !important; }
  #vue { padding: 0; }
  .doc-page { gap: 0; display: block; }
  .doc-scene { display: block; overflow: visible; padding: 0; }

  .a4 {
    width: auto; min-height: 0; border: 0;
    padding: 14mm 13mm 20mm; gap: 24px;
  }
  /* répété sur chaque page par le moteur d'impression */
  .a4-pied {
    position: fixed; bottom: 8mm; left: 13mm; right: 13mm;
    margin-top: 0; background: #FFFFFF;
  }
  .a4-bloc { break-inside: avoid; page-break-inside: avoid; }
  .a4-ordre-ligne { break-inside: avoid; page-break-inside: avoid; }
}
