/* ISS Command — Manager Dashboard overlay styles.
   مربوطة كلها بكلاسات iss-mgr-* جديدة بالكامل، مش بتلمس ولا تعدّل أي كلاس
   موجود (category-card / recent-reports-section / dashboard-top-bar...) غير
   تغييرات بسيطة جداً للـlayout (flex wrap) عشان الكروت الجديدة تتظبط جنبهم.

   تصميم بصري (ثيم فاتح، لمسة أزرق) بناءً على تصميم مرجعي — نفس الكروت/
   الشارات، لكن كل البيانات لسه حقيقية 100% من نفس الـAPIs الموجودة فعلاً
   (مفيش أرقام وهمية أو اتجاهات/نسب مختلقة مش عندنا مصدر حقيقي ليها). */

.iss-mgr-sb-profile {
  display: flex; gap: 11px; align-items: center;
  padding: 14px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.iss-mgr-sb-avatar {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #1f3956, #152338);
  border: 1px solid #2a425f; color: #00d4ff;
  font-weight: 800; font-size: 12px; flex-shrink: 0;
}
.iss-mgr-sb-profile strong { display: block; font-size: 12px; color: #e2e8f0; font-weight: 700; }
.iss-mgr-sb-profile span { font-size: 10px; color: #94a3b8; }
#iss-new-sidebar:has(.iss-mgr-sb-profile) { --sb-accent: #00d4ff; }

.iss-mgr-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.iss-mgr-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.iss-mgr-badge-green  { color: #15803d; background: rgba(22,163,74,.1); border-color: rgba(34,197,94,.16); }
.iss-mgr-badge-amber  { color: #b45309; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.18); }
.iss-mgr-badge-orange { color: #c2410c; background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.18); }
.iss-mgr-badge-red    { color: #dc2626; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.2); }
.iss-mgr-badge-cyan   { color: #0089a5; background: rgba(0,212,255,.12); border-color: rgba(0,212,255,.18); }
.iss-mgr-badge-neutral{ color: #64748b; background: rgba(100,116,139,.1); border-color: rgba(100,116,139,.16); }

.iss-mgr-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0;
  padding: 26px 30px;
  border-radius: 22px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(10, 20, 45, .88), rgba(20, 50, 110, .55)),
    url('/cfc-hero.png?v=20261104b') center/100% auto no-repeat;
  background-color: #0a1830;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .12);
}
.iss-mgr-hero:after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,212,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,.04) 1px, transparent 1px);
  background-size: 35px 35px;
  mask-image: linear-gradient(90deg, #000, transparent);
}
.iss-mgr-hero-text h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; }
.iss-mgr-hero-text p { margin: 0 0 10px; font-size: .92rem; color: #dbe6ff; line-height: 1.5; }
.iss-mgr-hero-meta { font-size: .82rem; color: #cdd9f5; display: flex; gap: 14px; flex-wrap: wrap; }
.iss-mgr-hero-loc { text-align: right; font-size: .85rem; color: #e6edff; flex-shrink: 0; line-height: 1.6; position: relative; z-index: 1; }
.iss-mgr-hero-loc span { color: #aebcdd; font-size: .78rem; }
.iss-mgr-weather {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  font-size: .95rem; font-weight: 700; color: #fcd34d;
}

/* ── جرس التنبيهات ── */
.iss-mgr-hero-controls {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  display: flex; align-items: center; gap: 2px;
  background: rgba(8, 14, 32, .55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 4px;
}
.iss-mgr-hc-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: #e2e8f0;
  font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 7px 11px; border-radius: 999px; font-family: inherit;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.iss-mgr-hc-btn:hover { background: rgba(255,255,255,.12); }
.iss-mgr-hc-bell { padding: 7px; font-size: 13px; color: #fbbf24; }
.iss-mgr-hc-bell.active { color: #34d399; background: rgba(52,211,153,.18); }
.iss-mgr-hc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
@media (max-width: 640px) {
  .iss-mgr-hero-controls { top: 10px; right: 10px; }
}

/* ── جرس الإشعارات (notification center) ── */
.iss-mgr-hc-notif { position: relative; color: #e2e8f0; }
.iss-mgr-notif-badge {
  position: absolute; top: 1px; right: 1px;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 800; line-height: 15px; text-align: center;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #0a1830;
}
/* position:fixed (مش absolute جوه الهيرو) — الهيرو عنده overflow:hidden
   (عشان خلفية الشبكة بتاعته)، فلو القايمة absolute جواه كانت بتتقص على
   حدوده بدل ما تتعرض كاملة. الإحداثيات (top/right) بتتحسب بالـJS وقت
   الفتح من مكان الجرس نفسه، زي أي dropdown حقيقي. */
.iss-mgr-notif-panel {
  position: fixed; z-index: 9999;
  width: 340px; max-height: min(480px, 70vh); overflow-y: auto;
  background: #0f1f3d;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.2);
  padding: 0;
  opacity: 0; transform: translateY(-6px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.iss-mgr-notif-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.iss-notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; position: sticky; top: 0;
  background: #0f1f3d; border-bottom: 1px solid rgba(255,255,255,.08);
  border-radius: 18px 18px 0 0;
}
.iss-notif-head-title { color: #f1f5f9; font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.iss-notif-head-title i { color: #fbbf24; font-size: 12px; }
.iss-notif-clear-all {
  background: none; border: none; color: #60a5fa; font-size: 11.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; padding: 4px 6px; border-radius: 6px;
}
.iss-notif-clear-all:hover { background: rgba(96,165,250,.12); }
.iss-notif-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.iss-notif-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 10px 10px; border-radius: 12px;
  border-right: 3px solid rgba(96,165,250,.55);
  transition: background .13s;
}
.iss-notif-item:hover { background: rgba(255,255,255,.055); }
.iss-notif-item-main { flex: 1; min-width: 0; cursor: pointer; }
.iss-notif-item-title { color: #e9edf4; font-size: 12.5px; font-weight: 700; margin-bottom: 3px; line-height: 1.45; }
.iss-notif-item-body { color: #9aa7bb; font-size: 11.5px; line-height: 1.55; margin-bottom: 4px; }
.iss-notif-item-time { color: #647088; font-size: 10px; font-weight: 600; }
.iss-notif-item-x {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px; margin-top: 1px;
  border: none; background: transparent; color: #647088; cursor: pointer;
  font-size: 16px; line-height: 1; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.iss-notif-item-x:hover { background: rgba(239,68,68,.16); color: #f87171; }
.iss-notif-empty {
  padding: 36px 16px; text-align: center; color: #647088; font-size: 12.5px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.iss-notif-empty i { font-size: 26px; opacity: .5; }
@media (max-width: 640px) {
  .iss-mgr-notif-panel { width: calc(100vw - 24px); }
}

/* ── مربع تفاصيل الإشعار (الدوسة على إشعار بتفتح التفاصيل كاملة) ── */
.iss-notif-detail-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(5,10,20,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.iss-notif-detail-box {
  position: relative; width: 100%; max-width: 380px;
  background: #0f1f3d; border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.25);
}
.iss-notif-detail-close {
  position: absolute; top: 10px; left: 10px;
  width: 26px; height: 26px; border-radius: 8px;
  border: none; background: transparent; color: #647088; cursor: pointer;
  font-size: 18px; line-height: 1; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.iss-notif-detail-close:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.iss-notif-detail-head {
  display: flex; align-items: center; gap: 7px;
  color: #fbbf24; font-size: 12px; font-weight: 800; margin-bottom: 12px;
}
.iss-notif-detail-group { color: #60a5fa; font-size: 11.5px; font-weight: 700; margin-bottom: 4px; }
.iss-notif-detail-title { color: #f1f5f9; font-size: 15px; font-weight: 800; line-height: 1.5; margin-bottom: 8px; }
.iss-notif-detail-body { color: #aab4c6; font-size: 13px; line-height: 1.7; margin-bottom: 12px; white-space: pre-wrap; }
.iss-notif-detail-time {
  display: flex; align-items: center; gap: 6px;
  color: #647088; font-size: 11px; font-weight: 600; margin-bottom: 16px;
}
.iss-notif-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.iss-notif-detail-go, .iss-notif-detail-dismiss {
  flex: 1; min-width: 120px; padding: 10px 14px; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent;
}
.iss-notif-detail-go { background: #2563eb; color: #fff; }
.iss-notif-detail-go:hover { background: #1d4ed8; }
.iss-notif-detail-dismiss { background: transparent; color: #9aa7bb; border-color: rgba(255,255,255,.14); }
.iss-notif-detail-dismiss:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }

/* ── صف الحالة: الحالة الأمنية + قوة الوردية الحالية — أول صف بعد الهيرو ── */
.iss-mgr-status-row {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-bottom: 20px;
}
.iss-mgr-card, .iss-mgr-status-card, .iss-mgr-strength-card {
  background: linear-gradient(145deg, #ffffff, #f3f7fc);
  border: 1px solid #c2d2e8;
  border-radius: 16px; padding: 18px 22px;
  box-shadow: 0 10px 24px rgba(30, 64, 175, .10), inset 0 1px 0 rgba(255,255,255,.85);
}
.iss-mgr-status-card { display: flex; align-items: center; gap: 18px; }
.iss-mgr-status-banner-icon {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  background: rgba(37,99,235,.14); color: #2563eb;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 4px 10px rgba(37,99,235,.18), inset 0 1px 0 rgba(255,255,255,.5);
}
.iss-mgr-status-banner-body { flex: 1; min-width: 0; }
.iss-mgr-sysstatus-lbl { font-size: .76rem; color: #64748b; display: block; }
.iss-mgr-sysstatus-val { font-size: 1.3rem; font-weight: 800; color: #0d2a52; display: block; margin-top: 2px; }
.iss-mgr-sysstatus-note { font-size: .76rem; color: #475569; margin: 4px 0 0; }

/* ── قوة الوردية الحالية (تفصيلة الحضور) ── */
.iss-mgr-strength-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.iss-mgr-strength-head > div > span { font-size: .76rem; color: #64748b; display: block; }
.iss-mgr-strength-head > div > strong { font-size: 1.25rem; font-weight: 800; color: #0d2a52; }
.iss-mgr-strength-head > div > strong small { font-size: .85rem; font-weight: 700; color: #94a3b8; }
.iss-mgr-progress {
  width: 100%; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: 14px;
}
.iss-mgr-progress span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width .3s ease;
}
.iss-mgr-strength-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding-top: 12px; border-top: 1px dashed #d7e0ea;
}
.iss-mgr-strength-stats > div { text-align: center; }
.iss-mgr-strength-stats span { display: block; font-size: .68rem; color: #64748b; margin-bottom: 2px; }
.iss-mgr-strength-stats strong { font-size: .95rem; font-weight: 800; color: #0d2a52; }
.iss-mgr-blue-text { color: #2563eb !important; }
.iss-mgr-red-text { color: #dc2626 !important; }
.iss-mgr-green-text { color: #15803d !important; }

/* ── جدول تفصيلة الحضور لكل قطاع فرعي ── */
.iss-mgr-breakdown-card { margin-bottom: 20px; }
.iss-mgr-breakdown-table-wrap { overflow-x: auto; border-radius: 10px; }
.iss-mgr-breakdown-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.iss-mgr-breakdown-table thead th {
  text-align: center; padding: 10px 12px; color: #64748b; font-weight: 800;
  font-size: .7rem; letter-spacing: .03em; text-transform: uppercase;
  background: #f1f5fb; border-bottom: 1px solid #d7e0ea;
}
.iss-mgr-breakdown-table thead th:first-child { text-align: right; border-top-right-radius: 10px; }
.iss-mgr-breakdown-table thead th:last-child { border-top-left-radius: 10px; }
.iss-mgr-breakdown-table td {
  padding: 10px 12px; color: #0d2a52; font-weight: 600; text-align: center;
  border-bottom: 1px solid #eef2f6; transition: background .12s;
}
.iss-mgr-breakdown-table tbody tr:last-child td { border-bottom: none; }
.iss-mgr-breakdown-table tbody tr.alt td { background: #f8fafd; }
.iss-mgr-breakdown-table tbody tr:hover td { background: #eaf1fc; }
.iss-mgr-brk-sec { text-align: right !important; font-weight: 700; }
.iss-mgr-brk-pct { font-size: .72rem; font-weight: 600; color: #94a3b8; }
.iss-mgr-brk-arrow-cell { text-align: center; width: 36px; font-size: .95rem; }

/* ── صف: إجراءات سريعة ── */
.iss-mgr-row1 { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 20px; }
.iss-mgr-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px; font-size: .85rem; font-weight: 800; color: #334155;
}
.iss-mgr-card-head > span { display: flex; align-items: center; gap: 8px; }

/* إجراءات سريعة */
.iss-mgr-qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.iss-mgr-qa-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 13px; border: 1px solid rgba(15,23,42,.07);
  background: #fff; text-decoration: none; color: #0f172a; font-size: .78rem; font-weight: 700;
  transition: background .15s, border-color .15s;
}
.iss-mgr-qa-btn:hover { background: #eff6ff; border-color: rgba(37,99,235,.3); }
.iss-mgr-qa-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(37,99,235,.1); color: #2563eb;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.iss-mgr-qa-btn span:nth-child(2) { flex: 1; }
.iss-mgr-qa-arrow { font-size: 10px; color: #94a3b8; }

@media (max-width: 1180px) {
  .iss-mgr-qa-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .iss-mgr-hero { flex-direction: column; align-items: flex-start; text-align: left; }
  .iss-mgr-hero-loc { text-align: left; }
  .iss-mgr-status-row { grid-template-columns: 1fr; }
  .iss-mgr-status-card { flex-direction: column; align-items: flex-start; text-align: right; }
  .iss-mgr-qa-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .iss-mgr-strength-stats { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
}

/* جدول تفصيلة الحضور على الموبايل — يفضل جدول زي ما هو بالظبط، بس
   بيتقاس (خط وحشو أصغر + عرض أعمدة ثابت) عشان يتشاف كله جوه عرض
   الشاشة من غير أي تمرير أفقي. */
@media (max-width: 640px) {
  .iss-mgr-breakdown-table-wrap { overflow-x: visible; }
  .iss-mgr-breakdown-table { table-layout: fixed; font-size: .62rem; }
  .iss-mgr-breakdown-table th, .iss-mgr-breakdown-table td { padding: 6px 3px; }
  .iss-mgr-breakdown-table thead th { font-size: .52rem; letter-spacing: 0; padding: 6px 2px; white-space: normal; word-break: break-word; line-height: 1.15; }
  .iss-mgr-breakdown-table th:nth-child(1), .iss-mgr-breakdown-table td:nth-child(1) { width: 22%; }
  .iss-mgr-breakdown-table th:nth-child(2), .iss-mgr-breakdown-table td:nth-child(2),
  .iss-mgr-breakdown-table th:nth-child(3), .iss-mgr-breakdown-table td:nth-child(3) { width: 13%; }
  .iss-mgr-breakdown-table th:nth-child(4), .iss-mgr-breakdown-table td:nth-child(4) { width: 20%; }
  .iss-mgr-breakdown-table th:nth-child(5), .iss-mgr-breakdown-table td:nth-child(5) { width: 20%; }
  .iss-mgr-breakdown-table th:nth-child(6), .iss-mgr-breakdown-table td:nth-child(6) { width: 12%; }
  .iss-mgr-brk-sec { white-space: normal; line-height: 1.2; word-break: break-word; }
  .iss-mgr-breakdown-table td:not(.iss-mgr-brk-sec) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .iss-mgr-brk-pct { display: none; }
  .iss-mgr-brk-arrow-cell { font-size: .7rem; }
}
