/**
 * MANANORD — Factures & impressions responsive
 * Logo + société à GAUCHE | Facture + client à DROITE — tous écrans
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: auto;
  word-break: normal;
  overflow-wrap: normal;
}

img {
  max-width: 100%;
  height: auto;
}

/* ─── Conteneurs ─── */
.invoice-container,
.facture-container,
#print-sales,
#print-recu,
#print-achat,
#print-depense,
#print-commande,
.print-container {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

/* ═══ EN-TÊTE : grille 2 colonnes (gauche / droite) ═══ */
.header-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 38%) !important;
  grid-template-rows: auto !important;
  gap: 0.65rem 0.75rem !important;
  align-items: start !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  /* annule flex hérité */
  flex-direction: unset !important;
  flex-wrap: unset !important;
}

/* ── Structure 2 blocs (print_sales_credit) ── */
.logo-company {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  text-align: left !important;
}

.invoice-section {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 145px !important;
  max-width: none !important;
  width: auto !important;
  text-align: right !important;
  justify-self: stretch !important;
  align-self: start !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Structure 3 blocs (cash, achat, etc.) → gauche fusionné ── */
.header-section > .logo-section {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  z-index: 1;
}

.header-section > .company-title {
  grid-column: 1 !important;
  grid-row: 1 !important;
  margin-left: 72px !important;
  padding-left: 0.35rem !important;
  padding-right: 0.5rem !important;
  text-align: left !important;
  min-width: 0 !important;
  max-width: none !important;
  z-index: 0;
}

.header-section > .invoice-title,
.header-section > .receipt-title {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 145px !important;
  max-width: none !important;
  width: auto !important;
  text-align: right !important;
  justify-self: stretch !important;
  align-self: start !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Logo + société côte à côte (sans chevauchement) */
.header-left {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 6px !important;
  min-width: 0 !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
}

.header-left .logo-section {
  flex: 0 0 auto !important;
  grid-column: unset !important;
  grid-row: unset !important;
  width: auto !important;
  max-width: none !important;
  z-index: auto !important;
  margin: 0 !important;
}

.header-left .company-title {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  grid-column: unset !important;
  grid-row: unset !important;
}

.logo-section img,
.logo {
  flex-shrink: 0;
  max-width: 90px;
  height: auto;
}

.logo-placeholder {
  flex-shrink: 0;
}

.company-details,
.company-title,
.company-name {
  text-align: left !important;
  min-width: 0;
}

.company-title h1,
.company-title h2,
.company-name,
.company-details,
.company-details div,
.invoice-details,
.invoice-details div {
  word-break: normal !important;
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  hyphens: none !important;
  white-space: normal !important;
}

.invoice-title h2,
.document-title,
.receipt-title h2 {
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: nowrap !important;
  hyphens: none !important;
}

.invoice-title > div,
.invoice-details div {
  text-align: right !important;
}

/* Pas de casse caractère par caractère dans l'en-tête */
.header-section,
.header-section * {
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* ─── Tableaux produits ─── */
.table-responsive,
.invoice-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-bottom: 0.75rem;
}

.products-table,
.invoice-table,
table.table {
  width: 100%;
  max-width: 100%;
}

.products-table th,
.products-table td {
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}

.products-table td:first-child,
.products-table td:nth-child(4),
.products-table td:nth-child(5),
.products-table td:last-child,
.totals-table td:last-child {
  white-space: nowrap;
}

.products-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.totals-section {
  max-width: 100%;
  box-sizing: border-box;
}

.totals-table td {
  word-break: normal;
  overflow-wrap: normal;
}

.signatures {
  flex-wrap: wrap;
  gap: 1rem;
}

.signature-box {
  min-width: 0;
  flex: 1 1 140px;
  max-width: 100%;
}

.conversion-text,
.notes-section {
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}

.no-print,
.print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.no-print .btn,
.no-print button {
  min-height: 44px;
}

.header {
  word-break: normal;
}

body > table,
.print-table-wrap {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  body {
    padding: 8px !important;
    margin: 0 !important;
  }

  .invoice-container,
  .facture-container {
    padding: 8px;
    border-width: 1px;
  }

  .header-section {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 42%) !important;
    gap: 0.4rem 0.5rem !important;
  }

  .header-section > .company-title {
    margin-left: 58px !important;
  }

  .logo,
  .logo-placeholder {
    width: 52px !important;
    height: 52px !important;
    margin-right: 6px !important;
  }

  .logo-section img {
    max-width: 52px;
    max-height: 52px;
  }

  .company-details,
  .invoice-details {
    font-size: 9px !important;
    line-height: 1.35 !important;
  }

  .company-name {
    font-size: 11px !important;
  }

  .document-title,
  .invoice-title h2 {
    font-size: 13px !important;
  }

  .products-table {
    font-size: 8px;
    min-width: 480px;
  }

  .products-table th,
  .products-table td {
    padding: 3px;
  }

  .totals-section {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .no-print .btn,
  .no-print button {
    flex: 1 1 100%;
    width: 100%;
  }
}

@media (max-width: 576px) {
  .header-section {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 44%) !important;
  }

  .company-title h1 {
    font-size: 13px !important;
  }

  .company-title h2 {
    font-size: 9px !important;
  }

  .products-table {
    min-width: 420px;
    font-size: 7px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm 8mm;
  }

  html, body, .print-invoice-body {
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
  }

  .invoice-container,
  .facture-container,
  #print-sales {
    max-width: 100% !important;
    width: 100% !important;
    border: 1px solid #333 !important;
    overflow: visible !important;
    padding: 4mm 5mm !important;
    margin: 0 !important;
    font-size: 8.5pt !important;
    line-height: 1.25 !important;
    page-break-inside: avoid;
  }

  .header-section {
    overflow: visible !important;
    margin-bottom: 6px !important;
    padding-bottom: 6px !important;
    gap: 4px 6px !important;
  }

  .header-section > .company-title {
    margin-left: 48px !important;
  }

  .logo-section img,
  .logo {
    max-width: 48px !important;
    max-height: 42px !important;
  }

  .company-title h1,
  .company-name {
    font-size: 11pt !important;
    margin-bottom: 2px !important;
  }

  .company-title h2,
  .company-details {
    font-size: 7pt !important;
  }

  .invoice-title h2,
  .document-title {
    font-size: 10pt !important;
  }

  .invoice-title > div,
  .invoice-details,
  .invoice-details div {
    font-size: 7pt !important;
    line-height: 1.3 !important;
  }

  .table-responsive,
  .invoice-table-scroll {
    overflow: visible !important;
    margin-bottom: 4px !important;
  }

  .products-table,
  .totals-table {
    font-size: 7.5pt !important;
  }

  .products-table th,
  .products-table td,
  .totals-table td {
    padding: 2px 3px !important;
  }

  .products-table tfoot td,
  .products-table tfoot th {
    font-size: 7.5pt !important;
    padding: 2px 3px !important;
  }

  .totals-section {
    width: 55% !important;
    margin-left: auto !important;
  }

  .conversion-text {
    font-size: 7pt !important;
    margin: 4px 0 !important;
    padding: 0 !important;
  }

  .signatures {
    margin-top: 8px !important;
    gap: 0.5rem !important;
  }

  .signature-box {
    font-size: 7pt !important;
  }

  .signature-line {
    height: 22px !important;
    margin-bottom: 2px !important;
  }

  .petit-texte {
    font-size: 7pt !important;
  }

  .no-print {
    display: none !important;
  }

  /* ─── A4 (défaut) ─── */
  body.paper-a4 .invoice-container,
  body.paper-a4 #print-sales,
  body.paper-a4 .facture-container {
    font-size: 8.5pt !important;
  }

  /* ─── A5 ─── */
  body.paper-a5 .invoice-container,
  body.paper-a5 #print-sales,
  body.paper-a5 .facture-container {
    font-size: 7.5pt !important;
    padding: 3mm 4mm !important;
    line-height: 1.2 !important;
  }

  body.paper-a5 .header-section > .company-title {
    margin-left: 0 !important;
  }

  body.paper-a5 .header-left {
    gap: 4px !important;
  }

  body.paper-a5 .logo-section img,
  body.paper-a5 .logo {
    max-width: 36px !important;
    max-height: 32px !important;
  }

  body.paper-a5 .company-title h1,
  body.paper-a5 .company-name {
    font-size: 9.5pt !important;
  }

  body.paper-a5 .company-title h2,
  body.paper-a5 .company-details,
  body.paper-a5 .invoice-title > div,
  body.paper-a5 .invoice-details div {
    font-size: 6pt !important;
  }

  body.paper-a5 .invoice-title h2,
  body.paper-a5 .document-title {
    font-size: 8.5pt !important;
  }

  body.paper-a5 .products-table,
  body.paper-a5 .totals-table {
    font-size: 6.5pt !important;
  }

  body.paper-a5 .products-table th,
  body.paper-a5 .products-table td,
  body.paper-a5 .totals-table td,
  body.paper-a5 .products-table tfoot td,
  body.paper-a5 .products-table tfoot th {
    padding: 1px 2px !important;
    font-size: 6.5pt !important;
  }

  body.paper-a5 .conversion-text,
  body.paper-a5 .petit-texte,
  body.paper-a5 .signature-box {
    font-size: 6pt !important;
  }

  body.paper-a5 .signature-line {
    height: 16px !important;
  }

  body.paper-a5 .totals-section {
    width: 62% !important;
  }

  /* ─── A6 (ticket compact) ─── */
  body.paper-a6 .invoice-container,
  body.paper-a6 #print-sales,
  body.paper-a6 .facture-container {
    font-size: 6pt !important;
    padding: 2mm 2.5mm !important;
    line-height: 1.15 !important;
    border-width: 1px !important;
  }

  body.paper-a6 .header-section {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 3px !important;
    margin-bottom: 3px !important;
    padding-bottom: 3px !important;
  }

  body.paper-a6 .header-left {
    grid-column: 1 !important;
    grid-row: 1 !important;
    gap: 3px !important;
  }

  body.paper-a6 .invoice-title {
    grid-column: 1 !important;
    grid-row: 2 !important;
    text-align: left !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  body.paper-a6 .invoice-title > div {
    text-align: left !important;
  }

  body.paper-a6 .header-section > .company-title {
    margin-left: 0 !important;
  }

  body.paper-a6 .logo-section img,
  body.paper-a6 .logo {
    max-width: 24px !important;
    max-height: 22px !important;
  }

  body.paper-a6 .company-title h1,
  body.paper-a6 .company-name {
    font-size: 7pt !important;
  }

  body.paper-a6 .company-title h2,
  body.paper-a6 .company-details,
  body.paper-a6 .invoice-title > div,
  body.paper-a6 .invoice-details div {
    font-size: 5pt !important;
  }

  body.paper-a6 .invoice-title h2,
  body.paper-a6 .document-title {
    font-size: 7pt !important;
  }

  body.paper-a6 .products-table,
  body.paper-a6 .totals-table {
    font-size: 5.5pt !important;
  }

  body.paper-a6 .products-table th,
  body.paper-a6 .products-table td,
  body.paper-a6 .totals-table td,
  body.paper-a6 .products-table tfoot td,
  body.paper-a6 .products-table tfoot th {
    padding: 1px !important;
    font-size: 5.5pt !important;
  }

  body.paper-a6 .conversion-text,
  body.paper-a6 .petit-texte,
  body.paper-a6 .signature-box {
    font-size: 5pt !important;
  }

  body.paper-a6 .signature-line {
    height: 12px !important;
  }

  body.paper-a6 .signatures {
    margin-top: 4px !important;
  }

  body.paper-a6 .totals-section {
    width: 72% !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   En-tête facture — modèle ÉMETTEUR / DESTINATAIRE
   ═══════════════════════════════════════════════════════════ */
.invoice-head-pro {
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  color: #111;
  margin: 0 0 14px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.ihp-table {
  width: 100%;
  border-collapse: collapse;
}
.ihp-logo,
img.ihp-logo,
.ihp-brand img {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  object-fit: contain !important;
}
.ihp-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.3px;
}
.ihp-tag {
  font-size: 9px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: #555;
  margin-top: 3px;
}
.ihp-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.ihp-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.4px;
  line-height: 1.55;
}
.ihp-num {
  text-align: right;
  font-weight: 600;
}
.ihp-line {
  height: 0;
  border: 0;
  border-top: 1.5px solid #111;
  margin: 10px 0 14px;
}
.ihp-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  font-size: 11px;
  line-height: 1.5;
}
.ihp-lbl {
  font-weight: 800;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* En-tete facture modele photo — cadres et espaces conserves a l'impression */
.invoice-head-studio {
  margin: 0 0 12px;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  page-break-inside: avoid;
  break-inside: avoid;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-head-studio .ihp-outer {
  width: 100%;
  border: 1px solid #444 !important;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}
.invoice-head-studio .ihp-pad { padding: 10px 10px 8px; }
.invoice-head-studio .ihp-logo-wrap {
  width: 94px;
  height: 94px;
  border: 1.5px solid #333 !important;
  border-radius: 50%;
  padding: 3px;
  box-sizing: border-box;
}
.invoice-head-studio img.ihp-logo,
.invoice-head-studio .ihp-logo {
  width: 86px !important;
  height: 86px !important;
  max-width: 86px !important;
  max-height: 86px !important;
  border-radius: 50%;
  object-fit: contain;
  display: block;
}
.invoice-head-studio .ihp-num {
  font-size: 14px !important;
  line-height: 1.4 !important;
  font-weight: 800 !important;
}
.invoice-head-studio .ihp-reference {
  font-size: 13px !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
}
.invoice-head-studio .ihp-name,
.invoice-head-studio .ihp-loc {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #333;
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0;
}
.invoice-head-studio .ihp-sub {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #444;
  margin-top: 6px;
  line-height: 1.55;
}
.invoice-head-studio .ihp-box,
.invoice-head-studio .ihp-box-tbl {
  width: 100%;
  border: 1px solid #777 !important;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
}
.invoice-head-studio .ihp-box-title {
  background: transparent !important;
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.8px;
  padding: 7px 8px 5px;
  color: #5a5a5a !important;
  line-height: 1.15;
  border-bottom: 0;
}
.invoice-head-studio .ihp-box-rule {
  border-top: 1px solid #c8c8c8 !important;
  height: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
}
.invoice-head-studio .ihp-box-body {
  padding: 7px 10px 9px;
  font-size: 11px;
  line-height: 1.55;
  color: #222;
}
.invoice-head-studio .ihp-k {
  color: #666;
  font-weight: 400;
  font-size: 11px;
}
.invoice-head-studio .ihp-v {
  color: #111;
  font-weight: 600;
}
.invoice-head-studio .ihp-num {
  text-align: left;
  font-weight: 600;
}
.invoice-head-studio .ihp-title {
  font-family: Arial, Helvetica, sans-serif;
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.15;
}
.invoice-head-studio .ihp-rainbow-tbl {
  width: 100%;
  border-collapse: collapse;
  height: 4px;
}
.invoice-head-studio .ihp-rainbow-tbl td {
  height: 4px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-head-studio .ihp-seg-r { background: #d32f2f !important; }
.invoice-head-studio .ihp-seg-g { background: #2e7d32 !important; }
.invoice-head-studio .ihp-seg-b { background: #1565c0 !important; }
.invoice-head-cash .ihp-name,
.invoice-head-cash .ihp-num {
  color: #111;
}
.invoice-head-cash .ihp-brand {
  background: #292929 !important;
  padding: 14px 16px !important;
}
.invoice-head-cash .ihp-brand > table { width: 100% !important; }
.invoice-head-cash .ihp-logo-wrap {
  background: #292929 !important;
  border-color: #e5b454 !important;
}
.invoice-head-cash .ihp-name,
.invoice-head-cash .ihp-loc { color: #e5b454 !important; }
.invoice-head-cash .ihp-sub,
.invoice-head-cash .ihp-sub .ihp-v { color: #fff !important; }
.invoice-head-cash .ihp-box-title {
  background: #e5b454 !important;
  color: #292929 !important;
}
.invoice-head-cash .ihp-box-body {
  background: #fffdf7 !important;
  color: #292929 !important;
}
.invoice-head-cash .ihp-box-tbl { border-color: #c99736 !important; }

/* Crédit : mêmes cadres, barre RVB plus nette */
.invoice-head-credit {
  padding-top: 0;
  border-top: 0;
}
.invoice-head-credit .ihp-outer {
  border-color: #333 !important;
}
.invoice-head-credit .ihp-name,
.invoice-head-credit .ihp-loc {
  color: #333 !important;
}
.invoice-head-credit .ihp-box,
.invoice-head-credit .ihp-box-tbl {
  border-color: #555 !important;
}
.invoice-head-credit .ihp-box-title {
  background: transparent !important;
  color: #5a5a5a !important;
  font-size: 22px;
}
.invoice-head-credit .ihp-seg-r { background: #d32f2f !important; }
.invoice-head-credit .ihp-seg-g { background: #388e3c !important; }
.invoice-head-credit .ihp-seg-b { background: #1976d2 !important; }
.invoice-head-credit .ihp-badge-credit {
  display: none;
}

.invoice-head-studio.invoice-head-proforma {
  border-top: 0;
  padding-top: 0;
}
.invoice-head-studio.invoice-head-proforma img.ihp-logo {
  width: 70px !important;
  height: 70px !important;
  max-width: 70px !important;
  max-height: 70px !important;
}
.invoice-head-proforma {
  border-top: 5px solid #1b3a4b;
  padding-top: 6px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-head-proforma .ihp-title,
.invoice-head-proforma .ihp-name,
.invoice-head-proforma .ihp-num,
.invoice-head-proforma .ihp-lbl {
  color: #1b3a4b !important;
}
.invoice-head-proforma .ihp-tag {
  color: #8a7348 !important;
}
.invoice-head-proforma .ihp-badge-proforma {
  display: inline-block;
  background: #1b3a4b !important;
  color: #f3e6c4 !important;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 3px 7px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 2px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-head-proforma img.ihp-logo {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
}

@media (max-width: 576px) {
  .ihp-top { flex-direction: column; }
  .ihp-title { font-size: 22px; }
  .ihp-parties { grid-template-columns: 1fr; }
}

@media print {
  .invoice-head-pro {
    break-inside: avoid;
  }
  html, body {
    background: #fff !important;
    background-image: none !important;
  }
  .invoice-container,
  .receipt-container,
  .facture-container,
  #print-sales,
  .table-responsive,
  .invoice-table-scroll {
    overflow: visible !important;
  }
  body:not(.paper-80mm):not(.paper-58mm) .ihp-logo,
  body:not(.paper-80mm):not(.paper-58mm) img.ihp-logo,
  body:not(.paper-80mm):not(.paper-58mm) .invoice-head-pro img,
  body:not(.paper-80mm):not(.paper-58mm) .logo-section img {
    width: 86px !important;
    height: 86px !important;
    max-width: 86px !important;
    max-height: 86px !important;
    object-fit: contain !important;
  }
}

/* ═══ Ticket thermique 80 mm / 58 mm ═══ */
body.paper-80mm,
body.paper-58mm {
  background: #fff !important;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0 !important;
  padding: 0 !important;
}
body.paper-80mm { max-width: 76mm; width: 76mm; }
body.paper-58mm { max-width: 54mm; width: 54mm; }

body.paper-80mm .invoice-container,
body.paper-80mm #print-sales,
body.paper-80mm #print-achat,
body.paper-80mm #print-retour,
body.paper-80mm #print-sortie,
body.paper-80mm #print-depense,
body.paper-80mm #print-commande-special,
body.paper-80mm .facture-container,
body.paper-80mm .receipt-container,
body.paper-58mm .invoice-container,
body.paper-58mm #print-sales,
body.paper-58mm #print-achat,
body.paper-58mm #print-retour,
body.paper-58mm #print-sortie,
body.paper-58mm #print-depense,
body.paper-58mm #print-commande-special,
body.paper-58mm .facture-container,
body.paper-58mm .receipt-container {
  max-width: 100% !important;
  width: 100% !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

body.paper-80mm .ihp-table,
body.paper-80mm .ihp-table tbody,
body.paper-80mm .ihp-table tr,
body.paper-80mm .ihp-table td,
body.paper-58mm .ihp-table,
body.paper-58mm .ihp-table tbody,
body.paper-58mm .ihp-table tr,
body.paper-58mm .ihp-table td {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body.paper-80mm .ihp-title,
body.paper-58mm .ihp-title {
  font-size: 15px !important;
  text-align: center !important;
  padding: 6px 0 4px !important;
  letter-spacing: 1px !important;
  white-space: normal !important;
}
body.paper-80mm .ihp-name,
body.paper-58mm .ihp-name {
  font-size: 14px !important;
}
body.paper-80mm .ihp-tag,
body.paper-58mm .ihp-tag {
  font-size: 13px !important;
  letter-spacing: 1px !important;
}
body.paper-80mm img,
body.paper-80mm img.ihp-logo,
body.paper-80mm .invoice-head-pro img,
body.paper-80mm .logo-section img,
body.paper-58mm img,
body.paper-58mm img.ihp-logo,
body.paper-58mm .invoice-head-pro img,
body.paper-58mm .logo-section img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  object-fit: contain !important;
}
body.paper-80mm .header-section,
body.paper-58mm .header-section {
  display: block !important;
  overflow: visible !important;
  width: 100% !important;
}
body.paper-80mm .header-left,
body.paper-80mm .logo-section,
body.paper-80mm .logo-company,
body.paper-80mm .company-title,
body.paper-80mm .invoice-title,
body.paper-80mm .invoice-section,
body.paper-80mm .receipt-title,
body.paper-58mm .header-left,
body.paper-58mm .logo-section,
body.paper-58mm .logo-company,
body.paper-58mm .company-title,
body.paper-58mm .invoice-title,
body.paper-58mm .invoice-section,
body.paper-58mm .receipt-title {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: left !important;
  margin: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
}
body.paper-80mm .company-title,
body.paper-58mm .company-title {
  margin-left: 0 !important;
}
body.paper-80mm .table-responsive,
body.paper-80mm .invoice-table-scroll,
body.paper-58mm .table-responsive,
body.paper-58mm .invoice-table-scroll {
  overflow: visible !important;
  width: 100% !important;
}
body.paper-80mm .products-table,
body.paper-80mm .totals-table,
body.paper-58mm .products-table,
body.paper-58mm .totals-table {
  font-size: 13px !important;
  width: 100% !important;
  table-layout: auto !important;
}
body.paper-58mm .products-table,
body.paper-58mm .totals-table {
  font-size: 13px !important;
}
body.paper-80mm .products-table th,
body.paper-80mm .products-table td,
body.paper-80mm .totals-table td,
body.paper-58mm .products-table th,
body.paper-58mm .products-table td,
body.paper-58mm .totals-table td {
  padding: 4px 3px !important;
  border: 1px solid #000 !important;
  background: none !important;
  color: #000 !important;
  word-wrap: break-word !important;
}
body.paper-80mm .products-table thead th,
body.paper-58mm .products-table thead th {
  background: #000 !important;
  color: #fff !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
body.paper-80mm .signatures,
body.paper-58mm .signatures {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 13px !important;
  gap: 8px !important;
}
body.paper-80mm .signature-line,
body.paper-58mm .signature-line {
  height: 16px !important;
}
body.paper-80mm .inv-footer,
body.paper-58mm .inv-footer,
body.paper-80mm .conversion-text,
body.paper-58mm .conversion-text {
  font-size: 13px !important;
  padding: 4px 0 !important;
  line-height: 1.3 !important;
}

/* Minimum de lisibilite pour toutes les ecritures des factures imprimees. */
#print-sales,
#print-sales * {
  font-size: max(13px, 1em) !important;
}

#print-sales .products-table thead th,
#print-sales .products-table td:first-child,
#print-sales .products-table td:nth-child(2),
#print-sales .products-table td:nth-child(4),
#print-sales .products-table td:nth-child(5) {
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

#print-sales .products-table tbody td,
#print-sales .totals-table td,
#print-sales .conversion-text,
#print-sales .notes-section,
#print-sales .ihp-box-body .ihp-v,
#print-sales .ihp-reference {
  font-weight: 400 !important;
}

#print-sales .products-table,
#print-sales .products-table tbody td,
#print-sales .totals-table,
#print-sales .totals-table td,
#print-sales .conversion-text,
#print-sales .notes-section {
  font-size: 13px !important;
  color: #3d5666 !important;
}

#print-sales.credit-invoice .products-table tbody td,
#print-sales.credit-invoice .totals-table td,
#print-sales.credit-invoice .conversion-text,
#print-sales.credit-invoice .notes-section {
  color: #24566b !important;
}

#print-sales.credit-invoice {
  background: #f4f8fa !important;
  border: 1px solid #9bb8c4 !important;
}

#print-sales.credit-invoice .invoice-head-studio .ihp-outer {
  background: #eef6f8 !important;
  border-color: #6f9aaa !important;
}

#print-sales.credit-invoice .invoice-head-studio .ihp-box-tbl {
  background: #ffffff !important;
  border-color: #4f8193 !important;
}

#print-sales.credit-invoice .invoice-head-studio .ihp-box-title {
  background: #0e5a72 !important;
  color: #ffffff !important;
}

#print-sales.credit-invoice .invoice-head-studio .ihp-box-body {
  background: #f8fcfd !important;
  color: #24566b !important;
}

#print-sales.credit-invoice .products-table thead th {
  background: #dbeef2 !important;
  border-bottom-color: #6f9aaa !important;
  color: #0e5a72 !important;
}

#print-sales.credit-invoice .totals-table td:first-child {
  background: #e6f1f4 !important;
}

@media print {
  #print-sales.credit-invoice,
  #print-sales.credit-invoice .inv-body,
  #print-sales.credit-invoice .invoice-head-studio .ihp-outer,
  #print-sales.credit-invoice .invoice-head-studio .ihp-box-title,
  #print-sales.credit-invoice .invoice-head-studio .ihp-box-body,
  #print-sales.credit-invoice .products-table thead th,
  #print-sales.credit-invoice .totals-table td:first-child {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #print-sales.credit-invoice {
    background-color: #f4f8fa !important;
  }
  #print-sales.credit-invoice .inv-body,
  #print-sales.credit-invoice .invoice-head-studio .ihp-outer {
    background-color: #eef6f8 !important;
  }
  #print-sales.credit-invoice .invoice-head-studio .ihp-box-title {
    background-color: #0e5a72 !important;
  }
  #print-sales.credit-invoice .invoice-head-studio .ihp-box-body {
    background-color: #f8fcfd !important;
  }
  #print-sales.credit-invoice .products-table thead th {
    background-color: #dbeef2 !important;
  }
  #print-sales.credit-invoice .totals-table td:first-child {
    background-color: #e6f1f4 !important;
  }
}

#print-sales.credit-invoice .products-table thead th,
#print-sales.credit-invoice .totals-table td:first-child {
  color: #0e5a72 !important;
}

/* Texte d'impression neutre et lisible, sans teinte bleue dans le contenu. */
#print-sales,
#print-sales .products-table,
#print-sales .products-table tbody td,
#print-sales .totals-table,
#print-sales .totals-table td,
#print-sales .conversion-text,
#print-sales .notes-section,
#print-sales .ihp-box-body,
#print-sales .ihp-box-body .ihp-v,
#print-sales .ihp-reference {
  color: #222 !important;
  font-size: 13px !important;
}

#print-sales.credit-invoice .products-table tbody td,
#print-sales.credit-invoice .totals-table td,
#print-sales.credit-invoice .conversion-text,
#print-sales.credit-invoice .notes-section,
#print-sales.credit-invoice .ihp-box-body,
#print-sales.credit-invoice .ihp-box-body .ihp-v,
#print-sales.credit-invoice .ihp-reference {
  color: #222 !important;
}
