/* ============ EduSuite Documents (premium print templates) ============
   Used by preview.html (full page) and module pages (inline previews).
   All docs print with exact colors. */
.doc, .doc * { box-sizing: border-box; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.doc { font-family: "Segoe UI", "Noto Sans Devanagari", sans-serif; color: #0f172a; background: #fff; }
.serif { font-family: Georgia, "Times New Roman", serif; }

/* ---------------- A4 SHEET (bulk print: N docs per page) ---------------- */
.a4-page {
  width: 794px; /* A4 @96dpi */
  min-height: 1123px;
  margin: 0 auto;
  padding: 24px 28px;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
}
.a4-page + .a4-page { page-break-before: always; break-before: page; }
.a4-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 8px;
}
/* 10 horizontal CR80 cards = 2 cols × 5 rows */
.sheet-10 {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 10px 14px;
  align-content: stretch;
}
.sheet-10 .sheet-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.sheet-10 .idcard,
.sheet-10 .idpair {
  width: 100%;
  max-width: 340px;
  height: auto;
  max-height: 100%;
  box-shadow: none;
  border-radius: 8px;
  transform: none !important;
}
.sheet-10 .idpair { display: block; }
.sheet-10 .idpair .id-back { display: none; } /* fronts only on 10-up sheet */
.sheet-10 .idcard { aspect-ratio: 340 / 216; }
/* badge portrait: 6 per page = 2 cols × 3 rows */
.sheet-badge {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px 16px;
  align-content: stretch;
}
.sheet-badge .sheet-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.sheet-badge .idbadge {
  width: 100%;
  max-width: 300px;
  height: auto;
  max-height: 100%;
  min-height: 0;
  box-shadow: none;
  transform: none !important;
  aspect-ratio: 260 / 420;
}
.sheet-badge .idbadge-pair { display: block; }
.sheet-badge .idbadge-pair .idbadge:nth-child(2) { display: none; } /* front only */
/* admit/cert landscape: 2 per A4 */
.sheet-2 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}
.sheet-2 .sheet-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.sheet-2 .adm,
.sheet-2 .crt {
  width: 100%;
  max-width: 100%;
  transform: scale(.92) !important;
  transform-origin: center center;
  box-shadow: none;
}
/* marksheet: 1 per page (full A4) */
.sheet-1 {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.sheet-1 .ms {
  transform: scale(.95) !important;
  transform-origin: top center;
}

/* ---------------- MARKSHEET (A4 portrait) ---------------- */
.ms { width: 740px; max-width: 100%; margin: 0 auto; padding: 24px 26px; position: relative; overflow: hidden; }
.ms table { border-collapse: collapse; width: 100%; }
.ms .cand td { border: 1px solid #cbd5e1; padding: 6px 10px; font-size: 12px; background: #fff; }
.ms .cand .k { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; background: #f8fafc; width: 110px; }
.ms .marks th, .ms .marks td { border: 1px solid #cbd5e1; padding: 6px 8px; font-size: 12px; text-align: center; }
.ms .marks th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.ms .marks td.sub { text-align: left; font-weight: 700; }

/* design 1 : MPBSE Official — deep blue + gold */
.ms-govt { border: 3px double #1e3a8a; }
.ms-govt::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #1e3a8a, #d4a017, #1e3a8a); }
.ms-govt .mast { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #1d4ed8 100%); color: #fff; text-align: center; padding: 18px 16px 14px; position: relative; }
.ms-govt .mast .b1 { font-size: 10px; letter-spacing: 3px; opacity: .8; text-transform: uppercase; }
.ms-govt .mast h1 { font-family: Georgia, serif; font-size: 24px; margin: 4px 0 2px; letter-spacing: .5px; text-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ms-govt .mast .b2 { font-size: 11.5px; opacity: .9; }
.ms-govt .mast .logo-wrap { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }
.ms-govt .examline { text-align: center; font-weight: 800; font-size: 13px; letter-spacing: 2px; padding: 9px; border-bottom: 2px solid #1e3a8a; background: linear-gradient(90deg, #eff6ff, #dbeafe, #eff6ff); color: #1e3a8a; }
.ms-govt .marks th { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.ms-govt .marks tr:nth-child(even) td { background: #f8fafc; }
.ms-govt .marks tr.tot td { background: linear-gradient(90deg, #dbeafe, #bfdbfe); font-weight: 800; border-top: 2px solid #1e3a8a; }
.ms-govt .annex th { background: #1e40af; color: #fff; border-color: #1e3a8a; }
.ms-govt .annex td { background: #f8fafc; }
.ms-govt .cosch th { background: #1e40af; color: #fff; }
.ms-govt .cosch td { background: #fffbeb; }
.ms-govt .stamp { border: 3px solid #b91c1c; color: #b91c1c; font-weight: 900; letter-spacing: 3px; padding: 6px 20px; display: inline-block; transform: rotate(-6deg); border-radius: 6px; font-size: 20px; background: rgba(254,226,226,.3); }
.ms-govt .stamp.ok { border-color: #15803d; color: #15803d; background: rgba(220,252,231,.4); }
.ms-govt .watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-30deg); font-size: 90px; font-weight: 900; color: rgba(30,58,138,.04); letter-spacing: 8px; pointer-events: none; white-space: nowrap; z-index: 0; }
.ms-govt > * { position: relative; z-index: 1; }

/* design 2 : Heritage Maroon — ornate classic */
.ms-classic { border: 2px solid #7f1d1d; outline: 6px double #b45309; outline-offset: 5px; background: #fffdf7; }
.ms-classic .mast { text-align: center; padding: 16px 14px 10px; border-bottom: 3px double #b45309; position: relative; }
.ms-classic .mast::before, .ms-classic .mast::after { content: "❧"; position: absolute; top: 50%; transform: translateY(-50%); color: #b45309; font-size: 22px; }
.ms-classic .mast::before { left: 18px; }
.ms-classic .mast::after { right: 18px; transform: translateY(-50%) scaleX(-1); }
.ms-classic .mast h1 { font-family: Georgia, serif; font-size: 26px; color: #7f1d1d; margin: 2px 0; letter-spacing: .5px; }
.ms-classic .mast .b1 { font-size: 11px; letter-spacing: 3px; color: #b45309; font-weight: 700; text-transform: uppercase; }
.ms-classic .mast .b2 { font-size: 12px; color: #78716c; margin-top: 4px; }
.ms-classic .examline { text-align: center; font-family: Georgia, serif; font-size: 15px; font-weight: 700; color: #7f1d1d; padding: 9px; letter-spacing: 2px; background: #fef3c7; border-bottom: 1px solid #b45309; }
.ms-classic .cand td { background: #fffdf7; border-color: #d6c4a8; }
.ms-classic .cand .k { background: #fef3c7; color: #92400e; border-color: #d6c4a8; }
.ms-classic .marks th { background: #7f1d1d; color: #fef3c7; border-color: #991b1b; }
.ms-classic .marks td { background: #fffdf7; border-color: #d6c4a8; }
.ms-classic .marks tr:nth-child(even) td { background: #fef9ee; }
.ms-classic .marks tr.tot td { background: linear-gradient(90deg, #fde68a, #fef3c7); font-weight: 800; border-top: 2px solid #b45309; }
.ms-classic .annex th { background: #92400e; color: #fef3c7; border-color: #b45309; }
.ms-classic .cosch th { background: #92400e; color: #fef3c7; }
.ms-classic .cosch td { background: #fef3c7; }
.ms-classic .stamp { background: #7f1d1d; color: #fef3c7; font-weight: 800; letter-spacing: 2px; padding: 8px 26px; display: inline-block; border-radius: 999px; font-size: 18px; box-shadow: 0 3px 10px rgba(127,29,29,.3); }
.ms-classic .stamp.ok { background: #14532d; }
.ms-classic .corner { position: absolute; width: 40px; height: 40px; border-color: #b45309; z-index: 2; }
.ms-classic .c1 { top: 8px; left: 8px; border-top: 3px solid; border-left: 3px solid; }
.ms-classic .c2 { top: 8px; right: 8px; border-top: 3px solid; border-right: 3px solid; }
.ms-classic .c3 { bottom: 8px; left: 8px; border-bottom: 3px solid; border-left: 3px solid; }
.ms-classic .c4 { bottom: 8px; right: 8px; border-bottom: 3px solid; border-right: 3px solid; }

/* design 3 : Contemporary Teal — clean modern */
.ms-modern { border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 24px rgba(15,23,42,.08); }
.ms-modern .mast { background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #0891b2 100%); color: #fff; padding: 20px 22px; display: flex; gap: 16px; align-items: center; position: relative; overflow: hidden; }
.ms-modern .mast::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; background: rgba(255,255,255,.1); border-radius: 50%; }
.ms-modern .mast h1 { font-size: 22px; margin: 2px 0 0; font-weight: 800; }
.ms-modern .mast .b1 { font-size: 10px; letter-spacing: 2.5px; opacity: .85; text-transform: uppercase; }
.ms-modern .examline { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #0f766e; padding: 12px 22px 0; text-transform: uppercase; background: #f0fdfa; }
.ms-modern .cand td { border-color: #99f6e4; }
.ms-modern .cand .k { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.ms-modern .marks th { background: #f0fdfa; color: #0f766e; border-color: #5eead4; }
.ms-modern .marks td, .ms-modern .marks th { border-color: #5eead4; }
.ms-modern .marks tr.tot td { background: #ccfbf1; font-weight: 800; }
.ms-modern .annex th { background: #ccfbf1; color: #0f766e; border-color: #5eead4; }
.ms-modern .cosch th { background: #ccfbf1; color: #0f766e; }
.ms-modern .cosch td { background: #f0fdfa; }
.ms-modern .sumcard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.ms-modern .sumcard .bx { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); border: 1px solid #5eead4; border-radius: 12px; padding: 12px 8px; text-align: center; }
.ms-modern .sumcard .bx .v { font-size: 18px; font-weight: 800; color: #0f766e; }
.ms-modern .sumcard .bx .l { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #0d9488; margin-top: 2px; }
.ms-modern .stamp { border: 2px dashed #0f766e; color: #0f766e; font-weight: 800; letter-spacing: 2px; padding: 7px 20px; display: inline-block; border-radius: 12px; font-size: 18px; background: #f0fdfa; }
.ms-modern .stamp.bad { border-color: #b91c1c; color: #b91c1c; background: #fef2f2; }

.ms .annex { margin-top: 12px; }
.ms .annex th, .ms .annex td { border: 1px solid #cbd5e1; padding: 5px 8px; font-size: 11px; text-align: center; }
.ms .annex th { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.ms .cosch th, .ms .cosch td { border: 1px solid #cbd5e1; padding: 5px 8px; font-size: 11.5px; text-align: center; }
.ms .cosch th { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.ms .signrow { display: flex; justify-content: space-between; margin-top: 32px; text-align: center; font-size: 11px; color: #64748b; }
.ms .signrow .sl { width: 170px; border-top: 1.5px solid #475569; margin: 0 auto; padding-top: 5px; font-weight: 700; color: #0f172a; }
.ms .scale { margin-top: 14px; font-size: 9.5px; color: #94a3b8; border-top: 1px dashed #cbd5e1; padding-top: 7px; line-height: 1.7; }
.ms .section-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #64748b; margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.ms .section-label::after { content: ""; flex: 1; border-top: 1px dashed #cbd5e1; }

/* ---------------- ID CARD ---------------- */
/* Horizontal CR80 pair */
.idpair { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; page-break-inside: avoid; }
.idcard { width: 340px; height: 216px; border-radius: 12px; overflow: hidden; position: relative; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.16); font-size: 11px; }
.idcard .slot { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 54px; height: 7px; border-radius: 4px; background: rgba(0,0,0,.25); z-index: 3; }
.idcard .id-wm { position: absolute; right: -14px; bottom: -28px; font-family: Georgia, serif; font-weight: 700; font-size: 130px; opacity: .05; z-index: 0; pointer-events: none; line-height: 1; }
.id-front { display: flex; flex-direction: column; height: 100%; position: relative; z-index: 1; }
.id-band { display: flex; align-items: center; gap: 9px; padding: 13px 14px 9px; position: relative; overflow: hidden; }
.id-band::after { content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; background: rgba(255,255,255,.12); border-radius: 50%; }
.id-band .lg { flex: 0 0 40px; position: relative; z-index: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,.25)); }
.id-band .sn { font-weight: 800; font-size: 13.5px; line-height: 1.15; position: relative; z-index: 1; }
.id-band .sa { font-size: 8px; font-weight: 400; opacity: .85; line-height: 1.3; }
.id-student-tag { margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; padding: 4px 10px; border-radius: 999px; position: relative; z-index: 1; }
.id-body { display: flex; gap: 10px; padding: 7px 14px; flex: 1; align-items: center; position: relative; }
.id-photo { width: 70px; height: 84px; border-radius: 8px; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff; flex: 0 0 70px; overflow: hidden; border: 2px solid rgba(0,0,0,.1); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.id-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-info { line-height: 1.55; flex: 1; min-width: 0; }
.id-info .nm { font-size: 14px; font-weight: 800; letter-spacing: -.2px; }
.id-info .kv { font-size: 10px; }
.id-info .kv b { font-weight: 700; }
.id-info .k { color: #64748b; font-weight: 600; }
.id-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 9px; border-top: 1px dashed #e2e8f0; position: relative; z-index: 1; }
.id-valid { font-size: 8.5px; color: #64748b; font-weight: 600; }
.cqr-mini { flex-shrink: 0; background: #fff; border-radius: 3px; padding: 2px; line-height: 0; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cqr-mini svg { width: 34px; height: 34px; display: block; }
.cqr-mini.big svg { width: 44px; height: 44px; }
.id-back { padding: 16px 16px 10px; height: 100%; display: flex; flex-direction: column; }
.id-back h4 { margin: 0 0 6px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; }
.id-back .bl { font-size: 10px; line-height: 1.85; }
.id-back-qr { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.id-back .ifs { margin-top: auto; font-size: 8px; text-align: center; opacity: .7; letter-spacing: .3px; }
.id-sigrow { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 6px; }
.id-sig { text-align: center; font-size: 8px; color: #475569; }
.id-sig .ln { border-top: 1px solid #94a3b8; width: 100px; margin: 0 auto 2px; }

/* ID Navy Official */
.id-navy .id-band { background: linear-gradient(135deg, #1e3a8a, #1d4ed8); color: #fff; }
.id-navy .id-student-tag { background: #dc2626; color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.4); }
.id-navy .id-photo { background: #1d4ed8; }
.id-navy .id-wm { color: #1e3a8a; }
.id-navy.id-back { background: #0f172a; color: #e2e8f0; }
.id-navy.id-back h4 { color: #93c5fd; }

/* ID Maroon Gold */
.id-maroon { border: 2px solid #b45309; }
.id-maroon .id-band { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #7f1d1d; border-bottom: 2px solid #b45309; }
.id-maroon .id-student-tag { background: linear-gradient(135deg, #b45309, #d97706); color: #fff; box-shadow: 0 2px 6px rgba(180,83,9,.35); }
.id-maroon .id-photo { background: #7f1d1d; }
.id-maroon .id-wm { color: #7f1d1d; }
.id-maroon.id-back { background: #fef3c7; color: #7c2d12; }
.id-maroon.id-back h4 { color: #92400e; }

/* ID Emerald Split */
.id-green { display: flex; }
.id-green .id-wm { color: #065f46; }
.id-green .id-side { width: 118px; background: linear-gradient(160deg, #064e3b, #059669); color: #fff; display: flex; flex-direction: column; align-items: center; padding: 18px 8px 10px; gap: 6px; text-align: center; position: relative; overflow: hidden; z-index: 1; }
.id-green .id-side::before { content: ""; position: absolute; bottom: -20px; left: -20px; width: 70px; height: 70px; background: rgba(255,255,255,.1); border-radius: 50%; }
.id-green .id-photo { background: rgba(255,255,255,.2); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.id-green .id-main { flex: 1; padding: 12px 12px 8px; display: flex; flex-direction: column; position: relative; z-index: 1; }
.id-green .id-main-top { display: flex; align-items: center; gap: 8px; }
.id-green .crest-sm { flex: 0 0 auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.id-green .id-main .sn { font-size: 12.5px; font-weight: 800; color: #065f46; line-height: 1.2; }
.id-green .id-student-tag { background: #065f46; color: #fff; }
.id-green .id-foot2 { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.id-green.id-back { background: #ecfdf5; color: #064e3b; }
.id-green.id-back h4 { color: #047857; }

/* ---- ID Badge Portrait (reference style: lanyard slot, hexagon photo, vertical label) ---- */
.idbadge-pair { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; page-break-inside: avoid; }
.idbadge { width: 260px; min-height: 420px; border-radius: 18px; overflow: hidden; position: relative; background: #fff; box-shadow: 0 12px 36px rgba(15,23,42,.2); font-size: 11px; }
.idbadge .slot { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 36px; height: 10px; border-radius: 6px; background: rgba(0,0,0,.22); z-index: 5; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.idbadge .lanyard { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); width: 14px; height: 48px; background: repeating-linear-gradient(180deg, #1e3a8a 0 6px, #2563eb 6px 12px); border-radius: 0 0 4px 4px; z-index: 4; }
.idbadge .bh { position: relative; padding: 28px 16px 14px; text-align: center; overflow: hidden; }
.idbadge .bh::before { content: ""; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; background: rgba(255,255,255,.15); border-radius: 50%; }
.idbadge .bh::after { content: ""; position: absolute; bottom: -20px; left: -20px; width: 60px; height: 60px; background: rgba(255,255,255,.1); border-radius: 50%; }
.idbadge .bh .school-logo { width: 52px; height: 52px; margin: 0 auto 6px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; border: 2px solid rgba(255,255,255,.5); position: relative; z-index: 1; }
.idbadge .bh .school-name { font-weight: 800; font-size: 15px; letter-spacing: .5px; position: relative; z-index: 1; line-height: 1.2; }
.idbadge .bh .school-addr { font-size: 9px; opacity: .85; margin-top: 3px; position: relative; z-index: 1; }
.idbadge .hexwrap { position: relative; z-index: 2; display: flex; justify-content: center; margin-top: -6px; }
.idbadge .hexphoto { width: 120px; height: 120px; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #1e3a8a, #3b82f6); border: 4px solid #fbbf24; position: relative; overflow: hidden; box-shadow: 0 6px 16px rgba(15,23,42,.25); }
.idbadge .hexphoto::after { content: ""; position: absolute; inset: 3px; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); border: 2px solid rgba(255,255,255,.4); pointer-events: none; }
.idbadge .hexphoto img { width: 100%; height: 100%; object-fit: cover; }
.idbadge .vlabel { position: absolute; right: 8px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; font-size: 11px; font-weight: 800; letter-spacing: 4px; color: rgba(255,255,255,.5); z-index: 3; text-transform: uppercase; }
.idbadge .bfields { padding: 14px 18px 6px; position: relative; z-index: 1; }
.idbadge .bfield { display: flex; gap: 4px; margin-bottom: 6px; font-size: 11px; line-height: 1.4; }
.idbadge .bfield .lbl { color: #64748b; font-weight: 700; min-width: 58px; flex-shrink: 0; }
.idbadge .bfield .lbl::after { content: " :"; }
.idbadge .bfield .val { font-weight: 600; color: #0f172a; flex: 1; }
.idbadge .bdiag { position: absolute; left: 0; right: 0; bottom: 72px; height: 40px; overflow: hidden; pointer-events: none; z-index: 0; }
.idbadge .bdiag::before { content: ""; position: absolute; left: -10%; right: -10%; height: 200%; background: linear-gradient(135deg, transparent 40%, rgba(15,23,42,.04) 40%, rgba(15,23,42,.04) 50%, transparent 50%, transparent 60%, rgba(15,23,42,.03) 60%, rgba(15,23,42,.03) 70%, transparent 70%); transform: rotate(-8deg); }
.idbadge .bfoot { display: flex; justify-content: space-between; align-items: flex-end; padding: 8px 16px 14px; position: relative; z-index: 1; border-top: 1px solid #f1f5f9; margin-top: 4px; }
.idbadge .bfoot .phone { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #0f766e; }
.idbadge .bfoot .phone svg { width: 14px; height: 14px; }
.idbadge .bfoot .sig { text-align: center; font-size: 10px; color: #334155; }
.idbadge .bfoot .sig .sname { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 14px; color: #0f172a; margin-bottom: 1px; }
.idbadge .bfoot .sig .sline { border-top: 1px solid #94a3b8; width: 90px; margin: 0 auto; padding-top: 2px; font-weight: 700; }

/* badge teal (reference) */
.idbadge-teal .bh { background: linear-gradient(135deg, #0d9488, #14b8a6); color: #fff; padding-bottom: 28px; }
.idbadge-teal .hexphoto { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.idbadge-teal .bfield .lbl { color: #0d9488; }
.idbadge-teal .bfoot .phone { color: #0d9488; }

/* badge navy */
.idbadge-navy .bh { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; padding-bottom: 28px; }
.idbadge-navy .hexphoto { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.idbadge-navy .bfield .lbl { color: #1e3a8a; }
.idbadge-navy .bfoot .phone { color: #1e3a8a; }
.idbadge-navy .vlabel { color: rgba(30,58,138,.35); }

/* badge maroon */
.idbadge-maroon .bh { background: linear-gradient(135deg, #7f1d1d, #991b1b); color: #fff; padding-bottom: 28px; }
.idbadge-maroon .hexphoto { background: linear-gradient(135deg, #7f1d1d, #b91c1c); border-color: #f59e0b; }
.idbadge-maroon .bfield .lbl { color: #7f1d1d; }
.idbadge-maroon .bfoot .phone { color: #7f1d1d; }
.idbadge-maroon .vlabel { color: rgba(127,29,29,.3); }

/* ---------------- ADMIT CARD ---------------- */
.adm { width: 760px; max-width: 100%; margin: 0 auto; padding: 4px; position: relative; }
.adm table { border-collapse: collapse; width: 100%; }
.adm .mast { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.adm .adm-crest { flex: 0 0 auto; filter: drop-shadow(0 2px 5px rgba(0,0,0,.25)); }
.adm .adm-sname { flex: 1; text-align: center; }
.adm .adm-sname h1 { font-family: Georgia, "Times New Roman", serif; font-size: 22px; margin: 2px 0; }
.adm .adm-sname .eyebrow { font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; }
.adm .adm-sname .s { font-size: 11px; letter-spacing: .5px; opacity: .9; }
.adm .adm-htbox { flex: 0 0 auto; text-align: center; border: 1.5px solid currentColor; border-radius: 8px; padding: 6px 12px; opacity: .95; }
.adm .adm-htbox .lbl { font-size: 8px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.adm .adm-htbox .ht { font-size: 13px; font-weight: 800; letter-spacing: .5px; font-family: "Consolas", monospace; }
.adm .titleband { text-align: center; font-weight: 800; letter-spacing: 5px; padding: 8px; font-size: 15px; position: relative; z-index: 1; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.adm .titleband small { font-weight: 400; letter-spacing: 1px; font-size: 12px; opacity: .85; }
.adm .sched th, .adm .sched td { border: 1px solid #cbd5e1; padding: 7px 10px; font-size: 12px; text-align: center; position: relative; z-index: 1; }
.adm .sched th { text-transform: uppercase; font-size: 10.5px; letter-spacing: .5px; }
.adm .info td { border: 1px solid #cbd5e1; padding: 6px 11px; font-size: 12.5px; position: relative; z-index: 1; background: rgba(255,255,255,.82); }
.adm .info .k { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; background: rgba(248,250,252,.92); }
.adm .info .rollno { font-size: 15px; font-family: "Consolas", monospace; letter-spacing: 1px; }
.adm .photo { width: 96px; height: 112px; border: 2px dashed #94a3b8; display: grid; place-items: center; text-align: center; font-size: 9px; color: #64748b; border-radius: 6px; overflow: hidden; margin: 0 auto; background: rgba(255,255,255,.7); }
.adm .photo img { width: 100%; height: 100%; object-fit: cover; }
.adm .sig-cand { font-size: 8px; color: #94a3b8; margin-top: 4px; border-top: 1px solid #cbd5e1; padding-top: 3px; }
.adm .section-label { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #475569; margin: 16px 0 6px; display: flex; align-items: baseline; gap: 8px; position: relative; z-index: 1; }
.adm .section-label small { font-weight: 400; text-transform: none; opacity: .7; letter-spacing: 0; }
.adm .section-label::after { content: ""; flex: 1; border-top: 1px dashed #cbd5e1; }
.adm .adm-bottom { display: flex; gap: 14px; align-items: stretch; margin-top: 14px; position: relative; z-index: 1; }
.adm .instr { flex: 1; font-size: 11px; line-height: 1.7; color: #475569; background: rgba(248,250,252,.9); border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px; }
.adm .instr ol { list-style: none; margin: 6px 0 0; padding: 0; }
.adm .instr li { display: flex; gap: 8px; margin-bottom: 5px; }
.adm .instr .num { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%; background: currentColor; color: #fff; font-size: 9px; font-weight: 800; display: grid; place-items: center; opacity: .85; }
.adm .instr .num { color: inherit; }
.adm .adm-qrbox { flex: 0 0 auto; text-align: center; background: rgba(248,250,252,.9); border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; }
.adm .cqr { background: #fff; padding: 4px; border-radius: 3px; display: inline-block; line-height: 0; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.adm .cqr svg { width: 58px; height: 58px; display: block; }
.adm .qrcap { font-size: 8.5px; color: #94a3b8; margin-top: 4px; letter-spacing: .3px; }
.adm .signrow { display: flex; justify-content: space-between; margin-top: 26px; font-size: 11px; color: #64748b; text-align: center; position: relative; z-index: 1; }
.adm .signrow .sl { width: 170px; border-top: 1.5px solid #475569; margin: 0 auto; padding-top: 5px; font-weight: 700; color: #0f172a; }
.adm .adm-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-25deg); font-family: Georgia, serif; font-size: 220px; font-weight: 700; opacity: .045; z-index: 0; pointer-events: none; white-space: nowrap; }

.adm-blue { border: 3px double #1e3a8a; border-radius: 4px; padding: 20px 24px; background: linear-gradient(180deg, #fff 0%, #fff 100%); }
.adm-blue .mast { color: #1e3a8a; }
.adm-blue .adm-sname .eyebrow { color: #3b82f6; }
.adm-blue .adm-htbox { color: #1e3a8a; background: #eff6ff; }
.adm-blue .titleband { color: #fff; background: linear-gradient(90deg, #1e3a8a, #2563eb, #1e3a8a); margin: 12px -24px 0; }
.adm-blue .sched th { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.adm-blue .sched tr:nth-child(even) td { background: #f8fafc; }
.adm-blue .info .k { color: #1e3a8a; border-color: #bfdbfe; }
.adm-blue .adm-watermark { color: #1e3a8a; }
.adm-blue .instr .num { background: #1e3a8a; }

.adm-maroon { border: 2px solid #7f1d1d; outline: 5px double #b45309; outline-offset: 4px; padding: 22px 26px; background: #fffdf7; }
.adm-maroon .mast { color: #7f1d1d; }
.adm-maroon .adm-sname h1 { color: #7f1d1d; }
.adm-maroon .adm-sname .eyebrow { color: #b45309; }
.adm-maroon .adm-htbox { color: #7f1d1d; background: #fef3c7; border-color: #b45309; }
.adm-maroon .titleband { color: #7f1d1d; background: #fef3c7; border-top: 1px solid #b45309; border-bottom: 1px solid #b45309; margin: 12px -26px 0; font-family: Georgia, serif; }
.adm-maroon .sched th { background: #7f1d1d; color: #fef3c7; border-color: #991b1b; }
.adm-maroon .sched tr:nth-child(even) td { background: #fef9ee; }
.adm-maroon .info .k { background: rgba(254,243,199,.9); color: #92400e; border-color: #fcd34d; }
.adm-maroon .photo { border-color: #b45309; }
.adm-maroon .adm-watermark { color: #7f1d1d; }
.adm-maroon .instr .num { background: #b45309; }

.adm-teal { border-radius: 16px; overflow: hidden; box-shadow: 0 6px 28px rgba(15,23,42,.12); padding: 0; border: 1px solid #99f6e4; }
.adm-teal .mast { background: linear-gradient(135deg, #0f766e, #0891b2); color: #fff; padding: 18px 22px 14px; }
.adm-teal .adm-htbox { color: #fff; }
.adm-teal .titleband { color: #fff; background: linear-gradient(90deg, #0d9488, #0f766e); }
.adm-teal table, .adm .section-label, .adm .adm-bottom, .adm .signrow, .adm .adm-watermark { padding-left: 0; }
.adm-teal .sched, .adm-teal .info, .adm-teal .section-label, .adm-teal .adm-bottom, .adm-teal .signrow { margin-left: 22px; margin-right: 22px; width: calc(100% - 44px); }
.adm-teal .info { margin-top: 14px; }
.adm-teal .signrow { margin-bottom: 20px; }
.adm-teal .sched th { background: #ccfbf1; color: #0f766e; border-color: #5eead4; }
.adm-teal .sched td, .adm-teal .info td { border-color: #5eead4; }
.adm-teal .info .k { color: #0f766e; border-color: #99f6e4; }
.adm-teal .photo { border-color: #5eead4; }
.adm-teal .instr { background: #f0fdfa; border-color: #99f6e4; }
.adm-teal .instr .num { background: #0f766e; }
.adm-teal .adm-watermark { color: #0f766e; }

/* ---------------- CERTIFICATE (A4 landscape) ---------------- */
.crt { width: 880px; max-width: 100%; margin: 0 auto; padding: 18px; }
.crt .frame { position: relative; border-radius: 6px; padding: 30px 52px 26px; min-height: 540px; text-align: center; overflow: hidden; }
.crt .ctop { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 2px; }
.crt .crest-wrap { position: relative; z-index: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.2)); }
.crt .cflourish { opacity: .8; flex-shrink: 0; }
.crt .cflourish:first-child { transform: scaleX(-1); }
.crt .crule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto 2px; width: 320px; }
.crt .crule span { flex: 1; height: 1px; background: currentColor; opacity: .4; }
.crt .ctitle { font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 700; letter-spacing: 6px; text-transform: uppercase; margin: 8px 0 2px; }
.crt .csub { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; font-weight: 600; }
.crt .cname { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 40px; margin: 16px 0 6px; display: inline-block; padding: 0 30px 8px; position: relative; }
.crt .cbody { font-size: 14px; line-height: 2; max-width: 640px; margin: 10px auto 0; color: #334155; }
.crt .dupstamp { display: inline-block; border: 3px double #dc2626; color: #dc2626; font-weight: 800; letter-spacing: 3px; padding: 3px 16px; border-radius: 8px; margin: 4px 0; transform: rotate(-4deg); font-size: 13px; }
.crt .cfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding: 0 6px; }
.crt .csig { text-align: center; font-size: 11px; color: #64748b; min-width: 170px; }
.crt .csig .ln { border-top: 1.5px solid #475569; width: 170px; margin: 0 auto 6px; }
.crt .cseal-wrap { position: relative; width: 100px; }
.crt .cseal { filter: drop-shadow(0 4px 8px rgba(0,0,0,.28)); }
.crt .cribbon-tails { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); width: 46px; height: 46px; z-index: 0; }
.crt .cribbon-tails::before, .crt .cribbon-tails::after { content: ""; position: absolute; top: 0; width: 16px; height: 46px; }
.crt .cribbon-tails::before { left: 2px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); transform: rotate(-8deg); background: #b45309; }
.crt .cribbon-tails::after { right: 2px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); transform: rotate(8deg); background: #92400e; }
.crt-navy .cribbon-tails::before { background: #1e3a8a; }
.crt-navy .cribbon-tails::after { background: #1d4ed8; }
.crt-emerald .cribbon-tails::before { background: #b45309; }
.crt-emerald .cribbon-tails::after { background: #92400e; }
.crt .cmetarow { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.crt .cqr { flex-shrink: 0; background: #fff; padding: 3px; border-radius: 3px; line-height: 0; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.crt .cqr svg { width: 46px; height: 46px; display: block; }
.crt .cmeta { font-size: 9.5px; letter-spacing: .4px; color: #94a3b8; font-weight: 600; line-height: 1.6; text-align: left; }
.crt .guilloche { position: absolute; inset: 10px; opacity: .1; pointer-events: none; background-image:
    repeating-linear-gradient(115deg, currentColor 0 1px, transparent 1px 7px),
    repeating-linear-gradient(65deg, currentColor 0 1px, transparent 1px 7px);
  -webkit-mask-image: radial-gradient(ellipse at 50% 15%, black 0%, transparent 42%), radial-gradient(ellipse at 50% 100%, black 0%, transparent 38%);
  mask-image: radial-gradient(ellipse at 50% 15%, black 0%, transparent 42%), radial-gradient(ellipse at 50% 100%, black 0%, transparent 38%);
}
.crt .innerline { position: absolute; inset: 14px; border: 1px solid currentColor; opacity: .3; border-radius: 3px; pointer-events: none; }

/* Certificate Gold Royal */
.crt-gold .frame { border: 4px double #b45309; background: radial-gradient(ellipse at 50% 0%, #fffbeb 0, #fff 55%); box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 9px #d4a017, inset 0 0 0 12px #fff; color: #92400e; }
.crt-gold .ctitle { color: #92400e; text-shadow: 0 1px 0 #fef3c7; }
.crt-gold .csub { color: #b45309; }
.crt-gold .cname { color: #1e3a8a; border-bottom: 3px double #b45309; }
.crt-gold .cbody { color: #44403c; }
.crt-gold .csig .ln { border-color: #78350f; }
.crt-gold .cmeta { color: #a8a29e; }
.crt-gold .cqr { border: 1px solid #f3e2b8; }

/* Certificate Emerald Classic */
.crt-emerald .frame { background: linear-gradient(160deg, #064e3b 0%, #065f46 40%, #047857 100%); color: #d4af37; box-shadow: inset 0 0 0 5px #064e3b, inset 0 0 0 8px #d4af37, inset 0 0 0 14px #064e3b, inset 0 0 0 15px rgba(212,175,55,.5); border-radius: 3px; }
.crt-emerald .panel { border: 1.5px solid #d4af37; border-radius: 4px; padding: 24px 34px 20px; position: relative; z-index: 1; background: rgba(0,0,0,.15); }
.crt-emerald .ctitle { color: #fde68a; text-shadow: 0 2px 4px rgba(0,0,0,.3); }
.crt-emerald .csub { color: #d4af37; }
.crt-emerald .cname { color: #fff; border-bottom: 2px solid #d4af37; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.crt-emerald .cbody { color: #fefce8; }
.crt-emerald .csig .ln { border-color: #fde68a; }
.crt-emerald .csig, .crt-emerald .cmeta { color: #d6d3c0; }

/* Certificate Navy Modern */
.crt-navy .frame { border: 3px solid #1e3a8a; background: linear-gradient(180deg, #eff6ff 0, #fff 35%); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #3b82f6; color: #1e3a8a; }
.crt-navy .ctitle { color: #1e3a8a; }
.crt-navy .csub { color: #3b82f6; }
.crt-navy .cname { color: #0f172a; border-bottom: 2px solid #3b82f6; }
.crt-navy .csig .ln { border-color: #1e3a8a; }

/* ---------------- FEE CERTIFICATE (A4 portrait) ---------------- */
.feec { width: 740px; max-width: 100%; margin: 0 auto; padding: 26px 28px; border: 3px double #0f766e; }
.feec table { border-collapse: collapse; width: 100%; }
.feec .mast { background: linear-gradient(135deg, #0f766e, #0891b2); color: #fff; border-radius: 10px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.feec .mast h1 { font-size: 22px; margin: 0; }
.feec .mast .s { font-size: 11px; opacity: .9; }
.feec .titleband { color: #0f766e; font-weight: 800; letter-spacing: 2px; padding: 12px 4px 2px; font-size: 14px; text-align: center; }
.feec .info td { border: 1px solid #99f6e4; padding: 7px 11px; font-size: 12.5px; }
.feec .info .k { color: #0f766e; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; background: #f0fdfa; }
.feec .plist th, .feec .plist td { border: 1px solid #99f6e4; padding: 6px 10px; font-size: 12px; text-align: left; }
.feec .plist th { background: #ccfbf1; color: #0f766e; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.feec .plist tr:nth-child(even) td { background: #f0fdfa; }
.feec .totals { margin-top: 10px; }
.feec .totals td { border: 2px solid #0f766e; background: #f0fdfa; padding: 8px 12px; font-size: 13.5px; font-weight: 700; color: #0f766e; }
.feec .totals td:last-child { text-align: right; }
.feec .note { font-size: 11.5px; line-height: 1.8; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px; margin-top: 14px; }
.feec .signrow { display: flex; justify-content: space-between; margin-top: 30px; font-size: 11px; color: #64748b; text-align: center; }
.feec .signrow .sl { width: 180px; border-top: 1.5px solid #475569; margin: 0 auto; padding-top: 5px; font-weight: 700; color: #0f172a; }

/* ---------------- TIMETABLE ---------------- */
.ttd { width: 960px; max-width: 100%; margin: 0 auto; padding: 24px 26px; border: 2px solid #0f172a; position: relative; }
.ttd .mast { text-align: center; border-bottom: 3px double #0f172a; padding-bottom: 12px; }
.ttd .mast h1 { font-family: Georgia, serif; font-size: 24px; margin: 0; }
.ttd .mast .s { font-size: 12px; color: #64748b; }
.ttd table { border-collapse: collapse; width: 100%; margin-top: 14px; }
.ttd th, .ttd td { border: 1px solid #475569; padding: 8px 5px; font-size: 11.5px; text-align: center; }
.ttd th { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.ttd td.day { font-weight: 800; background: #f1f5f9; }
.ttd td.lunch { background: #fef3c7; font-weight: 800; color: #92400e; }
.ttd tr:nth-child(even) td:not(.day):not(.lunch) { background: #f8fafc; }

/* ---------------- FEE RECEIPT (modal print) ---------------- */
.receipt { font-family: "Segoe UI", sans-serif; color: #0f172a; }
.receipt .rhead { display: flex; align-items: center; gap: 14px; border-bottom: 3px double #1e3a8a; padding-bottom: 12px; margin-bottom: 14px; }
.receipt .rhead h3 { font-family: Georgia, serif; font-size: 20px; color: #1e3a8a; margin: 0; }
.receipt .rhead .sub { font-size: 11px; color: #64748b; }
.receipt table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.receipt .rrow td { border: 1px solid #cbd5e1; padding: 7px 10px; }
.receipt .rrow .k { background: #f8fafc; font-weight: 700; color: #475569; width: 130px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.receipt .amt td { border: 1px solid #1e3a8a; background: #eff6ff; font-weight: 800; font-size: 14px; color: #1e3a8a; }
.receipt .stamp-ok { display: inline-block; border: 2.5px solid #15803d; color: #15803d; font-weight: 900; letter-spacing: 3px; padding: 5px 16px; border-radius: 6px; transform: rotate(-5deg); font-size: 16px; background: rgba(220,252,231,.5); }

/* ---------------- SALARY SLIP ---------------- */
.payslip { font-family: "Segoe UI", sans-serif; color: #0f172a; }
.payslip .phead { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; padding: 14px 16px; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; }
.payslip .phead h3 { margin: 0; font-size: 17px; }
.payslip .phead .sub { font-size: 11px; opacity: .9; }
.payslip table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.payslip .prow td { border: 1px solid #cbd5e1; padding: 7px 10px; }
.payslip .prow .k { background: #f8fafc; font-weight: 700; color: #475569; font-size: 11px; }
.payslip .net td { background: #eff6ff; border: 2px solid #1e3a8a; font-weight: 800; font-size: 14px; color: #1e3a8a; }
