@media print {
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Persistent header + footer */
  .header, .footer {
    position: fixed;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
  }

  .header {
    top: 0;
    border-bottom: 2px solid var(--red);
  }

  .footer {
    bottom: 0;
    border-top: 1px solid var(--navy);
    text-align: center;
    font-size: 11px;
    color: var(--navy);
    padding: 3px 0;
  }

  /* Space for them so content doesn’t overlap */
  .container {
    margin-top: calc(var(--header-h) + 12px);
    margin-bottom: calc(var(--footer-h) + 12px);
    box-shadow: none !important; /* remove card shadow for print */
    border-radius: 0 !important;
    overflow: visible !important;
  }

    /* Table tweaks: repeat header each page and disable sticky in print */
    thead { display: table-header-group; }
    .table thead th { position: static !important; }

  /* Optional link cleanup */
  a {
    color: black;
    text-decoration: none;
  }

  /* Repeat table headers automatically */
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }

  /* 4) Avoid row splits across pages (helps readability) */
  .table { page-break-inside: auto; }
  .table tr { page-break-inside: avoid; page-break-after: auto; }

  @page {
    margin: 10mm;
  }
}
