        @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

        body {
            font-family: 'Cairo', sans-serif;
            background-color: #f8fafc;
            overflow-x: hidden;
            font-size: 13px;
        }

        .sidebar-link.active {
            background-color: #2563eb;
            color: white;
            transform: scale(1.02);
        }

        .page-content {
            animation: fadeIn 0.3s ease-out;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .no-scrollbar::-webkit-scrollbar {
            display: none;
        }

        /* Custom premium scrollbar for sidebar navigation */
        #sidebar nav::-webkit-scrollbar {
            width: 6px;
        }
        #sidebar nav::-webkit-scrollbar-track {
            background: #f8fafc;
        }
        #sidebar nav::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
            transition: background 0.2s;
        }
        #sidebar nav::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        input,
        select,
        button {
            font-size: 13px !important;
        }

        th,
        td {
            padding: 10px 12px !important;
        }

        .card-stat {
            padding: 16px !important;
            border-radius: 20px !important;
        }

        .glass-modal {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(8px);
        }

        .custom-shadow {
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
        }

        /* دعم LTR */
        [dir="ltr"] .text-right {
            text-align: left !important;
        }

        [dir="ltr"] .text-left {
            text-align: right !important;
        }

        [dir="ltr"] .border-r-4 {
            border-right-width: 0 !important;
            border-left-width: 4px !important;
        }

        [dir="ltr"] .border-l-4 {
            border-left-width: 0 !important;
            border-right-width: 4px !important;
        }

        [dir="ltr"] .right-0 {
            right: auto !important;
            left: 0 !important;
        }

        [dir="ltr"] .left-0 {
            left: auto !important;
            right: 0 !important;
        }

        [dir="ltr"] .mr-auto {
            margin-right: 0 !important;
            margin-left: auto !important;
        }

        [dir="ltr"] .ml-auto {
            margin-left: 0 !important;
            margin-right: auto !important;
        }

        /* Flip absolute icons */
        [dir="ltr"] .absolute.right-4 {
            right: auto !important;
            left: 1rem !important;
        }

        [dir="ltr"] .absolute.left-4 {
            left: auto !important;
            right: 1rem !important;
        }

        [dir="ltr"] .absolute.right-3 {
            right: auto !important;
            left: 0.75rem !important;
        }

        [dir="ltr"] .font-cairo {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
        }

        /* تنسيق خاص للطباعة مخفي عن العرض العادي */
        #barcodePrintContainer {
            display: none;
        }

        #invoicePDFTemplate {
            display: none;
        }

        /* أنماط الطباعة المحسنة للباركود - تجعله يأخذ عرض الفاتورة بالكامل */
        @media print {
            @page {
                size: auto;
                margin: 0mm;
            }

            body {
                margin: 0;
                padding: 0;
                background: white;
            }

            .thermal-barcode-label {
                width: 100%;
                box-sizing: border-box;
                padding: 4mm 2mm;
                margin: 0;
                page-break-after: always;
                page-break-inside: avoid;
                border: none;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .thermal-barcode-label:last-child {
                page-break-after: auto;
            }

            .thermal-barcode-label svg {
                width: 100% !important;
                height: auto !important;
                max-height: 18mm;
            }
        }

        /* تحسينات للواجهة الجديدة */
        .submenu-link {
            padding-inline-start: 2.5rem !important;
            background-color: rgba(0, 0, 0, 0.02);
            border-radius: 0.75rem;
            margin-bottom: 0.25rem;
        }

        .submenu-link:hover {
            background-color: rgba(37, 99, 235, 0.1);
        }

        .filter-btn.active {
            background-color: #2563eb;
            color: white;
        }

        .summary-card {
            border-radius: 1.5rem;
            border: 1px solid #e2e8f0;
            transition: all 0.3s ease;
        }

        .summary-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        /* نتائج البحث */
        .search-result-item {
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .search-result-item:hover {
            background-color: #eff6ff !important;
            transform: translateX(-2px);
        }

        .search-result-item.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .search-result-item.disabled:hover {
            background-color: #f8fafc !important;
            transform: none;
        }

        /* فلترة المخزون - الألوان الجديدة */
        .zero-stock {
            background-color: #fee2e2 !important;
            /* أحمر فاتح */
            border-right: 4px solid #dc2626 !important;
        }

        .zero-stock td {
            color: #dc2626 !important;
            font-weight: bold;
        }

        .low-stock {
            background-color: #ffedd5 !important;
            /* برتقالي فاتح */
            border-right: 4px solid #f97316 !important;
        }

        .low-stock td {
            color: #ea580c !important;
            font-weight: bold;
        }

        .normal-stock {
            background-color: #f0f9ff !important;
            /* أزرق فاتح */
            border-right: 4px solid #0ea5e9 !important;
        }

        /* تحسينات للهواتف */
        @media (max-width: 768px) {
            .table-container {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .table-container table {
                min-width: 800px;
            }

            th,
            td {
                padding: 8px 10px !important;
                font-size: 12px !important;
            }

            .mobile-flex-col {
                flex-direction: column !important;
            }

            .mobile-w-full {
                width: 100% !important;
            }

            .mobile-text-center {
                text-align: center !important;
            }

            .mobile-p-2 {
                padding: 0.5rem !important;
            }

            .mobile-text-xs {
                font-size: 11px !important;
            }

            /* إخفاء بعض الأعمدة على الهواتف */
            .mobile-hide {
                display: none !important;
            }

            /* تحسين حجم الخطوط على الهواتف */
            .mobile-text-sm {
                font-size: 11px !important;
            }

            /* تحسين التباعد على الهواتف */
            .mobile-p-3 {
                padding: 0.75rem !important;
            }

            /* تحسين عرض البطاقات على الهواتف */
            .mobile-card {
                margin-bottom: 0.5rem !important;
                padding: 0.75rem !important;
            }

            /* تحسين حجم خط التقارير المالية في الهاتف */
            #page-reports .text-2xl {
                font-size: 1.25rem !important;
            }

            #page-reports .text-lg {
                font-size: 1rem !important;
            }

            #page-reports .text-sm {
                font-size: 0.75rem !important;
            }

            #page-reports .text-xs {
                font-size: 0.65rem !important;
            }

            #page-reports .px-4 {
                padding-left: 0.75rem !important;
                padding-right: 0.75rem !important;
            }

            #page-reports .py-2 {
                padding-top: 0.5rem !important;
                padding-bottom: 0.5rem !important;
            }

            #page-reports .gap-2 {
                gap: 0.5rem !important;
            }
        }

        /* تحسين عرض أزرار الفلترة على الهواتف */
        .filter-buttons-container {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-top: 10px;
        }

        .filter-button {
            padding: 8px 16px;
            border-radius: 12px;
            font-weight: bold;
            font-size: 11px;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            white-space: nowrap;
            flex: 1;
            min-width: 120px;
            text-align: center;
        }

        .filter-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* تحسين الأزرار على الهواتف الصغيرة */
        @media (max-width: 640px) {
            .filter-button {
                flex: 0 0 calc(50% - 8px);
                min-width: calc(50% - 8px);
                padding: 6px 12px;
                font-size: 10px;
            }
        }

        @media (max-width: 400px) {
            .filter-button {
                flex: 0 0 100%;
                min-width: 100%;
            }
        }

        /* تحسين الشريط العلوي على الهواتف */
        @media (max-width: 768px) {
            #globalFilter {
                padding: 0.75rem !important;
            }

            #globalFilter input,
            #globalFilter select {
                padding: 0.5rem !important;
                font-size: 12px !important;
            }
        }

        /* تحسين رأس الجدول على الهواتف */
        @media (max-width: 768px) {
            .mobile-table-header {
                font-size: 9px !important;
                padding: 6px 8px !important;
            }
        }

        /* تحسين الأزرار في الجدول على الهواتف */
        @media (max-width: 768px) {
            .mobile-action-buttons {
                flex-wrap: wrap;
                gap: 4px;
            }

            .mobile-action-buttons button {
                width: 28px !important;
                height: 28px !important;
            }
        }

        /* تنسيق لحقول الإدخال غير المسموح بها */
        .disabled-input {
            background-color: #f3f4f6 !important;
            color: #9ca3af !important;
            cursor: not-allowed !important;
        }

        /* تنسيق للإشعارات */
        .permission-notice {
            background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
            border: 1px solid #fbbf24;
            border-radius: 1rem;
            padding: 1rem;
            margin-bottom: 1rem;
        }

        /* إخفاء التقارير المالية عن الموظفين */
        .reports-hidden {
            display: none !important;
        }

        /* تحسين عرض تفصيل المصاريف */
        .expense-category-summary {
            border-right: 3px solid;
            padding: 10px;
            border-radius: 12px;
            margin-bottom: 8px;
            background-color: white;
        }

        .category-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
        }

        .category-header:hover {
            background-color: #f8fafc;
        }

        .category-details {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }

        .category-details.expanded {
            max-height: 500px;
        }

        .expense-item-detail {
            display: flex;
            justify-content: space-between;
            padding: 6px 12px;
            margin: 2px 0;
            background-color: #f8fafc;
            border-radius: 6px;
            font-size: 11px;
        }

        .expense-item-detail:hover {
            background-color: #f1f5f9;
        }

        /* تنسيقات جديدة للبطاقات */
        .inventory-card,
        .expense-card {
            border-radius: 1.5rem;
            background: white;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            overflow: hidden;
        }

        .inventory-card:hover,
        .expense-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .card-header {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid #f1f5f9;
        }

        .card-body {
            padding: 1.25rem;
        }

        .card-footer {
            padding: 1rem 1.25rem;
            background-color: #f8fafc;
            border-top: 1px solid #f1f5f9;
        }

        .stock-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            display: inline-block;
            margin-left: 5px;
        }

        .stock-zero {
            background-color: #ef4444;
        }

        .stock-low {
            background-color: #f97316;
        }

        .stock-normal {
            background-color: #10b981;
        }

        .status-badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.7rem;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }

        .status-zero {
            background-color: #fee2e2;
            color: #dc2626;
        }

        .status-low {
            background-color: #ffedd5;
            color: #ea580c;
        }

        .status-normal {
            background-color: #d1fae5;
            color: #059669;
        }

        /* تنسيقات الشبكة للبطاقات */
        .cards-grid {
            display: grid;
            grid-template-columns: repeat(1, 1fr);
            gap: 1rem;
        }

        @media (min-width: 640px) {
            .cards-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1024px) {
            .cards-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (min-width: 1280px) {
            .cards-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        /* تحسين شريط البحث في المخزون */
        .inventory-search-container {
            background-color: white;
            border-radius: 1.5rem;
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            border: 1px solid #e2e8f0;
        }

        .inventory-search-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border-radius: 1rem;
            border: 2px solid #e2e8f0;
            font-family: 'Cairo', sans-serif;
            font-weight: bold;
            font-size: 14px;
            transition: all 0.3s ease;
            background-color: #f8fafc;
        }

        .inventory-search-input:focus {
            outline: none;
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
            background-color: white;
        }

        .search-hint {
            font-size: 11px;
            color: #64748b;
            margin-top: 0.5rem;
            text-align: center;
        }

        .clear-search-btn {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            font-size: 14px;
            transition: color 0.2s ease;
        }

        .clear-search-btn:hover {
            color: #ef4444;
        }

        /* تحسين عرض نتائج البحث */
        .search-stats {
            background-color: #f1f5f9;
            padding: 0.5rem 1rem;
            border-radius: 0.75rem;
            margin-top: 0.5rem;
            font-size: 11px;
            color: #475569;
            text-align: center;
        }

        /* تنسيقات الزبناء والموردين */
        .customer-supplier-card {
            border-radius: 1.5rem;
            background: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            overflow: hidden;
            border: 2px solid transparent;
        }

        .customer-card {
            border-color: #3b82f6;
        }

        .supplier-card {
            border-color: #10b981;
        }

        .debt-badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.7rem;
            font-weight: bold;
        }

        .debt-active {
            background-color: #fee2e2;
            color: #dc2626;
        }

        .debt-settled {
            background-color: #d1fae5;
            color: #059669;
        }

        .payment-badge {
            padding: 0.2rem 0.5rem;
            border-radius: 0.5rem;
            font-size: 0.6rem;
            font-weight: bold;
            display: inline-block;
            margin: 0.1rem;
        }

        .payment-cash {
            background-color: #dcfce7;
            color: #15803d;
        }

        .payment-check {
            background-color: #fef3c7;
            color: #92400e;
        }

        .payment-transfer {
            background-color: #dbeafe;
            color: #1d4ed8;
        }

        .payment-promissory {
            background-color: #f3e8ff;
            color: #7c3aed;
        }

        .payment-credit {
            background-color: #fce7f3;
            color: #be185d;
        }

        /* WhatsApp Button */
        .whatsapp-float {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background-color: #25d366;
            color: white;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            text-align: center;
            font-size: 30px;
            box-shadow: 2px 2px 3px #999;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            text-decoration: none;
        }

        .whatsapp-float:hover {
            background-color: #128c7e;
            transform: scale(1.1);
        }