#print-root {
  display: none;
}

@media print {
  #print-root {
    display: block !important;
  }

  @page {
    size: A4;
    margin: 8mm 10mm;
  }

  html,
  body,
  #root,
  .dashboard-main-container {
    height: auto !important;
    overflow: visible !important;
  }

  /* Hide everything on the screen except the print content */
  body * {
    visibility: hidden;
  }

  #print-root,
  #print-root * {
    visibility: visible;
  }

  #print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-height: 250mm;
    height: auto !important;
    color: #000;
    background: #fff;
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 8pt;
    box-sizing: border-box;
    padding-bottom: 60pt;
  }

  /* Hide UI elements that shouldn't be printed */
  .no-print,
  button,
  nav,
  aside,
  header,
  .floating-buttons {
    display: none !important;
  }

  /* Compact Medical Typography */
  h1 {
    font-size: 11pt;
    margin: 0;
  }

  h2 {
    font-size: 9.5pt;
    margin: 0;
  }

  h3 {
    font-size: 8.5pt;
    margin: 0;
  }

  p,
  div,
  li,
  td,
  th {
    font-size: 8pt;
    line-height: 1.1;
    color: #000;
    margin: 0;
    padding: 0;
  }

  /* ── Ultra-Compact Print Header ── */
  .print-header-container {
    margin-bottom: 4pt;
    border: 0.25pt solid #ddd;
    padding: 0;
  }

  .header-top-grid {
    display: grid;
    grid-template-columns: 80pt 1fr 50pt;
    border-bottom: 0.25pt solid #ddd;
    min-height: 40pt;
  }

  .logo-section {
    border-right: 0.25pt solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2pt;
  }

  .hospital-logo-img {
    max-height: 35pt;
    width: auto;
    object-fit: contain;
  }

  .hospital-section {
    text-align: center;
    padding: 2pt;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hospital-title {
    font-size: 13pt !important;
    font-weight: 800;
    margin: 0 !important;
    color: #000;
    line-height: 1.1;
  }

  .hospital-details {
    font-size: 7.5pt;
    margin-top: 1pt;
    line-height: 1;
    color: #444;
  }

  .hospital-details p {
    margin: 0;
    padding: 0;
  }

  .rx-section {
    border-left: 0.25pt solid #ddd;
    display: flex;
    align-items: center;
    justifyContent: center;
  }

  .rx-symbol {
    font-size: 24pt;
    font-family: serif;
    color: #444;
  }

  .rx-x {
    font-size: 12pt;
    font-family: serif;
    color: #444;
    margin-top: 6pt;
    margin-left: -3pt;
  }

  .report-title {
    text-align: center;
    font-weight: 800;
    font-size: 8.5pt;
    padding: 1pt 0;
    border-bottom: 0.25pt solid #ddd;
    background-color: #f8f8f8;
    -webkit-print-color-adjust: exact;
  }

  /* ── Ultra-Compact Patient Info Table ── */
  .patient-info-table-compact {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .patient-info-table-compact td {
    border: 0.25pt solid #ddd;
    padding: 2pt 4pt !important;
    font-size: 8pt;
    line-height: 1;
    vertical-align: middle;
    height: auto !important;
  }

  .cell-label {
    font-weight: 800;
    width: 50pt;
    background-color: #fafafa;
    text-transform: uppercase;
    font-size: 6.5pt !important;
    color: #666;
    -webkit-print-color-adjust: exact;
  }

  .cell-value {
    font-weight: 700;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ── Section Styles ── */
  .print-section {
    page-break-inside: avoid;
    margin-bottom: 2pt;
  }

  .print-section h3 {
    background-color: #f7f7f7;
    padding: 2pt 4pt;
    border-top: 0.25pt solid #ddd;
    border-bottom: 0.25pt solid #ddd;
    margin-top: 4pt;
    margin-bottom: 1pt;
    font-size: 8.5pt;
    font-weight: 800;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact;
  }

  /* Clinical Tables Standard */
  table {
    width: 100%;
    border-collapse: collapse;
  }

  th,
  td {
    border: 0.25pt solid #ddd;
    padding: 2pt 4pt;
    text-align: left;
    font-size: 8pt;
    line-height: 1;
  }

  th {
    background-color: #fafafa !important;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
  }

  .print-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4pt;
  }

  /* ── Digital Signature Section ── */
  .print-signature-section {
    position: absolute;
    bottom: 0;
    right: 10mm;
    width: 150pt;
  }

  .signature-content {
    text-align: center;
  }

  .signature-line {
    border-top: 0.5pt solid #000;
    margin-bottom: 4pt;
  }

  .consultant-name {
    font-size: 9pt;
    font-weight: 800;
    text-transform: uppercase;
  }

}