/* =====================================================
   Rehan Oncology — print stylesheet
   Used for prescriptions and receipts printed on
   pre-printed letterhead paper. Margins come from
   inline CSS vars set per-document from `settings` table.
   ===================================================== */

@media print {
  @page {
    size: A4;
    /* Page margin is set per-print via inline @page rule (see prescription print template) */
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 12.5pt;
    line-height: 1.45;
    margin: 0; padding: 0;
  }

  /* Hide everything chrome-y on print */
  .no-print, .site-header, .site-header__top, .site-header__nav,
  .topbar-contact, .topbar-link, .topbar-cta, .nav-toggle, .nav-close, .nav-backdrop,
  .wa-float, .eeat,
  .site-footer, .admin-shell .admin-side, .admin-topbar,
  .nav, nav, button, .btn, .flash, .rx-preview .margin-guide {
    display: none !important;
  }

  .print-only { display: block !important; }

  /* The actual printable area fills the page (margins handled by @page) */
  .print-sheet {
    width: 100%;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  .rx-header, .rcpt-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 12pt;
    padding-bottom: 8pt;
    border-bottom: 1pt solid #333;
  }
  .rx-header h2, .rcpt-header h2 {
    font-family: 'Georgia', serif; font-size: 14pt; margin: 0; font-weight: 600;
  }
  .rx-header .meta, .rcpt-header .meta {
    font-size: 10pt; color: #333; text-align: right;
  }

  .patient-block {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8pt 16pt;
    margin-bottom: 12pt;
    font-size: 11pt;
  }
  .patient-block strong { font-weight: 700; }

  .section-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10pt;
    color: #444;
    margin: 10pt 0 4pt;
    border-bottom: 0.5pt solid #999;
    padding-bottom: 2pt;
  }

  .rx-meds {
    width: 100%;
    border-collapse: collapse;
    font-size: 11pt;
    margin-bottom: 10pt;
  }
  .rx-meds th, .rx-meds td {
    text-align: left;
    padding: 4pt 6pt;
    vertical-align: top;
    border-bottom: 0.5pt dotted #999;
  }
  .rx-meds th {
    font-weight: 700; font-size: 9.5pt; text-transform: uppercase;
    border-bottom: 1pt solid #555;
  }
  .rx-meds .drug { font-weight: 700; }
  .rx-meds .instr { font-style: italic; color: #333; }

  .rx-advice, .rx-followup { margin-top: 8pt; font-size: 11pt; }
  .rx-followup strong { font-weight: 700; }

  .rx-signature {
    margin-top: 30pt;
    text-align: right;
    font-size: 11pt;
  }
  .rx-signature .line {
    display: inline-block;
    border-top: 0.5pt solid #333;
    min-width: 200pt;
    padding-top: 4pt;
  }

  /* Receipt-specific */
  .rcpt-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5pt;
    margin-top: 8pt;
  }
  .rcpt-items th, .rcpt-items td {
    text-align: left; padding: 5pt 8pt;
    border-bottom: 0.5pt dotted #999;
  }
  .rcpt-items th { font-weight: 700; text-transform: uppercase; font-size: 9.5pt; border-bottom: 1pt solid #555; }
  .rcpt-items td.amt, .rcpt-items th.amt { text-align: right; }
  .rcpt-total {
    margin-top: 8pt; text-align: right;
    font-size: 13pt; font-weight: 700;
  }
  .rcpt-pay { margin-top: 10pt; font-size: 11pt; }
}

/* On-screen draft of what a print page looks like (visible only in admin) */
@media screen {
  .print-only { display: none; }
}
