html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden; /* لمنع ظهور شريط التمرير الأفقي المزعج */
    box-sizing: border-box;
}
/* منع التحديد في الصفحة بالكامل */
body {
    -webkit-user-select: none; /* لمتصفحات Safari و Chrome القديمة */
    -moz-user-select: none;    /* لمتصفح Firefox القديم */
    -ms-user-select: none;     /* لمتصفح Internet Explorer / Edge القديم */
    user-select: none;         /* المعيار القياسي المدعوم حالياً في معظم المتصفحات */
}
.dataTables_scrollHeadInner{
  width: 100%;
}
/* إذا كان لديك حاوية رئيسية لكل محتوى الموقع (مثل container أو wrapper) */
.main-wrapper, .container-fluid {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
}
    body {
      background-color: #f1f3f5;
      direction: rtl;
            height: 100%;
      margin: 0;
      overflow: hidden;
    }
    .sidebar {
      height: 100vh;
      background-color: #343a40;
      padding-top: 1rem;
      position: fixed;
      right: 0;
      top: 0;
      width: 220px;
      color: white;
    }
    .sidebar a {
      color: #ddd;
      display: block;
      padding: 10px 20px;
      text-decoration: none;
    }
    .sidebar a:hover {
      background-color: #49505773;
    }
    .main-content {
      margin-right: 220px;
      padding: 20px;
      
    }
    .floating-card {
      position: fixed;
      top: 10px;
      right: 10px;
      left: 10px;
      z-index: 1050;
      display: none;
      max-width: 600px;
      margin: auto;
      box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }
  .toggle-blue .btn-check:checked + .btn {
    background-color: #cce5ff; /* أزرق فاتح */
    color: #004085;
    border-color: #80bdff;
  }

  .toggle-blue .btn {
    background-color: white;
    color: #004085;
    border: 1px solid #80bdff;
  }

    .section-title { font-weight: bold; font-size: 1.2rem; color: #444; margin-top: 30px; margin-bottom: 10px; }
    .stat-card {
      background-color: #fff;
      border-radius: 12px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.05);
      padding: 15px;
      margin-bottom: 15px;
    }
    .stat-title {
      font-size: 0.95rem;
      color: #666;
    }
    .stat-value {
      font-size: 1.4rem;
      font-weight: 600;
      color: #222;
    }
    .container .main-content{
      display: flex;
      flex-direction: column;
      height: 100vh;
    }
.table {
  width: 100% !important;     /* ليأخذ كامل عرض الحاوية */
  overflow-x: auto;
      border-collapse: collapse;

}

.table th,
.table td {
  text-align: right;
  white-space: nowrap;        /* لمنع التفاف النص */
}
.container{
  height: 65vh;
  overflow:hidden;
}
.section-title{
  margin-top: 0px;
}
.py-4{
  padding-top: 0px;
}
.modal-content{
  height: auto;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}
.table2 {
    width: 100% !important;
    overflow-x: auto;
    border-collapse: collapse;
}
.table2>thead {
    vertical-align: bottom;
}
.table2>tbody {
    vertical-align: inherit;
}
            .container2{
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
  gap:10px;
  margin: 5px;
}
.card2{
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
    .card2 a {
      color: #ddd;
      display: block;
      padding: 10px 20px;
      text-decoration: none;
    }
    .top_bar{
      position: fixed;
      height: 100vh;
      width: 100%;
      z-index: 10;
  background-color: #f0f0f0;
    }
    #report2{
      overflow-y: scroll;
      overflow-x: hidden;
      height: 73vh;
      padding-left: 5px;
    }
    /* إجبار عناوين الجدول على محاذاة اليمين واتجاه RTL */
table.dataTable th {
    text-align: right !important;
    direction: rtl !important;
}

.dynamicfooter {
  margin: 10px;
}

    /* ==================== تحسينات المظهر والانيميشن وتسريع الاستجابة ==================== */
    :root {
      --primary-color: #0d6efd;
      --accent-color: #495057;
      --bg-main: #f8f9fa;
      --sidebar-width: 240px;
      --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body {
      background-color: var(--bg-main);
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
    }

    /* تسريع أداء الرسوم بالاعتماد على كارت الشاشة GPU وتقليل التقطيع (للكمبيوتر فقط منعا لتجميد اسكرول الهاتف) */
    @media (min-width: 768px) {
        .spa-page,
        .modal-dialog, /* تم تعديلها من .modal لمنع تعارض سياق التموضع وتجميد التمرير */
        .sidebar,
        .main-content {
          will-change: transform, opacity;
          transform: translate3d(0, 0, 0);
        }
    }

    /* القائمة الجانبية المحدثة */
    .sidebar {
      height: 100vh;
      background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
      padding-top: 1.5rem;
      position: fixed;
      right: 0;
      top: 0;
      width: var(--sidebar-width);
      color: #f8fafc;
      display: flex !important;
      flex-direction: column;
      padding-bottom: 20px;
      box-sizing: border-box;
      z-index: 1040;
      box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
      transition: transform var(--transition-smooth);
    }

    .sidebar h5 {
      font-weight: 600;
      font-size: 1.1rem;
      padding-bottom: 1rem;
      margin-bottom: 1.5rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      color: #38bdf8;
    }

    .sidebar-menu {
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 0 10px;
    }

    .sidebar a {
      color: #cbd5e1;
      display: block;
      padding: 10px 16px;
      text-decoration: none;
      cursor: pointer;
      border-radius: 8px;
      font-size: 0.95rem;
      transition: all var(--transition-fast);
    }

    .sidebar a:hover {
      background-color: rgba(255, 255, 255, 0.07);
      color: #fff;
      transform: translateX(-4px);
    }

    /* الستايل النشط الذي يتم تعيينه عبر JS */
    .sidebar a.active-link {
      background-color: var(--primary-color) !important;
      color: #fff !important;
      box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
      font-weight: bold;
    }

    .sidebar-footer {
      margin-top: auto;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      padding: 15px 15px 0 15px;
    }

    .main-content {
      margin-right: var(--sidebar-width);
      padding: 24px;
      transition: margin-right var(--transition-smooth);
    }

    /* تحسين شكل الكروت العائمة والصفحات */
    .card,
    .spa-page {
      background: #ffffff;
      border: none;
      border-radius: 12px;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
      padding: 20px;
      margin-bottom: 24px;
      animation: fadeIn var(--transition-smooth);
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .floating-card {
      position: fixed;
      top: 15px;
      right: 15px;
      left: 15px;
      z-index: 1050;
      display: none;
      max-width: 600px;
      margin: auto;
      border-radius: 12px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

    /* إخفاء وإظهار صفحات الـ SPA ديناميكياً باستخدام ميزة تسريع التلاشي */
    .spa-page {
      display: none;
    }

    /* مفاتيح التبديل السريعة (Radio Buttons as Toggle) */
    .btn-group.toggle-blue .btn-check:checked+.btn {
      background-color: var(--primary-color);
      color: white;
      box-shadow: 0 4px 10px rgba(13, 110, 253, 0.25);
    }

    .btn-group.toggle-blue .btn {
      border: 1px solid #dee2e6;
      transition: all var(--transition-fast);
      padding: 8px 16px;
    }

    /* الجداول المحسنة */
    .table-responsive {
      border-radius: 8px;
      overflow-x: auto !important;
      -webkit-overflow-scrolling: touch;
    }

    .table {
      margin-bottom: 0;
    }

    .table th {
      font-weight: 600;
      background-color: #f8fafc;
      border-bottom-width: 1px;
    }

    /* تحسينات المودال (Modals) */
    .modal {
      overflow-x: hidden !important;
      overflow-y: auto !important; /* تفعيل شريط التمرير داخل المودال بشكل إجباري */
      -webkit-overflow-scrolling: touch; /* تمرير سلس ولطيف على هواتف الأيفون */
    }

    .modal-content {
      border: none;
      border-radius: 16px;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
      transform: scale(0.95);
      transition: transform var(--transition-smooth);
    }

    .modal.show .modal-content {
      transform: scale(1);
    }

    /* مفتاح التبديل الأنيق للراديو */
    .printer-toggle-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 15px;
      color: #fff;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 24px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #475569;
      transition: var(--transition-fast);
      border-radius: 24px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: var(--transition-fast);
      border-radius: 50%;
    }

    input:checked+.slider {
      background-color: var(--primary-color);
    }

    input:checked+.slider:before {
      transform: translateX(22px);
    }

    /* شريط التمرير المخصص */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
      background: #c1c1c1;
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #a8a8a8;
    }

    /* تنسيقات هادئة ومريحة للعين للنافذة المنبثقة */
.clean-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
}

.clean-modal .modal-header {
    border-bottom: 1px solid #f1f3f4;
    background-color: #f8f9fa;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem;
}

.clean-modal .modal-title {
    color: #202124;
    font-weight: 500;
}

.clean-modal label {
    color: #5f6368;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.clean-modal .form-control {
    border-radius: 8px;
    border: 1px solid #dadce0;
    padding: 0.6rem 1rem;
    color: #202124;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
}

.clean-modal .form-control:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: none;
}

/* تنسيق قسم الصلاحيات ليكون كبطاقات أنيقة (Chips/Cards) */
.permissions-wrapper {
    background-color: #f8f9fa;
    border: 1px solid #f1f3f4;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.permission-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin: 0;
    height: 100%;
}

.permission-card:hover {
    background-color: #f1f3f4;
}

.permission-card input[type="checkbox"] {
    margin-left: 10px; /* مسافة للغة العربية */
    accent-color: #1a73e8; /* لون التحديد الأزرق الهادئ */
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.clean-modal .modal-footer {
    border-top: 1px solid #f1f3f4;
    background-color: #f8f9fa;
    border-radius: 0 0 16px 16px;
    padding: 1rem 1.5rem;
}

/* تحسين الأزرار السفلية */
.clean-modal .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
}

.clean-modal .btn-success {
    background-color: #1a73e8; /* أزرق نظيف بدلاً من الأخضر الفاقع */
    border-color: #1a73e8;
}

.clean-modal .btn-success:hover {
    background-color: #1557b0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.clean-modal .btn-danger {
    background-color: #ea4335;
    border-color: #ea4335;
}

.clean-modal .btn-danger:hover {
    background-color: #c5221f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* تنسيقات الجداول داخل النوافذ المنبثقة الذكية */
.clean-modal .table-responsive {
    border: 1px solid #e8eaed;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
}

.clean-modal .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* تحسين مظهر رأس الجدول ليكون مريحاً ومنخفض التوهج */
.clean-modal .table thead th {
    background-color: #f8f9fa;
    color: #5f6368;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 14px 12px;
    border-bottom: 2px solid #f1f3f4;
}

/* تنسيق سطور الجدول وخلفياتها عند التمرير بالفأرة */
.clean-modal .table tbody td {
    padding: 14px 12px;
    color: #202124;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease-in-out;
}

/* تأثير التمرير (Hover) بلون رمادي ناعم جداً مقتبس من ألوان الكروم */
.clean-modal .table-hover tbody tr:hover td {
    background-color: #f1f3f4 !important;
    color: #1a73e8; /* تحول خط النص للون الأزرق الهادئ عند الإشارة للإشعار بالضغط */
    cursor: pointer;
}

/* إزالة حدود السطر الأخير للحفاظ على نظافة الهيكل الدائري */
.clean-modal .table tbody tr:last-child td {
    border-bottom: none;
}

/* 1. إخفاء أدوات الـ DataTable تماماً (البحث، الترقيم، الفلترة، معلومات الجدول) بداخل نافذة الجرد فقط */
#inventoryModal .dataTables_filter,
#inventoryModal .dataTables_length,
#inventoryModal .dataTables_info,
#inventoryModal .dataTables_paginate {
    display: none !important;
}

/* 2. إلغاء تأثيرات الـ Hover والضغط المنبثقة من الـ DataTable وإجبار السطور على الثبات */
#inventoryModal table.table tbody tr {
    background-color: #ffffff !important;
    cursor: default !important;
}

#inventoryModal table.table tbody tr:hover td {
    background-color: #ffffff !important;
    color: #202124 !important;
}

/* 3. تحسين مظهر الجدول الأصلي ليصبح ناعماً وبحواف دائرية مريحة للعين */
#inventoryModal .table-responsive {
    border: 1px solid #e8eaed !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

#inventoryModal table.table {
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

/* 4. تنسيق رأس الجدول وحقول الإدخال لتطابق نمط الواجهات الهادئة */
#inventoryModal table.table thead th {
    background-color: #f8f9fa !important;
    color: #5f6368 !important;
    font-weight: 600 !important;
    padding: 12px !important;
    border-bottom: 2px solid #f1f3f4 !important;
}

#inventoryModal .form-control {
    border-radius: 6px !important;
    border: 1px solid #dadce0 !important;
    transition: all 0.2s ease-in-out !important;
}

#inventoryModal .form-control:focus {
    border-color: #1a73e8 !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15) !important;
    outline: none !important;
}

/* تنسيق قسم الترويسة ليكون هادئاً */
.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* زر الجرس */
.alert-btn {
    position: relative;
    background: transparent;
    border: none;
    color: #cbd5e1; /* متناسق مع لون القائمة الداكنة */
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

/* تأثير تمرير الماوس (Hover) */
.alert-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* النقطة الحمراء (مؤشر التنبيه) - بحجم أكبر وأوضح */
.alert-badge {
    position: absolute;
    top: 3px;          /* تم تعديل الارتفاع ليناسب الحجم الجديد */
    right: 5px;        /* تم تعديل الإزاحة لتكون متناسقة */
    width: 12px;       /* تكبير العرض من 8px إلى 12px */
    height: 12px;      /* تكبير الارتفاع من 8px إلى 12px */
    background-color: #ea4335; /* لون أحمر واضح ومريح للعين */
    border-radius: 50%;
    border: 2px solid #f8f9fa; /* زيادة سُمك الإطار الأبيض ليفصل النقطة عن جسم الجرس ويبرزها */
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15); /* إضافة ظل خفيف جداً خلف النقطة لزيادة وضوحها وعمقها */
}

/* إخفاء النقطة الحمراء بسلاسة */
.alert-badge.hidden {
    opacity: 0;
    transform: scale(0);
}

/* ضبط حدود النقطة الحمراء في الكمبيوتر لتناسب الخلفية الداكنة للـ Sidebar */
.border-dark-sidebar {
    border-color: #1e293b !important;
}

/* عناوين الأقسام داخل النافذة */
.alert-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #5f6368;
    padding-right: 5px;
}

/* بطاقة التنبيه العامة */
.custom-alert-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* بطاقة نقص المخزون (أحمر ناعم وراقي) */
.low-stock-card {
    background-color: #fce8e6;
    border-color: #fad2cf;
}
.low-stock-card .card-icon {
    font-size: 1.2rem;
    margin-left: 12px;
}

/* بطاقة انتهاء الصلاحية (برتقالي/أشهر ناعم وراقي) */
.expiry-card {
    background-color: #fef7e0;
    border-color: #feecb8;
}
.expiry-card .card-icon {
    font-size: 1.2rem;
    margin-left: 12px;
}

/* تفاصيل النصوص داخل البطاقات */
.card-details {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.card-product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 2px;
}

.card-product-desc {
    font-size: 0.85rem;
    color: #5f6368;
}

.text-warning-dark {
    color: #b06000 !important; /* لون برتقالي غامق مقروء بوضوح فوق الخلفية الصفراء */
}

/* شارات إضافية صغيرة للجمالية */
.badge-batch {
    font-size: 0.75rem;
    background-color: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: #5f6368;
    margin-right: 6px;
}

.badge-days {
    background-color: #f1f3f4;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* --- أولاً: شاشات الكمبيوتر (شاشات أكبر من 768 بكسل) --- */
@media (min-width: 768px) {
    .mobile-header {
        display: none !important; /* إخفاء ترويسة الهاتف بالكامل */
    }
    .sidebar {
        position: fixed;
        top: 0;
        right: 0; 
        width: 260px;
        height: 100vh;
        z-index: 1000;
    }
    .main-content {
        margin-right: 260px;
        margin-left: 0;
    }
}

/* --- ثانياً: شاشات الهاتف والتابلت (شاشات أصغر من 768 بكسل) --- */
@media (max-width: 767.98px) {
    html, body:not(.modal-open) {
        overflow-y: auto !important; /* يتم تفعيل السكرول العمودي بشكل إجباري فقط عندما لا تكون هناك نافذة منبثقة مفتوحة */
        height: auto !important;
    }

    /* شريط الهاتف العلوي ثابت */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        z-index: 1030;
        border-bottom: 1px solid #e8eaed;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .mobile-header .alert-btn {
        color: #5f6368;
    }

    /* سحب القائمة الجانبية خارج الشاشة يميناً والحفاظ على الخلفية الداكنة المتناسقة */
    .sidebar {
        position: fixed;
        top: 0;
        right: -280px; 
        width: 280px;
        height: 100vh;
        z-index: 1050; 
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
        box-shadow: -4px 0 12px rgba(0,0,0,0.2);
    }

    .sidebar .sidebar-header h5 {
        color: #38bdf8 !important;
    }

    /* كلاس التنشيط: لإعادة القائمة داخل الشاشة عند فتحها */
    .sidebar.active {
        right: 0;
    }

    /* تعديل حاوية المحتوى لتأخذ كامل الشاشة وتنزل بمسافة كافية تمنع اختفائها خلف الهيدر */
    .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding: 15px !important;
        padding-top: 80px !important; /* مسافة أمان كافية لعدم تداخل البيانات مع الشريط العلوي */
    }

    /* تحسين استجابة الكروت وأقراص الـ SPA المفتوحة */
    .card, .spa-page {
        padding: 12px !important;
        margin-bottom: 16px !important;
    }

    /* تحويل الـ btn-group الطويلة لتدعم الالتفاف المرن والنزول لسطر جديد تلقائياً في الشاشات الضيقة */
    .btn-group.toggle-blue {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 6px !important;
        box-shadow: none !important;
    }

    .btn-group.toggle-blue .btn {
        flex: 1 1 auto !important;
        border-radius: 8px !important;
        margin: 0 !important;
        border: 1px solid #dee2e6 !important;
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
    }

	.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

body.modal-open {
    overflow: hidden !important;
}
}

/* --- ثالثاً: العناصر المساعدة العامة --- */

/* الخلفية الداكنة عند فتح القائمة بالهاتف */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* زر الهامبرغر */
.mobile-toggle-btn {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-toggle-btn:hover {
    background-color: #f1f3f4;
}

/* زر الإغلاق (X) داخل القائمة الجانبية بالهاتف */
.close-sidebar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-sidebar-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* للتأكد من موقع الأيقونة في أقصى الشمال للأعلى */
.stat-card {
  position: relative;
}

.stat-card .info-popover-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  background: transparent;
  border: none;
  padding: 0;
  color: #6c757d; /* لون الأيقونة رمادي */
  cursor: pointer; /* إظهار علامة اليد */
  z-index: 10;
  line-height: 1;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.stat-card .info-popover-btn:hover {
  color: #0d6efd; /* يتغير للأزرق عند التمرير */
  transform: scale(1.1);
}