:root {
  --brand: #0d6a4f;
  --brand-dark: #094a37;
}

body {
  background: #eef2f5;
  color: #233;
}

.app-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 1.3rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  text-align: left;
}

.header-logo {
  height: 88px;
  width: 88px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 5px;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.header-text h1 { font-weight: 700; letter-spacing: .2px; }

@media (max-width: 575.98px) {
  .header-inner { flex-direction: column; text-align: center; gap: .6rem; }
  .header-logo { height: 72px; width: 72px; }
}

.section-card {
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  border-radius: .6rem;
  overflow: hidden;
}

.section-card > .card-header {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  letter-spacing: .2px;
}

.section-card > .card-header i {
  margin-right: .35rem;
}

.form-label {
  font-weight: 500;
  margin-bottom: .25rem;
}

.upload-preview {
  max-width: 140px;
  max-height: 170px;
  border: 1px solid #ced4da;
  border-radius: .35rem;
  padding: 3px;
  background: #fff;
}

.upload-preview.sign {
  max-height: 90px;
  max-width: 220px;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* Validation niceties */
.form-control.is-valid,
.was-validated .form-control:valid {
  background-image: none;
}

/* ===================== Print sheet ===================== */
.print-sheet {
  position: relative;
  z-index: 0;
  overflow: hidden;
  background: #fff;
  max-width: 820px;
  margin: 1.2rem auto;
  padding: 0 0 1.4rem;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .14);
  border: 1px solid #e2e8eb;
  border-radius: .4rem;
  color: #1f2a30;
}

/* keep all content above the watermark */
.print-sheet > *:not(.sheet-watermark) { position: relative; z-index: 1; }

/* watermark logo */
.sheet-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  max-width: 480px;
  transform: translate(-50%, -50%);
  opacity: .06;
  z-index: 0;
  pointer-events: none;
}

/* header band — college info only */
.sheet-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 1rem 1.4rem;
}
.sheet-logo { height: 76px; width: 76px; object-fit: contain; flex: 0 0 auto; background: #fff; border-radius: 50%; padding: 3px; }
.sheet-head-text { text-align: center; flex: 1; }
.sheet-head-text h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.sheet-head-text .addr { font-size: .85rem; opacity: .95; }
.sheet-head-text .form-title { font-size: .9rem; font-weight: 600; margin-top: .35rem; }

/* meta strip with barcode */
.sheet-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.4rem;
  background: #f3f7f5;
  border-bottom: 2px solid var(--brand);
}
.meta-fields { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; }
.meta-fields > div { display: flex; flex-direction: column; line-height: 1.2; }
.meta-fields span { font-size: .68rem; text-transform: uppercase; color: #6b7b80; letter-spacing: .3px; }
.meta-fields strong { font-size: .95rem; }
.meta-barcode { flex: 0 0 auto; text-align: right; }
.meta-barcode svg { max-width: 220px; height: 52px; }

/* section title bands */
.section-title {
  background: var(--brand);
  color: #fff;
  padding: .35rem .9rem;
  font-weight: 600;
  margin: 1rem 1.4rem .5rem;
  border-radius: .25rem;
  font-size: .92rem;
}

/* data tables — fixed 4-column grid so values never stack */
.sheet-table {
  width: calc(100% - 2.8rem);
  margin: 0 1.4rem;
  border-collapse: collapse;
  table-layout: fixed;
}
.sheet-table th, .sheet-table td {
  border: 1px solid #d3dde0;
  padding: .4rem .6rem;
  font-size: .88rem;
  vertical-align: top;
  word-wrap: break-word;
}
.sheet-table th { width: 20%; background: #eef3f4; font-weight: 600; color: #2a3a40; }
.sheet-table td { width: 30%; }
.sheet-table small { color: #67767b; }
.sheet-table .row-head td {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
  font-size: .82rem;
  text-align: left;
}

/* personal + photo */
.personal-row { display: flex; gap: 0; align-items: flex-start; }
.personal-row .sheet-table { flex: 1; margin-right: .6rem; width: auto; }
.photo-box { flex: 0 0 auto; width: 130px; margin-right: 1.4rem; text-align: center; }
.print-photo { width: 120px; height: 150px; object-fit: cover; border: 1px solid #888; background: #fff; }
.photo-box .cap, .sign-box .cap { font-size: .72rem; color: #67767b; margin-top: .2rem; }

/* signature + declaration */
.sign-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 1.4rem 1.4rem 0;
}
.sign-row .decl { font-size: .82rem; max-width: 60%; }
.decl-meta { margin-top: .8rem; display: flex; gap: 2rem; font-size: .85rem; }
.sign-box { text-align: center; flex: 0 0 auto; }
.print-sign { max-width: 180px; max-height: 70px; border-bottom: 1px solid #888; display: block; }

.remarks-box { margin: 0 1.4rem; border: 1px solid #d3dde0; border-radius: .25rem; padding: .5rem .7rem; font-size: .85rem; }

/* verification note (bilingual) */
.verify-note {
  margin: 1.2rem 1.4rem 0;
  border: 1px dashed var(--brand);
  background: #f3f7f5;
  border-radius: .3rem;
  padding: .55rem .8rem;
  font-size: .8rem;
  line-height: 1.45;
}
.verify-note [lang="hi"] { margin-top: .25rem; }

/* admit card / letter */
.admit-instructions { margin: 0 1.4rem; font-size: .82rem; }
.admit-instructions li { margin-bottom: .25rem; }
.letter-body { padding: 1rem 1.6rem; font-size: .9rem; line-height: 1.55; }
.letter-body p { margin-bottom: .7rem; }

/* attendance sheet */
.att-table th, .att-table td { vertical-align: middle; text-align: center; }
.att-photo { width: 52px; height: 64px; object-fit: cover; border: 1px solid #999; }
.att-blank { height: 60px; background: #fff; }   /* blank box for exam-day signature / thumb */

/* ===================== Print media ===================== */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .print-sheet {
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
  }
  a[href]:after { content: ""; }
  /* force colours + watermark to print */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
