:root{--navy:#12355b;--navy2:#1d4c80;--orange:#e8730c;--bg:#f2f5f9;--card:#fff;--line:#dbe2ea;--text:#1b2733;--muted:#66788a;--green:#1c7c4d;--red:#b3261e;--amber:#b36b00;--blue:#1b5fb0;}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,"Noto Nastaliq Urdu","Noto Sans Arabic",Arial,sans-serif;color:var(--text);background:var(--bg)}
a{color:var(--navy2)}
h1,h2,h3{margin:0 0 .4em;line-height:1.2}
.muted{color:var(--muted)}.small{font-size:.85rem}.center{text-align:center}
.ur{font-family:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq","Noto Sans Arabic",serif;color:var(--muted);font-weight:400;font-size:.9em;margin-left:.4em}
.wrap{max-width:1100px;margin:0 auto;padding:14px 16px 60px}
.pub-wrap{max-width:720px;margin:0 auto;padding:12px 14px 50px}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:18px;box-shadow:0 1px 3px rgba(0,0,0,.04);margin-bottom:14px}
.card.center{text-align:center}
.card h2.t{font-size:1.05rem;margin-bottom:.7em}
.logo-lg{width:110px;height:auto}
.lead{font-size:1.1rem}
.refbox{display:inline-block;background:#eef5ff;border:1px dashed var(--navy2);border-radius:10px;padding:10px 22px;margin:8px 0 14px}
.refbox strong{font-size:1.5rem;letter-spacing:.04em}

/* buttons */
.btn{display:inline-block;background:var(--navy);color:#fff;border:0;border-radius:10px;padding:10px 16px;font:inherit;font-weight:600;text-decoration:none;cursor:pointer;line-height:1.2}
.btn:hover{background:var(--navy2)}
.btn.big{width:100%;padding:14px;font-size:1.1rem;background:var(--orange)}
.btn.big:hover{background:#cf6508}
.btn.small{padding:6px 10px;font-size:.85rem}
.btn.ghost{background:#fff;color:var(--navy);border:1px solid var(--line)}
.btn.green{background:var(--green)}.btn.red{background:var(--red)}.btn.amber{background:var(--amber)}
.btn:disabled{opacity:.6}

/* form */
.form-head{display:flex;gap:14px;align-items:center;border-bottom:2px solid var(--navy);padding-bottom:12px;margin-bottom:16px}
.form-head img{width:76px;height:auto}
.form-head h1{font-size:1.35rem;color:var(--navy);letter-spacing:.03em}
.form-head h2{font-size:.9rem;color:var(--text)}
.form-head p{margin:2px 0 0}
.field{margin-bottom:14px}
.field label{display:block;font-weight:600;margin-bottom:5px}
.field label b{color:var(--navy)}
input,select,textarea{width:100%;font:inherit;padding:11px 12px;border:1px solid #c3ccd6;border-radius:10px;background:#fff;color:var(--text)}
input:focus,select:focus,textarea:focus{outline:2px solid var(--navy2);border-color:var(--navy2)}
input[type=file]{padding:9px;background:#f8fafc}
input[type=checkbox]{width:auto}
.prefix{display:flex}
.prefix span{display:flex;align-items:center;padding:0 12px;background:#eaeff5;border:1px solid #c3ccd6;border-right:0;border-radius:10px 0 0 10px;font-weight:700}
.prefix input{border-radius:0 10px 10px 0}
.uploads{display:grid;gap:0}
.prev{display:block;max-width:100%;max-height:160px;border:1px solid var(--line);border-radius:8px;margin-top:8px}
.prev.sq{width:110px;height:110px;object-fit:cover}
.undertaking{background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:14px 0}
.undertaking h3{font-size:1rem}.undertaking ol{margin:.3em 0 .8em;padding-left:1.3em}
.check{display:flex;gap:8px;align-items:flex-start;font-weight:600}
.check input{margin-top:5px}
#sig{width:100%;height:auto;aspect-ratio:3/1;background:#fff;border:1px dashed #8a9aab;border-radius:10px;touch-action:none;display:block;margin-bottom:6px}
.hp{position:absolute;left:-9999px;top:-9999px;height:0;overflow:hidden}
.alert{padding:11px 14px;border-radius:10px;margin:0 0 14px;border:1px solid}
.alert ul{margin:.3em 0 0;padding-left:1.2em}
.a-ok{background:#e9f7ef;border-color:#a9dcc0;color:#14502f}
.a-err{background:#fdeceb;border-color:#f0b7b3;color:#7d1b15}

/* admin chrome */
body.admin{background:var(--bg)}
.top{background:var(--navy);color:#fff;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 14px;flex-wrap:wrap}
.top a{color:#fff}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;font-weight:700}
.brand img{width:34px;height:34px;background:#fff;border-radius:50%;padding:2px}
.who{font-size:.85rem;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.who a{background:rgba(255,255,255,.18);padding:3px 9px;border-radius:7px;text-decoration:none}
.tabs{display:flex;gap:6px;overflow-x:auto;padding:8px 12px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5;-webkit-overflow-scrolling:touch}
.tabs a{white-space:nowrap;text-decoration:none;color:var(--text);padding:7px 13px;border-radius:999px;font-weight:600;font-size:.92rem}
.tabs a.on{background:var(--navy);color:#fff}

/* dashboard */
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:14px}
.stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 14px;text-decoration:none;color:inherit;display:block}
.stat b{display:block;font-size:1.8rem;line-height:1.1;color:var(--navy)}
.stat span{color:var(--muted);font-size:.85rem}
.stat.hot b{color:var(--orange)}

/* badges */
.badge{display:inline-block;padding:2px 9px;border-radius:999px;font-size:.78rem;font-weight:700;white-space:nowrap}
.b-grey{background:#e8edf2;color:#3d4c5b}.b-blue{background:#dcebfb;color:#134f94}.b-amber{background:#fdecc8;color:#7a4a00}
.b-green{background:#d8f1e3;color:#14602f}.b-red{background:#fbdad7;color:#8c1d16}

/* lists / tables */
.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.filters input,.filters select{width:auto;flex:1 1 150px}
table.list{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
table.list th,table.list td{padding:9px 11px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle}
table.list th{background:#f0f4f8;font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
table.list tr:last-child td{border-bottom:0}
.thumb{width:44px;height:44px;border-radius:50%;object-fit:cover;background:#e3e9ef;display:block}
.pager{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}
.pager a,.pager span{padding:6px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;text-decoration:none}
.pager span{background:var(--navy);color:#fff;border-color:var(--navy)}

/* member detail */
.grid2{display:grid;gap:14px}
.kv{display:grid;grid-template-columns:130px 1fr;gap:6px 10px;margin:0}
.kv dt{color:var(--muted);font-size:.88rem}.kv dd{margin:0;font-weight:600;word-break:break-word}
.docs{display:flex;gap:10px;flex-wrap:wrap}
.docs figure{margin:0;text-align:center;font-size:.8rem;color:var(--muted)}
.docs img{display:block;max-width:100%;height:auto;max-height:200px;border:1px solid var(--line);border-radius:8px;background:#fff}
.docs .ph{width:120px;height:120px;object-fit:cover}
.actions form{margin:0 0 14px}
.actions label{display:block;font-weight:600;margin-bottom:4px}
.row-btns{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.timeline{list-style:none;padding:0;margin:0}
.timeline li{padding:8px 0;border-bottom:1px solid var(--line);font-size:.9rem}
.timeline li:last-child{border:0}

/* scan */
#scanbox video{width:100%;max-height:60vh;background:#000;border-radius:12px}
#scanres{margin-top:12px}

/* verify (public) */
.vcard{max-width:420px;margin:24px auto;text-align:center}
.vcard .vph{width:150px;height:150px;border-radius:50%;object-fit:cover;border:4px solid var(--line);margin:10px auto;display:block;background:#e3e9ef}
.vstate{font-size:1.4rem;font-weight:800;padding:10px;border-radius:10px;margin:8px 0}
.vstate.ok{background:#d8f1e3;color:#14602f}.vstate.no{background:#fbdad7;color:#8c1d16}.vstate.warn{background:#fdecc8;color:#7a4a00}

/* login */
.login{max-width:380px;margin:8vh auto 0;padding:0 14px}

/* responsive */
@media (min-width:700px){
  .stats{grid-template-columns:repeat(5,1fr)}
  .uploads{grid-template-columns:repeat(3,1fr);gap:12px}
  .grid2{grid-template-columns:1fr 1fr}
  .grid2 .wide{grid-column:1/-1}
}
@media (max-width:699px){
  table.list.resp thead{display:none}
  table.list.resp,table.list.resp tbody,table.list.resp tr,table.list.resp td{display:block;width:100%}
  table.list.resp tr{border-bottom:8px solid var(--bg);padding:6px 0}
  table.list.resp td{border:0;padding:3px 12px}
  table.list.resp td[data-l]::before{content:attr(data-l) ": ";color:var(--muted);font-size:.8rem}
  .kv{grid-template-columns:105px 1fr}
}

/* ---------- membership card (screen + print) ---------- */
.cardwrap{display:flex;flex-wrap:wrap;gap:20px;justify-content:center;margin:16px 0}
.idc{width:85.6mm;height:54mm;border-radius:3.5mm;position:relative;overflow:hidden;color:#fff;background:linear-gradient(135deg,#12355b 0%,#1d4c80 60%,#e8730c 140%);box-shadow:0 2px 10px rgba(0,0,0,.25);font-family:system-ui,Arial,sans-serif;page-break-inside:avoid}
.idc .hd{display:flex;align-items:center;gap:2mm;padding:2.5mm 3mm 0}
.idc .hd img{width:9mm;height:9mm;background:#fff;border-radius:50%;padding:.4mm}
.idc .hd b{font-size:3.1mm;letter-spacing:.04em;line-height:1.1;display:block}
.idc .hd small{font-size:2.1mm;opacity:.85;display:block}
.idc .body{display:flex;gap:3mm;padding:2.5mm 3mm}
.idc .ph{width:21mm;height:21mm;border-radius:1.5mm;border:.5mm solid #fff;object-fit:cover;background:#fff}
.idc .inf{flex:1;min-width:0}
.idc .nm{font-size:3.6mm;font-weight:800;line-height:1.15;margin-bottom:.8mm}
.idc .ln{font-size:2.3mm;line-height:1.45;opacity:.95}
.idc .no{position:absolute;left:3mm;bottom:2.5mm;background:#fff;color:#12355b;font-weight:800;font-size:3.4mm;padding:.8mm 2.4mm;border-radius:1.2mm;letter-spacing:.05em}
.idc .qr{position:absolute;right:3mm;bottom:2.5mm;width:17mm;height:17mm;background:#fff;padding:.8mm;border-radius:1.2mm}
.idc .qr svg,.idc .qr img{width:100%;height:100%;display:block}
.idc.back{background:#fff;color:#1b2733;border:.3mm solid #c9d3de}
.idc.back .bt{padding:3.5mm;font-size:2.35mm;line-height:1.5}
.idc.back .bt h4{margin:0 0 1.2mm;font-size:2.9mm;color:#12355b}
.idc.back ol{margin:0;padding-left:3.4mm}
.idc.back .ft{position:absolute;left:3.5mm;right:3.5mm;bottom:2.5mm;font-size:2mm;color:#66788a;border-top:.25mm solid #dbe2ea;padding-top:1mm}
.noprint{}
@media print{
  body{background:#fff}
  .noprint,.top,.tabs{display:none!important}
  .wrap{padding:0;max-width:none}
  .cardwrap{gap:6mm;margin:0}
  .idc{box-shadow:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  @page{margin:10mm}
}
