/* प्रिंट दस्तावेज़ (A4) — SI पत्र, रसीद, प्रवेश पत्र आदि */
:root { --ink: #111; --muted: #555; --brand: #0b5d44; --accent: #e07b14; --line: #c9cfcc; }
* { box-sizing: border-box; }
body { margin: 0; background: #e9ece9; color: var(--ink); font-family: 'Mukta', 'Noto Sans Devanagari', system-ui, sans-serif; font-size: 15px; line-height: 1.55; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #0c2b22; color: #fff; }
.print-toolbar .tb-title { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.tb-btn.primary { background: var(--accent); border-color: var(--accent); }
.tb-btn[hidden] { display: none; }
.tb-btn:disabled { opacity: .6; cursor: progress; }
@media (max-width: 640px) {
  .print-toolbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .print-toolbar .tb-title { flex-basis: 100%; order: -1; font-size: 14px; }
  .tb-btn { padding: 7px 10px; font-size: 14px; }
}
/* JPG सेव */
.jpg-one { display: block; margin: 4px auto 0; padding: 5px 14px; border-radius: 99px; border: 1px solid #0b5d44; background: #fff; color: #0b5d44; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.jpg-toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; max-width: calc(100% - 24px); background: #0c2b22; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.3); font-size: 15px; font-weight: 600; }
.jpg-toast[hidden] { display: none; }
.jpg-toast button { padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.jpg-toast button.primary { background: #e07b14; border-color: #e07b14; }
/* JPG बनाते समय मोबाइल पर भी असली (प्रिंट) आकार */
.jpg-mode .id-pair { flex-wrap: nowrap !important; width: max-content; margin: 0 auto; }
.jpg-mode .receipt-page { width: 210mm !important; padding: 8mm 12mm !important; min-height: 0 !important; }
.jpg-mode .rcpt-head, .jpg-mode .rcpt-bottom { flex-wrap: nowrap !important; }
.jpg-mode .cert { width: 297mm !important; height: 210mm !important; padding: 12mm !important; }
.jpg-mode .cert-border { padding: 14mm 20mm !important; gap: 0 !important; }
.jpg-mode .page.half { width: 210mm !important; padding: 16mm 18mm !important; }
.jpg-mode .jpg-one { display: none; }
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; overflow: hidden; font-size: 13px; font-weight: 700; }
.lang-switch a { padding: 6px 10px; color: #fff; text-decoration: none; }
.lang-switch a.on { background: #fff; color: #0b5d44; }
.print-help { text-align: center; font-size: 13px; color: #445; padding: 8px 16px 0; }

.page { width: 210mm; min-height: 297mm; margin: 16px auto; background: #fff; padding: 16mm 18mm; box-shadow: 0 4px 24px rgba(0,0,0,.12); position: relative; }
.page.half { min-height: auto; }
.page + .page { page-break-before: always; }
@media (max-width: 820px) {
  .page { width: auto; min-height: 0; margin: 10px; padding: 18px; }
}

.doc-head { display: flex; align-items: center; gap: 14px; border-bottom: 2.5px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; }
.doc-head img { width: 62px; height: 62px; }
.doc-head .org { flex: 1; }
.doc-head .org b { display: block; font-size: 22px; color: var(--brand); line-height: 1.15; }
.doc-head .org span { font-size: 13px; color: var(--muted); }
.doc-head .meta { text-align: right; font-size: 13px; color: var(--muted); }
.doc-title { text-align: center; font-size: 19px; font-weight: 800; margin: 6px 0 14px; letter-spacing: .01em; }
.doc-title span { display: inline-block; border: 2px solid var(--ink); padding: 3px 18px; border-radius: 6px; }

/* ---------- SI पत्र ---------- */
.letter { font-family: 'Tiro Devanagari Hindi', 'Mukta', serif; font-size: 16.5px; line-height: 1.85; }
.letter .title { text-align: center; font-weight: 700; font-size: 18.5px; margin-bottom: 18px; font-family: 'Mukta', sans-serif; }
.letter .to { margin: 0 0 12px; }
.letter .indent { padding-left: 48px; }
.letter .subject { padding-left: 48px; margin: 14px 0; }
.letter .body p { text-indent: 48px; text-align: left; margin: 0 0 8px; }
.letter ol { margin: 6px 0 14px; padding-left: 28px; }
.letter li { margin: 2px 0; }
.fill { display: inline-block; min-width: 180px; border-bottom: 1.5px dotted #333; padding: 0 6px; font-family: 'Mukta', sans-serif; font-weight: 700; line-height: 1.3; }
.fill.sm { min-width: 90px; }
.fill.lg { min-width: 260px; }
.fill.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.sign-block { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 26px; gap: 20px; }
.sign-block .right { text-align: left; min-width: 300px; }
.sign-block .sign-line { height: 46px; border-bottom: 1.5px solid #333; margin: 6px 0 4px; width: 220px; }
.note { margin-top: 22px; font-size: 14.5px; border-top: 1px dashed var(--line); padding-top: 10px; }
.note.no-print { background: #fff6ea; border: 1px dashed #f0c48d; border-radius: 6px; padding: 8px 12px; font-family: 'Mukta', sans-serif; }
.ref { position: absolute; bottom: 10mm; left: 18mm; right: 18mm; font-size: 11px; color: #888; display: flex; justify-content: space-between; font-family: 'Mukta', sans-serif; }

/* ---------- रसीद ---------- */
.receipt { border: 2px solid var(--brand); border-radius: 10px; padding: 18px 22px; position: relative; overflow: hidden; }
.receipt::before { content: ''; position: absolute; right: -40px; bottom: -40px; width: 220px; height: 220px; background: url('/img/logo.svg') center/contain no-repeat; opacity: .06; }
.receipt-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.receipt-row span { color: var(--muted); }
.receipt-row b { text-align: right; }
.amount-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0; padding: 12px 16px; border-radius: 8px; background: #eef8f3; border: 1px solid #b9e2cf; }
.amount-box .amt { font-size: 28px; font-weight: 800; color: var(--brand); }
.amount-box .words { font-size: 14px; color: #234; text-align: right; }
.thanks { text-align: center; margin-top: 16px; font-size: 15px; }
.computer-gen { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- दान रसीद (नई) ---------- */
.verified-banner { max-width: 210mm; margin: 12px auto 0; background: #e3f3e8; border: 1px solid #a9d9b9; color: #0f5229; padding: 10px 14px; border-radius: 8px; text-align: center; font-size: 15px; }
.receipt-page.two-up { min-height: 148.5mm; padding: 8mm 12mm; }
.receipt-page.half { min-height: auto; }
.rcpt { border: 1.2mm double #0b5d44; border-radius: 3mm; padding: 5mm 7mm; position: relative; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rcpt::after { content: ''; position: absolute; inset: 0; background: url('/img/logo.svg') center/60mm no-repeat; opacity: .05; pointer-events: none; }
.rcpt-head { display: flex; align-items: center; gap: 4mm; border-bottom: .6mm solid #0b5d44; padding-bottom: 3mm; }
.rcpt-head > img:first-child { width: 17mm; height: 17mm; }
.rcpt-head .org { flex: 1; }
.rcpt-head .org b { display: block; font-size: 6.5mm; color: #0b5d44; line-height: 1.1; }
.rcpt-head .org span { display: block; font-size: 3mm; color: #555; }
.rcpt-qr { width: 20mm; height: 20mm; }
.rcpt-title { text-align: center; margin: 3mm 0 2mm; font-size: 5.2mm; font-weight: 800; color: #a95705; letter-spacing: .03em; }
.rcpt-title small { font-size: 3mm; color: #555; font-weight: 700; margin-left: 2mm; }
.rcpt-meta { display: flex; justify-content: space-between; font-size: 3.6mm; border: .3mm dashed #b9c4be; border-radius: 2mm; padding: 1.5mm 3mm; background: #f6fbf8; }
.rcpt-text { font-family: 'Tiro Devanagari Hindi', 'Mukta', serif; font-size: 4mm; line-height: 2; margin: 3mm 0; }
.rcpt-text .fill { min-width: 0; }
.rcpt-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 6mm; margin-top: 2mm; }
.amount-chip { border: .6mm solid #0b5d44; border-radius: 2mm; padding: 1.5mm 4mm; background: #eef8f3; }
.amount-chip span { display: block; font-size: 2.8mm; color: #555; }
.amount-chip b { font-size: 6.5mm; color: #0b5d44; }
.rcpt-sign { text-align: center; font-size: 3.3mm; font-weight: 700; min-width: 45mm; line-height: 1.3; }
.rcpt-sign .line { border-bottom: .35mm solid #333; height: 11mm; margin-bottom: 1mm; display: flex; align-items: flex-end; justify-content: center; }
.rcpt-sign .line img { height: 12mm; max-width: 44mm; object-fit: contain; margin-bottom: -1.5mm; }
.rcpt-sign i { font-style: normal; font-weight: 600; color: #555; }
.rcpt-foot { margin-top: 3.5mm; font-size: 2.8mm; color: #555; text-align: center; border-top: .3mm dashed #c9cfcc; padding-top: 2mm; }
.page.receipt-page + .page.receipt-page.two-up { page-break-before: auto; }
.receipt-page { break-inside: avoid; page-break-inside: avoid; }
@media print { .receipt-page.two-up { min-height: 148mm; height: 148mm; overflow: hidden; } }
@media screen and (max-width: 820px) { .rcpt-head { flex-wrap: wrap; } .rcpt-bottom { flex-wrap: wrap; } }

/* ---------- तालिका ---------- */
table.doc { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
table.doc th, table.doc td { border: 1px solid #9aa39f; padding: 6px 8px; text-align: left; vertical-align: middle; }
table.doc th { background: #eef2ef; font-weight: 700; }
table.doc td.num, table.doc th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.doc tfoot td { font-weight: 800; background: #f5f7f5; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; font-size: 14.5px; margin-bottom: 8px; }
.info-grid div span { color: var(--muted); }

/* ---------- प्रवेश पत्र ---------- */
.admit { border: 2px solid var(--ink); border-radius: 8px; padding: 14px 16px; }
.admit-top { display: grid; grid-template-columns: 1fr 120px; gap: 16px; }
.admit table.doc td:first-child { width: 36%; color: #333; font-weight: 600; background: #fafbfa; }
.admit-photo { width: 120px; height: 150px; border: 1.5px solid #333; object-fit: cover; background: #f0f0f0; display: grid; place-items: center; font-size: 12px; color: #777; text-align: center; }
.roll-big { font-size: 20px; font-weight: 800; letter-spacing: .06em; font-family: ui-monospace, Consolas, monospace; }
.instructions { font-size: 13.5px; margin: 10px 0 0; padding-left: 20px; }
.admit-sign { display: flex; justify-content: space-between; margin-top: 34px; font-size: 13.5px; }
.admit-sign div { border-top: 1.5px solid #333; padding-top: 4px; min-width: 180px; text-align: center; }
.cut-line { border-top: 1.5px dashed #999; margin: 18px 0; text-align: center; font-size: 11px; color: #999; }
.att-photo { width: 44px; height: 54px; object-fit: cover; border: 1px solid #999; }

/* ---------- ID कार्ड (CR80: 85.6 × 54 mm) ---------- */
.id-sheet { width: 210mm; margin: 16px auto; background: #fff; padding: 10mm 8mm; display: flex; flex-direction: column; gap: 6mm; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.id-pair { display: flex; gap: 6mm; justify-content: center; break-inside: avoid; page-break-inside: avoid; }
.idc { width: 85.6mm; height: 54mm; border-radius: 3mm; overflow: hidden; position: relative; background: #fff; border: .3mm solid #c9cfcc; font-family: 'Mukta', sans-serif; color: #111; flex: none;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.idc-head { display: flex; align-items: center; gap: 2mm; padding: 1.8mm 2.5mm; background: #0b5d44; color: #fff; height: 11mm; }
.idc-accent .idc-head { background: #a95705; }
.idc-dark .idc-head { background: #12241d; }
.idc-head img { width: 7.5mm; height: 7.5mm; background: #fff; border-radius: 50%; }
.idc-head b { display: block; font-size: 3.6mm; line-height: 1.1; }
.idc-head span { font-size: 2.2mm; opacity: .85; line-height: 1.1; }
.idc-title { background: #e07b14; color: #fff; text-align: center; font-weight: 800; font-size: 2.7mm; padding: .5mm 0; letter-spacing: .02em; }
.idc-accent .idc-title { background: #0b5d44; }
.idc-dark .idc-title { background: #c9a227; color: #111; }
.idc-title small { font-weight: 600; font-size: 1.9mm; opacity: .9; margin-left: 1mm; }
.idc-body { display: flex; gap: 2.5mm; padding: 2mm 2.5mm 0; }
.idc-photo { width: 17mm; height: 21mm; border: .4mm solid #0b5d44; border-radius: 1.5mm; overflow: hidden; flex: none; background: #eef8f3; display: grid; place-items: center; }
.idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.idc-photo span { font-size: 6mm; font-weight: 800; color: #0b5d44; }
.idc-info { min-width: 0; flex: 1; padding-right: 15.5mm; }
.idc-name { font-weight: 800; font-size: 3.4mm; line-height: 1.15; color: #0b2a20; }
.idc-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 2.6mm; color: #a95705; margin-bottom: .6mm; letter-spacing: .03em; }
.idc-row { font-size: 2.25mm; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45mm; }
.idc-row span { color: #555; font-weight: 600; }
.idc-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: .5mm 2.5mm 1.1mm; font-size: 2.1mm; border-top: .25mm solid #e1e6e3; background: #fafbfa; min-height: 7.5mm; }
.idc-sign { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.1; font-weight: 700; font-size: 2mm; min-width: 24mm; }
.idc-sign img { display: block; height: 6.4mm; max-width: 26mm; object-fit: contain; margin: -1.2mm 0 -.3mm; }
.idc-sign i { font-style: normal; font-weight: 600; color: #555; font-size: 1.85mm; }
.idc-qr { position: absolute; right: 2.4mm; top: 16.8mm; width: 14mm; height: 14mm; background: #fff; padding: .5mm; border-radius: 1mm; border: .2mm solid #ddd; }
.idc-qr-cap { position: absolute; right: 2.4mm; top: 31mm; width: 14mm; text-align: center; font-size: 1.6mm; line-height: 1.15; color: #555; font-weight: 600; }
.idc-back { padding: 2.5mm 3mm; background: #fbfaf6; }
.idc-back-top { display: flex; align-items: center; gap: 2mm; font-size: 3mm; color: #0b5d44; border-bottom: .3mm solid #0b5d44; padding-bottom: 1.2mm; }
.idc-back-top img { width: 6mm; height: 6mm; }
.idc-back ul { margin: 1.5mm 0 0; padding-left: 3.5mm; font-size: 2.15mm; line-height: 1.4; }
.idc-back-contact { font-size: 2.15mm; margin-top: 1.2mm; line-height: 1.35; color: #333; }
.idc-url { font-weight: 800; color: #0b5d44; }
.idc-back-band { position: absolute; left: 0; right: 0; bottom: 0; background: #0b5d44; color: #fff; text-align: center; font-size: 2.3mm; font-weight: 700; padding: .9mm 0; }

/* ---------- आभार पत्र (A4 आड़ा) ---------- */
.cert { width: 297mm; height: 210mm; margin: 16px auto; background: #fffdf7; padding: 12mm; box-shadow: 0 4px 24px rgba(0,0,0,.12); page: landscape; position: relative; }
.cert-border { height: 100%; border: 2.2mm double #0b5d44; outline: .6mm solid #e07b14; outline-offset: -5mm; padding: 14mm 20mm; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.cert img.logo { width: 26mm; height: 26mm; }
.cert .org { font-size: 9mm; font-weight: 800; color: #0b5d44; line-height: 1.1; }
.cert .tag { font-size: 4mm; color: #555; }
.cert h1 { font-family: 'Tiro Devanagari Hindi', serif; font-size: 13mm; color: #a95705; margin: 2mm 0; letter-spacing: .04em; }
.cert .text { font-family: 'Tiro Devanagari Hindi', serif; font-size: 5.4mm; line-height: 1.8; max-width: 220mm; }
.cert .text b { color: #0b2a20; border-bottom: .4mm dotted #999; padding: 0 2mm; }
.cert-signs { display: flex; justify-content: space-between; width: 100%; font-size: 4mm; margin-top: 15mm; }
.cert-signs > div { border-top: .4mm solid #333; padding-top: 1.5mm; min-width: 60mm; position: relative; }
.cert-signs img { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); height: 15mm; max-width: 58mm; object-fit: contain; margin-bottom: -2mm; }
@page landscape { size: A4 landscape; margin: 0; }
@media screen and (max-width: 820px) {
  .id-sheet { width: auto; margin: 10px; padding: 12px 0; }
  .id-pair { flex-wrap: wrap; gap: 10px; }
  .cert { width: auto; height: auto; margin: 10px; padding: 12px; }
  .cert-border { padding: 18px; gap: 12px; }
}

@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .page { margin: 0; box-shadow: none; width: 210mm; min-height: 297mm; }
  .page.half { min-height: auto; }
  .page-break { page-break-after: always; }
  .id-sheet { margin: 0; box-shadow: none; padding: 8mm; }
  .cert { margin: 0; box-shadow: none; }
}
