@media print {
  @page {
    size: landscape;
    margin: 0.5in;
  }

  /* Hide interactive chrome */
  .no-print {
    display: none !important;
  }

  /* Reset body to block flow for print */
  body {
    display: block !important;
    height: auto !important;
    background: white !important;
    font-size: 9pt;
  }

  /* Make the main content area block so the grid flows naturally */
  main {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* The outer flex container for the period page */
  .flex.flex-col.h-full {
    display: block !important;
    height: auto !important;
  }

  /* The split-layout flex row */
  .flex.flex-1.min-h-0 {
    display: block !important;
    height: auto !important;
  }

  /* Right panel: let the grid fill the full page width */
  .flex-1.overflow-auto {
    display: block !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* Make table fill the page */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8pt;
  }

  /* Sticky positioning doesn't apply in print */
  th, td {
    position: static !important;
  }

  /* Keep borders visible in B&W */
  th, td {
    border: 1px solid #aaa !important;
  }

  /* Strip background colors — B&W friendly */
  .bg-green-50, .bg-yellow-50, .bg-red-50 {
    background: white !important;
  }

  /* Preserve the role group header rows */
  td[colspan] {
    background: #eee !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Closed day columns — solid gray in print */
  .bg-gray-200, .bg-gray-300 {
    background: #ccc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Don't break staff rows across pages */
  tr {
    break-inside: avoid;
  }
}
