/* ==========================================================================
   Life Diagnostic Centre Ltd. - Detailed Candidate Report Stylesheet
   Strict 100% Single-Page A4 Precision Reproduction (210mm x 297mm)
   ========================================================================== */

* {
  box-sizing: border-box;
}

@page {
  size: 210mm 297mm;
  margin: 0mm;
}

body.print-mode {
  margin: 0;
  padding: 24px 0;
  background-color: #4b5257;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body.print-mode .report-sheet-container {
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

@media print {
  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .no-print {
    display: none !important;
  }
  .report-sheet-container {
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
  }
}

/* ==========================================================================
   Main A4 Report Sheet Container (Strict 210mm x 297mm)
   ========================================================================== */
.report-sheet-container {
  width: 210mm;
  height: 297mm;
  max-height: 297mm;
  margin: 0 auto;
  padding: 10mm 13mm 9mm 13mm;
  background-color: #ffffff;
  box-sizing: border-box;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: #111111;
  font-size: 8.8px;
  line-height: 1.42;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  page-break-after: avoid !important;
  page-break-inside: avoid !important;
}

/* Screen preview wrapper styles */
.portal-report-frame {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  background: #525659;
  padding: 20px 10px;
  border-radius: 8px;
}

.portal-report-frame .report-sheet-container {
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  transform-origin: top center;
}

/* ==========================================================================
   1. Clinic Official Header (Dynamic or Banner Mode)
   ========================================================================== */
.report-header-banner-box {
  width: 100%;
  max-height: 78px;
  overflow: hidden;
  margin-bottom: 6px;
  border-radius: 3px;
}

.report-header-banner-img {
  width: 100%;
  max-height: 78px;
  object-fit: contain;
  display: block;
}

.report-clinic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  width: 100%;
  padding-bottom: 3px;
}

.clinic-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clinic-logo-frame {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clinic-logo-pic {
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
}

.clinic-title-texts {
  display: flex;
  flex-direction: column;
}

.clinic-main-name {
  font-size: 23px;
  font-weight: 900;
  color: #c0014e;
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.3px;
}

.clinic-tagline-text {
  font-size: 9px;
  font-weight: 700;
  color: #334155;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.clinic-address-group {
  text-align: right;
  max-width: 290px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.clinic-contact-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 5px;
  font-size: 8.5px;
  color: #222222;
  line-height: 1.35;
}

.contact-svg-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  margin-top: 1px;
  fill: #c0014e;
}

.phone-row {
  font-weight: 700;
  color: #111111;
}

/* ==========================================================================
   2. Report Title Banner
   ========================================================================== */
.report-title-banner {
  background-color: #c0014e;
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.8px;
  padding: 4.5px 0;
  border-radius: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* ==========================================================================
   3. Metadata Strip (Ref No, Slip, GHC, Dates)
   ========================================================================== */
.report-meta-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff7fa;
  border: 1px solid #f0d5e2;
  border-radius: 4px;
  padding: 4px 14px;
  margin-bottom: 7px;
}

.meta-strip-col {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.strip-label {
  font-size: 8.5px;
  color: #444444;
  font-weight: 500;
}

.strip-val {
  font-size: 9px;
  color: #000000;
  font-weight: 800;
}

/* ==========================================================================
   4. Candidate Information Section
   ========================================================================== */
.candidate-section-header {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 4px 0 6px 0;
  width: 100%;
}

.candidate-section-header::before,
.candidate-section-header::after {
  content: '';
  flex: 1;
  border-bottom: 0.8px solid #d1d5db;
}

.section-rule-title {
  padding: 0 12px;
  font-size: 10px;
  font-weight: 700;
  color: #111111;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.candidate-info-container {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 0.8px solid #cbd5e1;
  margin-bottom: 7px;
  width: 100%;
}

.candidate-photo-frame {
  width: 82px;
  height: 98px;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  flex-shrink: 0;
  background-color: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.candidate-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-meta-table {
  flex: 1;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.candidate-meta-table td {
  padding: 3px 6px 4px 0;
  vertical-align: top;
}

.c-cell {
  display: flex;
  flex-direction: column;
}

.c-label {
  font-size: 7.8px;
  color: #222222;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 2px;
}

.c-val {
  font-size: 9px;
  color: #000000;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

/* ==========================================================================
   5. Two-Column Main Examination Grid (Fills A4 Page)
   ========================================================================== */
.report-body-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  flex-grow: 1;
}

.report-col {
  width: calc(50% - 12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Group Headers & Underline rules */
.exam-group {
  margin-bottom: 6px;
}

.group-header-line {
  font-size: 9.2px;
  font-weight: 700;
  text-transform: uppercase;
  color: #000000;
  border-bottom: 0.8px solid #cbd5e1;
  padding-bottom: 1.5px;
  margin-top: 5px;
  margin-bottom: 3px;
  letter-spacing: 0.2px;
}

.sub-header-title {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #000000;
  margin-top: 4px;
  margin-bottom: 2px;
}

.sub-sub-header {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: #000000;
  margin-top: 2.5px;
  margin-bottom: 1.5px;
}

.mt-0 {
  margin-top: 0 !important;
}

/* Key-Value Pair Layouts */
.exam-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 2px;
}

.exam-table td {
  padding: 1.5px 0;
  vertical-align: baseline;
  line-height: 1.35;
}

.exam-table td.e-label {
  font-size: 8.2px;
  color: #111111;
  font-weight: 400;
  white-space: nowrap;
}

.exam-table td.e-val {
  font-size: 8.6px;
  color: #000000;
  font-weight: 700;
  white-space: nowrap;
  text-align: left;
}

.exam-pair-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2.5px;
  line-height: 1.38;
}

.exam-pair-row .pair-item {
  width: 48%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.exam-pair-row .pair-item.pair-compact {
  justify-content: flex-start;
  gap: 8px;
}

.exam-single-row {
  display: flex;
  justify-content: space-between;
  width: 48%;
  margin-bottom: 2.5px;
  line-height: 1.38;
}

.e-label {
  font-size: 8.4px;
  color: #111111;
  font-weight: 400;
}

.e-val {
  font-size: 8.6px;
  color: #000000;
  font-weight: 700;
  text-align: right;
}

/* ==========================================================================
   Remarks & Fitness Verdict Section
   ========================================================================== */
.remarks-section {
  margin-top: 5px;
  margin-bottom: 3px;
  width: 100%;
}

.remarks-header-row {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 4px;
  width: 100%;
}

.remarks-header-row::before,
.remarks-header-row::after {
  content: '';
  flex: 1;
  border-bottom: 0.8px solid #cbd5e1;
}

.remarks-header-title {
  padding: 0 10px;
  font-size: 9.2px;
  font-weight: 700;
  color: #111111;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.remarks-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 1px 0;
}

.fit-shield-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.remarks-text {
  font-size: 8.4px;
  line-height: 1.35;
  color: #000000;
}

.candidate-mention-name {
  font-weight: 700;
}

/* ==========================================================================
   Doctor Sign-Off & Wide Barcode (Inside Right Column)
   ========================================================================== */
.col-signoff-barcode-block {
  margin-top: 6px;
  width: 100%;
}

.signoff-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: flex-end;
  margin-bottom: 5px;
}

.signoff-col-name {
  width: 63%;
  display: flex;
  flex-direction: column;
}

.signoff-col-sig {
  width: 32%;
  display: flex;
  flex-direction: column;
}

.sig-val-space {
  height: 24px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.sig-val-right {
  justify-content: center;
}

.doctor-named-text {
  font-size: 8.8px;
  font-weight: 700;
  color: #000000;
  line-height: 1.2;
}

.doc-sig-pic {
  max-height: 24px;
  max-width: 100%;
  object-fit: contain;
}

.sig-underline {
  width: 100%;
  border-bottom: 0.9px solid #000000;
  margin-bottom: 2px;
}

.sig-label-text {
  font-size: 8.2px;
  color: #111111;
  font-weight: 500;
  line-height: 1.2;
}

.col-barcode-wrapper {
  width: 100%;
  display: block;
  margin-top: 4px;
}

.barcode-svg-img {
  height: 34px;
  width: 100%;
  display: block;
  object-fit: fill;
}

/* ==========================================================================
   6. Official Clinic Footer
   ========================================================================== */
.report-clinic-footer {
  text-align: center;
  padding-top: 4px;
  margin-top: 4px;
  width: 100%;
}

.footer-divider-rule {
  border-bottom: 0.8px solid #cbd5e1;
  margin-bottom: 3.5px;
}

.footer-clinic-motto {
  font-size: 8.2px;
  font-weight: 800;
  color: #c0014e;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Helper utilities */
.text-bold {
  font-weight: 700 !important;
}

.font-num {
  font-family: Arial, sans-serif;
  letter-spacing: 0.2px;
}
