﻿/* =============================================================================
   nav-shell — الهيدر وقائمة الأقسام الموحّدة
   ألوان الهوية: تيل #0E8C9B على أسطح فاتحة، وحدود #E1E9EC، ونص #0B1B22.
   ========================================================================== */

:root{
  --ns-teal:#0E8C9B;
  --ns-teal-2:#12A8B8;
  --ns-ink:#0B1B22;
  --ns-dim:#5C737C;
  --ns-line:#E1E9EC;
  --ns-soft:#EEF7F8;
  --ns-card:#FFFFFF;
}

/* ── إخفاء آليات التنقّل القديمة (تبقى في DOM، فلا يُفقد إجراء) ───────────
   لا نُخفيها إلا بعد أن ينجح بناء القائمة الجديدة: class ns-on على <html>. */
html.ns-on .ch-menu-btn,
html.ns-on .ch-menu,
html.ns-on #pn-btn,
html.ns-on #pn-d,
html.ns-on #pn-s,
html.ns-on .burger,
html.ns-on .drawer,
html.ns-on #sidebarToggle,
html.ns-on .dashboard-sidebar{ display:none !important; }

html.ns-locked{ overflow:hidden; }

/* ── الزر ─────────────────────────────────────────────────────────────── */
.ns-btn{
  display:inline-flex; align-items:center; gap:9px;
  min-height:40px; padding:0 13px; margin-inline-start:6px;
  border-radius:11px; cursor:pointer;
  border:1px solid color-mix(in srgb, currentColor 22%, transparent);
  background:color-mix(in srgb, currentColor 9%, transparent);
  color:inherit; font:700 13px/1 Tajawal,"IBM Plex Sans Arabic",system-ui,sans-serif;
  transition:background .15s ease, border-color .15s ease, transform .15s ease;
}
.ns-btn:hover{ background:color-mix(in srgb, currentColor 16%, transparent); }
.ns-btn:active{ transform:translateY(1px); }
.ns-btn:focus-visible{ outline:2px solid var(--ns-teal-2); outline-offset:2px; }
.ns-btn[aria-expanded="true"]{ background:var(--ns-teal); border-color:var(--ns-teal); color:#fff; }
.ns-bars{ display:grid; gap:3px; }
.ns-bars i{ display:block; width:15px; height:2px; border-radius:2px; background:currentColor; transition:transform .18s, opacity .18s; }
.ns-btn[aria-expanded="true"] .ns-bars i:nth-child(1){ transform:translateY(5px) rotate(45deg); }
.ns-btn[aria-expanded="true"] .ns-bars i:nth-child(2){ opacity:0; }
.ns-btn[aria-expanded="true"] .ns-bars i:nth-child(3){ transform:translateY(-5px) rotate(-45deg); }
@media (max-width:640px){ .ns-btn .ns-btn-txt{ display:none; } .ns-btn{ padding:0 11px; } }

/* ── الحاجز ───────────────────────────────────────────────────────────── */
#ns-scrim{
  position:fixed; inset:0; z-index:9300;
  background:rgba(11,27,34,.38); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
#ns-scrim.is-open{ opacity:1; pointer-events:auto; }

/* ── اللوحة ───────────────────────────────────────────────────────────── */
#ns-panel{
  position:fixed; z-index:9350; inset-block-start:72px; inset-inline-end:20px;
  width:min(400px, calc(100vw - 32px));
  max-height:min(72vh, 660px);
  display:flex; flex-direction:column;
  background:var(--ns-card); color:var(--ns-ink);
  border:1px solid var(--ns-line); border-radius:20px;
  box-shadow:0 28px 70px -24px rgba(11,27,34,.42), 0 2px 8px rgba(11,27,34,.06);
  font-family:Tajawal,"IBM Plex Sans Arabic",system-ui,-apple-system,"Segoe UI",sans-serif;
  opacity:0; visibility:hidden; transform:translateY(-8px) scale(.99);
  transform-origin:top left;
  transition:opacity .16s ease, transform .16s ease, visibility .16s;
  overflow:hidden;
}
#ns-panel.is-open{ opacity:1; visibility:visible; transform:none; }

html[dir="rtl"] #ns-panel{ transform-origin:top right; }

/* رأس اللوحة */
.ns-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:13px 16px 11px;
  background:linear-gradient(180deg,#F5FAFB,#FFFFFF);
  border-block-end:1px solid var(--ns-line);
}
.ns-title{ display:flex; align-items:baseline; gap:9px; }
.ns-title b{ font-size:15.5px; letter-spacing:.1px; color:var(--ns-ink); }
.ns-role{ font-size:11px; color:var(--ns-dim); background:var(--ns-soft); padding:3px 8px; border-radius:99px; }
.ns-x{
  width:34px; height:34px; border-radius:10px; border:1px solid var(--ns-line);
  background:#fff; color:var(--ns-ink); cursor:pointer; display:grid; place-items:center;
  font-size:14px; line-height:1;
}
.ns-x:hover{ background:var(--ns-soft); border-color:var(--ns-teal); }
.ns-x:focus-visible{ outline:2px solid var(--ns-teal); outline-offset:2px; }

/* البحث */
.ns-search{ position:relative; padding:12px 16px 10px; }
.ns-search input{
  width:100%; box-sizing:border-box; padding:11px 38px 11px 36px;
  border:1px solid var(--ns-line); border-radius:12px;
  background:#FBFDFD; color:var(--ns-ink); font:inherit; font-size:13.5px;
}
.ns-search input::placeholder{ color:#8AA0A8; }
.ns-search input:focus{ outline:none; border-color:var(--ns-teal); background:#fff; box-shadow:0 0 0 3px rgba(14,140,155,.14); }
.ns-si{ position:absolute; inset-inline-start:28px; inset-block-start:50%; transform:translateY(-58%); color:#8AA0A8; font-size:14px; pointer-events:none; }
.ns-kbd{
  position:absolute; inset-inline-end:26px; inset-block-start:50%; transform:translateY(-58%);
  font:600 11px/1 ui-monospace,monospace; color:#8AA0A8;
  border:1px solid var(--ns-line); border-radius:5px; padding:3px 5px; background:#fff;
}

/* الجسم */
.ns-body{ overflow:auto; padding:0 10px 8px; flex:0 1 auto; overscroll-behavior:contain; }
.ns-group{ margin-bottom:2px; padding-bottom:2px; }
.ns-group + .ns-group{ border-block-start:1px solid #F2F6F7; margin-block-start:4px; padding-block-start:4px; }
.ns-group-head{
  width:100%; display:flex; align-items:center; gap:8px;
  padding:9px 10px; margin-top:2px;
  border:0; border-radius:9px; background:transparent; cursor:pointer;
  color:var(--ns-dim); font:700 11.5px/1 inherit; letter-spacing:.04em; text-align:start;
}
.ns-group-head:hover{ background:#F7FAFB; color:var(--ns-ink); }
.ns-group-head:focus-visible{ outline:2px solid var(--ns-teal); outline-offset:-2px; }
.ns-group-head span{ flex:1; }
.ns-group-head b{
  font-size:10px; font-weight:700; color:var(--ns-dim);
  background:#F1F6F7; border-radius:99px; padding:2px 7px; min-width:18px; text-align:center;
}
.ns-caret{
  width:7px; height:7px; border-inline-end:1.8px solid currentColor; border-block-end:1.8px solid currentColor;
  transform:rotate(45deg); transition:transform .16s ease; margin-inline-start:2px; opacity:.7;
}
.ns-group-head[aria-expanded="true"] .ns-caret{ transform:rotate(-135deg); }

.ns-list{ display:grid; gap:1px; padding:0 0 4px; }

/* البند */
.ns-item{
  display:flex; align-items:center; gap:10px;
  min-height:42px; padding:9px 11px;
  border-radius:10px; text-decoration:none; color:var(--ns-ink);
  font-size:13.8px; line-height:1.35;
  transition:background .12s ease, color .12s ease;
}
.ns-item:hover{ background:var(--ns-soft); color:#08626C; }
.ns-item:focus-visible{ outline:2px solid var(--ns-teal); outline-offset:-2px; }
.ns-item i[data-lucide], .ns-item svg{ width:17px; height:17px; flex:0 0 17px; opacity:.75; }
.ns-item:hover i[data-lucide], .ns-item:hover svg{ opacity:1; }
.ns-dot{ width:6px; height:6px; border-radius:50%; background:#B9CDD2; flex:0 0 6px; margin-inline-start:5px; }
.ns-item-t{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ns-item.is-active{ background:var(--ns-soft); color:#08626C; font-weight:800; }
.ns-item.is-active .ns-dot{ background:var(--ns-teal); box-shadow:0 0 0 3px rgba(14,140,155,.16); }
.ns-item.is-active::after{
  content:""; width:6px; height:6px; border-radius:50%; background:var(--ns-teal); flex:0 0 6px;
}
.ns-guide{ margin-top:6px; border-top:1px solid var(--ns-line); border-radius:0 0 10px 10px; padding-top:12px; }

/* التذييل */
.ns-empty{ margin:0; padding:18px 16px 26px; text-align:center; color:var(--ns-dim); font-size:13px; }
.ns-foot{
  border-top:1px solid var(--ns-line); padding:9px 16px;
  display:flex; justify-content:flex-end; background:#FCFDFD;
}
.ns-foot-link{ font-size:12px; color:var(--ns-dim); text-decoration:none; padding:5px 8px; border-radius:7px; }
.ns-foot-link:hover{ color:var(--ns-teal); background:var(--ns-soft); }

/* ── الجوال: درج كامل ─────────────────────────────────────────────────── */
@media (max-width:760px){
  #ns-panel{
    inset-block-start:0; inset-inline-end:0;
    width:min(360px, 90vw); height:100dvh; max-height:none;
    border-radius:0; border:0;
    transform:translateX(105%);
  }
  /* في LTR تقع اللوحة على اليسار، فالتحريك الموجب يُدخلها للشاشة بدل إخراجها. */
  html[dir="ltr"] #ns-panel{ transform:translateX(-105%); }
  /* القاعدة السابقة (html[dir="rtl"] #ns-panel) كانت تتغلّب على .is-open
     بأولوية أعلى، فتبقى اللوحة خارج الشاشة رغم فتحها. هذا يرفع الأولوية
     إلى المستوى نفسه مع بقاء الحالة المفتوحة أخيرًا. */
  html[dir] #ns-panel.is-open{ transform:none !important; }
  .ns-head{ padding-top:max(14px, env(safe-area-inset-top)); }
  .ns-body{ padding-bottom:max(14px, env(safe-area-inset-bottom)); }
}

/* ── تقليل الحركة ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  #ns-panel, #ns-scrim, .ns-btn, .ns-item{ transition:none; }
}
@media print{ #ns-btn, #ns-panel, #ns-scrim{ display:none !important; } }

/* الزر داخل ترويسة بسيطة (sd-header) يدفع نفسه إلى الطرف بدل أن يزاحم العنوان */
header > .ns-btn{ margin-inline-start:auto; }

/* زر ثابت في الصفحات ذات ترويسة بسيطة: نفس الزاوية دائمًا */
.ns-btn.ns-floating{ position:fixed; inset-block-start:14px; inset-inline-end:14px; z-index:880; margin:0; box-shadow:0 6px 18px rgba(11,27,34,.14); }
@media print{ .ns-btn.ns-floating{ display:none !important; } }

/* ═══ أزرار الترويسة: قياس واحد وشكل واحد ═══
   كانت ثلاثة أصناف بأحجام مختلفة (أيقونة، إجراء، خروج بنص) فتظهر غير مرتّبة.
   الآن كلها دائرة 38px، والترتيب من اليمين: العلامة ← [الصفحة الرئيسية
   الإشعارات الدليل اللغة الخروج] ← البرغر في الطرف. */
.exam-header .header-actions{ display:flex; align-items:center; gap:8px; }
.exam-header .hbtn{
  width:38px; height:38px; border-radius:50%;
  display:inline-grid; place-items:center; padding:0; position:relative;
  border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.08);
  color:#fff; cursor:pointer; flex:0 0 auto;
  transition:background .16s ease, border-color .16s ease;
}
.exam-header .hbtn:hover{ background:rgba(255,255,255,.17); border-color:rgba(255,255,255,.32); }
.exam-header .hbtn:focus-visible{ outline:2px solid #12A8B8; outline-offset:2px; }
.exam-header .hbtn svg{ width:18px; height:18px; }
.exam-header .hbtn .ns-bars{ display:grid; gap:3px; }
.exam-header .hbtn .ns-bars i{ display:block; width:16px; height:2px; border-radius:2px; background:currentColor; }
#notificationCount{
  position:absolute; top:-3px; inset-inline-end:-3px;
  min-width:16px; height:16px; padding:0 4px; border-radius:99px;
  background:#B8862F; color:#0B1B22; font:800 10px/16px Tajawal,system-ui,sans-serif;
  display:grid; place-items:center;
}
#platformLangSlot > *{ height:38px; border-radius:99px; }

/* ═══ توحيد أدوات الترويسة الإضافية ═══
   زر البحث السريع (ui-cmd-trigger) كان 40×41 بمربّع، وتلميحه ظاهر دائمًا
   كفقاعة فوقه. نجعله دائرة كبقية الأزرار، ولا يظهر التلميح إلا عند التحويم
   أو التركيز. */
.exam-header .header-actions .ui-cmd-trigger{
  width:38px; height:38px; min-width:38px; border-radius:50%;
  display:inline-grid; place-items:center; padding:0; box-sizing:border-box;
  border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.08);
  color:#fff; cursor:pointer;
}
.exam-header .header-actions .ui-cmd-trigger:hover{ background:rgba(255,255,255,.17); }
.exam-header .header-actions .ui-cmd-trigger .ui-cmd-trigger-text{ display:none; }
.exam-header .header-actions > *{ box-sizing:border-box; }
.exam-header .header-actions .hbtn{ line-height:1; }

/* نصوص مساعدة لا تنتمي لشريط الأدوات */
.quick-navigation small{ display:none !important; }
.exam-header .header-actions .hbtn,
.exam-header .header-actions .ui-cmd-trigger{ height:38px !important; padding:0 !important; }

/* ═══ قياس موحّد لأدوات الترويسة ═══
   الأزرار كانت 36.79 و40.79 و43.2 و40 معًا. القياس يأتي من قواعد مختلفة
   لكل صنف، فنفرضه على المستوى الأدنى: كل زر مباشر في الشريط أو داخل حاوية
   الإشعارات. */
.exam-header .header-actions > button,
.exam-header .header-actions > div > button{
  width:38px !important; height:38px !important;
  min-width:38px !important; min-height:38px !important;
  max-width:38px !important; max-height:38px !important;
  padding:0 !important; border-radius:50% !important;
  display:inline-grid !important; place-items:center;
  line-height:1 !important;
}
.exam-header .header-actions{ align-items:center; }

/* القائمة الجانبية مخفية، فالشبكة كانت تُبقي عمودها فارغًا. */
html.ns-on .dashboard-shell,
html.ns-on main.dashboard-shell{
  grid-template-columns:1fr !important;
}
html.ns-on .dashboard-sidebar{ display:none !important; }

/* ═══ مبدّل اللغة داخل الشريط ═══
   pt-i18n يجعله fixed فيطفو منفصلًا؛ هنا يصبح عنصرًا في الصف بنفس قياس
   الأزرار الأخرى. */
#platformLangSlot{ display:inline-flex; align-items:center; gap:6px; }
#platformLangSlot [data-pt-lang-btn]{
  position:static !important; inset:auto !important; top:auto !important;
  right:auto !important; left:auto !important; bottom:auto !important;
  width:auto !important; min-width:44px; height:38px !important;
  padding:0 12px !important; margin:0 !important;
  border-radius:99px !important; display:inline-flex !important;
  align-items:center; justify-content:center; gap:6px;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18);
  color:#fff; font:700 12.5px/1 Tajawal,system-ui,sans-serif; cursor:pointer;
}
#platformLangSlot [data-pt-lang-btn]:hover{ background:rgba(255,255,255,.17); }

/* ارتفاع اللوحة المفروض كان يترك فراغًا أسفل المحتوى ويقص الفوتر. */
.dashboard-page .dashboard-shell{ min-height:auto !important; }

/* زر "تعليم الكل كمقروء": كان على حافة الصندوق اليسرى في RTL. يدفع نفسه
   إلى بداية السطر (اليمين) فيصبح مع عنوان الصندوق. */
#ntAll{ display:block; width:max-content; margin-inline-start:auto; margin-inline-end:0; }

/* ═══ ترويسة صفحة الدليل ═══
   خلفيتها داكنة (--navy) بينما h1 يرث لون النص الداكن، فكان التباين 1.03 —
   أي عنوان غير مقروء. */
.guide-header{ color:#fff; }
.guide-header h1{ color:#fff; }
.guide-header small{ color:rgba(255,255,255,.82); }
.guide-header a{ color:#9FE3EC; text-decoration:none; }
.guide-header a:hover{ color:#fff; text-decoration:underline; }

/* نصوص غيّرها الكشف التلقائي إلى LTR */
[dir="ltr"]{ text-align:left; }

/* حالة فارغة = عنصر غير مرئي بدل صندوق بعرض صفر */
[role="status"]:empty, .brand-status:empty, .occ-status:empty{ display:none; }

