.report-card-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(11, 37, 58, 0.08);
  padding: 26px 30px;
  width: 100%;
  max-width: 740px;
  min-height: 1020px;
  max-height: 1045px;
  margin: 0 auto;
  border: 1.5px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #0f172a;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  page-break-after: avoid !important;
  break-after: avoid !important;
}

/* Watermark & Borders */
.report-card-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #10b981 0%, #00b4d8 50%, #0b253a 100%);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

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

.report-logo {
  height: 48px;
  width: auto;
}

.report-brand-text h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0b253a;
  margin-bottom: 2px;
  line-height: 1.2;
}

.report-brand-text p {
  font-size: 0.78rem;
  color: #00b4d8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.report-title-badge {
  text-align: right;
}

[dir="rtl"] .report-title-badge {
  text-align: left;
}

.report-title-badge h2 {
  font-size: 1.15rem;
  color: #0b253a;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

.report-title-badge .report-period {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 3px;
}

/* Student Information Strip */
.report-student-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1.5px solid #e2e8f0;
}

.strip-item label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.strip-item span {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92rem;
}

/* Scores & Performance Grid */
.report-metrics-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}

.metric-box.featured {
  background: linear-gradient(135deg, #0b253a 0%, #164267 100%);
  color: #ffffff;
  border: none;
}

.metric-box.featured .metric-lbl {
  color: #93c5fd;
}

.metric-box.featured .metric-val {
  color: #ffffff;
}

.metric-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 3px;
}

.metric-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: #0b253a;
  line-height: 1.1;
}

.metric-val.green {
  color: #10b981;
}

.metric-grade-pill {
  display: inline-block;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 2px 10px;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  margin-top: 3px;
}

/* Skills Competency Progress Bars */
.skills-section {
  margin-bottom: 16px;
}

.skills-section h4 {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0b253a;
  margin-bottom: 10px;
  border-bottom: 1.5px solid #f1f5f9;
  padding-bottom: 5px;
}

.skill-row {
  margin-bottom: 10px;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.skill-bar-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #00b4d8, #10b981);
}

/* Feedback & Comments */
.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.feedback-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}

.feedback-box h5 {
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #0b253a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-box p {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.remarks-box {
  margin-bottom: 14px !important;
  padding: 12px 14px;
}

/* Official Signature Seal */
.report-footer-seal {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1.5px dashed #cbd5e1;
  padding-top: 14px;
  margin-top: 10px;
}

.seal-signature-area {
  text-align: center;
}

.signature-stamp {
  font-family: 'Brush Script MT', cursive, sans-serif;
  font-size: 1.5rem;
  color: #00b4d8;
  line-height: 1;
  margin-bottom: 2px;
}

.signature-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0b253a;
}

.signature-sub {
  font-size: 0.7rem;
  color: #64748b;
}

.seal-badge {
  border: 1.5px solid #10b981;
  color: #10b981;
  padding: 6px 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Print Overrides - Guaranteed Single-Page A4 Precision */
@media print {
  @page {
    size: A4 portrait;
    margin: 4mm 6mm;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10.5pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide everything unrelated to the report card */
  .navbar,
  .portal-bar,
  .admin-sidebar,
  .admin-page-header,
  .admin-mobile-nav,
  .whatsapp-float,
  .btn,
  button,
  .no-print,
  .modal-overlay,
  .modal-close-btn,
  #teacherReportCardForm,
  #reportCardGeneratorForm,
  .report-form-column,
  .card:not(.report-card-wrapper) {
    display: none !important;
  }

  /* Unset multi-column grid containers so report card fills full printable width */
  .admin-layout,
  .admin-main,
  .admin-content,
  #adminTab-reports,
  #assistantTab-reportcard,
  #adminTab-reports > div,
  #assistantTab-reportcard > div,
  #teacherReportCardPreviewArea,
  #reportCardPreviewArea {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Hide the form container column */
  #adminTab-reports > div > div:first-child,
  #assistantTab-reportcard > div > div:first-child {
    display: none !important;
  }

  /* Report Card Container - Guaranteed 1-Page Fit */
  .report-card-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    visibility: visible !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 195mm !important;
    min-height: 272mm !important;
    max-height: 282mm !important;
    margin: 0 auto !important;
    padding: 20px 24px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    overflow: hidden !important;
  }

  .report-card-wrapper::before {
    height: 6px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .report-header {
    border-bottom: 2px solid #e2e8f0 !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
  }

  .report-logo {
    height: 46px !important;
  }

  .report-brand-text h3 {
    font-size: 1.22rem !important;
    margin-bottom: 2px !important;
  }

  .report-brand-text p {
    font-size: 0.72rem !important;
  }

  .report-title-badge h2 {
    font-size: 1.05rem !important;
  }

  .report-title-badge .report-period {
    font-size: 0.78rem !important;
  }

  /* Student Information Strip */
  .report-student-strip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    margin-bottom: 14px !important;
  }

  .strip-item label {
    font-size: 0.65rem !important;
    margin-bottom: 2px !important;
  }

  .strip-item span {
    font-size: 0.85rem !important;
  }

  /* Metrics Grid */
  .report-metrics-grid {
    display: grid !important;
    grid-template-columns: 1.2fr repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .metric-box {
    padding: 10px 8px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
  }

  .metric-box.featured {
    background: #0b253a !important;
    color: #ffffff !important;
    border: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .metric-lbl {
    font-size: 0.66rem !important;
    margin-bottom: 3px !important;
  }

  .metric-val {
    font-size: 1.5rem !important;
    line-height: 1.1 !important;
  }

  .metric-grade-pill {
    font-size: 0.85rem !important;
    padding: 1px 8px !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Skills Section */
  .skills-section {
    margin-bottom: 12px !important;
  }

  .skills-section h4 {
    font-size: 0.8rem !important;
    margin-bottom: 6px !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .skill-row {
    margin-bottom: 6px !important;
  }

  .skill-header {
    font-size: 0.75rem !important;
    margin-bottom: 2px !important;
  }

  .skill-bar-track {
    height: 6px !important;
    background: #e2e8f0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .skill-bar-fill {
    background: #00b4d8 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Feedback Grid */
  .feedback-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-bottom: 10px !important;
  }

  .feedback-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
  }

  .feedback-box h5 {
    font-size: 0.78rem !important;
    margin-bottom: 3px !important;
  }

  .feedback-box p {
    font-size: 0.74rem !important;
    line-height: 1.35 !important;
    color: #334155 !important;
  }

  .remarks-box {
    margin-bottom: 12px !important;
  }

  /* Footer & Official Seal */
  .report-footer-seal {
    border-top: 1.5px dashed #cbd5e1 !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
  }

  .signature-stamp {
    font-size: 1.3rem !important;
    color: #00b4d8 !important;
    margin-bottom: 2px !important;
  }

  .signature-name {
    font-size: 0.78rem !important;
  }

  .signature-sub {
    font-size: 0.66rem !important;
  }

  .seal-badge {
    padding: 5px 12px !important;
    font-size: 0.68rem !important;
    border: 1.5px solid #10b981 !important;
    color: #10b981 !important;
    border-radius: 6px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Student Portal PDF Reports Tab Styles */
.student-reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.student-report-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(11, 37, 58, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.student-report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 50%, #0b253a 100%);
}

.student-report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 37, 58, 0.1);
  border-color: #cbd5e1;
}

.student-report-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.student-report-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.student-report-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 3px;
}

.student-report-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.student-report-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 14px;
  text-align: center;
}

.student-report-metric-box label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.student-report-metric-box span {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-navy);
}

.student-report-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

