/* مركز التنبيهات — أنماط خاصة بالمركز وحده.
   تستعمل متغيّرات app.css نفسها (--surface/--border/--text) فتتبع الوضعين
   الفاتح والليلي بلا قواعد مكرّرة. */

.nt-tabs { flex-wrap: wrap; }

/* ── المؤشّرات ── */
.nt-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; margin-bottom: 16px; }
.nt-kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 15px; position: relative; overflow: hidden;
}
.nt-kpi::after { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 3px; background: var(--primary); opacity: .6; }
.nt-kpi.ok::after { background: var(--good); }
.nt-kpi.warn::after { background: var(--warn); }
.nt-kpi.crit::after { background: var(--crit); }
.nt-kpi .k-l { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.nt-kpi .k-v { font-size: 23px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.nt-kpi .k-s { color: var(--faint); font-size: 11px; }

.nt-grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
/* عنصر الشبكة يأخذ min-width:auto افتراضاً، فجدولٌ عريض داخله يمنع
   الانكماش ويدفع الصفحة كلّها أفقياً حتى يختفي نصفها. */
.nt-grid2 > *, .nt-grid2 .card { min-width: 0; }
/* الجدول ينزلق داخل إطاره بدل أن يدفع الصفحة كلّها. #ntdLog مذكور صراحةً
   لأن جدوله ليس داخل .tbl-wrap، فالقاعدة العامة لا تطاله. */
.nt-grid2 .tbl-wrap, #ntdLog { overflow-x: auto; max-width: 100%; }
.nt-grid2 table { max-width: 100%; }

/* ── الرسم العمودي: عمود كامل للمحاولات وداخله ما وصل ── */
.nt-spark { display: flex; align-items: flex-end; gap: 3px; height: 92px; margin-top: 8px; }
.nt-spark i { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; }
.nt-spark u, .nt-spark s {
  position: absolute; bottom: 0; inset-inline: 0; border-radius: 3px 3px 0 0; text-decoration: none;
}
.nt-spark u { background: var(--border); min-height: 2px; }
.nt-spark s { background: linear-gradient(180deg, var(--primary), var(--primary-light)); }
.nt-spark-x { display: flex; gap: 3px; margin-top: 5px; color: var(--faint); font-size: 10px; }
.nt-spark-x span { flex: 1; text-align: center; }

/* ── أشرطة أفقية ── */
.nt-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.nt-bar { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.nt-bar .nm { width: 160px; flex: none; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-bar .tr { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.nt-bar .tr i { display: block; height: 100%; background: var(--grad, linear-gradient(135deg, var(--primary), var(--primary-light))); }
.nt-bar .vl { width: 56px; flex: none; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── تحتاج انتباهك ── */
.nt-atts { display: flex; flex-direction: column; gap: 8px; }
.nt-att {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
}
.nt-att .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-att .d { grid-column: 1; color: var(--muted); font-size: 12px; }
/* الزرّ يجاور العنوان في عموده لا ينزل سطراً كاملاً تحت الشرح */
.nt-att > .btn { grid-row: 1 / span 2; grid-column: 2; align-self: center; white-space: nowrap; }
.nt-att.high { border-inline-start: 3px solid var(--crit); }
.nt-att.mid { border-inline-start: 3px solid var(--warn); }
.nt-att.low { border-inline-start: 3px solid var(--primary); }

/* ── مصفوفة القوالب ── */
.nt-mx td { vertical-align: middle; }
.nt-mx tr.nt-missing { background: color-mix(in srgb, var(--crit) 8%, transparent); }
.nt-cell {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 7px; font-size: 12px; font-weight: 800;
}
.nt-cell.has { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.nt-cell.miss { background: color-mix(in srgb, var(--crit) 18%, transparent); color: var(--crit); }
.nt-cell.na { color: var(--faint); }
.nt-key { direction: ltr; unicode-bidi: isolate; text-align: left; font-family: Consolas, monospace; font-size: 10.5px; color: var(--faint); }

/* ── نماذج المركز ── */
.nt-f { display: block; margin-bottom: 11px; }
.nt-f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.nt-f input, .nt-f textarea, .nt-f select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px;
}
.nt-f input:focus, .nt-f textarea:focus { outline: none; border-color: var(--primary); }
.nt-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.nt-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 13px; margin-bottom: 11px;
}
.nt-switch b { display: block; font-size: 13.5px; }
.nt-switch span { font-size: 12px; }
.nt-dim { opacity: .4; pointer-events: none; }
.nt-note {
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px 13px; color: var(--muted); font-size: 12.5px; margin-bottom: 11px;
}
.nt-note b { color: var(--text); }
.nt-empty { color: var(--muted); font-size: 13px; padding: 14px; text-align: center; }
.nt-ok-line { color: var(--good); font-size: 13px; font-weight: 600; }

/* ── بطاقة المستلِم في الإرسال الموجّه ── */
.nt-found { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.nt-rc { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
.nt-rc.ok { border-inline-start: 3px solid var(--good); }
.nt-rc.warn { border-inline-start: 3px solid var(--warn); }
.nt-rc.bad { border-inline-start: 3px solid var(--crit); }
.nt-rc .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-rc .d { color: var(--muted); font-size: 12px; margin-top: 2px; }

.nt-qt { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; border-top: 1px solid var(--border); }
.nt-qt .nm { flex: 1; }

@media (max-width: 1200px) {
  .nt-kpis { grid-template-columns: repeat(3, 1fr); }
  .nt-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) { .nt-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ────────────────────────────────────────────────────────────────
   طبقات استعملتها شاشات المركز ولم تكن معرَّفة في نظام التصميم.
   تُعرَّف هنا محصورةً في #ntBody بالرموز نفسها التي يستعملها .panel،
   فتتبع الوضعين الفاتح والليلي بلا قيم مثبّتة. (بديلها كان إعادة
   هيكلة كل بطاقة إلى panel/panel-head/panel-body — تغيير أوسع بلا
   مكسب بصري.)
   ──────────────────────────────────────────────────────────────── */
#ntBody .card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px;
}
#ntBody .card > h3 {
  margin: 0 0 2px; font-family: var(--fdisplay); font-size: 14.5px; font-weight: 800;
}
#ntBody .muted { color: var(--muted); font-size: 12.5px; }
#ntBody p.muted { margin: 0 0 10px; }
#ntBody .btn.primary {
  background: var(--grad, var(--primary)); border-color: transparent; color: #fff; font-weight: 700;
}
#ntBody .btn.primary:hover { filter: brightness(1.08); }
#ntBody .tag.info {
  background: var(--info-bg, var(--surface-2)); color: var(--info, var(--primary));
  border: 1px solid var(--info-line, var(--border));
}
