/* ============================================================
   طبقة المنصة — الشريط الموحد والقائمة والبحث
   تُحقن في الوحدات الأربعين وتُستخدم في الصفحات الجديدة
   الهوية البصرية مطابقة لملفات الوحدات الأصلية
   ============================================================ */

:root{
  --sh-h:48px;
  --sh-ink:#141A22; --sh-ink-soft:#2C3742;
  --sh-paper:#F2F4F3; --sh-surface:#FFFFFF; --sh-surface-2:#FAFBFA;
  --sh-verd:#1F6F5C; --sh-verd-deep:#164E41; --sh-verd-tint:#E4EFEB; --sh-verd-line:#BFD8D0;
  --sh-slate:#5A6672; --sh-slate-line:#D6DBD9;
  --sh-amber:#9C5A17; --sh-amber-tint:#F7EDE2; --sh-amber-line:#E2C7A4;
  --sh-blue:#2A4B6E; --sh-blue-tint:#E7EDF3; --sh-blue-line:#C0CFDF;
  --sh-rust:#8E3A32; --sh-rust-tint:#FBEEEE;
  --sh-disp:"Noto Kufi Arabic",system-ui,sans-serif;
  --sh-body:"IBM Plex Sans Arabic",system-ui,sans-serif;
  --sh-mono:"IBM Plex Mono",ui-monospace,monospace;
}

/* ---------- إفساح مكان الشريط فوق محتوى الوحدة ---------- */
body.ea-shelled{padding-top:var(--sh-h)}
body.ea-shelled .topbar{top:var(--sh-h)}
body.ea-shelled .rail{top:calc(var(--sh-h) + 76px);max-height:calc(100vh - var(--sh-h) - 96px)}
html.ea-shelled{scroll-padding-top:calc(var(--sh-h) + 96px)}
body.ea-shelled section{scroll-margin-top:calc(var(--sh-h) + 100px)}

/* ============================================================
   الشريط العلوي
   ============================================================ */
.eash{position:fixed;top:0;inset-inline:0;height:var(--sh-h);z-index:900;
  background:#0D1218;border-bottom:1px solid #000;
  display:flex;align-items:center;gap:14px;padding:0 16px;
  font-family:var(--sh-body);color:#DDE4E1;
  box-shadow:0 1px 0 rgba(0,0,0,.4)}
.eash *{box-sizing:border-box}

.eash-home{display:flex;align-items:center;gap:9px;text-decoration:none;color:#F2F4F3;flex:0 0 auto}
.eash-mark{width:25px;height:25px;border-radius:4px;background:var(--sh-verd);
  display:grid;place-items:center;font-family:var(--sh-mono);font-size:11px;
  font-weight:600;color:#fff;letter-spacing:-.4px}
.eash-name{font-family:var(--sh-disp);font-size:13.5px;font-weight:700;letter-spacing:-.3px;white-space:nowrap}
.eash-home:hover .eash-name{color:var(--sh-verd-tint)}

.eash-sep{width:1px;height:22px;background:#2A343C;flex:0 0 auto}

/* حقل البحث */
.eash-sbox{position:relative;flex:1;max-width:380px;min-width:0}
.eash-sbox input{width:100%;height:31px;border-radius:4px;border:1px solid #2A343C;
  background:#161D25;color:#E4EAE7;font-family:var(--sh-body);font-size:13.2px;
  padding:0 32px 0 11px;outline:none;transition:border-color .15s,background .15s}
.eash-sbox input::placeholder{color:#6B7780}
.eash-sbox input:focus{border-color:var(--sh-verd);background:#1A222B}
.eash-sbox svg{position:absolute;inset-inline-start:9px;top:50%;transform:translateY(-50%);
  width:14px;height:14px;stroke:#6B7780;fill:none;stroke-width:2;pointer-events:none}
.eash-kbd{position:absolute;inset-inline-end:8px;top:50%;transform:translateY(-50%);
  font-family:var(--sh-mono);font-size:10px;color:#5B6670;border:1px solid #2A343C;
  border-radius:3px;padding:1px 4px;pointer-events:none;direction:ltr}

.eash-right{margin-inline-start:auto;display:flex;align-items:center;gap:12px;flex:0 0 auto}

/* حلقة التقدم */
.eash-prog{display:flex;align-items:center;gap:8px;text-decoration:none;color:inherit;
  padding:3px 8px;border-radius:4px;transition:background .15s}
.eash-prog:hover{background:#1A222B}
.eash-ring{position:relative;width:26px;height:26px;flex:0 0 26px}
.eash-ring svg{width:26px;height:26px;transform:rotate(-90deg)}
.eash-ring circle{fill:none;stroke-width:3}
.eash-ring .bg{stroke:#2A343C}
.eash-ring .fg{stroke:var(--sh-verd);stroke-linecap:round;transition:stroke-dasharray .4s ease}
.eash-pct{font-family:var(--sh-mono);font-size:12px;color:#9AA6AC;direction:ltr;white-space:nowrap}
.eash-plabel{font-size:12px;color:#6B7780;white-space:nowrap}

.eash-btn{background:transparent;border:1px solid #2A343C;color:#C3CCD1;border-radius:4px;
  height:31px;padding:0 11px;font-family:var(--sh-body);font-size:12.8px;font-weight:500;
  cursor:pointer;display:inline-flex;align-items:center;gap:7px;transition:all .15s;white-space:nowrap}
.eash-btn:hover{background:#1A222B;border-color:var(--sh-verd);color:#fff}
.eash-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}

@media (max-width:880px){
  .eash-name{display:none}
  .eash-plabel{display:none}
  .eash-sep{display:none}
}
@media (max-width:560px){
  .eash{gap:9px;padding:0 11px}
  .eash-kbd{display:none}
  .eash-btn span{display:none}
  .eash-btn{padding:0 9px}
}

/* ============================================================
   القائمة الجانبية
   ============================================================ */
.eash-scrim{position:fixed;inset:0;z-index:940;background:rgba(13,18,24,.55);
  opacity:0;pointer-events:none;transition:opacity .22s}
.eash-scrim.on{opacity:1;pointer-events:auto}

.eash-drawer{position:fixed;top:0;inset-inline-end:0;height:100%;width:min(400px,92vw);
  z-index:950;background:var(--sh-surface);border-inline-start:1px solid var(--sh-slate-line);
  display:flex;flex-direction:column;font-family:var(--sh-body);color:var(--sh-ink);
  box-shadow:-14px 0 40px -20px rgba(20,26,34,.5)}
/* الدرج مثبّت على الحافة inline-end — وهي اليسار في RTL واليمين في LTR.
   ومحور transform لا ينقلب مع الاتجاه، فلكل حالة إزاحة إخفاء مختلفة.
   والإخفاء بـ visibility أيضاً حتى لا يتسرّب شيء فوق شريط التمرير،
   ولإخراجه من ترتيب التنقل بالمفاتيح وهو مغلق. */
.eash-drawer{transform:translateX(-101%);visibility:hidden;
  transition:transform .26s cubic-bezier(.4,0,.2,1),visibility 0s linear .26s}
html[dir="ltr"] .eash-drawer{transform:translateX(101%)}
.eash-drawer.on{transform:translateX(0);visibility:visible;
  transition:transform .26s cubic-bezier(.4,0,.2,1),visibility 0s}

.eash-dh{padding:14px 18px;background:var(--sh-ink);color:#E9EDEB;
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto}
.eash-dh b{font-family:var(--sh-disp);font-size:14.5px;font-weight:700}
.eash-dh em{display:block;font-style:normal;font-size:11.5px;color:#8C9995;margin-top:2px}
.eash-x{background:transparent;border:0;color:#8C9995;font-size:24px;line-height:1;
  cursor:pointer;padding:0 4px;transition:color .15s}
.eash-x:hover{color:#fff}

.eash-db{flex:1;overflow-y:auto;scrollbar-width:thin;padding:0 0 30px}

.eash-quick{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1px;background:var(--sh-slate-line);
  border-bottom:1px solid var(--sh-slate-line)}
.eash-quick a{background:var(--sh-surface-2);padding:12px 8px;text-align:center;text-decoration:none;
  color:var(--sh-ink-soft);transition:background .15s}
.eash-quick a:hover{background:var(--sh-verd-tint);color:var(--sh-verd-deep)}
.eash-quick i{display:block;font-family:var(--sh-mono);font-style:normal;font-size:13px;
  font-weight:600;color:var(--sh-verd);margin-bottom:3px;direction:ltr}
.eash-quick span{font-size:11.5px;line-height:1.4;display:block}

.eash-links{padding:12px 16px;border-bottom:1px solid var(--sh-slate-line);
  display:flex;flex-wrap:wrap;gap:7px}
.eash-links a{font-size:12.5px;text-decoration:none;color:var(--sh-ink-soft);
  border:1px solid var(--sh-slate-line);border-radius:3px;padding:4px 10px;
  background:var(--sh-surface-2);transition:all .15s}
.eash-links a:hover{border-color:var(--sh-verd);color:var(--sh-verd-deep);background:var(--sh-verd-tint)}

.eash-trk{border-bottom:1px solid var(--sh-slate-line)}
.eash-trk-h{padding:11px 16px 9px;background:var(--sh-surface-2);
  display:flex;align-items:baseline;gap:10px}
.eash-trk-n{font-family:var(--sh-mono);font-size:11px;font-weight:600;color:#fff;
  background:var(--sh-slate);border-radius:3px;padding:2px 6px;flex:0 0 auto;direction:ltr}
.eash-trk.done .eash-trk-n{background:var(--sh-verd)}
.eash-trk-t{font-family:var(--sh-disp);font-size:13px;font-weight:700;flex:1;line-height:1.4}
.eash-trk-c{font-family:var(--sh-mono);font-size:10.5px;color:var(--sh-slate);direction:ltr}

.eash-u{display:flex;align-items:center;gap:10px;padding:8px 16px 8px 14px;text-decoration:none;
  color:var(--sh-ink-soft);font-size:13.4px;line-height:1.5;
  border-inline-start:2.5px solid transparent;transition:background .13s}
.eash-u:hover{background:var(--sh-verd-tint);color:var(--sh-verd-deep)}
.eash-u.cur{background:var(--sh-verd-tint);border-inline-start-color:var(--sh-verd);
  color:var(--sh-verd-deep);font-weight:600}
.eash-u-c{font-family:var(--sh-mono);font-size:11px;color:var(--sh-slate);flex:0 0 30px;direction:ltr}
.eash-u.cur .eash-u-c{color:var(--sh-verd)}
.eash-u-t{flex:1;min-width:0}
.eash-u-s{flex:0 0 auto;width:15px;height:15px;border-radius:50%;
  border:1.5px solid var(--sh-slate-line);display:grid;place-items:center;
  font-size:9px;color:#fff;line-height:1}
.eash-u.done .eash-u-s{background:var(--sh-verd);border-color:var(--sh-verd)}
.eash-u.wip .eash-u-s{background:var(--sh-amber);border-color:var(--sh-amber)}
.eash-gate{font-family:var(--sh-mono);font-size:9.5px;color:var(--sh-amber);
  background:var(--sh-amber-tint);border:1px solid var(--sh-amber-line);
  border-radius:2px;padding:0 4px;flex:0 0 auto;direction:ltr}
.eash-cross{font-family:var(--sh-mono);font-size:9.5px;color:var(--sh-blue);
  background:var(--sh-blue-tint);border:1px solid var(--sh-blue-line);
  border-radius:2px;padding:0 4px;flex:0 0 auto;direction:ltr}

/* ============================================================
   لوحة البحث
   ============================================================ */
.eash-sp{position:fixed;inset:0;z-index:960;display:none;
  background:rgba(13,18,24,.5);padding:80px 20px 20px;overflow-y:auto}
.eash-sp.on{display:block}
.eash-sp-in{max-width:720px;margin:0 auto;background:var(--sh-surface);
  border:1px solid var(--sh-slate-line);border-top:3px solid var(--sh-verd);
  box-shadow:0 24px 60px -24px rgba(20,26,34,.6);font-family:var(--sh-body)}
.eash-sp-h{padding:14px 18px;border-bottom:1px solid var(--sh-slate-line);
  display:flex;align-items:center;gap:12px;background:var(--sh-surface-2)}
.eash-sp-h input{flex:1;height:38px;border:1px solid var(--sh-slate-line);border-radius:4px;
  padding:0 12px;font-family:var(--sh-body);font-size:15.5px;color:var(--sh-ink);outline:none;
  background:var(--sh-surface)}
.eash-sp-h input:focus{border-color:var(--sh-verd);box-shadow:0 0 0 3px var(--sh-verd-tint)}
.eash-sp-meta{padding:8px 18px;font-size:12.3px;color:var(--sh-slate);
  border-bottom:1px solid var(--sh-slate-line);background:var(--sh-surface-2)}
.eash-sp-b{max-height:56vh;overflow-y:auto;scrollbar-width:thin}
.eash-r{display:block;padding:12px 18px;border-bottom:1px solid var(--sh-slate-line);
  text-decoration:none;color:var(--sh-ink);transition:background .13s}
.eash-r:last-child{border-bottom:0}
.eash-r:hover,.eash-r.sel{background:var(--sh-verd-tint)}
.eash-r-top{display:flex;align-items:baseline;gap:9px;margin-bottom:4px;flex-wrap:wrap}
.eash-r-c{font-family:var(--sh-mono);font-size:10.5px;font-weight:600;color:var(--sh-verd-deep);
  background:var(--sh-verd-tint);border:1px solid var(--sh-verd-line);border-radius:2px;
  padding:1px 6px;direction:ltr}
.eash-r-u{font-size:12px;color:var(--sh-slate)}
.eash-r-t{font-family:var(--sh-disp);font-size:14.5px;font-weight:700;line-height:1.45;
  margin:0 0 4px}
.eash-r-x{font-size:13px;line-height:1.7;color:var(--sh-ink-soft)}
.eash-r-x mark{background:#FBEFC7;color:var(--sh-ink);padding:0 2px;border-radius:2px}
.eash-sp-e{padding:34px 18px;text-align:center;color:var(--sh-slate);font-size:14px;line-height:1.8}

/* ============================================================
   شريط أدوات الوحدة (أسفل الصفحة داخل الوحدات)
   ============================================================ */
.eash-save{position:fixed;bottom:18px;inset-inline-start:18px;z-index:880;
  background:var(--sh-ink);color:#D6DEDA;font-family:var(--sh-body);font-size:12.5px;
  padding:8px 14px;border-radius:4px;box-shadow:0 8px 24px -12px rgba(20,26,34,.7);
  display:flex;align-items:center;gap:8px;
  opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .25s,transform .25s}
.eash-save.on{opacity:1;transform:translateY(0)}
.eash-save i{width:7px;height:7px;border-radius:50%;background:var(--sh-verd);
  display:inline-block;font-style:normal;flex:0 0 7px}

@media print{
  .eash,.eash-drawer,.eash-scrim,.eash-sp,.eash-save{display:none!important}
  body.ea-shelled{padding-top:0}
  body.ea-shelled .topbar{top:0}
}
