/* تصميم النظام الأساسي - اللغة العربية */

/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* نسق الألوان */
:root {
    --primary-color: #4f46e5;
    --primary-rgb: 79, 70, 229;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --sidebar-width: 260px;
}

/* Sidebar Resizer */
.sidebar-resizer {
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 1001;
    transition: background 0.2s;
}

.sidebar-resizer:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-left: 2px solid var(--primary-color);
}

.resizing, .resizing * {
    user-select: none !important;
    cursor: col-resize !important;
}

.resizing .sidebar, .resizing .main-content {
    transition: none !important;
}

/* ---------------------------------------------------
    DARK MODE - الشامل والنهائي
----------------------------------------------------- */

[data-theme="dark"] {
    --bg-body: #020617;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

[data-theme="dark"] body {
    background: #020617 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .main-content {
    background: #020617 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .navbar,
[data-theme="dark"] .page-header,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .table-container,
[data-theme="dark"] .form-card,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .filter-section,
[data-theme="dark"] .filters-section,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .invoice-table,
[data-theme="dark"] .search-box,
[data-theme="dark"] .info-card,
[data-theme="dark"] .data-card,
[data-theme="dark"] .animate-up {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .input-group-text,
[data-theme="dark"] .currency-label {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .table,
[data-theme="dark"] .table th,
[data-theme="dark"] .table td,
[data-theme="dark"] .table tr:hover {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] input::file-selector-button {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155 !important;
}

/* تنسيقات لوحة التحكم Dashboard في الوضع الليلي */
[data-theme="dark"] .stats-card,
[data-theme="dark"] .animate-up,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .stats-number,
[data-theme="dark"] .page-title {
    color: #ffffff !important;
}

[data-theme="dark"] .stats-label,
[data-theme="dark"] .card-title,
[data-theme="dark"] .page-subtitle {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .badge.bg-light {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .border {
    border-color: #334155 !important;
}

[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .card-header {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: #475569 !important;
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-container {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .sidebar-header h4,
[data-theme="dark"] .sidebar-header p,
[data-theme="dark"] .menu-item,
[data-theme="dark"] .navbar h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .search-box-container input {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .menu-item:hover,
[data-theme="dark"] .menu-item.active {
    background-color: rgba(79, 70, 229, 0.2) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .submenu-arrow {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .sidebar hr {
    border-top-color: #334155 !important;
    opacity: 0.3;
}

[data-theme="dark"] .sidebar-header {
    border-bottom: 1px solid #334155 !important;
    background-color: #1e293b !important;
}

[data-theme="dark"] hr {
    border-top-color: #334155 !important;
    opacity: 0.2;
}

[data-theme="dark"] .bg-primary-soft {
    background-color: rgba(79, 70, 229, 0.15) !important;
}

/* تنسيقات الفواتير في الوضع الليلي */
[data-theme="dark"] .invoice-info,
[data-theme="dark"] .form-section,
[data-theme="dark"] .calculation-display,
[data-theme="dark"] .summary-card {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .summary-row {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .info-label,
[data-theme="dark"] .summary-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .info-value,
[data-theme="dark"] .summary-value {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .table-summary {
    background-color: #0f172a !important;
}

[data-theme="dark"] .info-section h6 {
    color: #818cf8 !important;
}

/* إصلاح التباين في بعض العناصر */
[data-theme="dark"] .text-gray-800 {
    color: #f8fafc !important;
}

[data-theme="dark"] .form-control:disabled, 
[data-theme="dark"] .form-control[readonly] {
    background-color: #1e293b !important;
    opacity: 0.8;
}

[data-theme="dark"] .stats-icon {
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
}

/* تنسيق التنبيهات في الوضع الليلي */
[data-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.1) !important;
    color: #67e8f9 !important;
    border: 1px solid rgba(13, 202, 240, 0.2) !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #ffda6a !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #ea868f !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(25, 135, 84, 0.1) !important;
    color: #75b798 !important;
    border: 1px solid rgba(25, 135, 84, 0.2) !important;
}

[data-theme="dark"] .alert strong {
    color: inherit !important;
}

/* تنسيقات شارات المدفوعات في الوضع الليلي */
[data-theme="dark"] .status-completed {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #75b798 !important;
}

[data-theme="dark"] .status-pending {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffda6a !important;
}

[data-theme="dark"] .status-failed {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #ea868f !important;
}

[data-theme="dark"] .payment-method-badge {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .method-cash,
[data-theme="dark"] .method-card,
[data-theme="dark"] .method-transfer,
[data-theme="dark"] .method-check {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .table {
    color: var(--text-main) !important;
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* صفحة تسجيل الدخول */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: right;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* التنقل الرئيسي */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Navbar styles enhancement */
.navbar {
    background: var(--bg-card);
    transition: all 0.3s ease;
}

.navbar .btn {
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.navbar .btn:hover {
    transform: translateY(-2px);
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.navbar .btn i {
    transition: transform 0.3s ease;
}

.navbar .btn:hover i {
    transform: scale(1.1);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 1.5rem);
}

.search-box-container {
    flex: 1;
    max-width: 450px;
    min-width: 200px;
}

.search-box-container input {
    width: 100%;
    transition: all 0.3s ease;
}

.search-box-container input:focus {
    background-color: white !important;
    box-shadow: var(--shadow) !important;
    border-color: var(--primary-color) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* الهيدر العلوي والبحث */
.search-box-container input:focus {
    background-color: white !important;
    box-shadow: var(--shadow) !important;
    transition: all 0.3s ease;
}

.search-box-container input {
    transition: all 0.3s ease;
}

.toast {
    border-radius: 12px;
    font-weight: 500;
}

.toast-container {
    margin-top: 1rem;
    margin-right: 1rem;
}

/* الشريط الجانبي */
.sidebar {
    background: white;
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    box-shadow: var(--shadow);
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: block;
    padding: 1rem 2rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.menu-item:hover,
.menu-item.active {
    background: #f1f5f9;
    border-right-color: var(--primary-color);
    color: var(--primary-color);
}

.menu-item i {
    margin-left: 0.5rem;
    width: 20px;
}

/* المحتوى الرئيسي */
.main-content {
    margin-right: var(--sidebar-width);
    padding: 1.5rem;
    min-height: 100vh;
    background: #f8fafc;
    transition: all 0.3s ease;
}

@media (min-width: 992px) and (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-right: 240px;
        padding: 1rem;
    }
    .navbar-container {
        padding: 0 1rem;
    }
}

.page-header {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #000000;
    font-size: 1.1rem;
}

/* البطاقات */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.card-body {
    padding: 2rem;
}

/* بطاقات الإحصائيات المطورة */
.stats-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 1200px) {
    .stats-number {
        font-size: 1.5rem;
    }
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) and (max-width: 1400px) {
    .col-lg-3 {
        flex: 0 0 auto;
        width: 50%; /* جعل الإحصائيات 2 في السطر في الشاشات المتوسطة لمنع الانضغاط */
    }
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stats-number {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stats-label {
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}


/* شارات الحالة (Status Badges) */
.badge-soft-success { background-color: #dcfce7; color: #15803d; }
.badge-soft-danger { background-color: #fee2e2; color: #b91c1c; }
.badge-soft-warning { background-color: #fef3c7; color: #a16207; }
.badge-soft-info { background-color: #e0f2fe; color: #0369a1; }
.badge-soft-primary { background-color: #e0e7ff; color: #4338ca; }

.status-badge {
    padding: 0.4em 0.8em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 50rem;
    display: inline-block;
}

/* الجداول */
.table-container {
    background: white;
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* منع انكسار السطور داخل الخانات لتسهيل التمرير */
}

@media (max-width: 768px) {
    /* تم تحسين التمرير الأفقي تلقائياً */
}

.table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tr:hover {
    background: #f8fafc;
}

/* النماذج */
.form-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* تنسيقات الطباعة */
@media print {
    .sidebar, .navbar, .action-buttons, .quick-links, .page-header .btn, .breadcrumb {
        display: none !important;
    }
    
    .main-content {
        margin-right: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .invoice-header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #eee !important;
        padding: 1rem 0 !important;
    }
    
    .invoice-header h2, .amount-highlight {
        color: black !important;
    }
    
    .invoice-table th {
        background: #f8f9fc !important;
        color: black !important;
        border-bottom: 2px solid #eee !important;
    }
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-col {
    flex: 1;
}

/* الأزرار */
.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* التنبيهات */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: none;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-warning {
    background: #fefce8;
    color: #a16207;
}

.alert-info {
    background: #f0f9ff;
    color: #1e40af;
}

/* التصميم المتجاوب */
@media (max-width: 991px) {
    html {
        font-size: 14px;
    }

    .sidebar {
        width: 280px !important;
        position: fixed !important;
        right: -280px !important; /* إخفاء القائمة في الجهة اليمنى لتناسب RTL */
        left: auto !important;
        transform: none !important;
        visibility: hidden !important;
        z-index: 2000 !important;
        transition: right 0.3s ease-in-out, visibility 0.3s !important;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1) !important;
    }
    
    .sidebar.active {
        right: 0 !important;
        visibility: visible !important;
    }

    .main-content {
        margin-right: 0 !important;
        padding: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .sidebar-header h4 {
        font-size: 1.25rem;
    }

    .sidebar-header p {
        font-size: 0.9rem;
    }

    .menu-item {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .menu-item i {
        font-size: 0.9rem;
        width: 18px;
    }
}

@media (max-width: 768px) {
    /* Backdrop when sidebar is active */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }
    
    .navbar {
        padding: 5px 0;
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 1010;
    }

    .navbar-container {
        padding: 0 0.5rem;
        gap: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        height: 65px;
    }

    .navbar .d-flex.align-items-center {
        gap: 8px !important; 
    }

    /* تحسين شكل الأزرار في الجوال */
    .navbar .btn {
        padding: 0.25rem 0.35rem;
        font-size: 0.75rem;
        min-width: 32px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .welcome-section {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 20px !important;
    }

    .welcome-section h1 {
        font-size: 1.3rem !important;
    }

    .action-tile {
        padding: 1.25rem 0.75rem !important;
    }

    .action-tile i {
        font-size: 1.8rem !important;
        margin-bottom: 0.75rem !important;
    }

    .action-tile span {
        font-size: 0.8rem !important;
    }
    
    .dropdown-menu {
        position: fixed !important;
        top: 70px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        margin: 0 !important;
        z-index: 2500 !important;
    }

    .navbar .btn i {
        font-size: 0.85rem;
    }

    /* إخفاء نصوص الأزرار في الجوال والاعتماد على الأيقونات */
    .navbar .btn span:not(.badge), 
    .navbar .btn strong,
    .navbar .dropdown-toggle span {
        display: none !important;
    }

    .navbar .dropdown-toggle::after {
        display: none !important; /* إخفاء سهم الدروب داون لتوفير مساحة */
    }

    .navbar .avatar-sm {
        margin-right: 0 !important;
    }

    /* تنسيق البحث في الجوال */
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .search-box-container.mobile-visible {
        display: block !important;
        animation: slideDown 0.3s ease-out forwards;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100% !important;
        background: white;
        padding: 10px;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        z-index: 1000;
        margin: 0 !important;
    }

    [data-theme="dark"] .search-box-container.mobile-visible {
        background: #1e293b;
        color: white;
    }

    [data-theme="dark"] .search-box-container.mobile-visible input {
        background: #0f172a !important;
        color: white;
    }

    .page-header {
        padding: 1rem 0.75rem;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .navbar h5 {
        font-size: 1rem;
    }


    .stats-card {
        padding: 1.5rem;
    }

    .stats-number {
        font-size: 2rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    /* إصلاح التداخل في الهيدر */
    .d-flex.align-items-center.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .d-flex.align-items-center.justify-content-between > div {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 5px;
        flex-wrap: wrap;
    }

    /* استثناء النافبار من تغيير الاتجاه */
    .navbar-container.d-flex, .navbar .d-flex {
        flex-direction: row !important;
        align-items: center !important;
    }

    /* تحسين العرض في الجوال */
    .row {
        margin-right: -5px;
        margin-left: -5px;
    }
    
    .col-lg-8, .col-lg-4, .col-xl-3, .col-md-6, .col-12, [class*="col-"] {
        padding-right: 5px;
        padding-left: 5px;
    }

    /* إصلاح تداخل العناوين */
    .page-header h1 {
        font-size: 1.5rem !important;
        line-height: 1.4;
    }

    .card-title {
        font-size: 1rem !important;
    }

    /* جعل الأيقونات والخطوط أصغر قليلاً في الجوال */
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .btn-lg i {
        font-size: 1.5rem !important;
    }
}

/* الرسوم المتحركة */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-right {
    animation: slideRight 0.6s ease-out;
}

@keyframes slideRight {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* تحسينات إضافية */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.w-100 {
    width: 100%;
}

/* حالات مختلفة للعناصر */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fef2f2;
    color: #991b1b;
}

.status-pending {
    background: #fefce8;
    color: #a16207;
}

.status-completed {
    background: #f0f9ff;
    color: #1e40af;
}

/* الوضع الليلي */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --border-color: #334155;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .sidebar {
    background: #1e293b;
    border-left: 1px solid #334155;
}

[data-theme="dark"] .sidebar-header {
    border-bottom: 1px solid #334155;
}

[data-theme="dark"] .menu-item {
    color: #94a3b8;
}

[data-theme="dark"] .menu-item:hover,
[data-theme="dark"] .menu-item.active {
    background: #334155;
    color: white;
}

[data-theme="dark"] .main-content {
    background: #0f172a;
}

[data-theme="dark"] .navbar {
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

[data-theme="dark"] .card {
    background: #1e293b;
    border: 1px solid #334155;
}

[data-theme="dark"] .card-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    color: white;
}

[data-theme="dark"] .table {
    color: #f1f5f9;
}

[data-theme="dark"] .table-light {
    background-color: #334155 !important;
    color: white !important;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: #334155;
    color: white;
}

[data-theme="dark"] .list-group-item {
    background-color: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .badge.bg-light {
    background-color: #334155 !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

/* تحسين الرسالة الترحيبية في الوضع الليلي */
[data-theme="dark"] .welcome-message h2,
[data-theme="dark"] .welcome-message p {
    color: white !important;
}

/* تنسيق المربعات الإحصائية في الوضع الليلي */
[data-theme="dark"] .stats-card {
    background: #1e293b;
    border: 1px solid #334155;
}

[data-theme="dark"] .bg-info { background-color: #0c4a6e !important; }
[data-theme="dark"] .bg-success { background-color: #064e3b !important; }
[data-theme="dark"] .bg-warning { background-color: #78350f !important; }
[data-theme="dark"] .bg-danger { background-color: #7f1d1d !important; }
[data-theme="dark"] .bg-primary { background-color: #1e3a8a !important; }
[data-theme="dark"] .bg-secondary { background-color: #334155 !important; }

[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-item {
    color: #f1f5f9;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: #334155;
    color: white;
}

[data-theme="dark"] .dropdown-divider {
    border-top-color: #334155;
}
