/* ==========================================================================
   PROVISIONAL GRADE SHEET STYLESHEET
   Faithful recreation of Silicon University Official Grade Sheet
   ========================================================================== */

.gradesheet-document {
  width: 100%;
  max-width: 820px;
  background-color: #ffffff;
  padding: 30px 32px 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: #000000;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Outer Border Container (Matches Official University Template) */
.gradesheet-border-box {
  border: 2px solid #000000;
  padding: 16px 20px 14px;
  background: #ffffff;
  position: relative;
}

/* Header Area */
.gradesheet-header {
  text-align: center;
  margin-bottom: 12px;
}

.gradesheet-logo {
  height: 48px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

.gradesheet-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #000000;
  margin-top: 6px;
  padding-bottom: 4px;
}

/* Student Information Header Table */
.student-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  margin-bottom: 14px;
  font-size: 11.5px;
  line-height: 1.6;
}

.student-info-table td {
  padding: 4px 6px;
  vertical-align: middle;
}

.student-info-table .info-label {
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
}

.student-info-table .info-val {
  font-weight: 700;
  color: #0e4194; /* Institutional Blue for student data */
}

/* Subject & Grades Tables */
.grades-semester-block {
  margin-bottom: 14px;
}

.semester-header-bar {
  background-color: #5c738e;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.grades-table thead th {
  background-color: #6c8299;
  color: #ffffff;
  font-weight: 700;
  padding: 4px 8px;
  text-align: left;
  font-size: 11px;
  border-bottom: 1px solid #4a5d70;
}

.grades-table th.col-code {
  width: 15%;
}

.grades-table th.col-name {
  width: 63%;
}

.grades-table th.col-credit {
  width: 11%;
  text-align: center;
}

.grades-table th.col-grade {
  width: 11%;
  text-align: center;
}

.grades-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

.grades-table tbody tr:nth-child(even) {
  background-color: #fbfcfd;
}

.grades-table td {
  padding: 3.5px 8px;
  color: #000000;
}

.grades-table td.col-code {
  font-family: Arial, sans-serif;
  font-weight: 600;
}

.grades-table td.col-credit {
  text-align: center;
  font-weight: 500;
}

.grades-table td.col-grade {
  text-align: center;
  font-weight: 700;
}

/* SGPA Row */
.sgpa-row {
  text-align: right;
  padding: 6px 12px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #000000;
  border-top: 1px solid #cbd5e1;
}

/* Cumulative CGPA Row */
.cgpa-container {
  text-align: right;
  padding: 10px 14px 10px;
  font-size: 14px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.5px;
}

.cgpa-container .cgpa-score {
  font-size: 15px;
  font-weight: 900;
}

/* Document Inner Footer */
.gradesheet-inner-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 18px;
  padding-top: 10px;
}

.generated-timestamp {
  font-size: 11px;
  color: #000000;
  font-weight: 600;
}

.signature-block {
  text-align: center;
  min-width: 180px;
}

.signature-img {
  height: 38px;
  width: auto;
  display: block;
  margin: 0 auto 2px;
}

.signatory-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #000000;
  border-top: 1px dashed transparent;
}

/* Document Outer Explanatory Notes & Disclaimer */
.gradesheet-outer-notes {
  margin-top: 16px;
  font-size: 9.5px;
  line-height: 1.45;
  color: #000000;
}

.grade-u-legend {
  margin-bottom: 10px;
}

.grade-u-legend strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.disclaimer-text {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}

.disclaimer-text strong {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Print Optimizations (@media print)
   Standard A4 Page Setup
   -------------------------------------------------------------------------- */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .gov-topbar,
  .main-header,
  .main-footer,
  .portal-toolbar,
  .dashboard-user-bar,
  .results-summary-grid,
  .modal-backdrop,
  .no-print {
    display: none !important;
  }

  .content-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .result-display-wrapper {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
  }

  .gradesheet-document {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .gradesheet-border-box {
    border: 1.5pt solid #000000 !important;
    padding: 12px 16px !important;
  }

  .semester-header-bar,
  .grades-table thead th {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    background-color: #5c738e !important;
    color: #ffffff !important;
  }

  .student-info-table .info-val {
    color: #000000 !important; /* Crisp black ink for print */
  }
}
