/* ==========================================================================
   desktop-luxury.css - التصميم الجمالي الملكي لمنظومة الاتحاد الليبي للفروسية
   تطوير الواجهة إلى تطبيق سطح مكتب فاخر v2.0
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* تخصيص شريط التمرير (Scrollbar) المكتبي */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #0a0a0f;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #b8860b 0%, #d4af37 50%, #9a7f3e 100%);
  border-radius: 10px;
  border: 2px solid #0a0a0f;
}
::-webkit-scrollbar-thumb:hover {
  background: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* عمومية الخط والخلفية */
body, button, input, select, textarea {
  font-family: 'Tajawal', 'Cairo', sans-serif !important;
}

body {
  background: radial-gradient(ellipse at 15% 15%, rgba(30, 58, 95, 0.35) 0%, transparent 50%),
              radial-gradient(ellipse at 85% 85%, rgba(184, 134, 11, 0.12) 0%, transparent 45%),
              linear-gradient(135deg, #0a0a10 0%, #10141f 50%, #0d0f18 100%) !important;
  background-attachment: fixed !important;
  color: #f1f5f9;
}

/* --------------------------------------------------------------------------
   1. شريط التنقل العلوي الملكي (Top Navbar)
   -------------------------------------------------------------------------- */
.top-dropdown-navbar {
  background: rgba(13, 17, 27, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.08) !important;
  height: 64px !important;
}

.navbar-brand-section {
  gap: 12px !important;
}

.navbar-logo-img {
  height: 44px !important;
  width: 44px !important;
  border-radius: 50% !important;
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.navbar-logo-img:hover {
  transform: rotate(5deg) scale(1.06);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.7) !important;
}

.navbar-brand-text {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #ffd700 !important;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4) !important;
  letter-spacing: 0.3px;
}

.navbar-menu-items {
  height: 64px !important;
  gap: 6px !important;
}

/* روابط وأزرار القوائم */
.nav-menu-link {
  height: 64px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #cbd5e1 !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  margin: 6px 2px !important;
  height: 52px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
}

.nav-menu-link:hover, .nav-menu-link.active {
  color: #ffd700 !important;
  background: rgba(255, 215, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-menu-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  background: linear-gradient(90deg, #b8860b, #ffd700, #b8860b);
  border-radius: 3px;
  box-shadow: 0 0 8px #ffd700;
}

/* القوائم المنسدلة (Dropdowns) */
.nav-dropdown-menu {
  top: 58px !important;
  background: rgba(18, 24, 38, 0.96) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
  border-radius: 14px !important;
  padding: 8px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.12) !important;
  animation: dropIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown-item {
  color: #e2e8f0 !important;
  font-weight: 600 !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  margin-bottom: 2px !important;
  transition: all 0.2s ease !important;
}

.nav-dropdown-item:hover {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05)) !important;
  color: #ffd700 !important;
  transform: translateX(-4px) !important;
}

.navbar-user-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  border-radius: 20px !important;
  padding: 4px 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.navbar-role-select {
  color: #ffd700 !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
}

/* --------------------------------------------------------------------------
   2. البطاقات وصناديق المحتوى (Cards & Glassmorphism)
   -------------------------------------------------------------------------- */
.card {
  background: rgba(20, 27, 45, 0.75) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 215, 0, 0.2) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.04) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255, 215, 0, 0.4) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(255, 215, 0, 0.08) !important;
}

.card-header {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.06), transparent) !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15) !important;
  padding: 1.1rem 1.4rem !important;
}

.card-title {
  color: #ffd700 !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.page-title {
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #fff !important;
  position: relative;
  display: inline-block;
}

.page-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, #b8860b, #ffd700);
  border-radius: 4px;
  margin-top: 6px;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* بطاقات الإحصائيات (Stat Cards) */
.stat-card, .metric-card {
  background: linear-gradient(145deg, rgba(26, 35, 60, 0.8), rgba(15, 20, 35, 0.9)) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.stat-card:hover, .metric-card:hover {
  transform: translateY(-5px) !important;
  border-color: #ffd700 !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 215, 0, 0.2) !important;
}

.stat-value, .stat-number {
  color: #ffd700 !important;
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* --------------------------------------------------------------------------
   3. جداول البيانات الاحترافية (Data Tables)
   -------------------------------------------------------------------------- */
.table-wrapper {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 215, 0, 0.15) !important;
  background: rgba(10, 14, 24, 0.6) !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

thead th {
  background: linear-gradient(180deg, #1b253b 0%, #141b2c 100%) !important;
  color: #ffd700 !important;
  font-weight: 800 !important;
  font-size: 0.92rem !important;
  padding: 14px 12px !important;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3) !important;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

tbody tr {
  background: transparent !important;
  transition: all 0.2s ease !important;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}

tbody tr:hover {
  background: rgba(255, 215, 0, 0.09) !important;
  box-shadow: inset 3px 0 0 #ffd700 !important;
}

tbody td {
  padding: 12px 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #e2e8f0 !important;
  font-size: 0.95rem !important;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   4. الأزرار وعناصر التحكم (Buttons)
   -------------------------------------------------------------------------- */
.btn {
  font-family: 'Tajawal', sans-serif !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.96) !important;
}

/* الزر الذهبي الأساسي */
.btn-primary {
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 50%, #d4af37 100%) !important;
  color: #0a0a0f !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.35) !important;
}

.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(255, 215, 0, 0.55) !important;
  transform: translateY(-2px) !important;
  filter: brightness(1.08);
}

/* الزر الثانوي الزجاجي */
.btn-secondary {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 215, 0, 0.3) !important;
}

.btn-secondary:hover {
  background: rgba(255, 215, 0, 0.12) !important;
  color: #ffd700 !important;
  border-color: #ffd700 !important;
}

/* زر الحذف والخطر */
.btn-danger {
  background: linear-gradient(135deg, #991b1b, #ef4444) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35) !important;
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.55) !important;
  transform: translateY(-1px) !important;
}

/* --------------------------------------------------------------------------
   5. النوافذ المنبثقة وحقول الإدخال (Modals & Inputs)
   -------------------------------------------------------------------------- */
.modal {
  background: rgba(10, 12, 20, 0.85) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
}

.modal-content {
  background: rgba(18, 25, 42, 0.95) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.35) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 215, 0, 0.15) !important;
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  border-bottom: 1px solid rgba(255, 215, 0, 0.2) !important;
  padding: 1.2rem 1.5rem !important;
}

.modal-title {
  color: #ffd700 !important;
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.modal-footer {
  border-top: 1px solid rgba(255, 215, 0, 0.15) !important;
  padding: 1.2rem 1.5rem !important;
}

/* حقول الإدخال والاختيار */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  border-radius: 10px !important;
  color: #fff !important;
  padding: 10px 14px !important;
  font-size: 0.95rem !important;
  transition: all 0.25s ease !important;
  outline: none !important;
}

input:focus, select:focus, textarea:focus {
  border-color: #ffd700 !important;
  background: rgba(255, 215, 0, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15), 0 0 15px rgba(255, 215, 0, 0.1) !important;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

select option {
  background: #141b2c !important;
  color: #fff !important;
}

/* بطاقات ثيمات المنظومة في قسم النسخ الاحتياطي */
.theme-card {
  border-radius: 14px !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.25s ease !important;
  overflow: hidden;
  cursor: pointer;
}

.theme-card:hover {
  transform: translateY(-4px) !important;
  border-color: #ffd700 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.2) !important;
}

.theme-card.active-theme {
  border-color: #ffd700 !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4) !important;
}


/* ==========================================================================
   صناديق بيانات دليل الخيول بخط أبيض ناصع
   ========================================================================== */

.horse-box-cell {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 9px !important;
  padding: 6px 14px !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45) !important;
  white-space: nowrap !important;
  letter-spacing: 0.3px;
  transition: all 0.2s ease !important;
}

.horse-box-cell:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 215, 0, 0.6) !important;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2) !important;
}

.horse-name-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)) !important;
  border-color: rgba(255, 215, 0, 0.4) !important;
  cursor: pointer !important;
  color: #ffffff !important;
}

.horse-name-box:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.1)) !important;
  border-color: #ffd700 !important;
  transform: translateY(-2px);
}

.horse-box-cell code,
.horse-box-cell strong,
.horse-box-cell span {
  color: #ffffff !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#horsesPage table tbody td {
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 8px 6px !important;
}

/* بطاقات وصناديق الملف الشخصي للجواد (Horse Profile) بخط أبيض ناصع */
.profile-field {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.25s ease !important;
}

.profile-field:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 215, 0, 0.5) !important;
  transform: translateY(-2px);
}

.profile-field .profile-label {
  color: #ffd700 !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  margin-bottom: 6px !important;
  display: block !important;
  letter-spacing: 0.2px;
}

.profile-field .profile-value,
.profile-field .pf-view {
  color: #ffffff !important;
  font-size: 1.18rem !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7) !important;
  display: block !important;
}

#horseProfilePage .card {
  background: rgba(18, 25, 42, 0.85) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
}


/* ==========================================================================
   تصميم جدول الخيول المدمج والفاخر عالي الكثافة (High-Density Compact Grid)
   ========================================================================== */

/* أسطر الجدول المدمجة */
.compact-horse-row {
  height: 42px !important;
  transition: all 0.15s ease !important;
  background: rgba(15, 23, 42, 0.6) !important;
}

.compact-horse-row:nth-child(even) {
  background: rgba(30, 41, 59, 0.45) !important;
}

.compact-horse-row:hover {
  background: rgba(245, 158, 11, 0.12) !important;
  box-shadow: inset 3px 0 0 #f59e0b !important;
}

.compact-horse-row td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  vertical-align: middle !important;
  padding: 6px 10px !important;
}

/* اسم الجواد الأنيق */
.compact-horse-name {
  color: #fbbf24 !important;
  font-weight: 800 !important;
  font-size: 0.94rem !important;
  cursor: pointer !important;
  transition: 0.15s !important;
  white-space: nowrap !important;
}

.compact-horse-name:hover {
  color: #38bdf8 !important;
  transform: translateX(-3px);
}

/* بطاقات الكود والأرقام (الجواز، الشفرة، الموحد) */
.badge-code {
  font-family: Consolas, monospace !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
  display: inline-block !important;
  white-space: nowrap !important;
}

.badge-passport {
  background: rgba(56, 189, 248, 0.1) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.badge-ueln {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-chip {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.badge-cat {
  background: rgba(148, 163, 184, 0.1) !important;
  color: #cbd5e1 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

/* أزرار الإجراءات المصغرة والفاخرة */
.btn-action-profile {
  background: rgba(2, 132, 199, 0.18) !important;
  color: #38bdf8 !important;
  border: 1px solid #0284c7 !important;
  padding: 3px 8px !important;
  font-size: 0.78rem !important;
  border-radius: 5px !important;
  margin-left: 3px !important;
}
.btn-action-profile:hover {
  background: #0284c7 !important;
  color: #fff !important;
}

.btn-action-print {
  background: rgba(217, 119, 6, 0.18) !important;
  color: #fbbf24 !important;
  border: 1px solid #d97706 !important;
  padding: 3px 8px !important;
  font-size: 0.78rem !important;
  border-radius: 5px !important;
  margin-left: 3px !important;
}
.btn-action-print:hover {
  background: #d97706 !important;
  color: #fff !important;
}

.btn-action-edit {
  background: rgba(100, 116, 139, 0.2) !important;
  color: #cbd5e1 !important;
  border: 1px solid #475569 !important;
  padding: 3px 7px !important;
  font-size: 0.8rem !important;
  border-radius: 5px !important;
  margin-left: 3px !important;
}
.btn-action-edit:hover {
  background: #475569 !important;
  color: #fff !important;
}

.btn-action-delete {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid #dc2626 !important;
  padding: 3px 7px !important;
  font-size: 0.8rem !important;
  border-radius: 5px !important;
}
.btn-action-delete:hover {
  background: #dc2626 !important;
  color: #fff !important;
}


/* ==========================================================================
   توحيد وترشيق الشريط العلوي العالمي الفائق التجاوب (All Screens 14" to 32" & 4K)
   ========================================================================== */
.top-dropdown-navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 54px !important;
  background: rgba(11, 17, 32, 0.96) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1.5px solid rgba(255, 215, 0, 0.35) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
  z-index: 999999 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.navbar-inner {
  height: 54px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 clamp(8px, 1vw, 20px) !important;
  gap: clamp(4px, 0.6vw, 10px) !important;
  position: relative !important;
  z-index: 999999 !important;
}

.navbar-brand-section {
  display: inline-flex !important;
  align-items: center !important;
  gap: clamp(6px, 0.6vw, 10px) !important;
  flex-shrink: 0 !important;
}

.navbar-logo-img {
  height: 38px !important;
  width: 38px !important;
  border-radius: 50% !important;
  border: 1.5px solid #ffd700 !important;
  flex-shrink: 0 !important;
}

.navbar-brand-text {
  font-size: clamp(0.88rem, 1vw, 1.15rem) !important;
  font-weight: 800 !important;
  color: #ffd700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: clamp(130px, 16vw, 250px) !important;
}

.navbar-menu-items {
  height: 54px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(2px, 0.35vw, 6px) !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  position: relative !important;
  z-index: 1000000 !important;
}

.navbar-menu-items::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.nav-menu-link {
  height: 38px !important;
  font-size: clamp(0.78rem, 0.8vw, 0.92rem) !important;
  font-weight: 700 !important;
  padding: 0 clamp(6px, 0.6vw, 12px) !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.nav-dropdown-menu {
  top: 50px !important;
  border-radius: 10px !important;
}

/* قسم المستخدم وتسجيل الخروج - مثبت يسار الشاشة وغير قابل للانقطاع */
.navbar-user-section {
  display: inline-flex !important;
  align-items: center !important;
  gap: clamp(3px, 0.4vw, 8px) !important;
  flex-shrink: 0 !important;
  margin-inline-start: auto !important;
  z-index: 1000001 !important;
  white-space: nowrap !important;
}

.navbar-user-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  height: 34px !important;
  padding: 0 clamp(6px, 0.5vw, 10px) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.35) !important;
  max-width: clamp(140px, 14vw, 220px) !important;
  min-width: 0 !important;
  overflow: hidden !important;
  flex-shrink: 1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.navbar-role-select {
  color: #ffd700 !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  max-width: clamp(110px, 11vw, 185px) !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  outline: none !important;
}

.navbar-logout-btn {
  height: 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.6) !important;
  border-radius: 8px !important;
  color: #fca5a5 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.25s ease !important;
}

.navbar-logout-btn:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.7) !important;
  transform: scale(1.06) !important;
}

/* ضبط المسافة العلوية للمحتوى ليتنفس بعد تصغير الشريط */
.app-container {
  padding-top: 58px !important;
}

.nav-dropdown-wrapper {
  position: relative !important;
  z-index: 1000000 !important;
}

.nav-dropdown-wrapper.open {
  z-index: 10000000 !important;
}

.nav-dropdown-menu {
  position: absolute !important;
  top: 50px !important;
  z-index: 99999999 !important;
  background: #0b1120 !important;
  border: 1.5px solid rgba(255, 215, 0, 0.5) !important;
  border-radius: 12px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 215, 0, 0.25) !important;
  min-width: 250px !important;
  max-height: calc(100vh - 65px) !important;
  overflow-y: auto !important;
}

/* محاذاة القوائم القريبة من اليسار مثل قائمة النظام حتى لا تخرج خارج الشاشة */
.nav-dropdown-wrapper:last-child .nav-dropdown-menu,
.nav-dropdown-wrapper:nth-last-child(2) .nav-dropdown-menu {
  left: 0 !important;
  right: auto !important;
}

/* زر التحديث المباشر للمنظومة */
.navbar-refresh-btn:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.85) !important;
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
}

/* بانر التمرير السريع للجدول */
.table-scroll-banner {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.table-scroll-banner button:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}
.table-scroll-banner button:active {
    transform: translateY(1px);
}

/* ===================================================
   تصميم بطاقات الإحصائيات وبانر التمرير والشارات الذكية
   =================================================== */
.kpi-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.kpi-stat-card {
    background: linear-gradient(135deg, rgba(15,23,42,0.9) 0%, rgba(30,41,59,0.85) 100%);
    border: 1.5px solid rgba(255,215,0,0.25);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.kpi-stat-card:hover {
    transform: translateY(-3px);
    border-color: #ffd700;
    box-shadow: 0 6px 20px rgba(255,215,0,0.2);
}
.kpi-stat-card.active-kpi {
    border-color: #38bdf8;
    background: linear-gradient(135deg, rgba(30,58,138,0.7) 0%, rgba(15,23,42,0.95) 100%);
}
.kpi-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.kpi-stat-info .kpi-num {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}
.kpi-stat-info .kpi-lbl {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
}

/* شارات الحالة بنظام الكبسولة واللمبة الدائرية */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-pill-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.status-pill-renew {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.4);
}
.status-pill-suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot-active { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-dot-renew { background: #eab308; box-shadow: 0 0 8px #eab308; }
.status-dot-suspended { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

/* بطاقة الفارس التفصيلية (Modal Dossier) */
.rider-dossier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.dossier-item {
    background: rgba(15,23,42,0.6);
    border: 1px solid #334155;
    padding: 10px 14px;
    border-radius: 8px;
}
.dossier-item label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 3px;
    font-weight: 600;
}
.dossier-item .val {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
}


#feiFinanceContainer tbody td,
#feiFinanceContainer table td,
#feiFinanceContainer td,
#feiFinanceContainer .fei-fin-cell {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  font-weight: 900 !important;
}
#feiFinanceContainer thead th {
  background: #000000 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 900 !important;
}


#feiFinanceContainer .btn-inv-num,
#feiFinanceContainer .btn-inv-num *,
#feiFinanceContainer button.btn-inv-num,
#feiFinanceContainer button.btn-inv-num * {
  background-color: #000000 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 900 !important;
  border-radius: 6px !important;
}


/* ========================================================
   تأكيد ظهور خطوط وتسميات نوافذ الإدراج والمطابقة باللون الأسود الملكي الصريح
   ======================================================== */
#modalAddInvoice label,
#modalAddInvoice strong,
#modalAddInvoice .modal-title,
#modalAddInvoice p,
#modalAddInvoice span:not(.badge-pill-black),
#modalEoARecon label,
#modalEoARecon strong,
#modalEoARecon p {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    font-weight: 900 !important;
}

#modalAddInvoice input,
#modalAddInvoice select,
#modalAddInvoice textarea,
#modalEoARecon input,
#modalEoARecon select,
#modalEoARecon textarea {
    background-color: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    font-weight: 900 !important;
    border: 2px solid #000000 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}





/* ==========================================================================
   دعم متكامل لفتح القوائم بالhover والنقر معاً (Zero-Clip Guarantee)
   ========================================================================== */
.top-dropdown-navbar {
    z-index: 999999 !important;
    overflow: visible !important;
}

.navbar-container {
    overflow: visible !important;
}

@media (min-width: 1025px) {
    .navbar-menu-items {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}

.nav-dropdown-wrapper {
    position: relative !important;
    overflow: visible !important;
    z-index: 1000000 !important;
}

.nav-dropdown-wrapper:hover,
.nav-dropdown-wrapper.open {
    z-index: 10000000 !important;
}

/* القائمة المنسدلة تفتح بالhover أو عند إضافة كلاس open */
.nav-dropdown-wrapper:hover .nav-dropdown-menu,
.nav-dropdown-wrapper.open .nav-dropdown-menu {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    z-index: 99999999 !important;
    background: rgba(11, 17, 32, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1.5px solid rgba(255, 215, 0, 0.6) !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 215, 0, 0.25) !important;
    min-width: 250px !important;
    max-height: calc(100vh - 75px) !important;
    overflow-y: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
}

.nav-dropdown-wrapper:not(:hover):not(.open) .nav-dropdown-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.dashboard-banner {
    position: relative !important;
    z-index: 1 !important;
}
