/* ==== خطوط وأساسيات ==== */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: #0f172a;
}

/* ==== شريط التمرير ==== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0d9488, #115e59);
}

/* ==== هيرو متدرج ==== */
.hero-gradient {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 50%, #134e4a 100%);
  position: relative;
  overflow: hidden;
}
.hero-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(45, 212, 191, 0.20), transparent 40%);
  pointer-events: none;
}

/* ==== بطاقات ==== */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(15, 118, 110, 0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(15, 118, 110, 0.06);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 12px 32px rgba(15, 118, 110, 0.15);
}

.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.08);
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.08);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
}

/* ==== أزرار ==== */
.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: #0f766e;
  padding: 0.6rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  border: 2px solid #0f766e;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #0f766e;
  color: white;
}

.btn-gold {
  background: linear-gradient(135deg, #d4af37, #a37f1e);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
}

/* ==== الشريط الجانبي ==== */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  color: #e2e8f0;
  font-weight: 600;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  transform: translateX(-4px);
}
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(15, 118, 110, 0.3));
  color: white;
  border-right: 3px solid #d4af37;
}
.sidebar-link i {
  width: 22px;
  font-size: 1.1rem;
  text-align: center;
}

/* ==== القائمة الفرعية (Submenu) للـ Sidebar ==== */
.sidebar-group {
  display: flex;
  flex-direction: column;
}
.sidebar-group-toggle .sidebar-chevron {
  margin-right: auto;
  font-size: 0.7rem !important;
  width: 14px !important;
  transition: transform 0.3s ease;
  opacity: 0.7;
}
.sidebar-group.expanded .sidebar-group-toggle .sidebar-chevron {
  transform: rotate(180deg);
}
.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  margin-right: 1.2rem;
  border-right: 2px solid rgba(212, 175, 55, 0.25);
  padding-right: 0.5rem;
  margin-top: 0.15rem;
}
.sidebar-group.expanded .sidebar-submenu {
  max-height: 400px;
}
.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.6rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: 0.2rem;
  position: relative;
}
.sidebar-sublink::before {
  content: '';
  position: absolute;
  right: -0.6rem;
  top: 50%;
  width: 0.5rem;
  height: 2px;
  background: rgba(212, 175, 55, 0.4);
  transform: translateY(-50%);
}
.sidebar-sublink:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transform: translateX(-3px);
}
.sidebar-sublink.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.35), rgba(15, 118, 110, 0.35));
  color: white;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
}
.sidebar-sublink.active::before {
  background: #d4af37;
  width: 0.7rem;
}
.sidebar-sublink i {
  width: 18px;
  font-size: 0.85rem;
  text-align: center;
  color: #d4af37;
  opacity: 0.85;
}
.sidebar-sublink.active i {
  opacity: 1;
}

/* ==== المستوى الثالث (أقسام فرعية للمسار 4) ==== */
.sidebar-subgroup {
  display: flex;
  flex-direction: column;
}
.sidebar-subgroup-toggle .sidebar-chevron {
  margin-right: auto;
  font-size: 0.65rem !important;
  width: 12px !important;
  transition: transform 0.3s ease;
  opacity: 0.6;
  color: #cbd5e1 !important;
}
.sidebar-subgroup.expanded .sidebar-subgroup-toggle .sidebar-chevron {
  transform: rotate(180deg);
}
.sidebar-subsubmenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  margin-right: 1rem;
  border-right: 1.5px dashed rgba(212, 175, 55, 0.3);
  padding-right: 0.4rem;
}
.sidebar-subgroup.expanded .sidebar-subsubmenu {
  max-height: 250px;
}
.sidebar-subsublink {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: 0.2rem;
  position: relative;
}
.sidebar-subsublink::before {
  content: '';
  position: absolute;
  right: -0.5rem;
  top: 50%;
  width: 0.4rem;
  height: 1.5px;
  background: rgba(212, 175, 55, 0.35);
  transform: translateY(-50%);
}
.sidebar-subsublink:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
  transform: translateX(-2px);
}
.sidebar-subsublink.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.28), rgba(15, 118, 110, 0.28));
  color: white;
}
.sidebar-subsublink.active::before {
  background: #d4af37;
  width: 0.6rem;
  height: 2px;
}
.sidebar-subsublink i {
  width: 14px;
  font-size: 0.7rem;
  text-align: center;
  color: #d4af37;
  opacity: 0.7;
}
.sidebar-subsublink.active i {
  opacity: 1;
}

/* ==== شارة الحالة ==== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ==== Animations ==== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp { animation: fadeInUp 0.5s ease-out; }

@keyframes pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(20, 184, 166, 0); }
}
.animate-pulse-soft { animation: pulse-soft 2.2s infinite; }

@keyframes spin-slow { from {transform:rotate(0);} to {transform:rotate(360deg);} }

/* ==== أيقونة الصلاحيات ==== */
.kaaba-icon {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #d4af37;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}

/* ==== جدول ==== */
.table-modern {
  width: 100%;
  border-collapse: collapse;
}
.table-modern thead th {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: white;
  font-weight: 700;
  padding: 1rem 0.85rem;
  text-align: right;
  font-size: 0.9rem;
}
.table-modern thead th:first-child { border-top-right-radius: 0.75rem; }
.table-modern thead th:last-child  { border-top-left-radius: 0.75rem; }
.table-modern tbody td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  vertical-align: top;
}
.table-modern tbody tr:hover { background: #f0fdfa; }
.table-modern tbody tr:last-child td { border-bottom: none; }

/* ==== Modal ==== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: white;
  border-radius: 1.25rem;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInUp 0.3s ease;
}

/* ==== مناطق الإسقاط للملفات ==== */
.dropzone {
  border: 2px dashed #0d9488;
  background: rgba(20, 184, 166, 0.04);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  background: rgba(20, 184, 166, 0.1);
  border-color: #0f766e;
  transform: scale(1.01);
}

/* ==== شجرة الهيكل التنظيمي ==== */
.org-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}
.org-node {
  background: white;
  border: 2px solid #0d9488;
  border-radius: 0.85rem;
  padding: 0.85rem 1.25rem;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.15);
  transition: all 0.25s ease;
  position: relative;
}
.org-node:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.25);
}
.org-node.director {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: white;
  border-color: #d4af37;
  min-width: 260px;
  padding: 1rem 1.5rem;
}
.org-node.deputy {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: white;
  min-width: 220px;
}
.org-node.section {
  background: linear-gradient(135deg, #f0fdfa, white);
}
.org-connector {
  width: 2px;
  height: 28px;
  background: #0d9488;
}
.org-horizontal {
  height: 2px;
  background: #0d9488;
}

/* ==== تبويبات الأقسام الفرعية ==== */
.subsection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f1f5f9;
  border-radius: 0.85rem;
  margin-bottom: 1.25rem;
}
.subsection-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.65rem;
  background: white;
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.subsection-tab:hover {
  background: #f0fdfa;
  border-color: #14b8a6;
  color: #0f766e;
  transform: translateY(-1px);
}
.subsection-tab.active {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: white;
  border-color: #0f766e;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}
.subsection-tab i {
  font-size: 0.95rem;
}
.subsection-tab .count-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.1rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.subsection-tab:not(.active) .count-badge {
  background: #e2e8f0;
  color: #475569;
}

/* ==== محرر الهيكل التنظيمي التفاعلي ==== */
.org-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 0 0.5rem;
}
.org-children-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.5rem;
  position: relative;
  flex-wrap: nowrap;
}
.org-child-wrapper {
  position: relative;
  padding-top: 1rem;
}
.org-child-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 2px;
  height: 1rem;
  background: #0d9488;
  transform: translateX(50%);
}
.org-horizontal-line {
  position: absolute;
  top: -1.5rem;
  right: 0;
  left: 0;
  height: 2px;
  background: #0d9488;
}
.org-node {
  cursor: pointer;
}
.org-node-controls {
  display: none;
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  padding: 0.25rem 0.4rem;
  gap: 0.25rem;
  z-index: 5;
  white-space: nowrap;
}
.org-node.show-controls .org-node-controls,
.org-node-wrapper:hover > .org-node .org-node-controls {
  display: inline-flex;
}
.org-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  background: #64748b;
  transition: all 0.18s ease;
}
.org-ctrl-btn:hover { transform: scale(1.12); }
.org-ctrl-btn.add  { background: #16a34a; }
.org-ctrl-btn.edit { background: #2563eb; }
.org-ctrl-btn.del  { background: #dc2626; }
.org-ctrl-btn.up,
.org-ctrl-btn.down { background: #0d9488; }

/* ==== Logo / branding ==== */
.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d4af37, #a37f1e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
}

/* ==== Toast ==== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: white;
  border-radius: 0.85rem;
  padding: 0.9rem 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  border-right: 4px solid #0d9488;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  animation: fadeInUp 0.3s ease;
  min-width: 280px;
}
.toast.toast-success { border-right-color: #16a34a; }
.toast.toast-error   { border-right-color: #dc2626; }
.toast.toast-warning { border-right-color: #d97706; }

/* ==== Print ==== */
@media print {
  body { background: white !important; }
  #sidebar, #menu-toggle, header, footer, #btn-add-task, .no-print {
    display: none !important;
  }
  #main-content { margin-right: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #cbd5e1; page-break-inside: avoid; }
  .org-node { box-shadow: none !important; }
  @page { margin: 1cm; }
}

/* ==== شريط التقدم ==== */
.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  border-radius: 9999px;
  transition: width 0.6s ease;
}

/* ==== ملاحظات صغيرة ==== */
.text-muted { color: #64748b; }
.divider-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 1rem 0;
}
.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ==== استجابة الموبايل ==== */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    right: -280px;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: right 0.3s ease;
  }
  #sidebar.open { right: 0; }
  #main-content { margin-right: 0 !important; }
}

/* ==== Accordion للتقارير ==== */
.report-accordion-item {
  transition: background 0.2s ease;
}
.report-accordion-item + .report-accordion-item {
  border-top: 1px solid #f1f5f9;
}

/* ==== قائمة اختيار البنود (Item Picker) ==== */
.item-pick-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #f8fafc;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.item-pick-card {
  display: block;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.item-pick-card:hover {
  border-color: #14b8a6;
  background: #f0fdfa;
  transform: translateX(-2px);
}
.item-pick-card.selected {
  border-color: #0d9488;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.15);
}
.item-pick-card .item-pick-check {
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}
.item-pick-card.selected .item-pick-check {
  opacity: 1;
}
.item-pick-card.selected p {
  color: #134e4a;
}
/* scrollbar مخصص للقائمة */
.item-pick-list::-webkit-scrollbar { width: 6px; }
.item-pick-list::-webkit-scrollbar-thumb { background: #14b8a6; border-radius: 3px; }

/* تحسين الـ stat-card الصغير */
.stat-card.\!p-3 {
  padding: 0.75rem !important;
}

/* ==== File card ==== */
.file-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}
.file-card:hover {
  background: #f0fdfa;
  border-color: #14b8a6;
}
.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
}
.file-icon-pdf  { background: #dc2626; }
.file-icon-doc  { background: #2563eb; }
.file-icon-xls  { background: #16a34a; }
.file-icon-img  { background: #db2777; }
.file-icon-default { background: #64748b; }

/* ---------- Staff Tabs (Human Resources) ---------- */
.staff-tab {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.875rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  min-width: max-content;
}
.staff-tab:hover {
  border-color: #14b8a6;
  background: #f0fdfa;
  transform: translateY(-1px);
}
.staff-tab.active {
  border-color: #0d9488;
  background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
  box-shadow: 0 4px 12px -2px rgba(13, 148, 136, 0.25);
}
.staff-tab.active .text-slate-800 { color: #0f766e; }

/* ==== Brand logo (الشعار الرسمي) ==== */
.brand-sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.brand-sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.brand-logo-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: white;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.brand-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.brand-logo-img-light {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.15);
  border: 2px solid #5eead4;
  flex-shrink: 0;
}
.brand-logo-img-light img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* ==== Delay Alerts Banner (نظام تنبيهات التأخر) ==== */
.delay-alerts-banner {
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(220, 38, 38, 0.25);
  animation: slideInDown 0.5s ease-out;
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.delay-alerts-banner .alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: filter 0.2s;
}
.delay-alerts-banner .alert-header:hover { filter: brightness(1.05); }
.delay-alerts-banner.severity-critical .alert-header {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
}
.delay-alerts-banner.severity-warning .alert-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}
.delay-alerts-banner.severity-info .alert-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  color: white;
}
.delay-alerts-banner .alert-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.delay-alerts-banner .alert-pulse {
  animation: alertPulse 1.5s ease-in-out infinite;
}
@keyframes alertPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.1); opacity: 0.85; }
}
.delay-alerts-banner .alert-count-badge {
  background: rgba(255, 255, 255, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.delay-alerts-banner .alert-body {
  background: white;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.delay-alerts-banner.open .alert-body {
  max-height: 600px;
  overflow-y: auto;
}
.delay-alerts-banner .alert-toggle-chevron {
  transition: transform 0.3s;
}
.delay-alerts-banner.open .alert-toggle-chevron {
  transform: rotate(180deg);
}
.delay-alert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.delay-alert-item:last-child { border-bottom: none; }
.delay-alert-item:hover { background: #fef2f2; }
.delay-alert-item .alert-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.delay-alert-item .alert-dot.critical { background: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
.delay-alert-item .alert-dot.warning  { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }
.delay-alert-item .alert-dot.info     { background: #0ea5e9; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15); }
.delay-alert-item .days-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}
.delay-alert-item .days-badge.critical { background: #fee2e2; color: #b91c1c; }
.delay-alert-item .days-badge.warning  { background: #fef3c7; color: #92400e; }
.delay-alert-item .days-badge.info     { background: #e0f2fe; color: #075985; }
