/* Professional Print Report Styles */
@media print {
  /* Reset and base styles */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-sizing: border-box;
  }

  @page {
    size: A4;
    margin: 1in 0.75in;
    @top-center {
      content: "Shift Handover Report";
    }
    @bottom-center {
      content: "Page " counter(page) " of " counter(pages);
    }
  }

  /* Hide all UI elements */
  .sidebar,
  .topbar,
  .controls,
  .section-toolbar,
  .no-print,
  .btn,
  button,
  .fa,
  select,
  input[type="button"],
  input[type="submit"] {
    display: none !important;
  }

  /* Page setup */
  html, body {
    background: white !important;
    color: #000 !important;
    font-family: 'Times New Roman', serif;
    font-size: 11pt;
    line-height: 1.4;
    margin: 0;
    padding: 0;
  }

  .app {
    display: block !important;
    grid-template-columns: none !important;
  }

  .main {
    padding: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Report Header */
  .print-header {
    display: block !important;
    text-align: center;
    border-bottom: 2pt solid #000;
    padding-bottom: 12pt;
    margin-bottom: 18pt;
  }

  .print-header h1 {
    font-size: 18pt;
    font-weight: bold;
    margin: 0 0 6pt 0;
    text-transform: uppercase;
    letter-spacing: 1pt;
  }

  .print-header .meta-line {
    font-size: 12pt;
    margin: 3pt 0;
  }

  .print-header .meta-line strong {
    font-weight: bold;
  }

  /* KPI Summary Box */
  .print-summary {
    display: block !important;
    border: 1pt solid #000;
    padding: 8pt;
    margin-bottom: 18pt;
    background: #f8f8f8 !important;
  }

  .print-summary h2 {
    font-size: 12pt;
    font-weight: bold;
    margin: 0 0 6pt 0;
    text-align: center;
  }

  .print-summary-grid {
    display: table !important;
    width: 100%;
    border-collapse: collapse;
  }

  .print-summary-row {
    display: table-row !important;
  }

  .print-summary-cell {
    display: table-cell !important;
    padding: 3pt 6pt;
    border: 0.5pt solid #666;
    vertical-align: top;
  }

  .print-summary-label {
    font-weight: bold;
    font-size: 10pt;
  }

  .print-summary-value {
    font-size: 11pt;
  }

  /* Sections */
  .print-section {
    break-inside: avoid;
    margin-bottom: 12pt;
    border: 1pt solid #000;
    padding: 6pt;
  }

  .print-section-title {
    font-size: 12pt;
    font-weight: bold;
    margin: 0 0 6pt 0;
    padding-bottom: 3pt;
    border-bottom: 0.5pt solid #666;
  }

  .print-section-content {
    font-size: 11pt;
    line-height: 1.5;
  }

  /* Field type specific styles */
  .print-textarea {
    white-space: pre-wrap;
    font-family: 'Times New Roman', serif;
  }

  .print-text {
    font-weight: normal;
    border-bottom: 0.5pt dotted #666;
    min-height: 12pt;
    display: inline-block;
    min-width: 200pt;
  }

  .print-checkbox-wrapper {
    display: block !important;
    margin: 3pt 0;
  }

  .print-checkbox {
    display: inline-block !important;
    width: 10pt;
    height: 10pt;
    border: 1pt solid #000;
    margin-right: 6pt;
    position: relative;
    vertical-align: middle;
  }

  .print-checkbox.checked::after {
    content: "✓";
    position: absolute;
    left: 1pt;
    top: -1pt;
    font-size: 8pt;
    font-weight: bold;
  }

  .print-checkbox-label {
    display: inline;
    vertical-align: middle;
  }

  .print-checklist {
    margin: 0;
    padding: 0;
  }

  .print-checklist-item {
    display: block;
    margin: 3pt 0;
    padding-left: 0;
  }

  .print-dropdown {
    font-weight: bold;
    border: 1pt solid #000;
    padding: 2pt 4pt;
    display: inline-block;
    min-width: 80pt;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6pt 0;
    font-size: 10pt;
  }

  .print-table th,
  .print-table td {
    border: 1pt solid #000;
    padding: 3pt 4pt;
    text-align: left;
    vertical-align: top;
  }

  .print-table th {
    background: #e8e8e8 !important;
    font-weight: bold;
  }

  .print-table td {
    min-height: 14pt;
  }

  /* Footer */
  .print-footer {
    display: block !important;
    margin-top: 18pt;
    padding-top: 6pt;
    border-top: 1pt solid #000;
    font-size: 9pt;
    text-align: center;
  }

  /* Overview Notes */
  .print-overview {
    border: 1pt solid #000;
    padding: 8pt;
    margin-bottom: 12pt;
  }

  .print-overview h2 {
    font-size: 12pt;
    font-weight: bold;
    margin: 0 0 6pt 0;
  }

  .print-overview-content {
    font-size: 11pt;
    line-height: 1.5;
    white-space: pre-wrap;
    min-height: 36pt;
  }

  /* Signatures */
  .print-signatures {
    display: block !important;
    margin-top: 18pt;
    page-break-inside: avoid;
  }

  .print-signatures h3 {
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 12pt;
  }

  .print-signature-grid {
    display: table !important;
    width: 100%;
  }

  .print-signature-row {
    display: table-row !important;
  }

  .print-signature-cell {
    display: table-cell !important;
    width: 50%;
    padding: 6pt 12pt;
    vertical-align: top;
  }

  .print-signature-line {
    border-bottom: 1pt solid #000;
    height: 24pt;
    margin-bottom: 3pt;
  }

  .print-signature-label {
    font-size: 10pt;
    text-align: center;
  }

  /* Page breaks */
  .print-section {
    page-break-inside: avoid;
  }

  .print-signatures {
    page-break-inside: avoid;
  }

  /* Ensure inputs show their values */
  input,
  select,
  textarea {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    color: #000 !important;
  }

  input[type="checkbox"] {
    display: none !important;
  }

  /* Hide empty sections */
  .print-section:empty {
    display: none !important;
  }
}