/* متغيرات CSS للتحسين */
:root {
    /* الألوان الأساسية */
    --primary-color: #0d6efd;
    --secondary-color: #20c997;
    --accent-color: #ffc107;
    --danger-color: #dc3545;
    --success-color: #198754;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* ألوان النصوص */
    --text-primary: #2c3e50;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-light: #adb5bd;
    --text-white: #ffffff;
    
    /* الحدود والظلال */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.08);
    
    /* الحدود المدورة */
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* الانتقالات */
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
    --transition-slow: all 0.5s ease;
    
    /* المسافات */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* الخطوط */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* الارتفاعات */
    --header-height: 70px;
    --sidebar-width: 250px;
    --card-min-height: 200px;
}

/* تحسينات إضافية للتصميم */

.rtl {
    direction: rtl;
    text-align: right;
}

.member-card {
    transition: transform 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.photo-upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s;
}

.photo-upload-area:hover {
    border-color: #007bff;
}

.photo-upload-area.dragover {
    border-color: #28a745;
    background-color: #f8f9fa;
}

.member-photo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #8b4513;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.member-photo:hover {
    transform: scale(1.05);
    border-color: #cd853f;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.expired {
    background-color: #dc3545 !important;
}

.expiring-soon {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.active {
    background-color: #28a745 !important;
}

.search-highlight {
    background-color: yellow;
    padding: 1px 3px;
    border-radius: 2px;
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s;
}

.stats-card:hover {
    transform: scale(1.05);
}

.stats-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.progress-custom {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-custom .progress-bar {
    border-radius: 4px;
}

/* تحسينات للطباعة */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    .table {
        font-size: 12px;
    }
    
    .member-photo {
        width: 40px;
        height: 40px;
    }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.3rem 0.5rem; /* تقليل الحشو أكثر على الشاشات الصغيرة */
    }
    
    .table .member-photo {
        width: 35px;
        height: 35px;
    }
    
    .table .btn-group-vertical .btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
        margin-bottom: 1px;
    }
    
    .table .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* إخفاء بعض الأعمدة على الشاشات الصغيرة جداً */
    @media (max-width: 576px) {
        .table th:nth-child(6),
        .table td:nth-child(6),
        .table th:nth-child(7),
        .table td:nth-child(7) {
            display: none;
        }
    }
}

/* تأثيرات الحركة */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* تحسينات للنماذج */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* تحسينات للأزرار */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* تحسينات للجداول */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.75rem; /* تقليل الحشو العمودي */
    vertical-align: middle;
}

.table td {
    padding: 0.4rem 0.75rem; /* تقليل الحشو العمودي للخلايا */
    vertical-align: middle;
    line-height: 1.3; /* تقليل ارتفاع السطر */
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* جعل الصفوف أكثر رقة وأناقة */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #e0e0e0; /* حدود أفتح */
}

/* تحسين مظهر الأزرار داخل الجدول */
.table .btn-group-vertical .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

/* تحسين مظهر الصور في الجدول */
.table .member-photo {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #dee2e6;
}

/* تحسين مظهر الشارات في الجدول */
.table .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* تحسينات إضافية للجدول لجعله أكثر رقة */
.table {
    font-size: 0.9rem; /* تقليل حجم الخط قليلاً */
}

.table thead th {
    background-color: #0d6efd; /* لون خلفية داكن (Bootstrap primary) */
    color: #fff;               /* نص أبيض لزيادة التباين */
    border-bottom: 2px solid #0b5ed7;
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
}

.admin-table.table thead th {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
    border-bottom: 2px solid #dee2e6 !important;
}

/* تأكد من بقاء النص داخل رؤوس الأعمدة واضحًا حتى لو كان رابطًا */
.table thead th a,
.table thead th span,
.table thead th i {
    color: #fff !important;
}

.admin-table.table thead th a,
.admin-table.table thead th span,
.admin-table.table thead th i {
    color: #ffffff !important;
}

/* تحسين مظهر الأرقام والنصوص المهمة */
.table td strong {
    font-weight: 600;
    color: #495057;
}

/* تحسين مظهر الخلايا الفارغة أو الافتراضية */
.table td .bg-secondary {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تحسين مظهر أزرار الباركود */
.table .btn-outline-primary {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-width: 1px;
}

/* وضع مدمج للجدول في صفحة المنخرطين لتقليل ارتفاع الأسطر والأزرار الجانبية */
.table-compact {
    font-size: 0.85rem;
}
.table-compact th,
.table-compact td {
    padding: 0.15rem 0.4rem; /* تقليل الحشو أكثر */
    line-height: 1.02;       /* سطر أكثر رقة */
}
.table-compact thead th {
    padding: 0.3rem 0.4rem;
    font-size: 0.76rem;
}
.table-compact .member-photo {
    width: 28px;
    height: 28px;
}
.table-compact .badge {
    font-size: 0.58rem;
    padding: 0.1rem 0.25rem;
}
/* أزرار الإجراءات في الوضع المدمج - أفقية ومحاذاة متناسقة */
.table-compact .btn-group .btn,
.table-compact .btn-group-vertical .btn {
    padding: 0.18rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1.1;
    min-height: 24px;
}
.table-compact .btn-group .btn i,
.table-compact .btn-group-vertical .btn i {
    margin-inline-end: 4px; /* مسافة صغيرة بين الأيقونة والنص */
}
.table-compact .btn-outline-primary {
    padding: 0.14rem 0.35rem;
    font-size: 0.7rem;
}

/* تحسينات للبطاقات */
.card {
    border-radius: 10px;
    overflow: hidden;
}

.card-header {
    font-weight: 600;
    border-bottom: none;
}

/* تحسينات للتنبيهات */
.alert {
    border-radius: 8px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: #d1edff;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ===== تصميم الشريط العلوي المحسن ===== */

/* الشريط العلوي الرئيسي */
.library-navbar {
    background: linear-gradient(135deg, 
        #2c3e50 0%,     /* رمادي داكن */
        #34495e 25%,    /* رمادي متوسط */
        #3d566e 50%,    /* رمادي مزرق */
        #2c3e50 100%    /* رمادي داكن */
    ) !important;
    box-shadow: 0 4px 20px rgba(44, 62, 80, 0.3);
    border-bottom: 3px solid #8b4513;
    padding: 0.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    min-height: 55px;
}

/* شعار المكتبة */
.library-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    text-decoration: none;
    color: #fff !important;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.library-brand:hover {
    color: #f5f5dc !important;
    text-decoration: none;
    background: rgba(245, 245, 220, 0.1);
    transform: translateY(-1px);
}

.brand-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    position: relative;
    overflow: hidden;
}

.brand-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.library-brand:hover .brand-icon::before {
    transform: scale(1);
}

/* تنسيقات شعار المكتبة */
.brand-logo {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.brand-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 12px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.library-brand:hover .brand-logo::before {
    transform: scale(1);
}

.library-brand:hover .brand-logo {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.library-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.library-brand:hover .library-logo-img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.brand-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.brand-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #bdc3c7;
    font-weight: 500;
    line-height: 1.2;
}

.brand-author {
    font-size: 0.65rem;
    color: #deb887;
    font-style: italic;
    font-weight: 400;
}

/* زر القائمة للشاشات الصغيرة */
.library-toggler {
    border: 2px solid #8b4513;
    border-radius: 8px;
    padding: 0.5rem;
    background: rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
}

.library-toggler:hover {
    background: rgba(139, 69, 19, 0.2);
    border-color: #cd853f;
}

.library-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
}

/* قائمة التنقل */
.library-nav {
    gap: 0.5rem;
}

.library-nav-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.7rem;
    color: #ecf0f1 !important;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.library-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(205, 133, 63, 0.1));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.library-nav-link:hover::before {
    transform: scaleX(1);
}

.library-nav-link:hover {
    color: #f5f5dc !important;
    text-decoration: none;
    transform: translateY(-2px);
    background: rgba(139, 69, 19, 0.3) !important;
}

.nav-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.library-nav-link:hover .nav-icon {
    background: linear-gradient(135deg, #cd853f, #deb887);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
}

.nav-text {
    font-weight: 500;
    font-size: 0.75rem;
    position: relative;
    z-index: 2;
}

/* تأثير إضافي عند تمرير الماوس على التبويبات */
.library-nav-link:hover .nav-text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* تأثير خاص للتبويبات التي تحتوي على قوائم منسدلة */
.dropdown:hover > .library-nav-link {
    background: rgba(139, 69, 19, 0.35) !important;
}

.dropdown:hover > .library-nav-link .nav-icon {
    background: linear-gradient(135deg, #cd853f, #deb887);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.5);
}

/* القوائم المنسدلة */
.library-dropdown {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 0.3rem 0;
    margin-top: 0.3rem;
    min-width: 280px;
    max-width: 320px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 69, 19, 0.1);
    z-index: 1050;
    direction: rtl;
    text-align: right;
}

/* تأثير الظهور للقوائم المنسدلة */
.library-dropdown {
    opacity: 1 !important;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.library-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    white-space: nowrap;
    min-height: 45px;
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.library-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(205, 133, 63, 0.05));
    color: #8b4513;
    text-decoration: none;
    transform: translateX(5px);
}

.dropdown-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b4513;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.library-dropdown-item:hover .dropdown-icon {
    background: linear-gradient(135deg, #8b4513, #cd853f);
    color: #fff;
    transform: scale(1.1);
}

.dropdown-text {
    font-weight: 500;
    font-size: 0.85rem;
    flex: 1;
    text-align: right;
    margin-right: 0.5rem;
    direction: rtl;
}

.library-divider {
    border-color: rgba(139, 69, 19, 0.2);
    margin: 0.5rem 1rem;
}

/* فتح القوائم المنسدلة عند تمرير الماوس (للأجهزة المكتبية فقط) */
@media (hover: hover) and (pointer: fine) {
    .library-navbar .dropdown:hover > .dropdown-menu {
        display: block !important;
        margin-top: 0.25rem;
        animation: dropdownFadeIn 0.3s ease-in-out;
    }
    
    /* إزالة pointer-events من dropdown-toggle لتجنب التعارض مع Bootstrap */
    .library-navbar .dropdown:hover > .dropdown-toggle {
        pointer-events: auto;
    }
}

/* تأثير الظهور التدريجي للقوائم المنسدلة */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* البحث السريع */
.navbar-search {
    margin: 0 0.5rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0.2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: #8b4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
}

.search-input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    width: 160px;
    outline: none;
    box-shadow: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #fff;
}

.search-btn {
    background: linear-gradient(135deg, #8b4513, #cd853f);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #cd853f, #deb887);
    transform: scale(1.1);
}

/* معلومات المستخدم */
.user-nav {
    margin-right: 1rem;
}

.library-user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    color: #ecf0f1 !important;
    text-decoration: none;
    border-radius: 25px;
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
}

.library-user-link:hover {
    color: #f5f5dc !important;
    text-decoration: none;
    background: rgba(139, 69, 19, 0.2);
    border-color: #8b4513;
    transform: translateY(-2px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
}

.user-role {
    font-size: 0.65rem;
    color: #bdc3c7;
    text-transform: capitalize;
}

.user-dropdown {
    margin-top: 0.3rem;
    border-top: 3px solid #8b4513;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

/* تحسين خاص لقائمة المستخدم */
.user-dropdown .library-dropdown-item {
    position: relative;
}

.user-dropdown .library-dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: all 0.3s ease;
}

.user-dropdown .library-dropdown-item:hover::before {
    background: linear-gradient(135deg, #8b4513, #cd853f);
}

.logout-item:hover {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05)) !important;
}

/* تحسينات إضافية للقائمة المنسدلة */
.library-dropdown .dropdown-divider {
    margin: 0.3rem 0;
    border-color: rgba(139, 69, 19, 0.15);
}

/* ضمان عدم قطع النصوص */
.library-dropdown {
    overflow: visible;
    word-wrap: break-word;
}

.library-dropdown-item {
    overflow: visible;
    text-overflow: ellipsis;
}

/* تحسين التباعد بين العناصر */
.library-dropdown li {
    margin: 0;
    padding: 0;
}

.library-dropdown li:not(:last-child) {
    border-bottom: 1px solid rgba(139, 69, 19, 0.05);
}

/* ضمان ظهور القائمة فوق جميع العناصر */
.dropdown-menu.show {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.dropdown-menu {
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: all 0.3s ease;
}

/* تحسين عرض القائمة على جميع المتصفحات */
.library-dropdown {
    -webkit-box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* ضمان عدم تداخل القائمة مع العناصر الأخرى */
.navbar-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    transform: translateX(0);
    z-index: 1050;
}

/* تحسين موضع القائمة المنسدلة للمستخدم - سحب إلى اليمين */
.user-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: -50px !important;
    left: auto !important;
    min-width: 320px;
    max-width: calc(100vw - 20px);
    margin-top: 0.5rem;
    transform: none !important;
    z-index: 1055;
    overflow: visible;
    box-sizing: border-box;
}

/* تحسين للشاشات المتوسطة */
@media (max-width: 992px) {
    .user-dropdown {
        min-width: 300px;
        right: -60px !important;
    }
}

/* تحسين للشاشات الصغيرة */
@media (max-width: 768px) {
    .user-dropdown {
        min-width: 280px;
        right: -70px !important;
        max-width: calc(100vw - 30px);
    }
}

/* تحسين للشاشات الصغيرة جداً */
@media (max-width: 576px) {
    .user-dropdown {
        min-width: 260px;
        right: -80px !important;
        max-width: calc(100vw - 40px);
    }
}

/* تحسين للشاشات الصغيرة جداً جداً */
@media (max-width: 480px) {
    .user-dropdown {
        min-width: 240px;
        right: -90px !important;
        max-width: calc(100vw - 50px);
    }
}

/* تحسين للشاشات الضيقة جداً */
@media (max-width: 400px) {
    .user-dropdown {
        min-width: 220px;
        right: -100px !important;
        max-width: calc(100vw - 60px);
    }
}

/* تحسين للشاشات العريضة */
@media (min-width: 1200px) {
    .user-dropdown {
        min-width: 350px;
        right: -30px !important;
    }
}

/* ضمان عدم تجاوز حدود الشاشة - حل إضافي */
.dropdown-menu-end {
    --bs-position: end;
}

.dropdown-menu-end[data-bs-popper] {
    right: 0 !important;
    left: auto !important;
    transform: translate3d(0px, 0px, 0px) !important;
}

/* تحسينات إضافية لضمان عمل القائمة المنسدلة */
.user-dropdown.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* إصلاح مشاكل الموضع في المتصفحات المختلفة */
.navbar-nav .nav-item.dropdown {
    position: relative;
}

.navbar-nav .nav-item.dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin: 0;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* تحسين للأجهزة اللوحية */
@media (max-width: 1024px) and (min-width: 769px) {
    .user-dropdown {
        right: -65px !important;
        min-width: 300px;
    }
}

/* تحسين خاص للأجهزة المحمولة الأفقية */
@media (max-width: 768px) and (orientation: landscape) {
    .user-dropdown {
        right: -75px !important;
        min-width: 270px;
        max-width: calc(100vw - 50px);
    }
}

/* ضمان عدم تداخل القائمة مع عناصر أخرى */
.user-dropdown {
    isolation: isolate;
    contain: layout;
}

/* تحسين إضافي لضمان الرؤية الكاملة */
.user-dropdown {
    white-space: nowrap;
    word-wrap: normal;
    text-overflow: visible;
}

.user-dropdown .library-dropdown-item {
    white-space: nowrap;
    overflow: visible;
    text-overflow: visible;
}

.user-dropdown .dropdown-text {
    white-space: nowrap;
    overflow: visible;
    text-overflow: visible;
    min-width: max-content;
}

/* ضمان عدم قطع النصوص الطويلة */
.library-dropdown-item .dropdown-text {
    flex: 1;
    min-width: 0;
    word-break: keep-all;
    overflow-wrap: normal;
}

/* ===== تحسين تنسيق الشريط العلوي الجديد ===== */

/* تنسيق القوائم الرئيسية والإدارية */
.navbar-collapse {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
}

.library-nav {
    flex: 0 0 auto;
    margin-right: 1rem;
}

.library-nav-admin {
    flex: 0 0 auto;
    margin-right: 1rem;
}

.navbar-spacer {
    flex: 1 1 auto;
    min-width: 20px;
}

.navbar-search {
    flex: 0 0 auto;
    margin: 0 1rem;
}

.user-nav {
    flex: 0 0 auto;
    position: relative;
}

/* تحسين القوائم المنسدلة الإدارية */
.backup-dropdown,
.users-dropdown,
.system-dropdown {
    min-width: 280px;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
}

/* تحسين خاص لقائمة المستخدم */
.user-dropdown-container {
    position: relative;
}

.user-dropdown-container .user-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: -50px !important;
    left: auto !important;
    min-width: 320px;
    max-width: 400px;
    margin-top: 0.5rem;
    z-index: 1060;
    transform: none !important;
}

/* تحسين للشاشات المتوسطة */
@media (max-width: 1200px) {
    .library-nav {
        margin-right: 0.5rem;
    }
    
    .library-nav-admin {
        margin-right: 0.5rem;
    }
    
    .navbar-search {
        margin: 0 0.5rem;
    }
    
    .user-dropdown-container .user-dropdown {
        right: -60px !important;
        min-width: 300px;
    }
}

/* تحسين للشاشات الصغيرة */
@media (max-width: 992px) {
    .navbar-collapse {
        flex-direction: column;
        align-items: stretch;
    }
    
    .library-nav,
    .library-nav-admin {
        width: 100%;
        margin: 0;
        padding: 0.5rem 0;
    }
    
    .navbar-spacer {
        display: none;
    }
    
    .navbar-search {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .user-nav {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .user-dropdown-container .user-dropdown {
        right: -70px !important;
        min-width: 280px;
        max-width: calc(100vw - 40px);
    }
}

/* تحسين للهواتف */
@media (max-width: 768px) {
    .user-dropdown-container .user-dropdown {
        right: -80px !important;
        min-width: 260px;
        max-width: calc(100vw - 50px);
    }
}

/* تحسين للهواتف الصغيرة */
@media (max-width: 576px) {
    .user-dropdown-container .user-dropdown {
        right: -90px !important;
        min-width: 240px;
        max-width: calc(100vw - 60px);
    }
}

/* تحسين للشاشات الضيقة */
@media (max-width: 480px) {
    .user-dropdown-container .user-dropdown {
        right: -100px !important;
        min-width: 220px;
        max-width: calc(100vw - 70px);
    }
}

/* تحسين للشاشات الضيقة جداً */
@media (max-width: 400px) {
    .user-dropdown-container .user-dropdown {
        right: -110px !important;
        min-width: 200px;
        max-width: calc(100vw - 80px);
    }
}

/* تحسين عرض النصوص في القوائم المنسدلة */
.backup-dropdown .dropdown-text,
.users-dropdown .dropdown-text,
.system-dropdown .dropdown-text {
    white-space: nowrap;
    overflow: visible;
    text-overflow: visible;
}

/* ضمان عدم تداخل القوائم المنسدلة */
.library-nav-admin .dropdown-menu {
    z-index: 1050;
}

.user-dropdown-container .dropdown-menu {
    z-index: 1060;
}

/* إصلاح مشاكل التوافق مع المتصفحات */
.user-dropdown .library-dropdown-item {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -webkit-flex-direction: row-reverse;
    -moz-flex-direction: row-reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
}

/* ضمان عرض صحيح للنصوص العربية */
.user-dropdown .dropdown-text {
    unicode-bidi: bidi-override;
    direction: rtl;
    text-align: right;
}

/* تحسين الأيقونات */
.user-dropdown .dropdown-icon {
    order: 2;
    margin-left: 0.5rem;
    margin-right: 0;
}

/* تحسين موضع القائمة */
.dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

.logout-item {
    color: #dc3545 !important;
}

.logout-item:hover .dropdown-icon {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: #fff !important;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 992px) {
    .library-brand {
        gap: 0.5rem;
    }
    
    .brand-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .brand-title {
        font-size: 1rem;
    }
    
    .brand-subtitle {
        font-size: 0.8rem;
    }
    
    .brand-author {
        font-size: 0.7rem;
    }
    
    .navbar-search {
        margin: 1rem 0;
        order: 3;
        width: 100%;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .user-nav {
        margin: 0;
        order: 2;
    }
    
    .library-nav {
        order: 1;
        width: 100%;
    }
    
    .library-nav-link {
        justify-content: flex-start;
        padding: 1rem;
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .nav-text {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .library-navbar {
        padding: 0.2rem 0;
        min-height: 50px;
    }
    
    .brand-content {
        display: none;
    }
    
    .library-brand {
        padding: 0.3rem 0.5rem;
    }
    
    .brand-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .search-input {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .user-info {
        display: none;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-search {
        margin: 0.5rem 0;
    }
    
    .search-container {
        padding: 0.1rem;
    }
    
    .search-input {
        width: calc(100% - 40px);
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .search-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    /* تحسينات القائمة المنسدلة للشاشات الصغيرة جداً */
    .library-dropdown {
        min-width: 220px;
        max-width: 260px;
        margin-top: 0.1rem;
        padding: 0.2rem 0;
    }
    
    .library-dropdown-item {
        padding: 0.4rem 0.8rem;
        min-height: 35px;
        gap: 0.6rem;
    }
    
    .dropdown-icon {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .dropdown-text {
        font-size: 0.75rem;
    }
    
    .user-dropdown {
        margin-top: 0.1rem;
        right: -110px !important;
        min-width: 200px;
        max-width: calc(100vw - 70px);
        transform: none !important;
    }
}

/* ===== تصميم الصفحات الداخلية المحسن ===== */

/* الحاوي الرئيسي للصفحات */
.page-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
    position: relative;
}

.page-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="page-pattern" patternUnits="userSpaceOnUse" width="40" height="40"><circle cx="20" cy="20" r="1" fill="%23deb887" opacity="0.1"/><rect x="15" y="15" width="10" height="1" fill="%238b4513" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23page-pattern)"/></svg>');
    opacity: 0.3;
}

/* عنوان الصفحة */
.page-header {
    background: linear-gradient(135deg, var(--text-primary) 0%, #34495e 100%);
    color: var(--text-white);
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 69, 19, 0.1), transparent);
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.1rem;
    color: #bdc3c7;
    font-weight: 400;
    margin-bottom: 0;
}

.page-icon {
    font-size: 3rem;
    color: #deb887;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* البطاقات المحسنة */
.enhanced-card {
    background: var(--light-color);
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-card);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b4513, #cd853f, #deb887);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.enhanced-card:hover::before {
    transform: scaleX(1);
}

.enhanced-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(139, 69, 19, 0.15);
}

.enhanced-card-header {
    background: linear-gradient(135deg, var(--light-color) 0%, var(--border-light) 100%);
    border-bottom: 2px solid var(--border-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.enhanced-card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.enhanced-card-title i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.enhanced-card-body {
    padding: 2rem;
}

/* الأزرار المحسنة */
.enhanced-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.enhanced-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.enhanced-btn:hover::before {
    transform: translateX(100%);
}

.enhanced-btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.enhanced-btn-primary {
    background: linear-gradient(135deg, #8b4513, #cd853f);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.enhanced-btn-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #a0522d, #deb887);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.enhanced-btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--secondary-color));
    color: var(--text-white);
    box-shadow: var(--shadow-medium);
}

.enhanced-btn-success:hover {
    color: #fff;
    background: linear-gradient(135deg, #218838, #17a2b8);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.enhanced-btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
    color: var(--text-white);
    box-shadow: var(--shadow-medium);
}

.enhanced-btn-danger:hover {
    color: #fff;
    background: linear-gradient(135deg, #c82333, #bd2130);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.enhanced-btn-info {
    background: linear-gradient(135deg, var(--info-color), #138496);
    color: var(--text-white);
    box-shadow: var(--shadow-medium);
}

.enhanced-btn-info:hover {
    color: #fff;
    background: linear-gradient(135deg, #138496, #117a8b);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

.enhanced-btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    color: var(--dark-color);
    box-shadow: var(--shadow-medium);
}

.enhanced-btn-warning:hover {
    color: #212529;
    background: linear-gradient(135deg, #e0a800, #d39e00);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

.enhanced-btn-outline {
    background: transparent;
    border: 2px solid #8b4513;
    color: #8b4513;
}

.enhanced-btn-outline:hover {
    background: #8b4513;
    color: #fff;
}

/* النماذج المحسنة */
.enhanced-form {
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.enhanced-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.enhanced-form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enhanced-form-label i {
    color: #8b4513;
}

.enhanced-form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #fff;
}

.enhanced-form-control:focus {
    border-color: #8b4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
    outline: none;
}

.enhanced-form-control:hover {
    border-color: #cd853f;
}

/* الجداول المحسنة */
.enhanced-table {
    background: #fff;
    border-radius: 15px;
    overflow: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    min-height: 400px;
    position: relative;
    width: 100%;
}

/* تحسين عرض الجدول بدون تمرير أفقي */

.enhanced-table table {
    margin: 0;
    width: 100%;
    table-layout: auto;
    font-size: 0.85rem;
}

.enhanced-table thead th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    font-weight: 600;
    padding: 1rem 0.8rem;
    border: none;
    text-align: center;
    position: relative;
    white-space: nowrap;
    font-size: 0.9rem;
}

.enhanced-table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b4513, #cd853f);
}

.enhanced-table tbody tr {
    transition: all 0.3s ease;
    min-height: 80px;
}

.enhanced-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05), rgba(205, 133, 63, 0.02));
    transform: scale(1.005);
}

.enhanced-table tbody td {
    padding: 0.8rem 0.6rem;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* تحسين عرض البيانات المختلفة - جدول مبسط (100% إجمالي) */
.enhanced-table tbody td:nth-child(1) { /* # */
    width: 4%;
    min-width: 40px;
    font-weight: bold;
}

.enhanced-table tbody td:nth-child(2) { /* الصورة */
    width: 7%;
    min-width: 70px;
    padding: 0.5rem;
}

.enhanced-table tbody td:nth-child(3) { /* رقم التسجيل */
    width: 10%;
    min-width: 100px;
    font-weight: bold;
    color: #8b4513;
}

.enhanced-table tbody td:nth-child(4) { /* رقم البطاقة */
    width: 9%;
    min-width: 90px;
}

.enhanced-table tbody td:nth-child(5) { /* الاسم الكامل */
    width: 17%;
    min-width: 150px;
    text-align: right;
    padding-right: 1rem;
    white-space: normal;
    word-wrap: break-word;
}

.enhanced-table tbody td:nth-child(6) { /* رقم التعريف الوطني */
    width: 10%;
    min-width: 100px;
}

.enhanced-table tbody td:nth-child(7) { /* نوع العضوية */
    width: 11%;
    min-width: 110px;
}

.enhanced-table tbody td:nth-child(8) { /* تاريخ الانخراط */
    width: 9%;
    min-width: 90px;
}

.enhanced-table tbody td:nth-child(9) { /* الحالة */
    width: 8%;
    min-width: 80px;
}

.enhanced-table tbody td:nth-child(10) { /* الإجراءات */
    width: 15%;
    min-width: 150px;
}

.enhanced-table tbody tr:last-child td {
    border-bottom: none;
}

/* تحسين عمود الإجراءات */
.enhanced-table td:last-child {
    white-space: nowrap;
    padding: 0.6rem 0.4rem;
    overflow: visible;
}

.enhanced-table .btn-xs {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    margin: 0.05rem;
    border-radius: 4px;
    min-width: 26px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.enhanced-table .btn-sm {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    margin: 0.1rem;
    border-radius: 6px;
    min-width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.enhanced-table .btn-xs:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.enhanced-table .btn-xs i {
    font-size: 0.75rem;
}

/* تحسين ألوان الأزرار */
.enhanced-table .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.enhanced-table .btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.enhanced-table .btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

.enhanced-table .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.enhanced-table .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.enhanced-table .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* تحسين الشارات في الجدول */
.enhanced-table .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.5px;
}

.enhanced-table .bg-info {
    background-color: #17a2b8 !important;
    color: #fff;
}

.enhanced-table .bg-primary {
    background-color: #007bff !important;
    color: #fff;
}

.enhanced-table .bg-success {
    background-color: #198754 !important;
    color: #fff;
}

.enhanced-table .bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

.enhanced-table .bg-danger {
    background-color: #dc3545 !important;
    color: #fff;
}

/* تحسين عرض التواريخ */
.enhanced-table td[data-col="registration_date"],
.enhanced-table td[data-col="expiry_date"] {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #495057;
}

/* تحسين عرض الحالة */
.enhanced-table td[data-col="status"] .badge {
    min-width: 80px;
    text-align: center;
}

/* الصور المحسنة */
.enhanced-image {
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 3px solid #fff;
}

.enhanced-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.2);
}

/* التنبيهات المحسنة */
.enhanced-alert {
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.enhanced-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.enhanced-alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.05));
    color: #155724;
    border-left: 4px solid #28a745;
}

.enhanced-alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.05));
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.enhanced-alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(224, 168, 0, 0.05));
    color: #856404;
    border-left: 4px solid #ffc107;
}

.enhanced-alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(19, 132, 150, 0.05));
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* شريط التقدم المحسن */
.enhanced-progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.enhanced-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b4513, #cd853f, #deb887);
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.enhanced-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%);
    background-size: 20px 20px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* الشارات المحسنة */
.enhanced-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enhanced-badge-primary {
    background: linear-gradient(135deg, #8b4513, #cd853f);
    color: #fff;
}

.enhanced-badge-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
}

.enhanced-badge-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

.enhanced-badge-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.enhanced-badge-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: #fff;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .page-header {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .page-icon {
        font-size: 2.5rem;
    }
    
    .enhanced-card-header {
        padding: 1rem;
    }
    
    .enhanced-card-body {
        padding: 1.5rem;
    }
    
    .enhanced-card-title {
        font-size: 1.2rem;
    }
    
    .enhanced-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .enhanced-form {
        padding: 1.5rem;
    }
    
    .enhanced-table {
        min-height: 300px;
    }
    
    .enhanced-table table {
        font-size: 0.8rem;
    }
    
    .enhanced-table thead th,
    .enhanced-table tbody td {
        padding: 0.6rem 0.3rem;
        font-size: 0.8rem;
    }
    
    .enhanced-table .btn-xs {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
        min-width: 24px;
        height: 22px;
        margin: 0.02rem;
    }
    
    .enhanced-table .member-photo {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .page-container {
        padding: 1rem 0;
    }
    
    .page-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .enhanced-card {
        margin-bottom: 1rem;
    }
    
    .enhanced-card-header {
        padding: 0.8rem;
    }
    
    .enhanced-card-body {
        padding: 1rem;
    }
    
    .enhanced-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .enhanced-form {
        padding: 1rem;
    }
    
    .enhanced-form-control {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .enhanced-table {
        font-size: 0.75rem;
        min-height: 250px;
    }
    
    .enhanced-table table {
        font-size: 0.75rem;
    }
    
    .enhanced-table thead th,
    .enhanced-table tbody td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .enhanced-table .btn-xs {
        font-size: 0.6rem;
        padding: 0.15rem 0.25rem;
        min-width: 22px;
        height: 20px;
        margin: 0.02rem;
    }
    
    .enhanced-table .member-photo {
        width: 35px;
        height: 35px;
    }
    
    .enhanced-table .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ===== تصميم الواجهة الرئيسية المحسن ===== */

/* خلفية القسم الرئيسي - مستوحاة من المكتبات الكلاسيكية */
.library-hero-section {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(139, 69, 19, 0.9) 0%,     /* بني داكن للخشب */
        rgba(160, 82, 45, 0.8) 25%,   /* بني متوسط */
        rgba(205, 133, 63, 0.7) 50%,  /* بني فاتح */
        rgba(222, 184, 135, 0.6) 75%, /* بيج */
        rgba(245, 245, 220, 0.5) 100% /* بيج فاتح */
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="books" patternUnits="userSpaceOnUse" width="20" height="20"><rect width="20" height="20" fill="%23f5f5dc" opacity="0.1"/><rect x="2" y="2" width="3" height="16" fill="%238b4513" opacity="0.3"/><rect x="6" y="3" width="3" height="15" fill="%23a0522d" opacity="0.3"/><rect x="10" y="1" width="3" height="17" fill="%23cd853f" opacity="0.3"/><rect x="14" y="4" width="3" height="14" fill="%23deb887" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23books)"/></svg>');
    background-size: 200px 200px, cover;
    background-attachment: fixed;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(139, 69, 19, 0.3);
    min-height: 250px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(139, 69, 19, 0.8) 0%,
        rgba(160, 82, 45, 0.6) 50%,
        rgba(205, 133, 63, 0.4) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    padding: 1rem;
}

.hero-icon {
    font-size: 2.5rem;
    color: #f5f5dc;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    animation: float 3s ease-in-out infinite;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    margin-bottom: 0.5rem;
    font-family: 'Arial', sans-serif;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f5f5dc;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.hero-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: #deb887;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    font-style: italic;
}

.hero-decoration {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.hero-decoration i {
    font-size: 1.3rem;
    color: #f5f5dc;
    opacity: 0.8;
    animation: bounce 2s infinite;
    animation-delay: calc(var(--i) * 0.2s);
}

.hero-decoration i:nth-child(1) { --i: 0; }
.hero-decoration i:nth-child(2) { --i: 1; }
.hero-decoration i:nth-child(3) { --i: 2; }

/* بطاقات الميزات المحسنة */
.feature-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b4513, #cd853f, #deb887);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(139, 69, 19, 0.2);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon::before {
    transform: scale(1);
}

.feature-icon.add-member {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.feature-icon.view-members {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.feature-icon.search {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
}

.feature-icon.rfid-search {
    background: linear-gradient(135deg, #17a2b8, #20c997);
}

.feature-icon.barcode-search {
    background: linear-gradient(135deg, #6f42c1, #17a2b8);
}

.feature-icon.print-cards {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

.feature-icon.print-preview {
    background: linear-gradient(135deg, #20c997, #0dcaf0);
}

.feature-icon.reports {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.feature-icon.backup {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.feature-icon.books {
    background: linear-gradient(135deg, #8b4513, #cd853f);
}

.feature-icon.add-book {
    background: linear-gradient(135deg, #d4a574, #a0826d);
}

.feature-icon.loans {
    background: linear-gradient(135deg, #c1551e, #d4a574);
}

.feature-icon.reservations {
    background: linear-gradient(135deg, #8b5a2b, #a0826d);
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.feature-btn:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
    background: linear-gradient(135deg, #a0522d, #deb887);
}

/* أزرار صغيرة جداً للجدول */
.btn-xs {
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
    line-height: 1.2;
    border-radius: 0.2rem;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-xs i {
    font-size: 0.7rem !important;
}

/* تحسينات للأزرار في الجدول */
.table .btn-xs {
    margin: 1px;
    transition: all 0.2s ease;
}

.table .btn-xs:hover {
    transform: scale(1.1);
    z-index: 2;
    position: relative;
}

/* أزرار أصغر للإجراءات */
.btn-micro {
    padding: 0.1rem 0.2rem !important;
    font-size: 0.6rem !important;
    line-height: 1 !important;
    border-radius: 0.15rem !important;
    min-width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-micro i {
    font-size: 0.55rem !important;
}

.btn-micro:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* تحسين النافذة المنبثقة */
.modal-xl .modal-content {
    border-radius: 0.5rem;
    overflow: hidden;
}

.modal-body .card {
    transition: transform 0.2s ease;
}

.modal-body .card:hover {
    transform: translateY(-2px);
}

/* تحسين tooltips للأزرار الصغيرة */
.tooltip {
    font-size: 0.75rem;
}

.tooltip-inner {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* أزرار النسخ الاحتياطية */
.backup-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.backup-btn {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.backup-btn.primary {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

.backup-btn.secondary {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.backup-btn.outline {
    background: transparent;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.backup-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.backup-btn.primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #c82333, #bd2130);
}

.backup-btn.secondary:hover {
    color: #212529;
    background: linear-gradient(135deg, #e0a800, #d39e00);
}

.backup-btn.outline:hover {
    color: #fff;
    background: #dc3545;
}

/* قسم معلومات النظام */
.system-info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.system-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="library-pattern" patternUnits="userSpaceOnUse" width="50" height="50"><circle cx="25" cy="25" r="2" fill="%23deb887" opacity="0.1"/><rect x="20" y="20" width="10" height="2" fill="%238b4513" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23library-pattern)"/></svg>');
    opacity: 0.3;
}

.section-header {
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-title i {
    color: #8b4513;
    margin-left: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
}

.features-group {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    height: 100%;
    position: relative;
    z-index: 2;
}

.features-group-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f8f9fa;
}

.features-group-title i {
    margin-left: 0.5rem;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    transform: translateX(5px);
}

.feature-item i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    color: #fff;
    border-radius: 50%;
    font-size: 1rem;
    flex-shrink: 0;
}

.feature-item span {
    color: #495057;
    font-weight: 500;
    line-height: 1.4;
}

/* إحصائيات المكتبة */
.library-stats {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.library-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stats-pattern" patternUnits="userSpaceOnUse" width="30" height="30"><circle cx="15" cy="15" r="1" fill="%23fff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23stats-pattern)"/></svg>');
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b4513, #cd853f);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content h4 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.stat-content p {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin: 0;
}

/* الحركات والتأثيرات */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.8rem;
    }
    
    .hero-name {
        font-size: 1.4rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .page-container {
        padding: 0.5rem 0;
    }
    
    .library-hero-section {
        min-height: 220px;
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-content {
        padding: 0.75rem;
    }
    
    .hero-icon {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .hero-name {
        font-size: 0.9rem;
    }
    
    .hero-decoration {
        gap: 0.75rem;
        margin-top: 0.5rem;
    }
    
    .hero-decoration i {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .feature-title {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-description {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }
    
    .feature-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .features-group {
        padding: 0.75rem;
    }
    
    .page-header {
        padding: 1rem 0;
    }
    
    .page-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .page-title {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
}

/* للهواتف الصغيرة جداً */
@media (max-width: 480px) {
    .page-container {
        padding: 0.25rem 0;
    }
    
    .page-container > .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .library-hero-section {
        min-height: 180px;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px;
    }
    
    .hero-content {
        padding: 0.5rem;
    }
    
    .hero-icon {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .hero-title {
        font-size: 1.2rem;
        margin-bottom: 0.15rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 0.1rem;
    }
    
    .hero-name {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
    
    .hero-decoration {
        gap: 0.5rem;
        margin-top: 0.25rem;
    }
    
    .hero-decoration i {
        font-size: 0.8rem;
    }
    
    .feature-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: 12px;
    }
    
    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-title {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
        font-weight: 600;
    }
    
    .feature-description {
        font-size: 0.75rem;
        margin-bottom: 0.35rem;
        line-height: 1.2;
    }
    
    .feature-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .page-header {
        padding: 0.75rem 0;
    }
    
    .page-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .page-title {
        font-size: 1.2rem;
        margin-bottom: 0.1rem;
    }
    
    .page-subtitle {
        font-size: 0.8rem;
    }
    
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    .col-lg-3, .col-md-6 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* ===== بطاقات الإحصائيات المحسنة ===== */
.enhanced-stats-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.enhanced-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.enhanced-stats-card:hover::before {
    transform: scaleX(1);
}

.enhanced-stats-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.enhanced-stats-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.enhanced-stats-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 0.1;
    border-radius: inherit;
}

.enhanced-stats-content {
    flex: 1;
}

.enhanced-stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.enhanced-stats-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

/* ألوان مختلفة لبطاقات الإحصائيات */
.enhanced-stats-primary .enhanced-stats-icon {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
}

.enhanced-stats-success .enhanced-stats-icon {
    background: linear-gradient(135deg, #198754, #157347);
}

.enhanced-stats-warning .enhanced-stats-icon {
    background: linear-gradient(135deg, #ffc107, #ffb300);
}

.enhanced-stats-danger .enhanced-stats-icon {
    background: linear-gradient(135deg, #dc3545, #b02a37);
}

.enhanced-stats-info .enhanced-stats-icon {
    background: linear-gradient(135deg, #0dcaf0, #0aa2c0);
}

/* تحسينات للشاشات الصغيرة للإحصائيات */
@media (max-width: 768px) {
    .enhanced-stats-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .enhanced-stats-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .enhanced-stats-number {
        font-size: 2rem;
    }
    
    .enhanced-stats-label {
        font-size: 1rem;
    }
}

/* ===== نمط موحد شامل لجميع صفحات النظام ===== */

/* Page Header - رؤوس الصفحات */
.page-header {
    background: linear-gradient(135deg, #3d4f5f 0%, #2c3e50 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(45, 62, 80, 0.15);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-header-primary {
    background: linear-gradient(135deg, #364858 0%, #2a3a48 100%) !important;
    box-shadow: 0 8px 32px rgba(54, 72, 88, 0.15) !important;
}

.page-header-warning {
    background: linear-gradient(135deg, #ffd54f 0%, #ffca28 100%) !important;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.15) !important;
}

.page-header-success {
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%) !important;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.15) !important;
}

.page-header-danger {
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%) !important;
    box-shadow: 0 8px 32px rgba(229, 57, 53, 0.15) !important;
}

.page-header-info {
    background: linear-gradient(135deg, #4dd0e1 0%, #26c6da 100%) !important;
    box-shadow: 0 8px 32px rgba(38, 198, 218, 0.15) !important;
}

.page-header-gray {
    background: linear-gradient(135deg, #3d4f5f 0%, #2c3e50 100%) !important;
    box-shadow: 0 8px 32px rgba(45, 62, 80, 0.15) !important;
}

.page-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.page-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.page-container {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Enhanced Cards - البطاقات */
.enhanced-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.enhanced-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.enhanced-card-body {
    padding: 1.5rem;
}

.enhanced-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
}

.enhanced-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enhanced-card-title i {
    color: #667eea;
}

/* Enhanced Tables - الجداول */
.enhanced-table {
    overflow: hidden;
}

.enhanced-table .table {
    margin-bottom: 0;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.enhanced-table .table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.enhanced-table .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    border-top: none;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.enhanced-table .table tbody td {
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
    padding: 0.75rem;
}

.enhanced-table .table tbody tr:hover {
    background-color: #f1f3f5;
    transition: background-color 0.2s ease;
}

.enhanced-table .table tbody tr {
    transition: background-color 0.2s ease;
}

/* Enhanced Stats Cards - بطاقات الإحصائيات */
.enhanced-stats-card {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.enhanced-stats-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.enhanced-stats-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
}

.enhanced-stats-content {
    flex: 1;
}

.enhanced-stats-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1;
}

.enhanced-stats-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0.5rem 0 0 0;
    font-weight: 500;
}

/* Color Variants */
.enhanced-stats-primary {
    border-left-color: #0d6efd;
}

.enhanced-stats-primary .enhanced-stats-icon {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}

.enhanced-stats-warning {
    border-left-color: #ffc107;
}

.enhanced-stats-warning .enhanced-stats-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
}

.enhanced-stats-success {
    border-left-color: #198754;
}

.enhanced-stats-success .enhanced-stats-icon {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

.enhanced-stats-danger {
    border-left-color: #dc3545;
}

.enhanced-stats-danger .enhanced-stats-icon {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
}

.enhanced-stats-info {
    border-left-color: #0dcaf0;
}

.enhanced-stats-info .enhanced-stats-icon {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
}

/* Classic Light Theme for Registration Management Page */
.admin-page-header {
    background: linear-gradient(135deg, var(--text-primary) 0%, #34495e 100%);
    color: var(--text-white);
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
}

.admin-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 69, 19, 0.1), transparent);
}

.admin-page-header .container {
    position: relative;
    z-index: 2;
}

.admin-page-header h1 {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    color: var(--text-white) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.admin-page-header p {
    color: #bdc3c7 !important;
    margin: 0.5rem 0 0 0 !important;
    font-size: 0.95rem !important;
}

.admin-page-header .page-icon {
    display: none !important;
}

/* Classic Cards */
.admin-card {
    background: white !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    margin-bottom: 2rem !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.admin-card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 1rem 1.5rem !important;
    box-shadow: none !important;
}

.admin-card-header h4 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #364858 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.admin-card-header .badge {
    font-size: 0.85rem !important;
    padding: 0.375rem 0.75rem !important;
}

.admin-card-body {
    padding: 1.5rem !important;
}

.admin-table {
    margin: 0 !important;
}

.admin-table thead {
    background-color: #2c3e50 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

.admin-table thead th {
    background-color: #2c3e50 !important;
    border: none !important;
    padding: 0.75rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
}

.admin-table thead th,
.admin-table.table thead th {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
}

.admin-table thead th a,
.admin-table thead th span,
.admin-table thead th i {
    color: #ffffff !important;
}

.admin-table tbody td {
    border-top: 1px solid #dee2e6 !important;
    padding: 0.75rem !important;
    vertical-align: middle !important;
    color: #495057 !important;
    font-size: 0.95rem !important;
}

.admin-table tbody tr {
    transition: background-color 0.15s ease !important;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.admin-table strong {
    color: #364858 !important;
}

.admin-empty-state {
    padding: 2rem !important;
    text-align: center !important;
    color: #6c757d !important;
}

.admin-empty-state i {
    font-size: 2rem !important;
    margin-bottom: 1rem !important;
    opacity: 0.5 !important;
}

/* Override page container for admin page */
.admin-page-header ~ .container-fluid {
    background: transparent !important;
}

/* Override enhanced cards/tables globally on admin page */
.admin-card.admin-card {
    box-shadow: none !important;
    border-radius: 4px !important;
}

.admin-table.enhanced-table {
    margin: 0 !important;
}

.bg-orange {
    background-color: #ff9800 !important;
    color: #ffffff !important;
}

.bg-orange-light {
    background-color: #ffb74d !important;
    color: #212529 !important;
}