/* ============================================================
   منصة ارتكاز للمتطوعين — الأنماط المشتركة
   ============================================================ */
html{color-scheme:light dark; -webkit-text-size-adjust:100%}
html,body{height:100%}
img{max-width:100%}
[hidden]{display:none!important}

:root{
  --bg:#F5F3EC; --surface:#FFFFFF; --surface-2:#FAF8F2; --surface-3:#F0EDE3;
  --line:#E2DED1; --line-2:#CEC8B6;
  --text:#141A2C; --muted:#5D6480; --faint:#8A8FA3;
  --brand:#1C2A5B; --brand-fill:#1C2A5B; --brand-soft:#E7EAF4; --on-brand:#FFFFFF;
  --accent:#9E7128; --accent-2:#C6A15A; --accent-soft:#F5EEDF;
  --ok:#2E7A57; --ok-soft:#E4F1EA;
  --crit:#A63A3A; --crit-soft:#F7E7E7;
  --shadow-1:0 1px 2px rgba(20,26,44,.05);
  --shadow-2:0 2px 4px rgba(20,26,44,.05), 0 14px 32px -18px rgba(20,26,44,.35);
  --r-s:8px; --r-m:12px; --r-l:18px;
  --f-display:"Tajawal","Segoe UI",system-ui,sans-serif;
  --f-body:"IBM Plex Sans Arabic","Tajawal","Segoe UI",system-ui,sans-serif;
  --f-cert:"Amiri","Times New Roman",serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0E1120; --surface:#161B2C; --surface-2:#1B2136; --surface-3:#222943;
    --line:#2A3150; --line-2:#3A4368;
    --text:#E9ECF7; --muted:#9BA3C0; --faint:#7B84A3;
    --brand:#A9BCF5; --brand-fill:#2F3E74; --brand-soft:#212A4C; --on-brand:#FFFFFF;
    --accent:#D6AE68; --accent-2:#B3893E; --accent-soft:#2A2418;
    --ok:#6BC79B; --ok-soft:#16301F;
    --crit:#E38686; --crit-soft:#331A1A;
    --shadow-1:0 1px 2px rgba(0,0,0,.3);
    --shadow-2:0 2px 4px rgba(0,0,0,.3), 0 14px 32px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"]{
  --bg:#0E1120; --surface:#161B2C; --surface-2:#1B2136; --surface-3:#222943;
  --line:#2A3150; --line-2:#3A4368;
  --text:#E9ECF7; --muted:#9BA3C0; --faint:#7B84A3;
  --brand:#A9BCF5; --brand-fill:#2F3E74; --brand-soft:#212A4C; --on-brand:#FFFFFF;
  --accent:#D6AE68; --accent-2:#B3893E; --accent-soft:#2A2418;
  --ok:#6BC79B; --ok-soft:#16301F;
  --crit:#E38686; --crit-soft:#331A1A;
  --shadow-1:0 1px 2px rgba(0,0,0,.3);
  --shadow-2:0 2px 4px rgba(0,0,0,.3), 0 14px 32px -18px rgba(0,0,0,.8);
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--f-body); font-size:15px; line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{font-family:var(--f-display); margin:0; text-wrap:balance; line-height:1.3}
p{margin:0}
button,input,select,textarea{font:inherit; color:inherit}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:4px}
.tnum{font-variant-numeric:tabular-nums}

/* ---------- shell ---------- */
.wrap{max-width:1180px; margin-inline:auto; padding-inline:16px}
.topbar{
  position:sticky; top:env(safe-area-inset-top,0px); z-index:40;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--line);
}
.topbar-in{display:flex; align-items:center; gap:14px; padding-block:12px}
.brandmark{display:flex; align-items:center; gap:11px; min-width:0}
.brandmark img{width:40px; height:40px; object-fit:contain; flex:none}
.brandmark .bt{font-family:var(--f-display); font-weight:800; font-size:15px; letter-spacing:-.2px; white-space:nowrap}
.brandmark .bs{font-size:11.5px; color:var(--muted); line-height:1.2}
.spacer{flex:1}

.iconbtn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:36px; padding-inline:12px; border-radius:var(--r-s);
  border:1px solid var(--line); background:var(--surface); cursor:pointer;
  font-size:13px; font-weight:600; color:var(--text); transition:border-color .15s, background .15s;
}
.iconbtn:hover{border-color:var(--line-2); background:var(--surface-2)}
.iconbtn svg{width:15px;height:15px}

/* ---------- registration ---------- */
.reg-stage{position:relative; min-height:100%; padding-block:28px 56px; overflow:hidden}
.reg-glow{
  position:absolute; inset-inline:0; top:-160px; height:460px; pointer-events:none; z-index:0;
  background:radial-gradient(60% 100% at 50% 0%, color-mix(in srgb,var(--brand) 16%, transparent), transparent 70%);
}
.reg-star{position:absolute; top:-40px; inset-inline-start:-90px; width:360px; opacity:.05; pointer-events:none; z-index:0; color:var(--brand)}
.reg-inner{position:relative; z-index:1; max-width:660px; margin-inline:auto}

.reg-head{text-align:center; display:grid; gap:12px; justify-items:center; margin-bottom:26px}
.reg-head img{width:104px; height:104px; object-fit:contain}
.eyebrow{
  font-size:11.5px; font-weight:700; letter-spacing:1.4px; color:var(--accent);
  text-transform:uppercase;
}
.reg-head h1{font-size:clamp(25px,5.4vw,34px); font-weight:800; letter-spacing:-.6px}
.reg-head .lede{color:var(--muted); max-width:44ch; font-size:14.5px}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-l);
  box-shadow:var(--shadow-2);
}
.card-pad{padding:clamp(18px,4vw,30px)}

form .fields{display:grid; gap:20px}
.field{display:grid; gap:7px}
.field > label, .fieldlabel{display:block; font-size:13.5px; font-weight:600; letter-spacing:-.1px}
.req{color:var(--accent); font-weight:700}
.hint{font-size:12px; color:var(--faint)}
.control{
  width:100%; height:46px; padding-inline:13px; border-radius:var(--r-m);
  border:1px solid var(--line-2); background:var(--surface-2); color:var(--text);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
select.control{appearance:none; background-image:linear-gradient(transparent,transparent); padding-inline-end:36px}
.select-shell{position:relative}
.select-shell::after{
  content:""; position:absolute; inset-inline-end:14px; top:50%; width:8px; height:8px;
  border-inline-end:2px solid var(--muted); border-block-end:2px solid var(--muted);
  transform:translateY(-70%) rotate(45deg); pointer-events:none;
}
.control:focus{outline:none; border-color:var(--brand); background:var(--surface); box-shadow:0 0 0 3px var(--brand-soft)}
.control[aria-invalid="true"]{border-color:var(--crit); background:var(--crit-soft)}
.err{font-size:12.5px; color:var(--crit); font-weight:600}
.err[hidden]{display:none}

fieldset{border:0; padding:0; margin:0; display:grid; gap:9px}
.choices{display:grid; gap:9px}
.choices.two{grid-template-columns:1fr 1fr}
@media (max-width:520px){ .choices.two{grid-template-columns:1fr} }
.choice{
  position:relative; display:flex; align-items:flex-start; gap:10px;
  padding:13px 14px; border:1px solid var(--line-2); border-radius:var(--r-m);
  background:var(--surface-2); cursor:pointer; transition:border-color .15s, background .15s;
}
.choice:hover{border-color:var(--brand)}
.choice input{position:absolute; opacity:0; pointer-events:none}
.dot{
  flex:none; width:18px; height:18px; margin-top:3px; border-radius:50%;
  border:2px solid var(--line-2); background:var(--surface); transition:border-color .15s;
}
.choice input:checked ~ .dot{border-color:var(--brand); border-width:6px}
.choice:has(input:checked){border-color:var(--brand); background:var(--brand-soft)}
.choice input:focus-visible ~ .dot{outline:2px solid var(--accent); outline-offset:2px}
.ctxt{display:grid; gap:2px; min-width:0}
.ctxt b{font-size:14px; font-weight:600}
.ctxt span{font-size:12.5px; color:var(--muted); line-height:1.45}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  height:50px; padding-inline:22px; border-radius:var(--r-m); border:0; cursor:pointer;
  background:var(--brand-fill); color:var(--on-brand); font-weight:700; font-size:15px;
  font-family:var(--f-display); transition:filter .15s, transform .06s;
}
.btn:hover{filter:brightness(1.12)}
.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.55; cursor:not-allowed}
.btn.full{width:100%}
.btn.ghost{background:transparent; color:var(--text); border:1px solid var(--line-2)}
.btn.ghost:hover{background:var(--surface-2); filter:none}
.btn.gold{background:var(--accent); color:#fff}
.btn.wa{background:#1F8A4C; color:#fff}
.btn.sm{height:38px; font-size:13px; padding-inline:14px; border-radius:var(--r-s)}
.btn svg{width:17px; height:17px; flex:none}
.btn.sm svg{width:15px; height:15px}
.btn.danger{background:transparent; color:var(--crit); border:1px solid var(--crit)}

.formfoot{margin-top:24px; display:grid; gap:12px}
.privacy{font-size:12px; color:var(--faint); text-align:center; line-height:1.6}

/* ---------- thank you ---------- */
.thanks{position:relative; z-index:1; max-width:640px; margin-inline:auto}
.seal{
  width:88px; height:88px; margin-inline:auto; border-radius:50%;
  display:grid; place-items:center; background:var(--accent-soft);
  border:1px solid var(--accent-2); color:var(--accent);
}
.seal svg{width:40px;height:40px}
.thanks h2{font-size:clamp(23px,5vw,31px); font-weight:800; letter-spacing:-.5px; text-align:center}
.thanks .name-hi{color:var(--accent)}
.thanks-body{
  margin-top:16px; font-size:15.5px; line-height:2; color:var(--text);
  text-align:center; max-width:48ch; margin-inline:auto;
}
.thanks-body em{font-style:normal; font-weight:700; color:var(--brand)}
.recap{
  margin-top:24px; border-top:1px solid var(--line); border-bottom:1px solid var(--line);
  padding-block:16px; display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:14px;
}
.recap div{display:grid; gap:3px}
.recap dt{font-size:11.5px; color:var(--faint); font-weight:600; letter-spacing:.4px}
.recap dd{margin:0; font-size:14px; font-weight:600}
.support{
  margin-top:22px; background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--r-m); padding:16px; display:grid; gap:12px;
}
.support p{font-size:13.5px; color:var(--muted); line-height:1.75}
.support b{color:var(--text)}
.actions-row{display:flex; gap:10px; flex-wrap:wrap}
.actions-row .btn{flex:1 1 180px}

/* ---------- notices ---------- */
.notice{
  display:flex; gap:11px; align-items:flex-start; padding:13px 15px;
  border-radius:var(--r-m); font-size:13.5px; line-height:1.65; border:1px solid;
}
.notice svg{width:17px;height:17px;flex:none;margin-top:3px}
.notice.warn{background:var(--accent-soft); border-color:var(--accent-2); color:var(--text)}
.notice.bad{background:var(--crit-soft); border-color:var(--crit); color:var(--text)}
.notice.info{background:var(--brand-soft); border-color:var(--line-2); color:var(--text)}

/* ---------- dashboard ---------- */
.dash{padding-block:22px 64px}
.tabs{display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--line); margin-bottom:24px}
.tab{
  border:0; background:transparent; cursor:pointer; padding:10px 14px; white-space:nowrap;
  font-weight:600; font-size:13.5px; color:var(--muted); border-bottom:2px solid transparent;
  margin-bottom:-1px; font-family:var(--f-display);
}
.tab:hover{color:var(--text)}
.tab[aria-selected="true"]{color:var(--brand); border-bottom-color:var(--brand)}

.sect{display:grid; gap:14px; margin-bottom:34px}
.sect-head{display:flex; align-items:baseline; gap:12px; flex-wrap:wrap}
.sect-head h2{font-size:17px; font-weight:700; letter-spacing:-.2px}
.sect-head p{font-size:13px; color:var(--muted)}

.kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px}
.kpi{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-m);
  padding:15px 16px; display:grid; gap:4px; box-shadow:var(--shadow-1);
}
.kpi .k{font-size:12px; color:var(--muted); font-weight:600}
.kpi .v{font-family:var(--f-display); font-size:30px; font-weight:800; letter-spacing:-1px; line-height:1.1}
.kpi .s{font-size:11.5px; color:var(--faint)}
.kpi.lead{background:var(--brand-fill); border-color:var(--brand-fill); color:var(--on-brand)}
.kpi.lead .k,.kpi.lead .s{color:rgba(255,255,255,.72)}

.cmp{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:700px){ .cmp{grid-template-columns:1fr} }
.org-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-l);
  padding:18px; display:grid; gap:14px; box-shadow:var(--shadow-1); position:relative; overflow:hidden;
}
.org-card::before{content:""; position:absolute; inset-block:0; inset-inline-start:0; width:4px; background:var(--oc,var(--brand))}
.org-card h3{font-size:15px; font-weight:700}
.org-card .total{display:flex; align-items:baseline; gap:8px}
.org-card .total b{font-family:var(--f-display); font-size:38px; font-weight:800; letter-spacing:-1.5px; color:var(--oc,var(--brand))}
.org-card .total span{font-size:13px; color:var(--muted)}
.splitbar{display:flex; height:9px; border-radius:99px; overflow:hidden; background:var(--surface-3)}
.splitbar i{display:block}
.legend{display:flex; gap:14px; flex-wrap:wrap; font-size:12.5px; color:var(--muted)}
.legend span{display:inline-flex; align-items:center; gap:6px}
.legend i{width:9px; height:9px; border-radius:3px; display:inline-block}
.mini{display:grid; grid-template-columns:1fr 1fr; gap:10px; border-top:1px solid var(--line); padding-top:12px}
.mini div{display:grid; gap:2px}
.mini dt{font-size:11.5px; color:var(--faint); font-weight:600}
.mini dd{margin:0; font-size:15px; font-weight:700; font-family:var(--f-display)}

.barlist{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-m); padding:16px; display:grid; gap:11px; box-shadow:var(--shadow-1)}
.bar{display:grid; grid-template-columns:minmax(110px,auto) 1fr auto; gap:12px; align-items:center; font-size:13px}
.bar .bl{color:var(--text); font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.bar .bt{height:20px; border-radius:5px; background:var(--surface-3); overflow:hidden; display:flex}
.bar .bt i{display:block; transition:width .5s cubic-bezier(.2,.7,.3,1)}
.bar .bv{font-weight:700; font-variant-numeric:tabular-nums; min-width:2.5ch; text-align:start}
.empty{padding:34px 16px; text-align:center; color:var(--muted); font-size:13.5px}

.toolbar{display:flex; gap:9px; flex-wrap:wrap; align-items:center}
.toolbar .control{height:38px; width:auto; font-size:13px; border-radius:var(--r-s)}
.toolbar .grow{flex:1 1 200px}

.tablewrap{overflow-x:auto; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-m); box-shadow:var(--shadow-1)}
table{border-collapse:collapse; width:100%; min-width:760px; font-size:13.5px}
th{
  text-align:start; font-weight:700; font-size:11.5px; letter-spacing:.4px; color:var(--muted);
  padding:11px 14px; border-bottom:1px solid var(--line); background:var(--surface-2); white-space:nowrap;
}
td{padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:var(--surface-2)}
.pill{
  display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:99px;
  font-size:11.5px; font-weight:700; white-space:nowrap;
}
.pill.ert{background:var(--brand-soft); color:var(--brand)}
.pill.him{background:var(--accent-soft); color:var(--accent)}
.pill.f{background:var(--ok-soft); color:var(--ok)}
.pill.m{background:var(--surface-3); color:var(--muted)}
.pill.sample{background:var(--surface-3); color:var(--faint); font-weight:600}
.rowacts{display:flex; gap:6px}
.miniact{
  width:31px; height:31px; display:grid; place-items:center; border-radius:7px;
  border:1px solid var(--line); background:var(--surface); cursor:pointer; color:var(--muted);
}
.miniact:hover{border-color:var(--brand); color:var(--brand)}
.miniact.wa:hover{border-color:#1F8A4C; color:#1F8A4C}
.miniact.del:hover{border-color:var(--crit); color:var(--crit)}
.miniact svg{width:15px;height:15px}

.grid2{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,420px); gap:16px; align-items:start}
@media (max-width:880px){ .grid2{grid-template-columns:1fr} }
.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-m); padding:18px; display:grid; gap:14px; box-shadow:var(--shadow-1)}
.panel h3{font-size:15px; font-weight:700}
.panel .sub{font-size:12.5px; color:var(--muted); line-height:1.7}

.certstage{background:var(--surface-3); border:1px solid var(--line); border-radius:var(--r-m); padding:12px; display:grid; place-items:center; min-height:180px}
.certstage canvas{width:100%; height:auto; max-width:100%; border-radius:4px; box-shadow:var(--shadow-2); display:block}

.qrbox{display:grid; gap:12px; justify-items:center; text-align:center}
.qrbox .qrframe{background:#fff; padding:12px; border-radius:var(--r-m); border:1px solid var(--line-2); line-height:0}
.qrbox img, .qrbox canvas{display:block}
.linkrow{display:flex; gap:8px; width:100%}
.linkrow input{flex:1; min-width:0; font-size:12px; direction:ltr; text-align:left}

.steps{display:grid; gap:9px; counter-reset:s; margin:0; padding:0; list-style:none}
.steps li{display:grid; grid-template-columns:auto 1fr; gap:10px; font-size:13px; color:var(--muted); line-height:1.6}
.steps li::before{
  counter-increment:s; content:counter(s);
  width:21px; height:21px; border-radius:50%; background:var(--brand-soft); color:var(--brand);
  display:grid; place-items:center; font-size:11px; font-weight:800; margin-top:2px;
}

.gate{max-width:380px; margin:min(12vh,80px) auto 0; display:grid; gap:16px; text-align:center; justify-items:center}
.pinput{letter-spacing:.5em; text-align:center; font-size:20px; font-weight:700; direction:ltr}

.toast{
  position:fixed; inset-inline:16px; bottom:calc(18px + env(safe-area-inset-bottom,0px)); z-index:99;
  margin-inline:auto; max-width:440px; background:var(--text); color:var(--bg);
  padding:12px 16px; border-radius:var(--r-m); font-size:13.5px; font-weight:600;
  box-shadow:var(--shadow-2); text-align:center;
}
.toast[hidden]{display:none!important}

.skeleton{padding:40px 16px; text-align:center; color:var(--muted); font-size:13.5px}

@media (prefers-reduced-motion:reduce){ *{animation:none!important; transition:none!important} }

/* ---------- إضافات النسخة المستضافة ---------- */
:root{ padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px) }

/* flex + align-self:stretch بدل grid/justify-items:center —
   يمنع أي ابن من أن يُحسب عرضه بنسبة مئوية تختلف عن إخوته */
.authwrap{
  max-width:400px; margin:min(10vh,72px) auto 0;
  display:flex; flex-direction:column; align-items:center;
  gap:18px; text-align:center;
}
.authwrap > *{max-width:100%}
.authwrap img{width:88px; height:88px; object-fit:contain; flex:none}
.authwrap form{align-self:stretch; display:grid; gap:12px; text-align:start; min-width:0}
.authwrap form *{min-width:0; max-width:100%}
.authwrap .field input{direction:ltr; text-align:left}
.authwrap .err, .authwrap .notice{overflow-wrap:anywhere}

.userchip{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--muted)}
.userchip b{color:var(--text); font-weight:600; direction:ltr}

.loadingbar{
  position:fixed; inset-inline:0; top:0; height:2px; background:var(--accent); z-index:100;
  transform-origin:100% 50%; animation:slide 1.1s ease-in-out infinite;
}
@keyframes slide{0%{transform:scaleX(0)}50%{transform:scaleX(1)}100%{transform:scaleX(0)}}
.loadingbar[hidden]{display:none!important}

.printonly{display:none}
@media print{
  .topbar,.tabs,.toolbar,.rowacts,.iconbtn,.btn{display:none!important}
  body{background:#fff}
  .printonly{display:block}
}

/* ---------- شريط أيام الفعالية ---------- */
.daystrip{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-m);
  padding:14px 16px; display:grid; gap:12px; margin-bottom:20px; box-shadow:var(--shadow-1);
}
.daystrip-head{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.daystrip-title{font-size:11.5px; font-weight:700; letter-spacing:1px; color:var(--accent)}
.daystrip-now{font-family:var(--f-display); font-size:15px; font-weight:700}

.daychips{display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; scrollbar-width:thin}
.daychip{
  flex:none; min-width:132px; display:grid; gap:2px; text-align:start; cursor:pointer;
  padding:10px 13px; border-radius:var(--r-m); border:1px solid var(--line-2);
  background:var(--surface-2); color:var(--text); font-family:var(--f-body);
  transition:border-color .15s, background .15s;
}
.daychip:hover{border-color:var(--brand)}
.daychip b{font-family:var(--f-display); font-size:13.5px; font-weight:700}
.daychip span{font-size:11.5px; color:var(--muted); white-space:nowrap}
.daychip .cnt{font-weight:700; color:var(--accent)}
.daychip.today{border-color:var(--accent-2)}
.daychip.on{
  background:var(--brand-fill); border-color:var(--brand-fill); color:var(--on-brand);
}
.daychip.on span{color:rgba(255,255,255,.75)}
.daychip.on .cnt{color:#fff}

.sect-head .spacer{flex:1}
.sect-head{align-items:center}
