@keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.8);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        #introScreen.fade-out {
            opacity: 0 !important;
            transition: opacity 1s ease-out;
        }
        :root {
            --primary: #4a90e2;
            --primary-hover: #357abd;
            --secondary: #f5a623;
            --secondary-hover: #de941a;
            --danger: #d0021b;
            --danger-hover: #b00216;
            --sales-bar-bg: rgba(74, 144, 226, 0.6);
            --sales-bar-border: rgba(74, 144, 226, 1);
            

            --bg-main: #f9fafb;
            --surface-main: #ffffff;
            --border-main: #e5e7eb;

            --text-title: #111827;
            --text-main: #374151;
            --text-secondary: #6b7280;
            --text-light: #ffffff;

            --login-gradient-start: #f3f4f6;
            --login-gradient-end: #e5e7eb;

            /* Status-specific colors */
            --info-bg: #e0f2fe;
            --info-text: #0c4a6e;
            --success-bg: #dcfce7;
            --success-text: #166534;
            --completed-bg: #e5e7eb;
            --completed-text: #4b5563;
            --cancelled-bg: #fee2e2;
            --cancelled-text: #991b1b;
            --delivering-bg: #fef3c7;
            --delivering-text: #92400e;
            --collected-bg: #d1fae5;
            --collected-text: #065f46;

            /* Customer notes colors */
            --customer-notes-bg: #e0f2fe;
            --customer-notes-text: #0c4a6e;

            /* Tag colors */
            --tag-orders-bg: #e0f2fe;
            --tag-customers-bg: #dcfce7;
            --tag-products-bg: #fef3c7;
            --tag-delivery-bg: #e5e7eb;
            --tag-marketing-bg: #d1fae5;
            --tag-inventory-bg: #fee2e2;
            --tag-freespace-bg: #f3f4f6;

            /* Campaign Platform Colors */
            --platform-facebook-bg: #e0f2fe;
            --platform-instagram-bg: #fdf4e0;
            --platform-website-bg: #dcfce7;
            --platform-tiktok-bg: #f1f5f9;
            --platform-other-bg: #e5e7eb;

            /* Reports Colors */
            --reports-cost-text: #d0021b;
            --reports-profit-text: #166534;

            /* Header and Navigation Colors */
            --header-border-top: #4a90e2;
            --stat-tab-text: #4a90e2;

            /* Notification Colors */
            --notification-bg: #ffffff;
            --notification-border: #e5e7eb;
            --notification-header-bg: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
            --notification-header-text: #111827;
            --notification-item-bg: #ffffff;
            --notification-item-hover-bg: #f9fafb;
            --notification-warning-bg: rgba(245, 166, 35, 0.1);
            --notification-warning-border: rgba(245, 166, 35, 0.3);
            --notification-warning-text: #d97706;

            /* Product Colors */
            --simple-product-bg: #f0f9ff;
            --simple-product-text: #1e40af;
            --simple-product-border: #3b82f6;
            --multi-product-bg: #f0fdf4;
            --multi-product-text: #166534;
            --multi-product-border: #22c55e;

            /* Pinned Notes Color */
            --pinned-note-color: #f5a623;

            /* Package Movement Highlight Color */
            --package-movement-highlight: #10b981;

            /* Product Status Colors */
            --profitable-product-bg: #dcfce7;
            --profitable-product-text: #166534;
            --losing-product-bg: #fee2e2;
            --losing-product-text: #dc2626;

            /* Notes Colors */
            --notes-bg: #fef3c7;
            --notes-text: #92400e;
            --notes-border: #f59e0b;

            /* General Table Colors */
            --table-wrapper-bg: #ffffff;
            --table-border: #e5e7eb;
            --table-header-bg: #4a90e2;
            --table-header-text: #ffffff;
            --table-row-bg: #ffffff;
            --table-row-hover-bg: #f9fafb;
            --table-row-border: #e5e7eb;
            --table-cell-padding: 14px 12px;
            --table-header-padding: 16px 12px;
            --table-font-size: 14px;
            --table-border-radius: 12px;
            --table-shadow: 0 2px 8px rgba(0,0,0,0.06);

            /* Customers Page Colors (مدمجة مع لون رأس الجدول)
               ملاحظة: هذه الألوان تتبع تلقائياً لون رأس الجدول (--table-header-bg)
               عند تغيير لون رأس الجدول في الإعدادات، يتم تحديث هذه الألوان تلقائياً
            */
            --orders-count-bg: var(--table-header-bg);
            --orders-count-text: #ffffff;

            /* Delivery Page Colors (مدمجة مع اللون الأساسي)
               ملاحظة: هذه الألوان تتبع تلقائياً اللون الأساسي (--primary)
               عند تغيير اللون الأساسي في الإعدادات، يتم تحديث هذه الألوان تلقائياً
            */
            --delivery-cities-count-bg: var(--primary);
            --delivery-cities-count-text: #ffffff;
            --delivery-cities-badge-bg: var(--primary);
            --delivery-cities-badge-text: #ffffff;
            --delivery-cities-badge-border: var(--primary);

            /* Order Tracking Page Additional Colors */
            --track-delivery-price-text: #059669;
            --track-input-bg-light: #f8fafc;
            --track-divider-color: #e2e8f0;

            /* Identity Verification Card Colors */
            --verification-card-border: #059669;
            --verification-btn-text: #ffffff;
            --verification-cancel-border: #059669;

            /* Report Page Colors */
            --report-header-bg: #ffffff;
            --report-header-border: #4a90e2;
            --report-header-title: #4a90e2;
            --report-summary-bg: linear-gradient(135deg, #e0f2fe 0%, #c7e8f8 100%);
            --report-summary-text: #0c4a6e;
            --report-table-header-bg: linear-gradient(135deg, #e0f2fe 0%, #c7e8f8 100%);
            --report-table-header-text: #0c4a6e;
            --report-table-row-border: #ddd;
            --report-table-odd-bg: #fafafa;
            --report-table-even-bg: #ffffff;
            --report-footer-bg: #ffffff;
            --report-footer-text: #666;
        }

        /* Print styles for exporting Reports to PDF */
        @media print {
            body * { visibility: hidden !important; }
            #reportsPage, #reportsPage *, #notesPage, #notesPage * { visibility: visible !important; }
            #reportsPage, #notesPage { position: absolute; inset: 0; padding: 16px; background: #fff; }
            .sidebar, .theme-settings-btn, .theme-settings-panel, .header-actions { display: none !important; }
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background-color: var(--bg-main);
            color: var(--text-main);
            direction: rtl;
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            border-top: 4px solid var(--header-border-top);
            touch-action: manipulation;
            transition: overflow 0.2s ease;
        }

        body.modal-open {
            overflow: hidden;
        }

        .sidebar {
            position: fixed;
            top: 50%;
            transform: translateY(-50%);
            right: 24px;
            width: 80px;
            height: auto;
            background: rgba(255, 255, 255, 0.4);
            padding: 14px 10px;
            display: flex;
            flex-direction: column;
            z-index: 1000;
            border-radius: 24px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            align-items: center;
            gap: 10px;
            backdrop-filter: blur(10px);
            max-height: 90vh;
            overflow-y: auto;
        }

        .logo {
            display: none;
        }

        .logo img {
            width: 70px;
            height: auto;
            object-fit: contain;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
        }

        .nav-item {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 20px;
            width: 58px;
            height: 58px;
            font-size: 0;
            position: relative;
            background: transparent;
        }

        .nav-item:hover {
            background: transparent;
            color: var(--text-main);
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

        .nav-item.active {
            background: var(--primary);
            color: var(--text-light);
            box-shadow: none;
            transform: translateY(-3px) scale(1.05);
        }

        .nav-item.active::after {
            content: '';
            position: absolute;
            right: -12px;
            width: 5px;
            height: 70%;
            background: var(--primary);
            border-radius: 3px 0 0 3px;
            box-shadow: none;
        }

        .nav-item span:not(.nav-icon) {
            display: none; /* Ensure text content is hidden */
        }

        .nav-icon {
            width: 24px; /* Slightly larger icons */
            height: 24px;
            font-size: 24px; /* Ensure emoji icons are larger */
        }

        .nav-icon-img {
            width: 30px;
            height: 30px;
            object-fit: contain;
            transition: transform 0.3s ease;
            filter: brightness(0.9);
        }

        .nav-item:hover .nav-icon-img {
            transform: none;
            filter: none; /* الإبقاء على اللون الأصلي عند التمرير */
        }

        .nav-item.active .nav-icon-img {
            transform: none;
            filter: brightness(0) invert(1);
        }

        .nav-item:active .nav-icon-img {
            filter: brightness(0) invert(1);
        }

        .main-content {
            padding: 32px;
            min-height: 100vh;
            max-width: 1600px;
            margin-left: auto;
            margin-right: 120px; /* Default for medium screens to prevent overlap */
        }

        /* For very wide screens, truly center the content */
        @media (min-width: 1810px) {
            .main-content {
                margin-left: auto;
                margin-right: auto;
            }
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 32px;
            padding: 28px 32px;
            background: var(--surface-main);
            border-radius: 16px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }

        .greeting {
            font-size: 30px;
            font-weight: 700;
            color: var(--text-title);
            margin-bottom: 6px;
            letter-spacing: -0.3px;
        }

        .subtitle {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .notification-bell {
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
            border-radius: 14px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: var(--surface-main);
            border: 1px solid var(--border-main);
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }

        .notification-bell:hover {
            background: var(--bg-main);
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            border-color: var(--primary);
        }

        .notification-bell:active {
            transform: translateY(0) scale(0.98);
        }

        .notification-bell .bell-icon {
            width: 24px;
            height: 24px;
            transition: all 0.3s ease;
        }

        .notification-bell:hover .bell-icon {
            animation: ring 0.5s ease-in-out;
        }

        @keyframes ring {
            0%, 100% { transform: rotate(0deg); }
            10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
            20%, 40%, 60%, 80% { transform: rotate(10deg); }
        }

        .notification-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            min-width: 18px;
            height: 18px;
            background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
            border-radius: 12px;
            display: none; /* Hidden by default */
            color: white;
            font-size: 11px;
            font-weight: 700;
            align-items: center;
            justify-content: center;
            padding: 0 5px;
            box-shadow: 0 2px 6px rgba(208, 2, 27, 0.4);
            animation: pulse 2s infinite;
            border: 2px solid white;
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
                box-shadow: 0 2px 6px rgba(208, 2, 27, 0.4);
            }
            50% {
                transform: scale(1.1);
                box-shadow: 0 2px 8px rgba(208, 2, 27, 0.6);
            }
            100% {
                transform: scale(1);
                box-shadow: 0 2px 6px rgba(208, 2, 27, 0.4);
            }
        }

        .notification-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            width: 320px;
            background-color: var(--notification-bg);
            border: 1px solid var(--notification-border);
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            z-index: 1001;
            max-height: 420px;
            overflow-y: auto;
            backdrop-filter: blur(10px);
            animation: fadeInDown 0.3s ease;
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .notification-dropdown-header {
            padding: 16px;
            font-weight: 700;
            font-size: 14px;
            color: var(--notification-header-text);
            border-bottom: 1px solid var(--notification-border);
            background: var(--notification-header-bg);
            border-radius: 12px 12px 0 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }


        .notification-item {
            display: flex;
            justify-content: space-between;
            padding: 16px;
            border-bottom: 1px solid var(--notification-border);
            transition: all 0.2s ease;
            position: relative;
            background: var(--notification-item-bg);
        }

        .notification-item:hover {
            background: var(--notification-item-hover-bg);
            transform: translateX(-3px);
        }

        .notification-item::before {
            content: "";
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: var(--notification-warning-text);
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .notification-item:hover::before {
            opacity: 1;
        }

        .notification-item:last-child {
            border-bottom: none;
        }

        .notification-dropdown-footer {
            padding: 16px;
            text-align: center;
            background: var(--notification-item-hover-bg);
            border-radius: 0 0 12px 12px;
            border-top: 1px solid var(--notification-border);
        }

        .notification-dropdown-footer a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .notification-dropdown-footer a:hover {
            color: var(--primary-hover);
            transform: translateY(-2px);
        }

        .notification-dropdown-footer a::after {
            content: "→";
            font-size: 14px;
            transition: transform 0.2s ease;
        }

        .notification-dropdown-footer a:hover::after {
            transform: translateX(-3px);
        }

        .search-box {
            display: flex;
            align-items: center;
            background: var(--bg-main);
            border: 1px solid var(--border-main);
            border-radius: 12px;
            padding: 10px 18px;
            gap: 10px;
            width: 220px; /* تصغير إضافي لعرض حقل البحث */
            transition: all 0.3s ease;
        }

        .search-box:focus-within {
            border-color: #d1d5db;
            box-shadow: 0 0 0 3px rgba(209, 213, 219, 0.5);
            background: var(--surface-main);
        }

        .search-box input {
            border: none;
            outline: none;
            background: transparent;
            flex: 1;
            font-size: 14px;
        }

        .btn {
            padding: 10px 20px;
            border-radius: 25px;
            border: none;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .btn:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .btn:active {
            transform: translateY(0) scale(0.98);
        }

        .btn-primary {
            background: var(--primary);
            color: var(--text-light);
        }

        .btn-primary:hover {
            background: var(--primary-hover);
            box-shadow: none;
        }

        #notesPage .header-actions {
            flex-wrap: wrap;
        }

        .stats-tabs {
            display: flex;
            gap: 12px;
            margin-bottom: 32px;
            flex-wrap: wrap;
        }

        .stat-tab {
            background: var(--surface-main);
            padding: 14px 24px;
            border-radius: 12px;
            border: 1px solid var(--border-main);
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            color: var(--stat-tab-text);
        }

        .stat-tab:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .stat-tab.active {
            background: var(--primary);
            color: var(--text-light) !important;
            border-color: var(--primary);
            box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
            transform: translateY(-2px);
        }

        .stat-tab[data-status="new"].active {
            background-color: var(--info-bg);
            color: var(--info-text) !important;
            border-color: var(--info-bg);
        }
        .stat-tab[data-status="ready"].active {
            background-color: var(--success-bg);
            color: var(--success-text) !important;
            border-color: var(--success-bg);
        }
        .stat-tab[data-status="delivering"].active {
            background-color: var(--delivering-bg);
            color: var(--delivering-text) !important;
            border-color: var(--delivering-bg);
        }
        .stat-tab[data-status="completed"].active {
            background-color: var(--completed-bg);
            color: var(--completed-text) !important;
            border-color: var(--completed-bg);
        }
        .stat-tab[data-status="collected"].active {
            background-color: var(--collected-bg);
            color: var(--collected-text) !important;
            border-color: var(--collected-bg);
        }
        .stat-tab[data-status="cancelled"].active {
            background-color: var(--cancelled-bg);
            color: var(--cancelled-text) !important;
            border-color: var(--cancelled-bg);
        }

        .stat-count {
            background: rgba(0,0,0,0.05);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
        }

        .stat-tab.active .stat-count {
            background: rgba(0,0,0,0.1);
            color: inherit;
        }

        .orders-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 24px;
        }
        
        /* Hide grid view when list view is active */
        .orders-list ~ .orders-grid,
        .orders-list.orders-grid {
            display: none;
        }
        
        /* Hide list view when grid view is active */
        .orders-grid ~ .orders-list,
        .orders-grid.orders-list {
            display: none;
        }

        .orders-list {
            display: block;
            background: var(--surface-main);
            border-radius: 16px;
            border: 1px solid var(--border-main);
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            overflow: hidden;
        }

        .orders-list table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        .orders-list thead {
            background: linear-gradient(135deg, var(--table-header-bg) 0%, var(--table-header-bg) 100%);
            color: var(--table-header-text);
        }

        .orders-list thead th {
            padding: var(--table-header-padding);
            text-align: right;
            font-weight: 600;
            border: none;
            white-space: nowrap;
            color: var(--table-header-text);
        }

        .orders-list tbody tr {
            border-bottom: 1px solid var(--table-row-border);
            transition: all 0.3s ease;
            background-color: var(--table-row-bg);
        }

        .orders-list tbody tr:hover {
            background: var(--table-row-hover-bg);
            transform: scale(1.005);
        }

        .orders-list tbody tr:last-child {
            border-bottom: none;
        }

        .orders-list tbody td {
            padding: var(--table-cell-padding);
            text-align: right;
            color: var(--text-main);
            vertical-align: middle;
        }

        .orders-list .order-id-cell {
            font-weight: 600;
            color: var(--text-title);
            min-width: 100px;
        }

        .orders-list .customer-cell {
            min-width: 120px;
        }

        .orders-list .status-cell {
            min-width: 100px;
        }

        .orders-list .price-cell {
            font-weight: 600;
            color: var(--text-title);
            min-width: 80px;
        }

        .orders-list .actions-cell {
            min-width: 150px;
        }

        .orders-list .actions-cell .btn-sm {
            margin: 2px;
            font-size: 11px;
            padding: 6px 10px;
        }

        /* Responsive styles for list view */
        @media (max-width: 768px) {
            .orders-list {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .orders-list table {
                min-width: 600px;
                font-size: 12px;
            }
            
            .orders-list thead th {
                padding: 10px 6px;
                font-size: 11px;
            }
            
            .orders-list tbody td {
                padding: 8px 6px;
                font-size: 12px;
            }
        }

        @media (max-width: 480px) {
            .orders-list table {
                min-width: 500px;
                font-size: 11px;
            }
            
            .orders-list thead th {
                padding: 8px 4px;
                font-size: 10px;
            }
            
            .orders-list tbody td {
                padding: 6px 4px;
                font-size: 11px;
            }
            
            .orders-list .actions-cell .btn-sm {
                font-size: 10px;
                padding: 4px 8px;
            }
        }
        
        /* Platform badge specific styles for advertising campaigns */
        .orders-grid .status-badge {
            width: auto;
            min-width: fit-content;
            max-width: 100%;
            text-align: center;
            font-size: 12px;
            padding: 6px 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.4;
            border-radius: 20px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        
        /* Table view platform badge adjustments */
        .movements-table .status-badge {
            width: auto;
            min-width: fit-content;
            max-width: 150px;
            text-align: center;
            font-size: 11px;
            padding: 4px 10px;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.4;
        }
        
        /* Campaign name adjustments for table view */
        .campaign-name {
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-weight: 600;
            color: var(--text-title);
        }
        
        /* Responsive adjustments for platform badges */
        @media (max-width: 768px) {
            .orders-grid .status-badge {
                font-size: 11px;
                padding: 5px 12px;
            }
            
            .movements-table .status-badge {
                font-size: 10px;
                padding: 3px 6px;
                max-width: 100px;
            }
            
            .campaign-name {
                max-width: 120px;
            }
        }
        
        @media (max-width: 480px) {
            .orders-grid .status-badge {
                font-size: 10px;
                padding: 4px 10px;
            }
            
            .movements-table .status-badge {
                font-size: 9px;
                padding: 2px 4px;
                max-width: 80px;
            }
            
            .campaign-name {
                max-width: 80px;
            }
        }

        .order-card {
            background: var(--surface-main);
            border-radius: 16px;
            padding: 24px;
            border: 1px solid var(--border-main);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            flex-direction: column;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            position: relative;
            overflow: hidden;
        }

        .order-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            left: 0;
            height: 4px;
            background: var(--primary);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .order-card:hover {
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            transform: translateY(-4px);
            border-color: var(--primary);
        }

        .order-card:hover::before {
            opacity: 1;
        }

        .clickable-card {
            cursor: pointer;
        }

        .clickable-card:active {
            transform: translateY(-2px) scale(0.98);
        }

        /* Order clickable rows and cards styles */
        .orders-list tbody tr {
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .orders-list tbody tr:hover {
            background: var(--table-row-hover-bg) !important;
            transform: scale(1.005);
            box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
        }

        .orders-list tbody tr:active {
            transform: scale(0.995);
        }

        /* Order details modal styles */
        .order-details-content {
            max-height: 70vh;
            overflow-y: auto;
        }

        .order-details-section {
            margin-bottom: 24px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border-main);
        }

        .order-details-section:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .order-details-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-title);
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .order-details-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        .order-detail-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .order-detail-label {
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .order-detail-value {
            font-size: 14px;
            color: var(--text-main);
            font-weight: 600;
        }

        .order-products-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .order-product-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background: var(--bg-main);
            border-radius: 8px;
            border: 1px solid var(--border-main);
        }

        .order-product-name {
            font-weight: 600;
            color: var(--text-title);
        }

        .order-product-details {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .order-product-price {
            font-weight: 700;
            color: var(--primary);
        }

        .order-customer-notes {
            background: var(--customer-notes-bg);
            padding: 12px;
            border-radius: 8px;
            color: var(--customer-notes-text);
            font-size: 14px;
            line-height: 1.5;
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        .order-details-actions {
            display: flex;
            gap: 12px;
            margin-top: 24px;
            padding-top: 20px;
            border-top: 1px solid var(--border-main);
        }

        .order-details-actions .btn {
            flex: 1;
            font-weight: 600;
        }

        /* Responsive adjustments for order details modal */
        @media (max-width: 768px) {
            .order-details-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .order-details-actions {
                flex-direction: column;
            }

            .order-details-actions .btn {
                width: 100%;
            }
        }

        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border-main);
        }

        .order-id {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-title);
            letter-spacing: -0.3px;
        }

        .status-badge {
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            min-width: fit-content;
            width: auto;
        }

        .status-new { background: var(--info-bg); color: var(--info-text); }
        .status-ready { background: var(--success-bg); color: var(--success-text); }
        .status-delivering { background: var(--delivering-bg); color: var(--delivering-text); }
        .status-completed { background: var(--completed-bg); color: var(--completed-text); }
        .status-collected { background: var(--collected-bg); color: var(--collected-text); }
        .status-cancelled { background: var(--cancelled-bg); color: var(--cancelled-text); }

        .order-info {
            margin-bottom: 20px;
            flex: 1;
        }

        .info-item {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            color: var(--text-secondary);
            font-size: 14px;
            padding: 4px 0;
        }

        .order-price {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-title);
            margin-bottom: 20px;
            padding-top: 16px;
            border-top: 1px solid var(--border-main);
        }

        .order-actions {
            display: flex;
            gap: 8px;
            margin-top: auto;
            padding-top: 16px;
            border-top: 1px solid var(--border-main);
            flex-wrap: wrap;
        }

        /* Status dropdown styles */
        .status-select-dropdown {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.2-5.4H18.2c-5%200-9.3%201.8-13.2%205.4A17.6%2017.6%200%200%200%200%2082.6c0%204.8%201.8%209.3%205.4%2013.2l128%20127.9c3.9%203.9%208.4%205.7%2013.2%205.7s9.3-1.8%2013.2-5.7l128-127.9c3.6-3.9%205.4-8.4%205.4-13.2%200-4.8-1.8-9.3-5.4-13.2z%22%2F%3E%3C%2Fsvg%3E');
            background-repeat: no-repeat;
            background-position: left 0.7em top 50%;
            background-size: 0.8em auto;
            padding-right: 2.5em;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .status-select-dropdown:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .status-select-dropdown:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(255,255,255,0.3), 0 4px 12px rgba(0,0,0,0.15);
        }

        .status-select-dropdown:active {
            transform: translateY(0) scale(0.98);
        }

        /* Custom dropdown arrow */
        .status-select-dropdown::-ms-expand {
            display: none;
        }

        .status-select-dropdown::-webkit-scrollbar {
            width: 6px;
        }

        .status-select-dropdown::-webkit-scrollbar-track {
            background: transparent;
        }

        .status-select-dropdown::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.3);
            border-radius: 3px;
        }

        /* Table view dropdown adjustments */
        .orders-list .status-select-dropdown {
            font-size: 11px;
            padding: 4px 10px;
            min-width: 100px;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .status-select-dropdown {
                font-size: 11px;
                padding: 5px 12px;
            }
        }

        @media (max-width: 480px) {
            .status-select-dropdown {
                font-size: 10px;
                padding: 4px 8px;
                min-width: 80px;
            }
        }

        .order-actions .btn {
            flex: 1;
            min-width: 80px;
            font-size: 12px;
            padding: 8px 12px;
            margin: 2px;
        }

        .btn-sm {
            padding: 8px 16px;
            font-size: 12px;
            border-radius: 20px;
            border: none;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn-sm:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .btn-success { background: var(--primary); color: var(--text-light); }
        .btn-warning { background: var(--primary); color: var(--text-light); }
        .btn-danger { background: var(--danger); color: var(--text-light); }
        .btn-info { background: var(--primary); color: var(--text-light); }

        .btn-success:hover { background: var(--primary-hover); }
        .btn-warning:hover { background: var(--primary-hover); }
        .btn-danger:hover { background: var(--danger-hover); }
        .btn-info:hover { background: var(--primary-hover); }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

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

        .modal-content {
            background: var(--surface-main);
            padding: 32px;
            border-radius: 24px;
            width: 90%;
            max-width: 520px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 25px 80px rgba(0,0,0,0.25),
                       0 10px 30px rgba(0,0,0,0.15);
            animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(20px);
        }

        @keyframes slideUp {
            from {
                transform: translateY(30px) scale(0.95);
                opacity: 0;
                filter: blur(5px);
            }
            to {
                transform: translateY(0) scale(1);
                opacity: 1;
                filter: blur(0);
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border-main);
        }

        .modal-title {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-title);
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 28px;
            cursor: pointer;
            color: var(--text-secondary);
            width: 36px;
            height: 36px;
            border-radius: 25px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .close-btn:hover {
            background: var(--bg-main);
            color: var(--text-main);
        }

        .form-group {
            margin-bottom: 24px;
            position: relative;
        }

        .form-label {
            display: block;
            margin-bottom: 12px;
            font-weight: 700;
            color: var(--text-title);
            font-size: 15px;
            text-align: right;
            position: relative;
            padding-right: 8px;
        }

        .form-label::after {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 4px;
            background: var(--primary);
            border-radius: 50%;
            opacity: 0.8;
        }

        /* إضافة تأثيرات إضافية لمجموعة الحقول */
        .form-group:hover .form-label {
            color: var(--primary);
            transform: translateX(3px);
            transition: all 0.3s ease;
        }

        .form-group:hover .form-label::after {
            width: 6px;
            height: 6px;
            background: var(--primary-hover);
            transition: all 0.3s ease;
        }

        .form-input {
            width: 100%;
            padding: 12px 24px;
            border: 2px solid transparent;
            border-radius: 50px;
            font-size: 15px;
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, #f8f9fa, #e9ecef) border-box;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
            position: relative;
            font-weight: 600;
        }

        /* النمط الحديث - افتراضي */
        .form-input.modern {
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, var(--primary), #6ba3e5) border-box;
        }

        .form-input.modern:focus {
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, #357abd, #4a90e2) border-box;
            box-shadow: 0 8px 25px rgba(53, 122, 189, 0.2),
                       0 4px 10px rgba(0, 0, 0, 0.08);
        }

        /* النمط البسيط الأنيق */
        .form-input.minimal {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: white;
            padding: 14px 18px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .form-input.minimal:focus {
            border: 1px solid var(--primary);
            box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
            transform: none;
        }

        /* النمط ثلاثي الأبعاد */
        .form-input.neumorphic {
            background: #f0f0f0;
            border: none;
            border-radius: 12px;
            padding: 16px 20px;
            box-shadow: 8px 8px 16px #d1d5db,
                       -8px -8px 16px #ffffff,
                       inset 1px 1px 2px rgba(255, 255, 255, 0.7);
        }

        .form-input.neumorphic:focus {
            box-shadow: 8px 8px 16px #c3c3c3,
                       -8px -8px 16px #ffffff,
                       inset 2px 2px 4px rgba(74, 144, 226, 0.1);
            background: #e8e8e8;
        }

        /* النمط الزجاجي */
        .form-input.glass {
            background: rgba(255, 255, 255, 0.25);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 12px;
            padding: 16px 20px;
            box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
            color: #333;
        }

        .form-input.glass:focus {
            background: rgba(255, 255, 255, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 8px 32px rgba(31, 38, 135, 0.47),
                       inset 0 0 0 2px rgba(74, 144, 226, 0.2);
        }

        .form-input.glass::placeholder {
            color: rgba(51, 51, 51, 0.7);
        }

        /* النمط الملون */
        .form-input.colorful {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            color: white;
            padding: 16px 20px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }

        .form-input.colorful:focus {
            background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
            transform: translateY(-1px);
        }

        .form-input.colorful::placeholder {
            color: rgba(255, 255, 255, 0.8);
        }

        /* النمط الخطي العصري */
        .form-input.outlined {
            background: transparent;
            border: 2px solid var(--primary);
            border-radius: 8px;
            padding: 14px 18px;
            color: var(--text-title);
            position: relative;
        }

        .form-input.outlined:focus {
            background: rgba(74, 144, 226, 0.05);
            border: 2px solid var(--primary-hover);
            box-shadow: none;
        }

        .form-input.outlined::placeholder {
            color: var(--text-secondary);
        }

        /* النمط ذو الحواف الدائرية */
        .form-input.pill {
            border-radius: 50px;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border: 2px solid #dee2e6;
            padding: 12px 24px;
            font-weight: 600;
        }

        .form-input.pill:focus {
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            border: 2px solid var(--primary);
            box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
        }

        .form-input:focus {
            outline: none;
            border: 2px solid transparent;
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, var(--primary), #6ba3e5) border-box;
            box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15),
                       0 4px 10px rgba(0, 0, 0, 0.05);
            transform: translateY(-2px);
        }

        .form-input:hover {
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
            transform: translateY(-1px);
        }

        .form-input::placeholder {
            color: #9ca3af;
            font-weight: 400;
            transition: opacity 0.3s ease;
        }

        .form-input:focus::placeholder {
            opacity: 0.7;
            transform: translateY(-1px);
        }

        /* إضافة تأثير التموج عند التركيز */
        .form-input:focus {
            animation: inputFocus 0.4s ease-out;
        }

        @keyframes inputFocus {
            0% {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
            }
            50% {
                box-shadow: 0 12px 35px rgba(74, 144, 226, 0.2),
                           0 6px 15px rgba(0, 0, 0, 0.08);
            }
            100% {
                box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15),
                           0 4px 10px rgba(0, 0, 0, 0.05);
            }
        }

        /* تحسين حقول الإدخال ذات الأخطاء */
        .form-input.error {
            border: 2px solid transparent;
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, var(--danger), #e53e3e) border-box;
            animation: shake 0.5s ease-in-out;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        /* إضافة تأثيرات للحقول المعطلة */
        .form-input:disabled {
            background: linear-gradient(#f9fafb, #f9fafb) padding-box,
                        linear-gradient(135deg, #e5e7eb, #d1d5db) border-box;
            color: var(--text-secondary);
            cursor: not-allowed;
            opacity: 0.7;
        }

        .form-input:disabled:hover {
            transform: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        }

        select.form-input {
            background-color: var(--surface-main);
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234a90e2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.2-5.4H18.2c-5%200-9.3%201.8-13.2%205.4A17.6%2017.6%200%200%200%200%2082.6c0%204.8%201.8%209.3%205.4%2013.2l128%20127.9c3.9%203.9%208.4%205.7%2013.2%205.7s9.3-1.8%2013.2-5.7l128-127.9c3.6-3.9%205.4-8.4%205.4-13.2%200-4.8-1.8-9.3-5.4-13.2z%22%2F%3E%3C%2Fsvg%3E');
            background-repeat: no-repeat;
            background-position: left 1.2em top 50%, 0 0;
            background-size: 0.8em auto, 100%;
            cursor: pointer;
        }

        select.form-input:focus {
            background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23357abd%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.2-5.4H18.2c-5%200-9.3%201.8-13.2%205.4A17.6%2017.6%200%200%200%200%2082.6c0%204.8%201.8%209.3%205.4%2013.2l128%20127.9c3.9%203.9%208.4%205.7%2013.2%205.7s9.3-1.8%2013.2-5.7l128-127.9c3.6-3.9%205.4-8.4%205.4-13.2%200-4.8-1.8-9.3-5.4-13.2z%22%2F%3E%3C%2Fsvg%3E');
        }

        textarea.form-input {
            resize: vertical;
            min-height: 120px;
            line-height: 1.5;
        }

        .searchable-dropdown {
            position: relative;
        }

        .searchable-dropdown .searchable-input {
            width: 100%;
            padding: 16px 20px;
            border: 2px solid transparent;
            border-radius: 16px;
            font-size: 15px;
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, #f0f0f0, #e0e0e0) border-box;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
            position: relative;
            font-weight: 500;
        }

        .searchable-dropdown .searchable-input:focus {
            outline: none;
            border: 2px solid transparent;
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(135deg, var(--primary), #6ba3e5) border-box;
            box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15),
                       0 4px 10px rgba(0, 0, 0, 0.05);
            transform: translateY(-2px);
        }

        .searchable-dropdown .searchable-input:hover {
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
            transform: translateY(-1px);
        }

        .searchable-dropdown .searchable-input::placeholder {
            color: #9ca3af;
            font-weight: 400;
            transition: opacity 0.3s ease;
        }

        .searchable-dropdown .searchable-input:focus::placeholder {
            opacity: 0.7;
            transform: translateY(-1px);
        }

        /* إضافة تأثير التموج للحقول القابلة للبحث */
        .searchable-dropdown .searchable-input:focus {
            animation: inputFocus 0.4s ease-out;
        }

        /* تحسين القوائم المنسدلة المتقدمة */
        .dropdown-list {
            max-height: 250px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--primary) transparent;
        }

        .dropdown-list::-webkit-scrollbar {
            width: 6px;
        }

        .dropdown-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .dropdown-list::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 3px;
            transition: background 0.3s ease;
        }

        .dropdown-list::-webkit-scrollbar-thumb:hover {
            background: var(--primary-hover);
        }

        .dropdown-list {
            border: 2px solid var(--primary);
            border-top: none;
            border-radius: 0 0 16px 16px;
            box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15),
                       0 4px 10px rgba(0, 0, 0, 0.05);
            background: var(--surface-main);
            backdrop-filter: blur(10px);
            margin-top: -2px;
            overflow: hidden;
        }

        .dropdown-list > div {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            padding: 14px 20px;
            cursor: pointer;
            font-weight: 500;
            border-left: 3px solid transparent;
        }

        .dropdown-list > div:hover {
            background: linear-gradient(90deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
            border-left-color: var(--primary);
            transform: translateX(3px);
        }

        .dropdown-list > div:active {
            transform: translateX(1px) scale(0.98);
        }

        .login-container {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background: linear-gradient(135deg, var(--login-gradient-start) 0%, var(--login-gradient-end) 100%);
        }

        .login-box {
            background: var(--surface-main);
            padding: 48px;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.15);
            width: 100%;
            max-width: 420px;
            text-align: center;
        }

        .login-title {
            font-size: 24px;
            font-weight: bold;
            margin-top: 0; /* Ensure no top margin */
            margin-bottom: 8px;
            color: var(--text-title);
        }

        .login-subtitle {
            color: var(--text-secondary);
            margin-bottom: 32px;
        }

        .error-message {
            background: #fee2e2;
            color: var(--danger-hover);
            padding: 8px 12px;
            border-radius: 6px;
            margin-bottom: 16px;
            font-size: 14px;
        }

        @media (max-width: 992px) {
            .charts-grid {
                grid-template-columns: 1fr !important;
            }
        }

        /* Tablet and smaller screens (before mobile) */
        @media (max-width: 1024px) and (min-width: 481px) {
            .header-actions {
                flex-direction: column;
                align-items: stretch;
            }

            .search-box {
                flex: 1 1 auto;
                width: 100%;
            }

            .header-actions .btn {
                padding: 8px 12px;
                font-size: 12px;
                white-space: nowrap;
                flex: 1 1 auto;
                min-width: 100px;
                width: 100%;
            }

            #notesPage .header-actions {
                flex-direction: column;
                align-items: stretch;
            }

            #notesPage .header-actions .btn {
                padding: 8px 12px;
                font-size: 12px;
                width: 100%;
            }
        }

        @media (max-width: 768px) {
            .recent-orders-header {
                align-items: center !important;
            }
            #themeSettingsBtn {
                display: none; /* Hide original button on mobile */
            }

            /* تحسين تصميم حقول الإدخال للأجهزة المحمولة */
            .form-input {
                padding: 18px 20px;
                font-size: 16px; /* منع التكبير التلقائي في iOS */
                border-radius: 18px;
            }

            .searchable-dropdown .searchable-input {
                padding: 18px 20px;
                font-size: 16px;
                border-radius: 18px;
            }

            .form-label {
                font-size: 16px;
                margin-bottom: 14px;
            }

            .form-group {
                margin-bottom: 28px;
            }

            .modal-content {
                padding: 24px;
                border-radius: 20px;
                width: 95%;
            }

            /* تحسين القوائم المنسدلة للأجهزة المحمولة */
            .dropdown-list {
                border-radius: 0 0 18px 18px;
            }

            .dropdown-list > div {
                padding: 16px 20px;
                font-size: 16px;
            }
            .sidebar {
                position: fixed;
                right: 0;
                left: 0;
                width: 100%;
                height: 70px;
                transform: translateY(0);
                max-height: none;
                padding: 0;
                bottom: 0;
                top: auto;
                border-radius: 20px 20px 0 0;
                background: var(--surface-main);
                border-top: 1px solid var(--border-main);
                box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
                backdrop-filter: none;
                z-index: 1000;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .sidebar nav {
                display: flex;
                align-items: center;
                justify-content: space-around;
                width: 100%;
                padding: 0 5px;
                overflow-x: auto;
                overflow-y: hidden;
                -webkit-overflow-scrolling: touch;
                flex-wrap: nowrap;
            }

            .nav-item {
                flex: 0 1 auto;
                height: 50px;
                padding: 8px;
                min-width: 50px;
                max-width: 60px;
            }
            
            .nav-icon-img {
                width: 28px;
                height: 28px;
            }

            .nav-item.active::after {
                display: none;
            }
            
            .main-content {
                margin-right: 0;
                padding: 20px;
                padding-bottom: 90px; /* Add padding to avoid overlap with sidebar */
            }

            .header {
                flex-direction: column;
                gap: 16px;
                align-items: flex-start;
                padding: 20px;
            }

            .header-actions {
                width: 100%;
                flex-wrap: wrap;
                gap: 10px; /* Add a gap between wrapped items */
            }

            .search-box {
                flex: 1 1 180px; /* Allow shrinking and growing, with a base size */
            }

            #notesPage .header-actions {
                display: flex;
                flex-wrap: wrap;
                gap: 10px;
            }

            #notesPage .header-actions > * {
                flex-grow: 1;
                min-width: 120px;
            }

            .orders-grid {
                grid-template-columns: 1fr;
                gap: 16px;
            }

            .greeting {
                font-size: 24px;
            }

            .dashboard-stats,
            .charts-grid {
                grid-template-columns: 1fr !important;
            }

            .modal-content {
                width: 95%;
                padding: 20px;
            }
            
            /* Mobile notification dropdown styles */
            .notification-dropdown {
                position: fixed !important;
                top: 70px !important;
                left: 5px !important;
                right: 5px !important;
                width: auto !important;
                max-width: calc(100vw - 10px) !important;
                max-height: 70vh !important;
                overflow-y: auto !important;
                z-index: 2000 !important;
                border-radius: 12px !important;
                box-shadow: 0 8px 30px rgba(0,0,0,0.3) !important;
                backdrop-filter: blur(10px) !important;
                animation: slideUpMobile 0.3s ease !important;
                min-width: 300px !important;
                background-color: var(--notification-bg) !important;
                border: 1px solid var(--notification-border) !important;
            }

            @keyframes slideUpMobile {
                from {
                    opacity: 0;
                    transform: translateY(20px);
                }
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
            
            .notification-badge {
                width: 16px !important;
                height: 16px !important;
                min-width: 16px !important;
                font-size: 10px !important;
                top: -4px !important;
                right: -4px !important;
                padding: 0 3px !important;
            }

            .notification-dropdown-header {
                padding: 12px 14px !important;
                font-size: 12px !important;
                border-radius: 12px 12px 0 0 !important;
                color: var(--notification-header-text) !important;
                background: var(--notification-header-bg) !important;
                border-bottom: 1px solid var(--notification-border) !important;
            }

            .notification-item {
                padding: 12px 14px !important;
                display: flex !important;
                justify-content: space-between !important;
                align-items: center !important;
                flex-wrap: wrap !important;
                gap: 8px !important;
                background: var(--notification-item-bg) !important;
                border-bottom: 1px solid var(--notification-border) !important;
            }

            .notification-item:hover {
                transform: translateX(-2px) !important;
                background: var(--notification-item-hover-bg) !important;
            }

            .notification-dropdown-footer {
                padding: 12px 14px !important;
                border-radius: 0 0 12px 12px !important;
                background: var(--notification-item-hover-bg) !important;
                border-top: 1px solid var(--notification-border) !important;
            }

            .notification-dropdown-footer a {
                font-size: 13px !important;
            }

            /* Mobile table styles */
            .customers-table {
                font-size: 11px;
                min-width: 550px;
            }

            .customers-table thead th {
                padding: 10px 6px;
                font-size: 10px;
            }

            .customers-table td {
                padding: 8px 5px;
                font-size: 11px;
            }

            .customer-address,
            .customer-address-details {
                max-width: 80px;
            }

            .customer-date {
                max-width: 70px;
                font-size: 11px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        /* Extra small devices (less than 480px) */
        @media (max-width: 480px) {
            .sidebar {
                height: 70px;
                bottom: 0;
            }

            .sidebar nav {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .nav-item {
                flex-shrink: 0;
                height: 50px;
                padding: 8px;
                min-width: 55px;
                max-width: 55px;
            }

            .nav-icon-img {
                width: 26px;
                height: 26px;
            }

            .main-content {
                padding-bottom: 85px;
            }

            /* تحسينات إضافية للأجهزة الصغيرة جداً */
            .form-input {
                padding: 20px 18px;
                border-radius: 20px;
            }

            .searchable-dropdown .searchable-input {
                padding: 20px 18px;
                border-radius: 20px;
            }

            .form-label {
                font-size: 15px;
            }

            .modal-content {
                padding: 20px;
                border-radius: 18px;
            }

            /* تقليل التأثيرات الحركية للأجهزة الضعيفة */
            .form-input:focus,
            .searchable-dropdown .searchable-input:focus {
                transform: translateY(-1px);
                box-shadow: 0 4px 15px rgba(74, 144, 226, 0.12),
                           0 2px 6px rgba(0, 0, 0, 0.04);
            }

            .form-input:hover,
            .searchable-dropdown .searchable-input:hover {
                transform: none;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            }

            /* Extra small device table styles */
            .customers-table {
                font-size: 10px;
                min-width: 520px;
            }

            .customers-table thead th {
                padding: 8px 4px;
                font-size: 9px;
            }

            .customers-table td {
                padding: 6px 4px;
                font-size: 10px;
            }

            .row-number {
                width: 30px;
            }

            .customer-address,
            .customer-address-details {
                max-width: 60px;
                font-size: 10px;
            }

            .orders-badge {
                padding: 4px 8px;
                font-size: 11px;
            }

            .customer-date {
                max-width: 60px;
                font-size: 10px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-secondary);
        }

        .empty-icon {
            font-size: 48px;
            margin-bottom: 16px;
        }

        /* Customers Table Styles */
        .customers-table-wrapper {
            background: var(--table-wrapper-bg);
            border-radius: var(--table-border-radius);
            overflow-x: auto;
            overflow-y: hidden;
            border: 1px solid var(--table-border);
            box-shadow: var(--table-shadow);
            margin-bottom: 32px;
            -webkit-overflow-scrolling: touch;
        }

        .customers-table {
            width: 100%;
            border-collapse: collapse;
            font-size: var(--table-font-size);
            min-width: 600px;
        }

        .customers-table thead {
            background: linear-gradient(135deg, var(--table-header-bg) 0%, var(--table-header-bg) 100%);
            color: var(--table-header-text);
        }

        .customers-table thead th {
            padding: var(--table-header-padding);
            text-align: right;
            font-weight: 600;
            border: none;
            white-space: nowrap;
            color: var(--table-header-text);
        }

        .sortable-header {
            cursor: pointer;
            user-select: none;
            transition: all 0.2s ease;
            position: relative;
            padding-right: 28px;
        }

        .sortable-header:hover {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }

        .sort-icon {
            font-size: 12px;
            opacity: 0.8;
            transition: opacity 0.2s ease;
            position: absolute;
            left: 8px;
        }

        .sortable-header:hover .sort-icon {
            opacity: 1;
        }

        .customers-table tbody tr {
            border-bottom: 1px solid var(--table-row-border);
            transition: all 0.3s ease;
            background-color: var(--table-row-bg);
        }

        .clickable-row {
            cursor: pointer;
        }

        .customers-table tbody tr:hover {
            background: var(--table-row-hover-bg);
            transform: scale(1.01);
        }

        .clickable-row:hover {
            background: linear-gradient(90deg, var(--table-row-hover-bg) 0%, var(--table-row-hover-bg) 100%) !important;
            box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
        }

        .customers-table tbody tr:last-child {
            border-bottom: none;
        }

        .customers-table td {
            padding: var(--table-cell-padding);
            text-align: right;
            color: var(--text-main);
        }

        .row-number {
            font-weight: 600;
            color: var(--text-main);
            background-color: var(--bg-main);
            width: 40px;
            text-align: center;
        }

        .customer-name {
            font-weight: 600;
            color: var(--text-title);
        }

        .customer-phone {
            direction: ltr;
            text-align: left;
        }

        .customer-address {
            color: var(--text-secondary);
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .customer-address-details {
            color: var(--text-secondary);
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .orders-badge {
            display: inline-block;
            background: var(--orders-count-bg);
            color: var(--orders-count-text);
            padding: 6px 12px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 13px;
        }

        .customer-date {
            color: var(--text-secondary);
            font-size: 13px;
            white-space: nowrap;
        }

        /* Dashboard Stats Cards */
        .dashboard-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 24px;
            margin-bottom: 32px;
        }

        .stat-card {
            background: var(--surface-main);
            border-radius: 16px;
            padding: 28px;
            border: 1px solid var(--border-main);
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            left: 0;
            height: 4px;
            background: var(--primary);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .stat-card:hover {
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            transform: translateY(-4px);
        }

        .stat-card:hover::before {
            opacity: 1;
        }

        .stat-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 16px;
        }

        .stat-card-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-card-icon {
            font-size: 32px;
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-main);
        }

        .stat-card-value {
            font-size: 36px;
            font-weight: 700;
            color: var(--text-title);
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }

        .stat-card-footer {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .stat-card-primary .stat-card-icon {
            background: transparent;
        }

        .stat-card-success .stat-card-icon {
            background: transparent;
        }

        .stat-card-warning .stat-card-icon {
            background: transparent;
        }

        .stat-card-info .stat-card-icon {
            background: transparent;
        }

        /* Chart Legend Styles */
        .chart-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--bg-main);
            border-radius: 8px;
            font-size: 14px;
        }

        .chart-legend-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
            display: inline-block;
        }


        .theme-settings-btn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 50px;
            height: 50px;
            border-radius: 25px;
            background: white;
            color: var(--text-main);
            border: 1px solid var(--border-main);
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: none;
            z-index: 1001;
        }

        .theme-settings-btn img {
            width: 26px;
            height: 26px;
            object-fit: contain;
            display: block;
        }

        @media (min-width: 769px) {
            #themeSettingsBtnMobile {
                display: none;
            }
        }

        .theme-settings-panel {
            position: fixed;
            top: 0;
            right: -350px;
            width: 350px;
            height: 100vh;
            background: var(--surface-main);
            border-left: 1px solid var(--border-main);
            z-index: 2001;
            transition: right 0.3s ease-in-out;
            padding: 20px;
            box-shadow: -2px 0 15px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
        }

        .theme-settings-panel.open {
            right: 0;
        }

        .theme-settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            border-bottom: 1px solid var(--border-main);
            padding-bottom: 10px;
        }

        .theme-color-pickers {
            display: flex;
            flex-direction: column;
            gap: 24px; /* Increased gap for better separation */
            overflow-y: auto;
            padding-right: 10px; /* Add some padding for the scrollbar */
        }

        .theme-group {
            background: var(--bg-main);
            border-radius: 12px;
            padding: 16px;
            border: 1px solid var(--border-main);
        }

        .theme-group-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-title);
            margin-bottom: 16px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border-main);
        }

        .color-picker-group {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px; /* Add margin between color pickers */
        }

        .color-picker-group:last-child {
            margin-bottom: 0;
        }

        .color-picker-group label {
            font-weight: 500;
            color: var(--text-secondary);
        }

        .color-picker-group input[type="color"] {
            width: 50px;
            height: 30px;
            border: 1px solid var(--border-main);
            border-radius: 6px;
            cursor: pointer;
            padding: 2px;
        }

        /* iPad landscape */
        @media (min-width: 1024px) and (max-width: 1366px) {
            .dashboard-stats {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        /* View Toggle Buttons Styles */
        .view-toggle-label {
            font-weight: 600;
            color: var(--text-title);
            font-size: 14px;
            margin-bottom: 20px;
            display: block;
        }

        .view-toggle-buttons {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
        }

        .view-toggle-buttons .btn {
            padding: 8px 16px;
            font-size: 14px;
            font-weight: 500;
            border-radius: 20px;
            transition: all 0.3s ease;
            min-width: 80px;
        }

        .view-toggle-buttons .btn:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .view-toggle-buttons .btn:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .view-toggle-buttons .btn-primary {
            background: var(--primary);
            color: var(--text-light);
            border: 1px solid var(--primary);
        }

        .view-toggle-buttons .btn-primary:hover {
            background: var(--primary-hover);
            border-color: var(--primary-hover);
        }

        .view-toggle-buttons .btn-secondary {
            background: var(--surface-main);
            color: var(--text-main);
            border: 1px solid var(--border-main);
        }

        .view-toggle-buttons .btn-secondary:hover {
            background: var(--bg-main);
            border-color: var(--primary);
        }

        /* Inventory Movements Table Styles */
        .movements-table-wrapper {
            background: var(--table-wrapper-bg);
            border-radius: var(--table-border-radius);
            overflow: hidden;
            border: 1px solid var(--table-border);
            box-shadow: var(--table-shadow);
            margin-bottom: 32px;
            width: 100%;
        }

        .movements-table {
            width: 100%;
            border-collapse: collapse;
            font-size: var(--table-font-size);
            min-width: 800px;
            max-width: 100%;
        }

        .movements-table thead {
            background: linear-gradient(135deg, var(--table-header-bg) 0%, var(--table-header-bg) 100%);
            color: var(--table-header-text);
        }

        .movements-table thead th {
            padding: var(--table-header-padding);
            text-align: right;
            font-weight: 600;
            border: none;
            white-space: nowrap;
            color: var(--table-header-text);
        }

        .movements-table tbody tr {
            border-bottom: 1px solid var(--table-row-border);
            transition: all 0.3s ease;
            background-color: var(--table-row-bg);
        }

        .movements-table tbody tr:hover {
            background: var(--table-row-hover-bg);
            transform: scale(1.005);
        }

        .movements-table tbody tr:last-child {
            border-bottom: none;
        }

        .movements-table tbody td {
            padding: var(--table-cell-padding);
            text-align: right;
            color: var(--text-main);
            vertical-align: middle;
        }

        .movements-table tbody td:first-child {
            font-weight: 600;
            color: var(--text-main);
            background-color: var(--bg-main);
            width: 60px;
            text-align: center;
        }

        /* Responsive table styles */
        @media (max-width: 768px) {
            .movements-table-wrapper {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .movements-table {
                min-width: 700px;
                font-size: 12px;
            }
            
            .movements-table thead th {
                padding: 10px 6px;
                font-size: 11px;
            }
            
            .movements-table tbody td {
                padding: 8px 6px;
                font-size: 12px;
            }
        }

        @media (max-width: 480px) {
            .movements-table {
                min-width: 600px;
                font-size: 11px;
            }
            
            .movements-table thead th {
                padding: 8px 4px;
                font-size: 10px;
            }
            
            .movements-table tbody td {
                padding: 6px 4px;
                font-size: 11px;
            }
            
            .movements-table tbody td:first-child {
                width: 40px;
            }
        }

        /* Clickable row styles */
        .clickable-row {
            cursor: pointer;
            transition: background-color 0.2s ease;
        }

        .clickable-row:hover {
            background-color: var(--surface-hover, rgba(0, 0, 0, 0.05));
        }

        .customer-row:hover,
        .product-row:hover,
        .production-cost-row:hover,
        .notes-row:hover {
            background-color: var(--surface-hover, rgba(0, 0, 0, 0.05));
        }

        /* Dropdown Menu Styles */
        .dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: var(--surface-main);
            border: 1px solid var(--border-main);
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            z-index: 1000;
            min-width: 180px;
            animation: fadeInDown 0.3s ease;
            padding: 8px 0;
            margin-top: 4px;
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            text-align: right;
            padding: 10px 16px;
            border: none;
            background: none;
            cursor: pointer;
            font-size: 14px;
            color: var(--text-main);
            transition: all 0.2s ease;
        }

        .dropdown-item:hover {
            background: var(--bg-main);
            color: var(--primary);
            transform: translateX(-3px);
        }

        .dropdown-item:active {
            transform: translateX(-1px) scale(0.98);
        }

        .dropdown-item img {
            width: 14px;
            height: 14px;
            object-fit: contain;
            opacity: 0.8;
            transition: opacity 0.2s ease;
        }

        .dropdown-item:hover img {
            opacity: 1;
        }

        /* Mobile Responsive for Dropdown */
        @media (max-width: 768px) {
            .dropdown-menu {
                position: fixed;
                top: auto;
                bottom: 70px;
                left: 5px;
                right: 5px;
                width: auto;
                min-width: calc(100vw - 10px);
                max-width: 300px;
                border-radius: 12px;
                box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
                animation: slideUpMobile 0.3s ease;
            }
            
            .dropdown-item {
                padding: 12px 16px;
                font-size: 15px;
            }
            
            .dropdown-item img {
                width: 16px;
                height: 16px;
            }
        }
