/*
  print.css - Specialized High-Fidelity Print Layouts for
  1. Official Nepal CDC Letter Grading Grade Sheet (लब्धाङ्क पत्र)
  2. Official School Fee Receipt (रसिद / भौचर)
  3. Student ID Cards
*/

@media print {
  body * {
    visibility: hidden;
  }
  
  .printable-area, .printable-area * {
    visibility: visible;
  }

  .printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
  }

  .no-print {
    display: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 12mm 15mm;
  }
}

/* Screen and Print Preview for Nepal CDC Grade Sheet */
.gradesheet-container {
  width: 100%;
  max-width: 820px;
  margin: 1.5rem auto;
  background: #ffffff;
  padding: 2.2rem 2.5rem;
  border: 4px double #1e3a8a;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  font-family: 'Times New Roman', 'Kalimati', serif;
  color: #000;
  position: relative;
  background-image: radial-gradient(#f8fafc 15%, transparent 16%);
  background-size: 16px 16px;
}

.gradesheet-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 4.5rem;
  font-weight: 900;
  color: rgba(30, 58, 138, 0.04);
  pointer-events: none;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gs-header {
  text-align: center;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.gs-gov-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 65px;
  height: 65px;
}

.gs-school-logo {
  position: absolute;
  top: 0;
  right: 0;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #1e3a8a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
}

.gs-nepal-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
}

.gs-school-name-np {
  font-size: 1.6rem;
  font-weight: bold;
  color: #1e3a8a;
  margin: 0.15rem 0;
}

.gs-school-name-en {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.gs-school-address {
  font-size: 0.85rem;
  color: #334155;
}

.gs-estd {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 0.2rem;
}

.gs-title-box {
  display: inline-block;
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.35rem 1.75rem;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: bold;
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gs-nepali-title {
  display: block;
  font-size: 0.95rem;
  font-weight: normal;
}

/* Student Information Block */
.gs-student-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2rem;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.gs-info-row {
  display: flex;
}

.gs-info-label {
  font-weight: bold;
  width: 150px;
  color: #334155;
}

.gs-info-val {
  flex: 1;
  color: #0f172a;
  border-bottom: 1px dotted #94a3b8;
  font-weight: 600;
}

/* CDC Marks & Grades Table */
.gs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.86rem;
}

.gs-table th, .gs-table td {
  border: 1px solid #334155;
  padding: 0.5rem 0.5rem;
  text-align: center;
}

.gs-table th {
  background: #f1f5f9;
  font-weight: bold;
  color: #0f172a;
}

.gs-table td.text-left {
  text-align: left;
  padding-left: 0.75rem;
}

.gs-table td.font-bold {
  font-weight: bold;
}

.gs-table .th-sub {
  font-size: 0.75rem;
  color: #475569;
  font-weight: normal;
}

/* GPA Result Box */
.gs-result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #1e3a8a;
  background: #f8fafc;
  padding: 0.85rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

.gs-gpa-display {
  font-size: 1.15rem;
  font-weight: bold;
  color: #1e3a8a;
}

.gs-gpa-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f172a;
  margin-left: 0.5rem;
}

.gs-remarks-display {
  font-size: 0.88rem;
  color: #334155;
}

/* CDC Grading Scale Legend */
.gs-legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-bottom: 2.5rem;
}

.gs-legend-table th, .gs-legend-table td {
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.4rem;
  text-align: center;
}

.gs-legend-table th {
  background: #f8fafc;
  font-weight: 600;
}

/* Signatures */
.gs-signatures {
  display: flex;
  justify-content: space-between;
  padding: 0 1.5rem;
  margin-top: 2rem;
}

.gs-sign-col {
  text-align: center;
  width: 160px;
}

.gs-sign-line {
  border-top: 1px solid #334155;
  margin-top: 2.5rem;
  padding-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: bold;
  color: #1e293b;
}

/* ==========================================================================
   OFFICIAL FEE RECEIPT (रसिद / भौचर)
   ========================================================================== */
.receipt-container {
  max-width: 700px;
  margin: 1.5rem auto;
  background: #ffffff;
  padding: 1.75rem 2rem;
  border: 2px dashed #0f766e;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px solid #0f766e;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.receipt-header h2 {
  font-size: 1.35rem;
  color: #0f766e;
  font-weight: 800;
}

.receipt-header p {
  font-size: 0.8rem;
  color: #64748b;
}

.receipt-badge-title {
  display: inline-block;
  background: #0f766e;
  color: white;
  padding: 0.2rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.4rem;
  text-transform: uppercase;
}

.receipt-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.receipt-items-table th, .receipt-items-table td {
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.75rem;
}

.receipt-items-table th {
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}

.receipt-total-row {
  font-weight: bold;
  background: #f8fafc;
}

.receipt-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding: 0 1rem;
}

.receipt-sign-col {
  text-align: center;
  width: 140px;
}

.receipt-sign-col .line {
  border-top: 1px solid #94a3b8;
  padding-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   4. Student Portal Login Slips (कट-आउट परिचय पर्ची)
   ========================================================================== */
.slips-container {
  max-width: 900px;
  margin: 1rem auto;
  background: white;
  padding: 1.5rem;
}

.slips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.login-slip-card {
  border: 1.5px dashed #475569;
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  page-break-inside: avoid;
  font-size: 0.88rem;
  color: #0f172a;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.login-slip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.slip-emblem {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e3a8a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

.slip-school-name {
  font-weight: 800;
  font-size: 0.86rem;
  color: #1e3a8a;
  line-height: 1.2;
}

.slip-school-sub {
  font-size: 0.72rem;
  color: #0f766e;
  font-weight: 600;
}

.slip-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.slip-credentials {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px 0;
}

.slip-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.slip-label {
  color: #64748b;
  font-weight: 600;
}

.slip-val {
  font-weight: 800;
  color: #0f172a;
}

.slip-instructions {
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.3;
  margin-top: 6px;
  border-top: 1px dotted #cbd5e1;
  padding-top: 6px;
}
