/* Documents CNS : identité graphique inspirée du modèle validé par le client.
   Les données restent rendues par PHP ; aucun texte commercial n'est dans une image. */
.invoice-screen .invoice-document {
  --cns-royal: #0755a8;
  --cns-deep: #002e80;
  --cns-sky: #ecf6ff;
  --cns-gold: #ffcb00;
  --cns-red: #e81835;
  color: #082757;
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
  background: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-screen .invoice-document .invoice-title {
  position: relative;
  height: 38mm;
  margin: -4mm -4mm 0;
  padding: 5mm 9mm 4mm 105mm;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-direction: column;
  gap: 1mm;
  color: #fff;
  background:
    linear-gradient(155deg, transparent 0 80%, #ffcb00 80% 83%, #e81835 83% 86%, transparent 86%),
    radial-gradient(circle at 76% 4%, #8ad4ff 0, transparent 42%),
    linear-gradient(115deg, #fff 0 49%, #eaf6ff 57%, #0755a8 100%);
  border-bottom: 2.2mm solid #0755a8;
  overflow: hidden;
}
.invoice-screen .invoice-document .invoice-title::before {
  content: '';
  position: absolute;
  left: -15mm;
  bottom: -8mm;
  width: 120mm;
  height: 14mm;
  transform: rotate(9deg);
  background: #0755a8;
  border-top: 2mm solid #ffcb00;
}
.invoice-screen .invoice-document .document-heading,
.invoice-screen .invoice-document .invoice-title .page-number {
  position: relative;
  z-index: 1;
  width: 100%;
}
.invoice-screen .invoice-document .document-heading small {
  display: block;
  color: #083c85;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.invoice-screen .invoice-document .document-heading strong {
  display: block;
  color: #063d89;
  font-size: 31px;
  line-height: 1;
  letter-spacing: .035em;
}
.invoice-screen .invoice-document .document-heading span {
  display: block;
  width: fit-content;
  margin-top: 2mm;
  padding: 1mm 3mm;
  border-radius: 0 8px 8px 0;
  color: #fff;
  background: #002e80;
  font-size: 12px;
  font-weight: 800;
}
.invoice-screen .invoice-document .invoice-title .page-number {
  color: #082f73;
  font-size: 9px;
  text-align: left;
}
.invoice-screen .invoice-document .invoice-logo {
  position: absolute;
  z-index: 2;
  left: 7mm;
  top: 4mm;
  width: 91mm;
  height: 29mm;
  display: flex;
  align-items: center;
  justify-content: center;
}
.invoice-screen .invoice-document .invoice-logo img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.invoice-screen .invoice-document .invoice-brand {
  display: block;
  min-height: 50mm;
  padding: 4mm 1mm 2mm;
}
.invoice-screen .invoice-document .invoice-client {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58mm 27mm;
  gap: 3mm;
  align-items: start;
}
.invoice-screen .invoice-document .invoice-client address {
  grid-column: 1;
  grid-row: 1;
  min-height: 42mm;
  margin: 0;
  padding: 3mm;
  border: 1px solid #d4e8fa;
  border-radius: 3mm;
  background: linear-gradient(120deg,#fff,#f3faff);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.invoice-screen .invoice-document .invoice-client address::before {
  content: '●  CLIENT';
  display: block;
  margin-bottom: 1.5mm;
  color: #0755a8;
  font-size: 11px;
  font-weight: 800;
}
.invoice-screen .invoice-document .invoice-client address strong {font-size: 12px;color:#063d89}
.invoice-screen .invoice-document .invoice-client address .document-initiator {font-size:8px}
.invoice-screen .invoice-document .invoice-client table {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #d4e8fa;
  border-radius: 3mm;
  overflow: hidden;
  background: #f3faff;
  font-size: 9px;
}
.invoice-screen .invoice-document .invoice-client table th,
.invoice-screen .invoice-document .invoice-client table td {
  height: 7mm;
  padding: 1mm;
  border: 0;
  border-bottom: 1px solid #d4e8fa;
  color: #063d89;
}
.invoice-screen .invoice-document .invoice-client table thead tr:first-child {display:none}
.invoice-screen .invoice-document .invoice-client table thead tr:last-child th {background:#e6f3ff;font-size:9px}
.invoice-screen .invoice-document .barcode {
  position: absolute;
  z-index: 2;
  top: 43mm;
  right: 6mm;
  width: 28mm;
  height: 37mm;
  margin: 0;
  padding: 1mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid #d4e8fa;
  border-radius: 3mm;
  background: #fff;
}
.invoice-screen .invoice-document .barcode.qr-code .qr-image,
.invoice-screen .invoice-document .barcode.qr-code .qr-image img,
.invoice-screen .invoice-document .barcode.qr-code .qr-image canvas {width:22mm!important;height:22mm!important}
.invoice-screen .invoice-document .barcode .qr-label {font-size:8px;font-weight:800;color:#063d89;white-space:normal;text-align:center}
.invoice-screen .invoice-document .barcode a {font-size:7px;text-align:center;color:#0755a8}
.invoice-screen .invoice-document .warranty,
.invoice-screen .invoice-document .proforma-warning {
  margin: 0 0 3mm;
  padding: 2mm 3mm;
  border: 0;
  border-radius: 2mm;
  color: #063d89;
  background: #eaf5ff;
  text-align: center;
  font-size: 10px;
}
.invoice-screen .invoice-document .invoice-lines {font-size:10px;border-collapse:collapse}
.invoice-screen .invoice-document .invoice-lines th {
  padding: 1.4mm 1mm;
  color: #fff;
  background: #0755a8;
  border-color: #7cb0e6;
  font-size: 9px;
}
.invoice-screen .invoice-document .invoice-lines td {border-color:#a4c8eb;color:#082757}
.invoice-screen .invoice-document .currency-note {color:#123966}
.invoice-screen .invoice-document .payment-mode {
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff!important;
  color: #082757!important;
}
.invoice-screen .invoice-document:not(.proforma-document) .payment-mode>strong {display:none}
.invoice-screen .invoice-document .payment-mode p {
  margin: 0 0 2mm;
  padding: 2mm;
  border-radius: 2mm;
  background: #ffe6eb;
  color: #b60022!important;
  font-size: 9px;
}
.invoice-screen .invoice-document .payment-mode p em {color:#b60022!important}
.invoice-screen .invoice-document .payment-mode table {width:100%;font-size:9px!important;line-height:1.38!important;border-spacing:2mm 0!important}
.invoice-screen .invoice-document .payment-mode table td:first-child,
.invoice-screen .invoice-document .payment-mode table td:last-child {
  width: 49%!important;
  min-height: 28mm;
  padding: 2mm!important;
  vertical-align: top;
  border: 1px solid #b8daf8;
  border-radius: 2mm;
  color: #082757!important;
  background: #f9fcff;
}
.invoice-screen .invoice-document .payment-mode table td:nth-child(2) {width:0!important;padding:0!important}
.invoice-screen .invoice-document .payment-mode table td:nth-child(2) span {display:none}
.invoice-screen .invoice-document .payment-mode table td:first-child>span,
.invoice-screen .invoice-document .payment-mode table td:last-child>strong {
  display: block;
  margin: -2mm -2mm 2mm;
  padding: 2mm;
  color: #fff!important;
  background: #0755a8;
  font-size: 10px!important;
}
.invoice-screen .invoice-document .payment-mode table td b,
.invoice-screen .invoice-document .payment-mode table td span {color:#063d89!important}
.invoice-screen .invoice-document .payment-mode table td:last-child>strong {color:#fff!important}
.invoice-screen .invoice-document .settlement {min-height:39mm;gap:3mm}
.invoice-screen .invoice-document .thanks {
  align-self: start;
  padding: 3mm;
  border-radius: 2mm;
  background: #eaf5ff;
  text-align: left;
  color: #082757;
}
.invoice-screen .invoice-document .summary th,
.invoice-screen .invoice-document .payments th {color:#fff;background:#0755a8;border-color:#a4c8eb}
.invoice-screen .invoice-document .summary td,
.invoice-screen .invoice-document .payments td {border-color:#a4c8eb}
.invoice-screen .invoice-document .summary td:last-child,
.invoice-screen .invoice-document .remaining b {color:#e81835;font-weight:900}
.invoice-screen .invoice-document .remaining {border-color:#ffb3c0}
.invoice-screen .invoice-document .remaining strong {background:#ffe6eb;color:#ba0026}
.invoice-screen .invoice-document .invoice-notes {background:#fff;border-left:3px solid #ffcb00}
.invoice-screen .invoice-document .office-footer {
  color: #fff!important;
  background: linear-gradient(105deg,#002e80,#0755a8)!important;
  border-top: 2mm solid #ffcb00;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-screen .invoice-document .office-footer::after {
  content:'';
  position:absolute;
  bottom:0;
  right:0;
  width:27mm;
  height:1mm;
  background:#e81835;
}
.invoice-screen .invoice-document .office-footer strong {color:#ffcb00!important}
.invoice-screen .invoice-document .office-footer span {color:#fff!important}
/* La pro forma n'imite jamais un paiement déjà reçu. */
.invoice-screen .proforma-document .invoice-brand {min-height:48mm}
.invoice-screen .proforma-document .payment-methods {gap:3mm;margin:2mm 0}
.invoice-screen .proforma-document .payment-methods>div {
  border:1px solid #b8daf8;
  border-radius:2mm;
  overflow:hidden;
  background:#f9fcff;
  color:#082757;
}
.invoice-screen .proforma-document .payment-methods strong {
  margin:0 0 2mm;
  padding:2mm;
  display:block;
  color:#fff;
  background:#0755a8;
}
.invoice-screen .proforma-document .payment-methods span {color:#082757}
@media print {
  .invoice-screen .invoice-document .invoice-title {margin:-4mm -4mm 0!important}
  .invoice-screen .invoice-document .office-footer {position:static!important;margin-top:auto!important}
}
