/* جرس الإشعارات في رأس التطبيق — عدّاد + لوحة منسدلة. */

.notif {
  position: relative;
  flex: none;
}

.notif-bell {
  position: relative;
}

/* خصائص منطقية لا فيزيائية: تنقلب مع الاتجاه تلقائياً بلا قواعد [dir] منفصلة.
   الشارة كانت بـ right: 2px بلا استثناء RTL، فتظهر بالجهة الخطأ بالعربية. */
.notif-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  /* تُثبَّت من طرف السطر لا من بدايته: الجرس بأقصى الترويسة، فلوحةٌ مثبتة
     من البداية تمتد خارج الشاشة وتنقص. */
  inset-inline-end: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--menu-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  overflow: hidden;
  z-index: 50;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--divider);
}

.notif-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
}

.notif-item:hover {
  background: var(--surface-2);
}

.notif-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--primary-soft);
  flex: none;
  margin-top: 1px;
}

.notif-item-overdue .notif-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.notif-item-reminder .notif-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notif-subject {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.notif-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.notif-late {
  color: var(--danger);
  font-weight: 700;
}

.notif-remind {
  color: var(--warning);
  font-weight: 700;
}

.notif-empty {
  margin: 0;
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
}

/* العنصر زرٌّ لا رابط: النقر ينقل داخلياً بالموجّه، وسمات الزر الافتراضية
   تكسر محاذاة الصف بلا هذي الإعادة. */
.notif-item {
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.notif-foot {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: 0;
  border-top: 1px solid var(--divider);
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notif-foot:hover {
  background: var(--surface-2);
}

/* الجرس بأقصى الترويسة: العنوان لا يملك flex ينمو به، وبالموبايل يختفي
   العنوان أصلاً — فالهامش التلقائي وحده يثبّت الجرس بالطرف بالحالتين. */
.notif {
  margin-inline-start: auto;
}

/* رابط الإجراء تحت التنبيه — للاشتراك المقارب على الانتهاء.
   مزاح بعرض الأيقونة ليصطفّ تحت نصّ التنبيه لا تحت أيقونته، فيُقرأ
   تابعًا له لا بندًا مستقلًّا. */
.notif-action {
  display: inline-block;
  margin-block: -2px 6px;
  margin-inline-start: 49px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.notif-action:hover {
  text-decoration: underline;
}
