/* 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; }
}

/* ── صف الحالة: الحالة الأمنية + قوة الوردية الحالية — أول صف بعد الهيرو ── */
.iss-mgr-status-row {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-bottom: 20px;
}
.iss-mgr-card, .iss-mgr-stat, .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; }
.iss-mgr-breakdown-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.iss-mgr-breakdown-table th {
  text-align: right; padding: 8px 12px; color: #64748b; font-weight: 700;
  font-size: .72rem; border-bottom: 1px solid #d7e0ea;
}
.iss-mgr-breakdown-table td {
  padding: 9px 12px; color: #0d2a52; font-weight: 600;
  border-bottom: 1px solid #eef2f6;
}
.iss-mgr-breakdown-table tr:last-child td { border-bottom: none; }
.iss-mgr-breakdown-table th:first-child, .iss-mgr-breakdown-table td:first-child { font-weight: 700; }
.iss-mgr-brk-arrow-cell { text-align: center; width: 30px; font-size: .95rem; }

.iss-mgr-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.iss-mgr-stat { display: flex; align-items: center; gap: 14px; }
.iss-mgr-stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.iss-mgr-stat-lbl { font-size: .78rem; color: #64748b; margin-bottom: 2px; }
.iss-mgr-stat-val { font-size: 1.5rem; font-weight: 800; color: #0d2a52; }
.iss-mgr-stat-trend { font-size: .68rem; font-weight: 700; margin-top: 2px; }

/* ── صف: إجراءات سريعة + مخطط نظرة عامة على التقارير ── */
.iss-mgr-row1 { display: grid; grid-template-columns: 1fr 1.6fr; 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(2, 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; }

/* مخطط نظرة عامة على التقارير */
.iss-mgr-chart-toggle { display: flex; gap: 4px; background: #eef3f5; border-radius: 999px; padding: 3px; }
.iss-mgr-chart-toggle button {
  border: none; background: none; padding: 5px 12px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; color: #64748b; cursor: pointer; font-family: inherit;
}
.iss-mgr-chart-toggle button.active { background: #2563eb; color: #fff; }
.iss-mgr-chart-wrap { height: 220px; position: relative; }

@media (max-width: 1180px) {
  .iss-mgr-row1 { grid-template-columns: 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-overview { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .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; }
}
