*{box-sizing:border-box}body{margin:0;background:#f3f6f7;color:#17242b;font:15px/1.5 Arial,sans-serif}.top{background:#fff;border-bottom:1px solid #e1e7e9;padding:16px max(20px,calc((100% - 1120px)/2));display:flex;justify-content:space-between;align-items:center;gap:18px}.brand{font-weight:800;color:#06343a;text-decoration:none;font-size:18px}.top nav{display:flex;gap:18px;flex-wrap:wrap}.top nav a{color:#43535a;text-decoration:none}.wrap{max-width:1120px;margin:28px auto;padding:0 18px}h1{font-size:26px;margin:0 0 20px}h2{font-size:19px;margin:0 0 12px}.panel{background:white;border:1px solid #e2e9eb;border-radius:16px;padding:22px;margin:18px 0;box-shadow:0 5px 20px #17313a08}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.stat{background:#fff;border:1px solid #e2e9eb;border-radius:15px;padding:20px}.stat span{display:block;color:#65747a}.stat strong{font-size:32px;color:#087e7c}.actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.btn{display:inline-block;background:#078d8a;color:white;border:0;border-radius:9px;padding:11px 16px;text-decoration:none;font-weight:700;cursor:pointer}.btn.secondary{background:#e8f1f1;color:#14565a}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid label,.login label{display:flex;flex-direction:column;gap:6px;font-weight:600;color:#42545a}.form-grid input,.form-grid select,.form-grid textarea,.inline-form input,.inline-form select,.login input{width:100%;padding:11px;border:1px solid #ccd8db;border-radius:8px;font:inherit;background:#fff}.form-grid textarea{min-height:80px}.full{grid-column:1/-1}.inline-form{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.inline-form input[type=file]{max-width:340px}.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;margin-top:14px}th,td{text-align:left;padding:11px;border-bottom:1px solid #e8edef;white-space:nowrap}th{background:#f7f9fa;color:#52636a}.avatar,.thumb{width:48px;height:48px;object-fit:cover;border-radius:8px}.thumb{width:100px;height:100px}.inline{display:inline}.link{border:0;background:none;color:#078d8a;cursor:pointer;padding:0;font:inherit}.danger{color:#bd3434}.nowrap{white-space:nowrap}.notice{padding:12px 15px;border-radius:9px;margin:12px 0;background:#e5f6ef;color:#146247}.notice.error{background:#fff0ef;color:#a22}.footer{text-align:center;padding:24px;color:#879398}.login-wrap{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;max-width:1000px;margin:auto;align-items:center;padding:25px}.login-art{min-height:470px;border-radius:22px;background:linear-gradient(140deg,#041b22,#087e7c);color:white;padding:45px;display:flex;flex-direction:column;justify-content:space-between}.art-mark{font-size:42px;letter-spacing:5px}.art-mark b{color:#e5c75a}.login{max-width:440px;width:100%;margin:auto}.login h1{margin-bottom:5px}.login p{color:#718087}.login label{margin:18px 0}.login .btn{width:100%}.login small{display:block;margin-top:15px;color:#718087}.student-card{width:85.6mm;height:54mm;background:linear-gradient(130deg,var(--card-color),#04151b 75%);color:white;border-radius:4mm;padding:5mm;position:relative;overflow:hidden;box-shadow:0 5px 18px #0002;break-inside:avoid}.student-card:after{content:"";position:absolute;width:85mm;height:50mm;right:-25mm;bottom:-35mm;border:1px solid #ffffff35;transform:rotate(-35deg);box-shadow:0 0 0 5px #ffffff08,0 0 0 12px #ffffff08,0 0 0 20px #ffffff08}.card-head{display:flex;align-items:center;gap:8px;position:relative;z-index:1}.card-head div{display:flex;flex-direction:column;min-width:0}.card-head small{font-size:6pt;letter-spacing:1.5px;color:#c6d6d7}.card-head strong{font-size:9pt;max-width:54mm;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.school-logo{width:9mm;height:9mm;object-fit:contain;background:#fff;border-radius:2px}.card-chip{margin-left:auto;width:10mm;height:7mm;border-radius:2mm;background:linear-gradient(135deg,#f9e47c,#c89c21);border:1px solid #fff7}.card-body{display:flex;gap:3mm;align-items:center;position:relative;z-index:1;margin-top:5mm}.photo-box{width:19mm;height:25mm;border:1px solid #ffffff80;background:#dce5e5;color:#375057;display:flex;align-items:center;justify-content:center;flex:none;font-size:7pt;overflow:hidden}.photo-box img{width:100%;height:100%;object-fit:cover}.student-info{min-width:0;flex:1}.student-info small{font-size:5.5pt;letter-spacing:1px;color:#c1d2d4;display:block}.student-info .nis{font-size:11pt;letter-spacing:1px}.student-info h2{font-size:10pt;line-height:1.1;margin:2mm 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:white}.student-info p{font-size:6.5pt;margin:1mm 0;color:#e3eeee}.qr{width:16mm;height:16mm;background:white;padding:1mm;flex:none}.qr img{width:100%;height:100%}.card-foot{position:absolute;bottom:2.5mm;left:5mm;right:5mm;border-top:1px solid #ffffff40;padding-top:1.5mm;font-size:5.5pt;color:#d2e0e0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:1}.card-page{background:#edf1f2;padding:24px}.print-tools{display:flex;gap:10px;align-items:center;margin:0 auto 20px;max-width:900px}.print-grid{display:flex;flex-wrap:wrap;gap:8mm;justify-content:center}.print-grid .student-card{margin-bottom:2mm}@media(max-width:700px){.top{align-items:flex-start;flex-direction:column}.stats{grid-template-columns:1fr}.login-wrap{grid-template-columns:1fr;padding:14px}.login-art{display:none}.form-grid{grid-template-columns:1fr}.full{grid-column:auto}.wrap{margin:18px auto}.panel{padding:16px}}@media print{@page{size:A4;margin:12mm}body.card-page{background:white;padding:0}.print-tools{display:none}.print-grid{justify-content:flex-start;gap:8mm}.student-card{box-shadow:none;margin:0 0 3mm 0;-webkit-print-color-adjust:exact;print-color-adjust:exact}.card-page:has(>.student-card){padding:0}.student-card{page-break-inside:avoid}}

/* Catatan masa berlaku kartu */
.card-foot{display:flex;flex-direction:column;justify-content:flex-end;gap:.4mm;line-height:1.15}
.card-foot .validity-note{font-weight:700;color:#fff;white-space:nowrap}
.card-foot span:last-child{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}

.unit-pill{display:inline-block;vertical-align:middle;margin-left:8px;padding:3px 9px;border-radius:20px;background:#e4f2f2;color:#087e7c;font-size:11px}
.intro{color:#5c6e75;margin:-6px 0 22px}
.unit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.unit-card{background:#fff;border:1px solid #dfe8ea;border-radius:18px;padding:25px;box-shadow:0 8px 28px #17313a0a;position:relative;overflow:hidden}
.unit-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:#0a8985}
.unit-card.ma:before{background:#0a526f}
.unit-icon{width:52px;height:52px;border-radius:14px;background:#e5f4f2;color:#087e7c;display:grid;place-items:center;font-weight:800;font-size:18px}
.unit-card.ma .unit-icon{background:#e8f0f5;color:#0a526f}
.unit-tag{font-size:10px;letter-spacing:1.6px;color:#829198;margin-top:17px}
.unit-card h2{font-size:22px;margin:5px 0 18px}
.unit-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:15px 0 22px}
.unit-stats div{background:#f6f9f9;border-radius:10px;padding:11px}
.unit-stats span{display:block;font-size:12px;color:#718087}
.unit-stats strong{display:block;font-size:25px;color:#087e7c}
.unit-card .btn{width:100%;text-align:center}
@media(max-width:700px){.unit-grid{grid-template-columns:1fr}.unit-card{padding:20px}.unit-stats{gap:5px}.unit-stats div{padding:8px}}

/* Tampilan pratinjau kartu pada ponsel */
@media screen and (max-width:600px){
  body.card-page{padding:16px 12px 28px;overflow-x:hidden}
  .print-tools{width:100%;max-width:100%;margin:0 auto 18px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
  .print-tools .btn{font-size:14px;padding:10px 13px}
  .student-card{width:min(85.6mm, calc(100vw - 32px));height:auto;aspect-ratio:85.6 / 54;margin:0 auto 18px;padding:4mm;border-radius:4mm}
  .card-head{gap:2mm}
  .card-head strong{font-size:8.5pt;max-width:52mm}
  .card-body{display:grid;grid-template-columns:17mm minmax(0,1fr) 12mm;gap:2mm;align-items:center;margin-top:4mm}
  .photo-box{width:17mm;height:22mm;font-size:6.5pt}
  .student-info{min-width:0;width:100%}
  .student-info small{font-size:5pt;letter-spacing:.7px}
  .student-info .nis{font-size:10pt;line-height:1.1}
  .student-info h2{font-size:8.5pt;line-height:1.12;margin:1.2mm 0;white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
  .student-info p{font-size:5.8pt;line-height:1.15;margin:.8mm 0;white-space:normal}
  .qr{width:12mm;height:12mm;padding:.6mm;overflow:hidden;justify-self:end}
  .qr img,.qr canvas{width:100%!important;height:100%!important;display:block}
  .card-foot{left:4mm;right:4mm;bottom:2mm;padding-top:1mm;white-space:normal;overflow:hidden;display:flex;flex-direction:column;gap:.5mm;line-height:1.1;font-size:5pt}
  .card-foot .validity-note{font-size:5.2pt;white-space:nowrap}
  .card-foot .school-contact{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media screen and (max-width:360px){
  .card-body{grid-template-columns:15mm minmax(0,1fr) 10mm;gap:1.5mm}
  .photo-box{width:15mm;height:20mm}
  .qr{width:10mm;height:10mm}
  .student-info h2{font-size:8pt}
}
@media print{
  .student-card{width:85.6mm;height:54mm;aspect-ratio:auto;padding:5mm;margin:0 0 3mm 0}
  .card-body{display:flex;gap:3mm;margin-top:5mm}
  .photo-box{width:19mm;height:25mm}
  .student-info h2{font-size:10pt;white-space:nowrap;display:block}
  .qr{width:16mm;height:16mm;padding:1mm}
  .card-foot{left:5mm;right:5mm;bottom:2.5mm;padding-top:1.5mm;display:flex;flex-direction:column;gap:.4mm;font-size:5.5pt;white-space:nowrap}
}

/* Login dengan dua tab: admin dan verifikasi kartu siswa */
.auth-page{min-height:100vh;background:#f3f6f7;padding:28px 16px;display:flex;align-items:center;justify-content:center}
.auth-shell{width:100%;max-width:560px;margin:auto}
.auth-brand{display:flex;align-items:center;justify-content:center;gap:12px;margin:0 auto 18px;color:#153943}
.auth-brand>div:last-child{display:flex;flex-direction:column}
.auth-brand strong{font-size:17px;letter-spacing:1.2px}
.auth-brand small{font-size:12px;color:#718087}
.auth-logo{width:42px;height:42px;border-radius:12px;background:#078d8a;color:white;display:grid;place-items:center;font-weight:800;font-size:24px}
.auth-panel{background:#fff;border:1px solid #e0e8ea;border-radius:16px;padding:0 30px 30px;box-shadow:0 8px 28px #17313a0c}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid #e3e9eb;margin-bottom:25px}
.auth-tab{border:0;border-bottom:3px solid transparent;background:transparent;padding:18px 8px 15px;font:inherit;color:#63737a;cursor:pointer}
.auth-tab.active{color:#078d8a;border-bottom-color:#08a88c;font-weight:700}
.auth-content h1{font-size:25px;margin:0 0 7px}
.auth-subtitle{color:#718087;margin:0 0 22px}
.auth-content label{display:flex;flex-direction:column;gap:7px;margin:17px 0;color:#31454c;font-weight:600}
.auth-content input{width:100%;min-height:48px;border:1px solid #cbd8dc;border-radius:9px;padding:11px 13px;font:inherit;background:#fff;color:#17242b}
.auth-content input:focus{outline:2px solid #b6e5df;border-color:#078d8a}
.auth-submit,.verify-submit{width:100%;margin-top:8px;min-height:48px}
.verify-submit{background:#202b3b;letter-spacing:.5px}
.verify-help{font-size:12px;color:#7b898e;text-align:center;margin:16px 0 0}
.auth-footer{text-align:center;color:#8a989d;font-size:12px;padding:20px}
.verify-result-page{min-height:100vh;padding:24px 16px}
.verify-result-wrap{width:100%;max-width:650px;margin:0 auto}
.verify-result-head{display:flex;align-items:center;gap:13px;margin:0 0 16px}
.verify-result-head h1{font-size:23px;margin:0 0 4px}
.verify-result-head p{margin:0;color:#718087}
.verified-mark{width:42px;height:42px;flex:none;border-radius:50%;display:grid;place-items:center;background:#dff5ec;color:#087c58;font-weight:800;font-size:24px}
.verified-status{display:flex;align-items:center;gap:8px;color:#087c58;font-weight:700;font-size:13px;margin:14px 0}
.status-dot{width:8px;height:8px;border-radius:50%;background:#16a36f}
.verified-card{margin:0 auto 16px}
.verify-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:16px 0}
.verify-disclaimer{max-width:520px;margin:14px auto;text-align:center;color:#7c898e;font-size:12px}
@media(max-width:600px){
 .auth-page{padding:18px 12px;align-items:flex-start}
 .auth-brand{margin:10px auto 16px}
 .auth-panel{padding:0 18px 22px;border-radius:14px}
 .auth-tabs{margin-bottom:21px}
 .auth-tab{font-size:14px;padding:15px 4px 12px}
 .auth-content h1{font-size:22px}
 .auth-content label{font-size:14px}
 .auth-content input{min-height:48px;font-size:16px}
 .auth-footer{padding:15px 5px}
 .verify-result-page{padding:18px 12px}
 .verify-result-wrap{max-width:100%}
 .verify-result-head h1{font-size:20px}
 .verified-card{width:min(85.6mm, calc(100vw - 32px));height:auto;aspect-ratio:85.6 / 54;padding:4mm}
 .verified-card .card-body{display:grid;grid-template-columns:17mm minmax(0,1fr) 12mm;gap:2mm;align-items:center;margin-top:4mm}
 .verified-card .photo-box{width:17mm;height:22mm}
 .verified-card .student-info{min-width:0}
 .verified-card .student-info small{font-size:5pt;letter-spacing:.7px}
 .verified-card .student-info .nis{font-size:10pt}
 .verified-card .student-info h2{font-size:8.5pt;line-height:1.12;margin:1.2mm 0;white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
 .verified-card .student-info p{font-size:5.8pt;line-height:1.15;margin:.8mm 0}
 .verified-card .qr{width:12mm;height:12mm;padding:.6mm;overflow:hidden;justify-self:end}
 .verified-card .qr img,.verified-card .qr canvas{width:100%!important;height:100%!important;display:block}
 .verified-card .card-foot{left:4mm;right:4mm;bottom:2mm;padding-top:1mm;font-size:5pt}
 .verified-card .card-foot .validity-note{font-size:5.2pt}
}
@media print{
 body.verify-result-page{background:#fff;padding:0}
 .verify-result-head,.verified-status,.verify-actions,.verify-disclaimer{display:none!important}
 .verify-result-wrap{max-width:none}
 .verified-card{margin:0;box-shadow:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* Pilih dan hapus siswa secara massal */
.bulk-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:13px 0;margin:12px 0;border-top:1px solid #e5ecee;border-bottom:1px solid #e5ecee}
.select-all-label{display:flex;align-items:center;gap:8px;font-weight:700;color:#344950}
.bulk-toolbar input[type=checkbox],.check-col input[type=checkbox]{width:18px;height:18px;accent-color:#078d8a;cursor:pointer}
#selected-count{font-size:13px;color:#718087;margin-right:auto}
.danger-btn{background:#c43d48;color:#fff;border:0}
.danger-btn:hover{background:#a92d38}
.danger-btn:disabled{opacity:.45;cursor:not-allowed}
.check-col{width:42px;text-align:center}
.check-col input{vertical-align:middle}
.link.danger{border:0;background:transparent;padding:0;color:#c43d48;text-decoration:underline;cursor:pointer;font:inherit}
@media(max-width:600px){.bulk-toolbar{gap:10px}.bulk-toolbar .danger-btn{width:100%}#selected-count{margin-right:0}}

/* Nama siswa harus tampil utuh, boleh membungkus ke beberapa baris */
.student-info{min-width:0}
.student-info h2{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  display:block !important;
  -webkit-line-clamp:unset !important;
  -webkit-box-orient:initial !important;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.08;
  max-width:100%;
}
@media screen and (max-width:600px){
  .student-info h2{
    font-size:7.6pt !important;
    line-height:1.08;
    margin:1mm 0;
  }
}
@media screen and (max-width:360px){
  .student-info h2{font-size:7.1pt !important}
}
@media print{
  .student-info h2{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    display:block !important;
    font-size:8pt !important;
    line-height:1.08;
    overflow-wrap:anywhere;
  }
}

/* Tata letak footer kartu: alamat di atas, catatan masa berlaku di bawah */
.card-foot{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:flex-end !important;
  gap:.45mm !important;
  text-align:left !important;
  white-space:normal !important;
  overflow:hidden;
}
.card-foot .school-contact{
  order:1;
  display:block;
  width:100%;
  text-align:left !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.card-foot .validity-note{
  order:2;
  display:block;
  width:100%;
  text-align:left !important;
  font-style:italic !important;
  font-weight:400 !important;
  white-space:nowrap;
}
@media screen and (max-width:600px){
  .card-foot{align-items:flex-start !important;text-align:left !important}
  .card-foot .school-contact,.card-foot .validity-note{text-align:left !important}
}
@media print{
  .card-foot{align-items:flex-start !important;text-align:left !important}
  .card-foot .school-contact,.card-foot .validity-note{text-align:left !important}
  .card-foot .validity-note{font-style:italic !important}
}

/* Sisi belakang kartu: satu backdrop dengan sisi depan, berisi janji siswa */
.card-pair{display:flex;align-items:flex-start;gap:3mm;break-inside:avoid}
.student-card-back{
  background:linear-gradient(130deg,var(--card-color),#04151b 75%);
  display:flex;align-items:center;justify-content:center;
  padding:4mm 4.5mm;
  -webkit-print-color-adjust:exact;print-color-adjust:exact;
}
.student-card-back:before{
  content:"";position:absolute;inset:0;
  background:linear-gradient(145deg,transparent 56%,#ffffff08 56.5%,transparent 58%,#ffffff0b 62%,transparent 63%);
  pointer-events:none;
}
.student-card-back:after{
  content:"";position:absolute;width:85mm;height:50mm;right:-25mm;bottom:-35mm;
  border:1px solid #ffffff35;transform:rotate(-35deg);
  box-shadow:0 0 0 5px #ffffff08,0 0 0 12px #ffffff08,0 0 0 20px #ffffff08;
}
.back-content{position:relative;z-index:1;width:100%;color:#fff}
.back-content h2{
  margin:0 0 2.2mm;text-align:center;color:#fff;
  font-size:8.2pt;line-height:1.1;letter-spacing:.35px;font-weight:800;
}
.back-content ol{
  margin:0;padding-left:5mm;color:#fff;
  font-size:5.65pt;line-height:1.48;
}
.back-content li{padding-left:.5mm;margin:0;white-space:normal}
@media screen and (max-width:700px){
  .card-pair{flex-direction:column;align-items:center;gap:12px}
  .card-pair .student-card{width:min(85.6mm,calc(100vw - 32px));height:auto;aspect-ratio:85.6 / 54}
  .student-card-back{min-height:54mm}
  .back-content h2{font-size:8pt;margin-bottom:2mm}
  .back-content ol{font-size:5.7pt;line-height:1.5}
}
@media print{
  .card-pair{display:flex;flex-direction:row;align-items:flex-start;gap:2mm;break-inside:avoid;page-break-inside:avoid}
  .card-pair .student-card{flex:none;box-shadow:none;margin:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .student-card-back{width:85.6mm;height:54mm;padding:4mm 4.5mm}
  .back-content h2{font-size:8.2pt}
  .back-content ol{font-size:5.65pt;line-height:1.48}
}

/* Logo dan identitas yang dapat diatur pada header login */
.auth-logo-image{width:52px;height:52px;flex:none;object-fit:contain;border-radius:12px;background:#fff;padding:4px;border:1px solid #e2eaec}
.auth-brand strong{max-width:100%;overflow-wrap:anywhere}
.auth-brand small{max-width:100%;line-height:1.35}
@media(max-width:480px){.auth-logo-image{width:46px;height:46px}.auth-brand{align-items:center}}

/* Final mobile login image constraints */
.auth-brand .auth-logo-image{display:block;width:54px;height:54px;max-width:54px;max-height:54px;min-width:54px;min-height:54px;object-fit:contain;flex:0 0 54px}
@media(max-width:600px){.auth-brand .auth-logo-image{width:48px;height:48px;max-width:48px;max-height:48px;min-width:48px;min-height:48px;flex-basis:48px}}

/* Final mobile preview fix for the reverse side: fit all 9 promises inside ID-1 card */
.student-card-back{
  height:54mm;
  min-height:54mm;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.student-card-back .back-content{
  width:100%;
  max-height:100%;
  overflow:hidden;
}
.student-card-back .back-content h2{
  font-size:8pt !important;
  line-height:1.08 !important;
  margin:0 0 2mm !important;
  text-align:center !important;
  letter-spacing:.2px !important;
}
.student-card-back .back-content ol{
  margin:0 !important;
  padding-left:5mm !important;
  font-size:6.4pt !important;
  line-height:1.22 !important;
}
.student-card-back .back-content li{
  font-size:inherit !important;
  line-height:inherit !important;
  margin:0 0 .35mm !important;
  padding-left:.3mm !important;
  white-space:normal !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
@media screen and (max-width:700px){
  .card-pair{
    width:100%;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    gap:14px !important;
  }
  .card-pair .student-card-back{
    width:min(85.6mm,calc(100vw - 32px)) !important;
    height:auto !important;
    min-height:0 !important;
    aspect-ratio:85.6 / 54 !important;
    padding:3.2mm 4mm !important;
    overflow:hidden !important;
  }
  .card-pair .student-card-back .back-content{
    width:100% !important;
    max-height:100% !important;
    overflow:hidden !important;
  }
  .card-pair .student-card-back .back-content h2{
    font-size:7.6pt !important;
    line-height:1.05 !important;
    margin:0 0 1.5mm !important;
  }
  .card-pair .student-card-back .back-content ol{
    font-size:6.1pt !important;
    line-height:1.18 !important;
    padding-left:4.5mm !important;
  }
  .card-pair .student-card-back .back-content li{
    font-size:inherit !important;
    line-height:inherit !important;
    margin:0 0 .25mm !important;
  }
}
@media screen and (max-width:360px){
  .card-pair .student-card-back .back-content h2{font-size:7.2pt !important}
  .card-pair .student-card-back .back-content ol{font-size:5.8pt !important;line-height:1.16 !important}
}
@media print{
  .card-pair .student-card-back{
    width:85.6mm !important;height:54mm !important;min-height:54mm !important;
    aspect-ratio:auto !important;padding:3.2mm 4mm !important;
    overflow:hidden !important;
  }
  .student-card-back .back-content h2{font-size:7.6pt !important}
  .student-card-back .back-content ol{font-size:6.1pt !important;line-height:1.18 !important}
  .student-card-back .back-content li{font-size:inherit !important;line-height:inherit !important}
}

/* A4 portrait PDF download for public card verification */
.pdf-export-mode{
  display:flex !important;
  width:210mm !important;
  height:297mm !important;
  min-width:210mm !important;
  max-width:210mm !important;
  min-height:297mm !important;
  max-height:297mm !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  background:#fff !important;
  align-items:center !important;
  justify-content:center !important;
}
.pdf-export-mode .card-pair{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:100% !important;
  gap:10mm !important;
  margin:0 !important;
  padding:0 !important;
}
.pdf-export-mode .student-card{
  display:flex !important;
  flex:none !important;
  width:85.6mm !important;
  min-width:85.6mm !important;
  max-width:85.6mm !important;
  height:54mm !important;
  min-height:54mm !important;
  max-height:54mm !important;
  aspect-ratio:auto !important;
  margin:0 !important;
  border-radius:4mm !important;
  box-shadow:none !important;
  overflow:hidden !important;
  -webkit-print-color-adjust:exact !important;
  print-color-adjust:exact !important;
}
.pdf-export-mode .verified-card .card-body{
  display:grid !important;
  grid-template-columns:17mm minmax(0,1fr) 12mm !important;
  gap:2mm !important;
  align-items:center !important;
  margin-top:4mm !important;
}
.pdf-export-mode .verified-card .photo-box{width:17mm !important;height:22mm !important}
.pdf-export-mode .verified-card .qr{width:12mm !important;height:12mm !important}
.pdf-export-mode .verified-card .student-info h2{
  display:block !important;
  white-space:normal !important;
  overflow:visible !important;
  -webkit-line-clamp:unset !important;
  overflow-wrap:anywhere !important;
}
.pdf-export-mode .student-card-back{
  padding:3.2mm 4mm !important;
  aspect-ratio:auto !important;
}
.pdf-export-mode .student-card-back .back-content h2{font-size:7.6pt !important}
.pdf-export-mode .student-card-back .back-content ol{font-size:6.1pt !important;line-height:1.18 !important}
#downloadPdfBtn:disabled{opacity:.65;cursor:wait}

/* Single-page A4 portrait PDF: render each card separately to prevent page splitting */
.pdf-card-export{
  display:flex !important;
  flex:none !important;
  box-sizing:border-box !important;
  width:85.6mm !important;
  min-width:85.6mm !important;
  max-width:85.6mm !important;
  height:54mm !important;
  min-height:54mm !important;
  max-height:54mm !important;
  aspect-ratio:auto !important;
  margin:0 !important;
  padding:4mm !important;
  border-radius:4mm !important;
  overflow:hidden !important;
  box-shadow:none !important;
  -webkit-print-color-adjust:exact !important;
  print-color-adjust:exact !important;
}
.pdf-card-export.verified-card .card-body{
  display:grid !important;
  grid-template-columns:17mm minmax(0,1fr) 12mm !important;
  gap:2mm !important;
  align-items:center !important;
  margin-top:4mm !important;
}
.pdf-card-export.verified-card .photo-box{width:17mm !important;height:22mm !important}
.pdf-card-export.verified-card .student-info{min-width:0 !important;overflow:hidden !important}
.pdf-card-export.verified-card .student-info h2{
  display:block !important;
  max-height:2.3em !important;
  white-space:normal !important;
  overflow:hidden !important;
  overflow-wrap:anywhere !important;
}
.pdf-card-export.verified-card .qr{
  width:12mm !important;height:12mm !important;padding:.6mm !important;
  overflow:hidden !important;justify-self:end !important;
}
.pdf-card-export.verified-card .qr img,
.pdf-card-export.verified-card .qr canvas{width:100% !important;height:100% !important;display:block !important}
.pdf-card-export.verified-card .card-foot{
  left:4mm !important;right:4mm !important;bottom:2mm !important;
  padding-top:1mm !important;font-size:5pt !important;
}
.pdf-card-export.verified-card .card-foot .validity-note{font-size:5.2pt !important}
.pdf-card-export.student-card-back{
  justify-content:center !important;
  padding:3.2mm 4mm !important;
}
.pdf-card-export.student-card-back .back-content{width:100% !important;max-height:100% !important;overflow:hidden !important}
.pdf-card-export.student-card-back .back-content h2{font-size:7.6pt !important;line-height:1.05 !important;margin:0 0 1.5mm !important}
.pdf-card-export.student-card-back .back-content ol{font-size:6.1pt !important;line-height:1.18 !important;padding-left:4.5mm !important;margin:0 !important}
.pdf-card-export.student-card-back .back-content li{font-size:inherit !important;line-height:inherit !important;margin:0 0 .25mm !important}

/* Export clone: preserve the same desktop/front-card composition as the live preview */
#pdf-front-card.pdf-render-front{
  display:block !important;
  position:relative !important;
  box-sizing:border-box !important;
  width:85.6mm !important;
  min-width:85.6mm !important;
  max-width:85.6mm !important;
  height:54mm !important;
  min-height:54mm !important;
  max-height:54mm !important;
  aspect-ratio:auto !important;
  padding:5mm !important;
  margin:0 !important;
  overflow:hidden !important;
  border-radius:4mm !important;
  box-shadow:none !important;
}
#pdf-front-card.pdf-render-front .card-head{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:8px !important;
}
#pdf-front-card.pdf-render-front .card-head div{
  display:flex !important;
  flex-direction:column !important;
  min-width:0 !important;
}
#pdf-front-card.pdf-render-front .card-body{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:3mm !important;
  margin-top:5mm !important;
}
#pdf-front-card.pdf-render-front .photo-box{
  display:flex !important;
  flex:0 0 19mm !important;
  width:19mm !important;
  min-width:19mm !important;
  height:25mm !important;
  min-height:25mm !important;
}
#pdf-front-card.pdf-render-front .student-info{
  display:block !important;
  flex:1 1 0 !important;
  min-width:0 !important;
  overflow:hidden !important;
}
#pdf-front-card.pdf-render-front .student-info h2{
  display:block !important;
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  max-height:2.25em !important;
  line-height:1.1 !important;
}
#pdf-front-card.pdf-render-front .qr{
  display:block !important;
  flex:0 0 16mm !important;
  width:16mm !important;
  min-width:16mm !important;
  height:16mm !important;
  padding:1mm !important;
  justify-self:auto !important;
  overflow:hidden !important;
}
#pdf-front-card.pdf-render-front .qr img,
#pdf-front-card.pdf-render-front .qr canvas{
  display:block !important;
  width:100% !important;
  height:100% !important;
}
#pdf-front-card.pdf-render-front .card-foot{
  position:absolute !important;
  left:5mm !important;
  right:5mm !important;
  bottom:2.5mm !important;
}
#pdf-back-card.pdf-render-back{
  display:flex !important;
  position:relative !important;
  box-sizing:border-box !important;
  width:85.6mm !important;
  min-width:85.6mm !important;
  max-width:85.6mm !important;
  height:54mm !important;
  min-height:54mm !important;
  max-height:54mm !important;
  aspect-ratio:auto !important;
  padding:3.2mm 4mm !important;
  margin:0 !important;
  overflow:hidden !important;
  border-radius:4mm !important;
  box-shadow:none !important;
  justify-content:center !important;
}
#pdf-back-card.pdf-render-back .back-content{width:100% !important;max-height:100% !important;overflow:hidden !important}
#pdf-back-card.pdf-render-back .back-content h2{font-size:7.6pt !important;line-height:1.05 !important;margin:0 0 1.5mm !important}
#pdf-back-card.pdf-render-back .back-content ol{font-size:6.1pt !important;line-height:1.18 !important;padding-left:4.5mm !important;margin:0 !important}
#pdf-back-card.pdf-render-back .back-content li{font-size:inherit !important;line-height:inherit !important;margin:0 0 .25mm !important}

/* QR code: scale both QRCode.js canvas and image to the full QR frame.
   The previous rule sized only IMG, leaving the 180px canvas clipped. */
.qr{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}
.qr canvas,
.qr img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
  flex:none !important;
}
#pdf-front-card.pdf-render-front .qr{
  width:16mm !important;
  height:16mm !important;
  min-width:16mm !important;
  flex:0 0 16mm !important;
  padding:1mm !important;
  overflow:hidden !important;
  background:#fff !important;
}
#pdf-front-card.pdf-render-front .qr canvas,
#pdf-front-card.pdf-render-front .qr img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
}
/* Mobile preview remains proportional and does not inherit export-only dimensions */
@media(max-width:600px){
  .verified-card .qr{
    width:12mm !important;
    height:12mm !important;
    min-width:12mm !important;
    flex:0 0 12mm !important;
    padding:.6mm !important;
  }
  .verified-card .qr canvas,
  .verified-card .qr img{
    width:100% !important;
    height:100% !important;
    max-width:100% !important;
    max-height:100% !important;
  }
}

/* Final QR centering and square-image normalization */
.verified-card .card-body{align-items:center !important}
.verified-card .qr{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  align-self:center !important;
  justify-self:center !important;
  position:relative !important;
  box-sizing:border-box !important;
  aspect-ratio:1 / 1 !important;
  overflow:hidden !important;
  line-height:0 !important;
  margin:0 !important;
  padding:1mm !important;
  background:#fff !important;
}
.verified-card .qr img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
  object-position:center center !important;
  margin:0 auto !important;
  padding:0 !important;
  border:0 !important;
  flex:0 0 100% !important;
}
.verified-card .qr canvas{display:none !important}
@media(max-width:600px){
  .verified-card .card-body{align-items:center !important}
  .verified-card .qr{
    width:12mm !important;height:12mm !important;
    min-width:12mm !important;min-height:12mm !important;
    justify-self:center !important;align-self:center !important;
    flex:0 0 12mm !important;
    padding:.55mm !important;
  }
}
#pdf-front-card.pdf-render-front .card-body{
  position:relative !important;
  display:flex !important;
  align-items:center !important;
}
#pdf-front-card.pdf-render-front .qr{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  align-self:center !important;
  justify-self:center !important;
  width:16mm !important;height:16mm !important;
  min-width:16mm !important;min-height:16mm !important;
  flex:0 0 16mm !important;
  aspect-ratio:1 / 1 !important;
  padding:1mm !important;
  margin:0 !important;
  transform:none !important;
}
#pdf-front-card.pdf-render-front .qr img{
  display:block !important;width:100% !important;height:100% !important;
  max-width:100% !important;max-height:100% !important;
  object-fit:contain !important;object-position:center center !important;
  margin:0 auto !important;flex:0 0 100% !important;
}

/* Admin card preview + browser print: keep QR square and centered */
.student-card .card-body .qr{
  box-sizing:border-box !important;
  width:16mm !important;
  height:16mm !important;
  min-width:16mm !important;
  min-height:16mm !important;
  flex:0 0 16mm !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  align-self:center !important;
  justify-self:center !important;
  position:relative !important;
  padding:1mm !important;
  margin:0 !important;
  overflow:hidden !important;
  background:#fff !important;
  line-height:0 !important;
  aspect-ratio:1 / 1 !important;
}
.student-card .card-body .qr img,
.student-card .card-body .qr canvas{
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
  object-position:center center !important;
  margin:0 auto !important;
  padding:0 !important;
  border:0 !important;
  flex:0 0 100% !important;
}
@media screen and (max-width:700px){
  .card-page .student-card .card-body .qr{
    width:16mm !important;
    height:16mm !important;
    min-width:16mm !important;
    min-height:16mm !important;
    flex:0 0 16mm !important;
  }
}
@media print{
  .card-page .student-card .card-body .qr{
    width:16mm !important;
    height:16mm !important;
    min-width:16mm !important;
    min-height:16mm !important;
    flex:0 0 16mm !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    align-self:center !important;
    margin:0 !important;
    padding:1mm !important;
    transform:none !important;
  }
  .card-page .student-card .card-body .qr img{
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
    object-position:center center !important;
  }
}
