body
{
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  /* padding: 20px; */
}

.report-card
{
  max-width: 900px;
  min-height: 1120px;
  margin: 20px auto;
  background: #f4f4cf;
  padding: 20px;
  border: 2px solid #000;
}

/* .header
{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
 
  padding-bottom: 10px;
}

.logo
{
  display: flex;
  align-items: center;
}


.logo img
{
  width: 130px;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.school-details
{
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 20px;
} */

.header
{
  display: flex;
  justify-content: center;
  /* center whole group */
  align-items: center;
  gap: 90px;
  /* space between logo & text */
  padding-bottom: 10px;
}

/* LOGO */
.logo
{
  flex: 0 0 auto;
  /* do NOT grow */
}

.logo img
{
  width: 90px;
  height: 100px;
  display: block;
}

.school-details
{
  flex: 0 0 auto;
  text-align: center;
  margin: 0;
}

.school-details p
{
  margin: 2px 0;
}

.address{
  font-size: 20px;
  
}

.address-line
{
  width: 100%;
  margin: 5px auto;
  border: 0;
  border-top: 2px solid #f6e018;
}

.sname
{
  font-weight: 1000;
  font-size: 200%;
  color: #a30202;
  margin-bottom: 5px;
}

.affiliation
{
  font-size: 16px;
  color: #820000;
}

.term-box
{
  border: 3px solid #e2cc3c;
  text-align: center;
  font-weight: bold;
  background-color: #fdf3b0;
  padding: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 16px;
}

.student-info
{
  display: flex;
  justify-content: space-evenly;
  margin: 15px 0;
}

.student-info p
{
  margin: 4px 0;
}

.section-title
{
  text-align: center;
  margin: 10px 0;
}

table
{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

table,
th,
td
{
  border: 1px solid #000;
}

th,
td
{
  padding: 6px;
  text-align: center;
  font-size: 14px;
}

.summary
{
  display: flex;
  justify-content: space-between;
  border: 1px solid #000;
  padding: 8px;
  margin: 10px 0;
}

.table-title
{
  border: 1px solid #000;
  border-bottom: none;
  text-align: center;
  font-weight: bold;
  padding: 7px;
  margin-top: 12px;
  font-size: 14px;
  background: #e7e1e1;
}

.bottom-section
{
  display: flex;
  gap: 20px;
}

.box
{
  flex: 1;
}

.grade-scale
{
  margin-top: 10px;
}

.remarks
{
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #000;
}

.signatures
{
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  font-weight: bold;
}

/* Print Styling */
/* PRINT SETTINGS */
@media print {

  @page {
    size: A4 portrait;
    margin: 6mm;   /* small safe margin */
  }

  html, body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    padding: 0;
  }

  .report-card {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    margin: 0 auto;
    padding: 8mm;
    border: 2px solid #000 !important;   /* KEEP OUTER BORDER */
    background: #f4f4cf !important;      /* KEEP LIGHT YELLOW */
    box-shadow: none;
    page-break-inside: avoid;
  }

  /* Prevent width overflow */
  table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  table, th, td {
    border: 1px solid #000 !important;
  }

  th, td {
    padding: 5px;
    font-size: 13px;   /* slightly smaller for perfect fit */
    word-wrap: break-word;
  }

  /* Reduce extra spacing */
  .section-title {
    margin: 6px 0;
  }

  .student-details p {
    margin: 5px 0;
    font-size: 14px;
  }

  .table-title {
    background: #e7e1e1 !important;
  }

  .term-box {
    background-color: #fdf3b0 !important;
    border: 3px solid #e2cc3c !important;
  }

  .bottom-section,
  .signatures,
  .summary,
  .remarks {
    page-break-inside: avoid;
  }

  /* Remove unnecessary gaps */
  .report-card > *:last-child {
    margin-bottom: 0;
  }
}

.student-info-container
{
  display: flex;
  align-items: center;
  gap: 20px;
  /* margin: 15px 0; */
  /* padding: 10px; */
  /* border: 1px solid #000; */
  /* background-color: #fff9e6; */
}

.student-details
{
  flex: 2;
}

.student-details p
{
  margin: 8px 0;
  font-size: 15px;
}

.student-photo
{
  flex: 0 0 auto;
}

.photo-placeholder
{
  width: 120px;
  height: 100px;
  border: 2px dashed #8b0000;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.student-img
{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-label
{
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #555;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 0;
}

/* If no image is available, show placeholder text */
.photo-placeholder:not(:has(img[src])) .student-img
{
  display: none;
}

.photo-placeholder:not(:has(img[src]))::before
{
  content: "Photo";
  font-size: 14px;
  color: #8b0000;
  font-weight: bold;
}