/* Générateur de devis, repris de l'ancienne feuille de style du site (lignes .gen). */
.gen { margin-top: 32px; padding: 24px; background: var(--surf); border: 1px solid var(--line); border-radius: 20px; }
.doc .gen h2 { margin-top: 0; }
.gen fieldset { margin: 20px 0 0; padding: 0; border: 0; }
.gen legend { margin-bottom: 10px; padding: 0; font-weight: 700; color: var(--text); }
.gen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gen label { display: grid; gap: 5px; font-size: 13px; color: var(--mut); }
.gen input, .gen select, .gen textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--ink); border: 1px solid #47475c; border-radius: 10px; color: var(--text); font: inherit; font-size: 16px; }
.gen textarea { min-height: 76px; resize: vertical; }
.gen input:focus-visible, .gen select:focus-visible, .gen textarea:focus-visible, .gen button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.gen .wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; align-items: stretch; }
.gen [hidden] { display: none; }
.gen-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px 124px auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.gen-remove, .gen-add { min-height: 44px; padding: 0 12px; background: none; border: 1px solid #47475c; border-radius: 10px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.gen-remove:hover, .gen-add:hover { border-color: var(--lime); color: var(--lime); }
.doc .gen-status { margin-top: 22px; font-weight: 700; color: var(--text); }
.doc .gen-status.ready { color: var(--lime); }
.gen-issues { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: var(--mut); }
.gen-sheet { margin-top: 18px; padding: 36px 32px; background: var(--white); border-radius: 12px; color: var(--ink); font-size: 13px; line-height: 1.5; overflow-x: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.doc .gen-sheet p { margin: 12px 0 0; color: var(--ink); font-size: inherit; }
.doc .gen-sheet b { color: var(--ink); }
.gen-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.doc .gen-sheet-head p { margin-top: 0; }
.doc .gen-sheet-head p:last-child { text-align: right; flex-shrink: 0; }
.doc .gen-sheet-head p:last-child b { display: inline-block; margin-bottom: 4px; font-size: 19px; letter-spacing: -.01em; }
.doc .gen-sheet-head + p { margin-top: 20px; padding: 12px 14px; background: #f3f3f7; border-radius: 6px; }
.gen-sheet table { width: 100%; min-width: 0; margin-top: 20px; border-collapse: collapse; background: none; }
.gen-sheet th, .gen-sheet td { padding: 9px 8px; border-bottom: 1px solid #d8d8e0; background: none; color: var(--ink); text-align: right; font-size: 13px; vertical-align: top; }
.gen-sheet thead th { background: #f3f3f7; border-bottom: 1px solid #b9b9c6; font-weight: 700; white-space: nowrap; }
.gen-sheet th:first-child, .gen-sheet td:first-child { width: 52%; text-align: left; }
.gen-totals { width: min(100%, 300px); margin-left: auto; margin-top: 10px; text-align: right; }
.doc .gen-totals p { margin-top: 6px; }
.doc .gen-totals .gen-grand { margin-top: 10px; padding-top: 8px; border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; }
.gen-terms { margin-top: 22px; }
.doc .gen-sheet .gen-sign { min-height: 96px; margin-top: 18px; padding: 12px 14px; border: 1px solid #b9b9c6; border-radius: 6px; break-inside: avoid; }
.doc .gen-sheet .gen-credit { margin-top: 22px; color: var(--on-white); font-size: 11px; }
.gen-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.gen-actions .btn { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.gen-actions .btn.ghost { border: 1px solid #47475c; }
.gen-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.doc .gen-note { margin-top: 14px; font-size: 13px; color: var(--mut); }
@media (max-width: 640px) {
  .gen { padding: 18px 14px; }
  .gen-grid { grid-template-columns: minmax(0, 1fr); }
  .gen-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gen-line label:first-child, .gen-remove { grid-column: 1 / -1; }
  .gen-sheet { padding: 22px 16px; }
  .gen-sheet-head { flex-direction: column; gap: 10px; }
  .doc .gen-sheet-head p:last-child { text-align: left; }
  .gen-sheet th, .gen-sheet td { padding: 8px 4px; font-size: 12px; }
}
@page { size: A4; margin: 16mm 15mm; }
@media print {
  body.print-quote, body.print-quote .glow, body.print-quote .doc, body.print-quote .gen, body.print-quote #gen-app { margin: 0; padding: 0; background: #fff; border: 0; box-shadow: none; }
  body.print-quote .glow > .wrap:first-child, body.print-quote footer, body.print-quote .sticky, body.print-quote .crumbs,
  body.print-quote article > :not(.gen), body.print-quote .gen > :not(#gen-app), body.print-quote #gen-app > :not(.gen-sheet) { display: none !important; }
  body.print-quote .doc > .wrap, body.print-quote .doc article { max-width: none; width: auto; margin: 0; padding: 0; }
  body.print-quote .gen-sheet { margin: 0; padding: 0; border-radius: 0; box-shadow: none; overflow: visible; font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-quote .gen-sheet th, body.print-quote .gen-sheet td { font-size: 10pt; }
  body.print-quote .gen-sheet tr { break-inside: avoid; }
  body.print-quote .gen-sheet-head { flex-direction: row; }
  body.print-quote .gen-sheet-head p:last-child { text-align: right; }
}