@media print {
  body {
    padding: 3rem;
  }
  /* Ukryj nawigację i elementy interaktywne */
  nav, .navbar, .offcanvas, .modal, .footer, .topcontrol,
  .btn, .form-control, .form-select, .form-check,
  .d-print-none, .d-none {
    display: none !important;
  }
  
  /* Pokaż elementy do wydruku */
  .d-print-inline {
    display: inline !important;
  }
  
  /* Resetuj tło i kolory */
  * {
    background: white !important;
    color: black !important;
  }
  
  /* Usuń cienie i efekty */
  .card, .container, .row, .col-md-* {
    box-shadow: none !important;
    border: none !important;
  }
  
  /* Ustaw layout na jednokolumnowy */
  .container, .container-fluid {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .col-md-7, .col-md-5, .col-md-8, .col-md-4 {
    width: 100% !important;
    float: none !important;
    margin-bottom: 20px !important;
  }
  
  /* Stylizuj tekst */
  h1, h2, h3, h4, h5, h6 {
    color: black !important;
    page-break-after: avoid !important;
    margin-bottom: 15px !important;
  }
  
  p {
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
  }
  
  /* Stylizuj tabele */
  .table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 20px !important;
  }
  
  .table th, .table td {
    border: 1px solid #000 !important;
    padding: 8px !important;
    text-align: left !important;
  }
  
  .table th {
    background: #f8f9fa !important;
    font-weight: bold !important;
  }
  
  /* Stylizuj obrazy */
  img {
    max-width: 100% !important;
    height: auto !important;
    margin: 10px 0 !important;
  }
  
  /* Dodaj informacje o stronie */
  .container.d-print-inline {
    border-top: 2px solid #000 !important;
    padding-top: 10px !important;
    margin-top: 20px !important;
    font-size: 12px !important;
  }
  
  /* Ustaw marginesy strony */
  @page {
    margin: 1.5cm;
    size: A4;
  }
  
  /* Unikaj łamania stron w niewłaściwych miejscach */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid !important;
  }
  
  .table {
    page-break-inside: avoid !important;
  }
}
