/* ===== Printable documents (ID card / certificate / appointment letter) =====
   Tune the top/left percentages below to line up with your own template images. */
.doc-wrap{display:inline-block;margin:0 12px 22px 0;vertical-align:top}
.doc-actions{display:flex;gap:6px;margin-top:8px;justify-content:center}
.doc{text-align:left;position:relative;background:#fff center/100% 100% no-repeat;color:#111;font-family:Roboto,Arial,sans-serif;overflow:hidden;box-shadow:0 6px 24px rgba(0,0,0,.15)}
.doc img{max-width:100%}
.doc .lg{display:inline-flex;align-items:center;justify-content:center;background:#fff;border-radius:6px;overflow:hidden}
.doc .lg img{max-height:100%;max-width:100%;object-fit:contain}
.doc .sig{text-align:center;font-size:10px}
.doc .sig img{height:42px;object-fit:contain;display:block;margin:0 auto}
.doc .sig span{display:block;border-top:1px solid #333;padding-top:1px;font-weight:600}
.ph-empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#e5e7eb;color:#9ca3af;font-size:40px}

/* ---- ID card (CR80 portrait) ---- */
.idc{width:340px;height:540px;border-radius:12px;border:1px solid #ddd}
.idc-head{display:flex;align-items:center;gap:10px;background:linear-gradient(90deg,#d71920,#9f1218);color:#fff;padding:12px 14px;height:78px}
.idc-head .lg{width:52px;height:52px;font-size:24px;color:#d71920;padding:3px}
.idc-head b{display:block;font-size:18px;line-height:1.1;font-family:'Roboto Condensed',Arial}
.idc-head small{font-size:10px;letter-spacing:1px;opacity:.9}
.idc-photo{width:104px;height:124px;margin:14px auto 6px;border:3px solid #d71920;border-radius:6px;overflow:hidden;background:#fff}
.idc-photo img{width:100%;height:100%;object-fit:cover}
.idc-name{text-align:center;font-weight:800;font-size:18px;text-transform:uppercase;line-height:1.15;padding:0 10px;font-family:'Roboto Condensed',Arial}
.idc-desig{text-align:center;margin:4px auto 6px;background:#d71920;color:#fff;font-weight:700;font-size:12px;border-radius:20px;padding:2px 14px;width:max-content;max-width:90%}
.idc-tbl{margin:0 auto;font-size:11.5px;width:84%}
.idc-tbl td{padding:1px 2px;vertical-align:top}
.idc-tbl td:first-child{width:70px;font-weight:600}
.idc .sig{position:absolute;right:18px;bottom:30px;width:110px}
.idc-foot{position:absolute;left:0;right:0;bottom:0;background:#111827;color:#fff;font-size:10px;text-align:center;padding:5px 6px;line-height:1.3}
/* template present: push content below the template's printed header */
.idc-front.has-tpl .idc-photo{margin-top:118px}
.idc-front.has-tpl .sig{bottom:34px}

.idc-ins{padding:12px 18px;font-size:11px}
.idc-ins ol{padding-left:16px;margin:4px 0 0}
.idc-back-body{position:absolute;left:18px;right:18px;top:220px;font-size:11px;text-align:center}
.idc-back-body>div{margin-bottom:5px}
.idc-back.has-tpl .idc-back-body{top:300px}
.qr{display:inline-block;background:#fff;padding:4px;margin-top:4px}
.qr img,.qr canvas{display:block}

/* ---- Certificate (A4 landscape) ---- */
.cert{width:1000px;height:707px;border:14px solid #d71920;outline:3px solid #f5c542;outline-offset:-24px}
.cert.has-tpl{border:0;outline:0}
.cert-head{text-align:center;padding-top:42px}
.cert-head .lg{width:70px;height:70px;font-size:34px;color:#d71920}
.cert-head h2{font-family:'Roboto Condensed',Arial;font-weight:800;color:#d71920;margin:6px 0 0;font-size:36px}
.cert-head h3{font-family:Georgia,serif;font-style:italic;font-size:44px;margin:0;color:#7a4b00}
.cert-body{position:absolute;left:130px;right:130px;top:250px;text-align:center;font-size:18px;line-height:1.6}
.cert.has-tpl .cert-body{top:270px}
.cert-name{font-family:Georgia,serif;font-size:38px;font-weight:700;color:#0f172a;border-bottom:2px dotted #999;display:inline-block;padding:0 30px;margin-bottom:10px}
.cert .lead-in{margin:0;font-style:italic}
.cert-photo{position:absolute;right:-90px;top:-40px;width:96px;height:116px;border:3px solid #d71920;overflow:hidden;background:#fff}
.cert-photo img{width:100%;height:100%;object-fit:cover}
.cert-foot{position:absolute;left:110px;right:110px;bottom:70px;display:flex;justify-content:space-between;align-items:flex-end;font-size:15px}
.cert .sig{width:170px;font-size:13px}

/* ---- Appointment letter (A4 portrait) ---- */
.appt{width:800px;height:1131px}
.appt-head{display:flex;gap:16px;align-items:center;border-bottom:4px solid #d71920;padding:30px 50px 16px}
.appt-head .lg{width:80px;height:80px;font-size:36px;color:#d71920;border:1px solid #eee}
.appt-head h2{font-family:'Roboto Condensed',Arial;font-weight:800;color:#d71920;margin:0;font-size:34px}
.appt-head small{color:#444}
.appt-body{position:absolute;left:70px;right:70px;top:170px;font-size:15.5px;line-height:1.65}
.appt.has-tpl .appt-body{top:230px}
.appt-body h3{text-align:center;text-decoration:underline;font-weight:800;font-size:22px;margin:22px 0}
.appt-sign{width:220px;margin-left:auto;margin-top:30px}
.appt .sig{font-size:13px}

/* screen scaling for big docs */
.doc-scale{transform-origin:top left}
@media print{
  @page{margin:8mm}
  body *{visibility:hidden}
  .doc-area,.doc-area *{visibility:visible}
  .doc-area{position:absolute;left:0;top:0}
  .doc-actions,.no-print{display:none!important}
  .doc{box-shadow:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .doc-scale{transform:none!important;height:auto!important;width:auto!important}
  .doc-wrap{page-break-inside:avoid}
}
