/* print-a4.css */
@media print {
  /* Paramètres de la page A4 */
  @page {
    size: A4;
    margin: 20mm; /* Marges de 2 cm sur tous les côtés */
  }

  body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif; /* Police plus adaptée pour une facture A4 */
    font-size: 12pt; /* Taille de police plus grande et lisible */
    line-height: 1.5;
    color: #000;
  }

  /* Afficher uniquement les éléments nécessaires pour l'impression */
  header, footer, aside, nav, form,
  .menu, .hero, .adslot, .d-print-none,
  .btn, .no-print {
    display: none !important;
  }

  /* Styles de mise en page et de texte de base */
  .d-flex { display: flex !important; }
  .justify-content-between { justify-content: space-between !important; }
  .justify-content-center { justify-content: center !important; }
  .align-items-center { align-items: center !important; }
  .text-right { text-align: right !important; }
  .text-left { text-align: left !important; }
  .text-center { text-align: center !important; }
  .mt-1 { margin-top: .5rem !important; }
  .mb-1 { margin-bottom: .5rem !important; }
  .p-1 { padding: .5rem !important; }
  .text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Styles de mise en forme des titres */
  h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    padding: 0;
    font-weight: bold;
    text-align: left;
  }
  h1 { font-size: 24pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }

  p {
    margin: 0 0 .5rem 0;
    padding: 0;
  }

  .bold {
    font-weight: bold;
  }

  .info {
    font-size: 12pt;
    margin-bottom: 20px;
  }

  hr {
    border: none;
    border-top: 1px solid #ccc; /* Bordure solide pour une meilleure lisibilité */
    margin: 15px 0;
  }

  /* Styles pour les tableaux */
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12pt;
    margin-bottom: 20px;
  }

  table th, table td {
    padding: 8px 10px; /* Espacement accru pour une meilleure lisibilité */
    text-align: left;
    border: 1px solid #ddd;
  }

  table th {
    background-color: #f2f2f2;
  }

  /* Styles pour les sections totales */
  .total-line {
    border-top: 2px solid #000; /* Ligne plus épaisse pour le total */
    padding-top: 10px;
    margin-top: 10px;
    font-size: 14pt;
    font-weight: bold;
  }

  /* Cache les liens et les éléments qui n'ont pas de sens en impression */
  a::after, .no-print-element, .fab-actions, .position-fixed {
    content: "" !important;
    display: none !important;
  }

  /* Footer spécifique pour les factures imprimées */
  .invoice main::after, main.invoice::after {
    content: "Cette facture est générée par ordinateur et ne nécessite pas de signature.";
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 10pt;
    color: #666;
  }

  /* Optimisations spécifiques pour les rapports WSM */
  .report-container, .report-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .badge {
    border: 1px solid #333 !important;
    color: #000 !important;
    background: transparent !important;
  }
}

/* Styles de base pour le ticket en A4 pour l'affichage à l'écran */
.invoice {
  font-family: 'Arial', sans-serif;
  font-size: 12pt;
  width: 210mm; /* Largeur d'une page A4 */
  min-height: 297mm; /* Hauteur d'une page A4 */
  padding: 20mm;
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.invoice-header {
  text-align: center;
  margin-bottom: 30px;
}

.invoice-body {
  padding: 0;
}
.invoice-footer {
  margin-top: 40px;
  text-align: right;
}

.text-danger {
  color: red;
}