/* ISS Command — Manager Sector Reports & Analysis (CCTV pilot) */
#iss-mgr-sector-reports { display: grid; gap: 18px; margin-top: 4px; }

.iss-mgr-rpt-card {
  background: linear-gradient(140deg, #fbfdfe, #f7fafb);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}
.iss-mgr-rpt-card-head {
  padding: 14px 18px;
  font-weight: 700;
  font-size: .95rem;
  color: #0f172a;
  border-bottom: 1px solid #eef1f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.iss-mgr-rpt-card-head i { color: #0089a5; margin-left: 6px; }
.iss-mgr-rpt-card-body { padding: 16px 18px; font-size: .88rem; color: #334155; }
.iss-mgr-rpt-loading, .iss-mgr-rpt-empty { color: #94a3b8; margin: 0; font-size: .85rem; }
.iss-mgr-rpt-err { color: #ef4444; margin: 0; font-size: .85rem; }

.iss-mgr-rpt-archive-btn {
  background: rgba(0, 212, 255, .1);
  border: 1px solid rgba(0, 137, 165, .3);
  color: #0089a5;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.iss-mgr-rpt-archive-btn:hover { background: rgba(0, 212, 255, .18); }

/* قائمة "آخر التقارير" + معاينة التفاصيل جنب بعض (زي تصميم Figma) */
.iss-mgr-rpt-split { display: grid; grid-template-columns: 1.4fr 1fr; align-items: stretch; }
.iss-mgr-rpt-list {
  padding: 10px; max-height: 380px; overflow-y: auto;
  border-left: 1px solid rgba(15,23,42,.08);
}
.iss-mgr-rpt-detail { padding: 16px 18px; }
.iss-mgr-rpt-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 11px;
  padding: 9px; text-align: right; cursor: pointer; font-family: inherit;
  margin-bottom: 4px; color: #334155;
}
.iss-mgr-rpt-row:hover, .iss-mgr-rpt-row.selected { background: rgba(0,212,255,.075); border-color: rgba(0,212,255,.14); }
.iss-mgr-rpt-row-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,212,255,.1); color: #0089a5; font-size: 13px;
}
.iss-mgr-rpt-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.iss-mgr-rpt-row-main strong { font-size: .84rem; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iss-mgr-rpt-row-main small { font-size: .74rem; color: #94a3b8; }

.iss-mgr-rpt-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid rgba(15,23,42,.08); }
.iss-mgr-rpt-detail-head span { font-size: .7rem; color: #0089a5; font-weight: 700; letter-spacing: .04em; display: block; }
.iss-mgr-rpt-detail-head strong { font-size: 1rem; display: block; margin-top: 4px; color: #0f172a; }
.iss-mgr-rpt-detail-meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; font-size: .78rem; color: #64748b; }
.iss-mgr-rpt-detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.iss-mgr-rpt-detail-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.iss-mgr-rpt-cat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f8fafc; border: 1px solid #e6ebf2; border-radius: 20px;
  padding: 5px 10px; font-size: .76rem; font-weight: 600; color: #475569;
}
.iss-mgr-rpt-cat-chip b { color: #0f172a; font-weight: 800; }
.iss-mgr-rpt-open-full { width: 100%; justify-content: center; }

@media (max-width: 860px) {
  .iss-mgr-rpt-split { grid-template-columns: 1fr; }
  .iss-mgr-rpt-list { border-left: none; border-bottom: 1px solid rgba(15,23,42,.08); max-height: 260px; }
}

.iss-mgr-rpt-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.iss-mgr-rpt-table th {
  background: #f8fafc; color: #64748b; font-weight: 700; font-size: .78rem;
  padding: 8px 10px; text-align: center; border-bottom: 1px solid #eef1f6;
}
.iss-mgr-rpt-table td { padding: 10px; text-align: center; border-bottom: 1px solid #f1f4f9; }
.iss-mgr-rpt-table tr:last-child td { border-bottom: none; }
.iss-mgr-rpt-ok, .iss-mgr-rpt-missing, .iss-mgr-rpt-active {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  border: 1px solid transparent;
}
.iss-mgr-rpt-ok { color: #15803d; background: rgba(22,163,74,.1); border-color: rgba(34,197,94,.16); }
.iss-mgr-rpt-missing { color: #dc2626; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.2); }
.iss-mgr-rpt-active { color: #0089a5; background: rgba(0,212,255,.12); border-color: rgba(0,212,255,.18); }

/* تابات الفترة (يوم/أسبوع/شهر) وتابات القسم الفرعي (CCTV بس) — زرار واحد
   مفعّل في كل مجموعة، بيبدّل الفترة/القسم المعروض من غير ما يحمّل الكل
   مع بعض. */
.iss-mgr-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.iss-mgr-subdept-tabs { margin-bottom: 18px; }
.iss-mgr-tab-btn {
  background: #f8fafc; border: 1px solid #e6ebf2; color: #64748b;
  border-radius: 20px; padding: 6px 14px; font-size: .8rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.iss-mgr-tab-btn:hover { background: #eaf1f4; }
.iss-mgr-tab-btn.active { background: #0089a5; border-color: #0089a5; color: #fff; }

/* FIX: الرقمين (اليوم/امبارح) كانوا جنب بعض يمين وشمال على نفس السطر —
   دلوقتي جدول حقيقي — الفئة/اليوم/امبارح/الفرق كل عمود محاذي بالظبط تحت
   بعضه في كل الصفوف، مش كروت شكل كل واحد مختلف. */
.iss-mgr-trend-table { margin-top: 2px; }
.iss-mgr-trend-table th:first-child, .iss-mgr-trend-table td.iss-mgr-trend-label-cell { text-align: right; }
.iss-mgr-trend-label-cell { color: #334155; font-weight: 600; }
.iss-mgr-trend-prev-cell { color: #94a3b8; }
.iss-mgr-trend-table td b { color: #0f172a; }
.iss-mgr-trend-up { color: #dc2626; font-weight: 700; }
.iss-mgr-trend-down { color: #16a34a; font-weight: 700; }
.iss-mgr-trend-flat { color: #94a3b8; font-weight: 700; }

/* توصية بسيطة (قاعدة ثابتة: زيادة 30%+) — صف كامل تحت الفئة اللي اتفعّل
   فيها الشرط بس، من غير ما يكسر محاذاة الأعمدة. */
.iss-mgr-trend-flag-row td { padding: 0 10px 10px; border-bottom: 1px solid #f1f4f9; }
.iss-mgr-trend-flag {
  background: rgba(234, 88, 12, .08);
  border: 1px solid rgba(234, 88, 12, .25);
  color: #c2410c;
  font-size: .76rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 5px 10px;
  width: fit-content;
}

/* رسم بياني خطي (SVG يدوي، من غير مكتبة خارجية) — فترة واختيار فئات
   يحددهم المدير، مش ثابتين. */
.iss-mgr-chart-wrap { margin-bottom: 18px; }
.iss-mgr-chart-title { font-size: .8rem; font-weight: 700; color: #64748b; margin-bottom: 6px; }
.iss-mgr-chart-svg { width: 100%; height: auto; display: block; }
.iss-mgr-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px; }
.iss-mgr-chart-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: #475569; }
.iss-mgr-chart-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.iss-mgr-chart-controls { margin-bottom: 14px; }
.iss-mgr-chart-daterange {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px;
  font-size: .8rem; color: #64748b; font-weight: 700;
}
.iss-mgr-chart-daterange label { display: inline-flex; align-items: center; gap: 6px; }
.iss-mgr-chart-daterange input[type="date"] {
  border: 1px solid #e6ebf2; border-radius: 8px; padding: 5px 8px;
  font-size: .8rem; font-family: inherit; color: #334155;
}
.iss-mgr-chart-cats { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.iss-mgr-chart-cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f8fafc; border: 1px solid #e6ebf2; border-radius: 20px;
  padding: 5px 12px 5px 8px; font-size: .78rem; font-weight: 600; color: #475569;
  cursor: pointer; user-select: none;
}
.iss-mgr-chart-cat-chip:has(input:checked) { background: rgba(0, 212, 255, .1); border-color: #0089a5; color: #0089a5; }
.iss-mgr-chart-cat-check { margin: 0; cursor: pointer; }
