﻿        :root {
            --primary: #0078B7;
            --primary-dark: #005a87;
            --secondary: #10b981;
            --success: #10b981;
            --light: #f8f9fa;
            --dark: #212529;
            --danger: #ef4444;
            --warning: #f59e0b;
            --info: #3b82f6;
            --font-family: 'Cairo', sans-serif;
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12);
        }
        * {
            box-sizing: border-box;
            font-family: var(--font-family);
            transition: var(--transition);
        }
        body {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            color: #333;
            min-height: 100vh;
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            touch-action: manipulation;
        }
        .auth-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: fadeIn 0.8s ease-out;
        }
        .auth-card {
            background: white;
            border-radius: 20px;
            box-shadow: var(--shadow);
            padding: 2rem;
            width: 100%;
            max-width: 450px;
            border: 1px solid rgba(0, 120, 183, 0.1);
        }
        .logo {
            text-align: center;
            margin-bottom: 1.5rem;
        }
        .logo img {
            width: 120px;
            height: auto;
            margin-bottom: 1rem;
            transition: var(--transition);
        }
        .password-container {
            position: relative;
        }
        .password-input-container {
            position: relative;
        }
        .password-toggle {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: #666;
            font-size: 1rem;
            user-select: none;
            padding: 0 5px;
            z-index: 2;
        }
        .password-toggle:hover {
            color: var(--primary);
        }
        .form-control {
            padding-left: 35px !important;
            border-radius: 10px;
            padding: 0.75rem 1rem;
            border: 2px solid #e9ecef;
            transition: var(--transition);
        }
        .dashboard {
            min-height: 100vh;
            background: #f8f9fa;
            display: flex;
        }
        .sidebar {
            background: linear-gradient(180deg, var(--primary), var(--primary-dark));
            color: white;
            min-height: 100vh;
            padding: 0;
            box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
            width: 280px;
            z-index: 1000;
            position: fixed;
            top: 0;
            right: 0;
            transition: transform 0.3s ease;
            overflow-y: auto;
            max-height: 100vh;
        }
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(100%);
            }
            .sidebar.active {
                transform: translateX(0);
            }
        }
        .sidebar-header {
            padding: 1.5rem;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            background: rgba(0, 0, 0, 0.1);
            position: relative;
        }
        .close-sidebar {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: white;
            font-size: 1.2rem;
            display: none;
            cursor: pointer;
            padding: 8px;
            border-radius: 5px;
        }
        .close-sidebar:hover {
            background: rgba(255, 255, 255, 0.1);
        }
        @media (max-width: 768px) {
            .close-sidebar {
                display: block;
            }
        }
        .sidebar-menu {
            list-style: none;
            padding: 1rem 0;
            margin: 0;
        }
        .sidebar-menu li {
            padding: 0;
            margin: 0.2rem 0;
        }
        .sidebar-menu a {
            display: flex;
            align-items: center;
            padding: 1rem 1.5rem;
            color: white;
            text-decoration: none;
            border-radius: 8px;
            margin: 0.2rem;
            transition: var(--transition);
            border-left: 4px solid transparent;
        }
        .sidebar-menu a:hover, .sidebar-menu a.active {
            background: rgba(255, 255, 255, 0.15);
            border-left: 4px solid white;
        }
        .sidebar-menu i {
            margin-right: 10px;
            font-size: 1.1rem;
            min-width: 24px;
            text-align: center;
        }
        .main-content {
            padding: 1rem;
            background: #f8f9fa;
            width: 100%;
            flex: 1;
            margin-right: 280px;
            transition: margin-right 0.3s ease;
        }
        @media (max-width: 768px) {
            .main-content {
                margin-right: 0;
            }
        }
        .header {
            background: white;
            padding: 1.2rem;
            border-radius: 15px;
            box-shadow: var(--shadow);
            margin-bottom: 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--primary);
            padding: 8px;
            border-radius: 8px;
            transition: var(--transition);
            cursor: pointer;
        }
        .mobile-menu-btn:active {
            background-color: rgba(0, 120, 183, 0.1);
        }
        @media (max-width: 768px) {
            .mobile-menu-btn {
                display: block;
            }
        }
        .stats-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
        }
        .stats-card:hover {
            box-shadow: var(--shadow-hover);
        }
        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 10px;
            font-weight: 600;
            transition: var(--transition);
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 120, 183, 0.4);
        }
        .btn-primary:active {
            transform: translateY(0);
        }
        .btn-danger {
            background: var(--danger);
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 10px;
            font-weight: 600;
            transition: var(--transition);
        }
        .btn-danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
        }
        .table th {
            border-top: none;
            font-weight: 700;
            background: rgba(0, 120, 183, 0.05);
        }
        .user-info {
            display: flex;
            align-items: center;
            background: rgba(0, 120, 183, 0.1);
            padding: 0.5rem 1rem;
            border-radius: 50px;
            transition: var(--transition);
        }
        .user-info:hover {
            background: rgba(0, 120, 183, 0.2);
        }
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 10px;
            font-weight: bold;
            font-size: 1.1rem;
            transition: var(--transition);
        }
        .loading {
            text-align: center;
            padding: 2rem;
            color: #666;
        }
        .alert {
            border-radius: 12px;
            border: none;
            padding: 1rem 1.5rem;
        }
        .password-requirements {
            font-size: 0.85rem;
            color: #666;
            margin-top: 0.5rem;
        }
        .requirement {
            display: flex;
            align-items: center;
            margin: 0.3rem 0;
        }
        .requirement i {
            margin-left: 0.5rem;
            font-size: 0.8rem;
        }
        .valid {
            color: #10b981;
        }
        .invalid {
            color: #ef4444;
        }
        .tab-content {
            animation: fadeIn 0.5s ease;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .report-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }
        .report-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
        }
        .report-card:hover {
            box-shadow: var(--shadow-hover);
        }
        .export-btn {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .report-header {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            padding: 1.5rem;
            border-radius: 15px;
            margin-bottom: 1.5rem;
        }
        .report-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .summary-card {
            flex: 1;
            min-width: 200px;
            background: white;
            border-radius: 10px;
            padding: 1.2rem;
            box-shadow: var(--shadow);
            text-align: center;
        }
        .summary-card h5 {
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            color: #666;
        }
        .summary-card .value {
            font-size: 1.5rem;
            font-weight: bold;
        }
        .summary-card.deposits .value {
            color: #10b981;
        }
        .summary-card.withdrawals .value {
            color: #ef4444;
        }
        .summary-card.net .value {
            color: var(--primary);
        }
        .summary-card.count .value {
            color: #f59e0b;
        }
        .report-details {
            background: white;
            border-radius: 15px;
            padding: 1.5rem;
            box-shadow: var(--shadow);
        }
        .report-table {
            width: 100%;
            border-collapse: collapse;
        }
        .report-table th, .report-table td {
            padding: 0.8rem;
            border-bottom: 1px solid #eee;
            text-align: right;
        }
        .report-table th {
            background-color: #f8f9fa;
            font-weight: 600;
        }
        .report-table tr:hover {
            background-color: #f8f9fa;
        }
        .empty-report {
            text-align: center;
            padding: 2rem;
            color: #666;
        }
        .report-period {
            font-size: 1.1rem;
            margin-bottom: 1rem;
            color: #666;
        }
        .dashboard-top-section {
            margin-bottom: 2rem;
        }
        .dashboard-sales-section {
            margin-top: 2rem;
        }
        .dashboard-alerts-section {
            margin-top: 2rem;
        }
        .whatsapp-export-btn {
            background-color: #25D366;
            border-color: #25D366;
        }
        .whatsapp-export-btn:hover {
            background-color: #128C7E;
            border-color: #128C7E;
        }
        @media (max-width: 1200px) {
            .sidebar {
                width: 250px;
            }
            .main-content {
                margin-right: 250px;
            }
        }
        @media (max-width: 992px) {
            .sidebar {
                width: 220px;
            }
            .main-content {
                margin-right: 220px;
            }
        }
        @media (max-width: 768px) {
            .main-content {
                margin-right: 0;
            }
            .header {
                padding: 1rem;
            }
            .auth-card {
                padding: 1.5rem;
            }
            .stats-card {
                padding: 1.2rem;
            }
            .user-info {
                padding: 0.4rem 0.8rem;
            }
            .user-avatar {
                width: 35px;
                height: 35px;
                font-size: 1rem;
            }
            .logo img {
                width: 100px;
            }
            .table-responsive {
                font-size: 0.9rem;
            }
            .btn {
                padding: 0.75rem 1rem;
                min-height: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            .sidebar-menu a {
                padding: 1rem 1.2rem;
                min-height: 54px;
            }
            .report-summary {
                flex-direction: column;
            }
            .summary-card {
                min-width: 100%;
            }
        }
        @media (max-width: 576px) {
            .auth-card {
                padding: 1.2rem;
                border-radius: 15px;
            }
            .header {
                flex-direction: column;
                align-items: flex-start;
            }
            .user-info {
                align-self: flex-end;
            }
            .stats-card {
                padding: 1rem;
            }
            .btn {
                padding: 0.6rem 1.2rem;
                font-size: 0.9rem;
            }
            .form-control {
                padding: 0.6rem 0.8rem;
            }
            .mobile-menu-btn {
                padding: 6px;
                font-size: 1.3rem;
            }
        }
        @media (max-width: 400px) {
            .auth-container {
                padding: 10px;
            }
            .auth-card {
                padding: 1rem;
            }
            .logo img {
                width: 80px;
            }
            .stats-card {
                padding: 0.8rem;
            }
            .btn {
                padding: 0.5rem 1rem;
                font-size: 0.85rem;
            }
        }
        @media (max-height: 500px) and (orientation: landscape) {
            .auth-container {
                padding: 10px;
                align-items: flex-start;
            }
            .auth-card {
                padding: 1rem;
                margin-top: 10px;
                margin-bottom: 10px;
            }
            .logo {
                margin-bottom: 1rem;
            }
            .logo img {
                width: 70px;
            }
        }
        @media (prefers-color-scheme: dark) {
            .dashboard {
                background: #121212;
                color: #e0e0e0;
            }
            .header, .stats-card {
                background: #1e1e1e;
                color: #e0e0e0;
            }
            .table {
                color: #e0e0e0;
            }
            .table th {
                background: rgba(0, 120, 183, 0.1);
            }
            .form-control {
                background: #2d2d2d;
                border-color: #444;
                color: #e0e0e0;
            }
            .form-control:focus {
                background: #2d2d2d;
                color: #e0e0e0;
            }
        }
        .btn, .sidebar-menu a, .mobile-menu-btn, .close-sidebar {
            -webkit-tap-highlight-color: transparent;
            cursor: pointer;
        }
        .btn:active, .sidebar-menu a:active, .mobile-menu-btn:active {
            transform: scale(0.98);
        }
        .animate__animated {
            animation-duration: 0.6s;
        }
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        .pulse-animation {
            animation: pulse 2s infinite;
        }
        .tab-content {
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .tab-content.active {
            opacity: 1;
        }
        .main-content {
            overflow: hidden;
        }
        .confirmation-modal {
            background: white;
            border-radius: 15px;
            padding: 2rem;
            max-width: 400px;
            margin: 0 auto;
            box-shadow: var(--shadow-hover);
        }
        .confirmation-modal h5 {
            margin-bottom: 1.5rem;
            color: var(--dark);
        }
        .confirmation-modal .btn {
            min-width: 100px;
        }
        .client-type-badge {
            padding: 0.35rem 0.75rem;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
        }
        .client-postponed {
            background-color: rgba(255, 193, 7, 0.15);
            color: #f59e0b;
        }
        .client-paid {
            background-color: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }
        .client-search {
            margin-bottom: 1rem;
        }
        .client-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }
        
        /* تحسينات لواجهة عرض المعاملات */
        .recent-transactions-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
            height: 100%;
        }
        .recent-transactions-card:hover {
            box-shadow: var(--shadow-hover);
        }
        .recent-transactions-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid #eee;
            padding-bottom: 1rem;
        }
        .recent-transactions-header h5 {
            margin: 0;
            color: var(--primary);
            font-weight: 700;
        }
        .recent-transactions-table {
            width: 100%;
            border-collapse: collapse;
        }
        .recent-transactions-table th {
            background-color: #f8f9fa;
            color: #666;
            font-weight: 600;
            padding: 0.8rem;
            border-bottom: 1px solid #eee;
            text-align: right;
            font-size: 0.9rem;
        }
        .recent-transactions-table td {
            padding: 0.8rem;
            border-bottom: 1px solid #f5f5f5;
            text-align: right;
            font-size: 0.9rem;
        }
        .recent-transactions-table tr:last-child td {
            border-bottom: none;
        }
        .recent-transactions-table tr:hover {
            background-color: #f8f9fa;
        }
        .transaction-amount {
            font-weight: 600;
        }
        .transaction-amount.deposit {
            color: #10b981;
        }
        .transaction-amount.withdraw {
            color: #ef4444;
        }
        .transaction-date {
            color: #666;
            font-size: 0.85rem;
        }
        .no-transactions {
            text-align: center;
            padding: 2rem;
            color: #666;
        }
        .no-transactions i {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        .transaction-status {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 0.3rem 0.7rem;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
        }
        .transaction-status.pending {
            background-color: rgba(255, 193, 7, 0.15);
            color: #f59e0b;
        }
        .transaction-status.completed {
            background-color: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }
        .transaction-client {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .transaction-client-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: bold;
        }
        
        /* إضافة أنماط جديدة لحذف المعاملات */
        .transaction-actions {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }
        .transaction-actions .btn {
            padding: 0.3rem 0.6rem;
            font-size: 0.8rem;
        }
        .bulk-actions {
            display: flex;
            gap: 10px;
            align-items: center;
            margin-bottom: 1rem;
            padding: 1rem;
            background: #f8f9fa;
            border-radius: 10px;
        }
        .select-all-checkbox {
            margin-left: 10px;
        }
        .transaction-checkbox {
            margin-left: 10px;
        }
        .selected-count {
            font-weight: bold;
            color: var(--primary);
        }

        /* أنماط جديدة للمنتجات والمبيعات */
        .product-actions {
            display: flex;
            gap: 5px;
            flex-wrap: nowrap;
            justify-content: flex-end;
        }
        .product-actions .btn {
            flex-shrink: 0;
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
        }
        .sale-item {
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 10px;
            margin-bottom: 10px;
            background: #f9f9f9;
        }
        .sale-summary {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            margin-top: 15px;
        }
        .product-search-results {
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #ddd;
            border-radius: 8px;
            background: white;
            position: absolute;
            width: 100%;
            z-index: 1000;
            display: none;
        }
        .product-search-item {
            padding: 10px;
            border-bottom: 1px solid #eee;
            cursor: pointer;
        }
        .product-search-item:hover {
            background: #f0f0f0;
        }
        .sale-status-badge {
            padding: 0.35rem 0.75rem;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
        }
        .sale-cash {
            background-color: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }
        .sale-postponed {
            background-color: rgba(255, 193, 7, 0.15);
            color: #f59e0b;
        }
        .sale-returned {
            background-color: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }
        
        /* تحسينات لقسمي المنتجات والمبيعات */
        .section-header {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            padding: 1.5rem;
            border-radius: 15px;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow);
        }
        .section-header h2 {
            margin: 0;
            font-weight: 700;
        }
        .card-header.bg-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
        }
        
        /* تحسينات لتقارير المبيعات */
        .sales-report-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }
        .sales-report-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
        }
        .sales-report-card:hover {
            box-shadow: var(--shadow-hover);
        }
        .sales-summary-card {
            flex: 1;
            min-width: 200px;
            background: white;
            border-radius: 10px;
            padding: 1.2rem;
            box-shadow: var(--shadow);
            text-align: center;
            border-top: 4px solid var(--primary);
        }
        .sales-summary-card h5 {
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            color: #666;
        }
        .sales-summary-card .value {
            font-size: 1.5rem;
            font-weight: bold;
        }
        .sales-summary-card.total .value {
            color: var(--primary);
        }
        .sales-summary-card.cash .value {
            color: #10b981;
        }
        .sales-summary-card.postponed .value {
            color: #f59e0b;
        }
        .sales-summary-card.returned .value {
            color: #ef4444;
        }
        .sales-summary-card.count .value {
            color: #3b82f6;
        }
        .sales-summary-card.products .value {
            color: #8b5cf6;
        }
        /* إضافة أنماط للخصم */
        .discount-section {
            background: #fff8e1;
            border-radius: 8px;
            padding: 15px;
            margin-top: 15px;
            border: 1px solid #ffd54f;
        }
        .discount-badge {
            background-color: rgba(255, 152, 0, 0.15);
            color: #f57c00;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        /* إحصائيات المنتجات */
        .product-stats-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            text-align: center;
            border-top: 4px solid var(--primary);
            transition: var(--transition);
        }
        .product-stats-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        .product-stats-icon {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            color: var(--primary);
        }
        .product-stats-value {
            font-size: 2rem;
            font-weight: bold;
            margin: 0.5rem 0;
            color: var(--primary);
        }
        .product-stats-label {
            font-size: 1rem;
            color: #666;
        }
        
        /* أنماط جديدة للفواتير */
        .invoice-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
        }
        .invoice-card:hover {
            box-shadow: var(--shadow-hover);
        }
        .invoice-header {
            border-bottom: 2px solid #0078B7;
            padding-bottom: 1rem;
            margin-bottom: 1.5rem;
        }
        .invoice-header h3 {
            color: #0078B7;
            margin-bottom: 0.5rem;
        }
        .invoice-details {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 1rem;
            margin-bottom: 1.5rem;
        }
        .invoice-items-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 1.5rem;
        }
        .invoice-items-table th {
            background: #e9ecef;
            padding: 0.8rem;
            text-align: right;
            font-weight: 600;
        }
        .invoice-items-table td {
            padding: 0.8rem;
            border-bottom: 1px solid #dee2e6;
            text-align: right;
        }
        .invoice-total {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 1rem;
            margin-top: 1.5rem;
        }
        .total-row {
            display: flex;
            justify-content: space-between;
            font-weight: 600;
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
        }
        .total-amount {
            color: #0078B7;
            font-size: 1.2rem;
        }
        .print-invoice-btn {
            background: linear-gradient(135deg, #10b981, #0ca678);
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 10px;
            color: white;
            font-weight: 600;
            transition: var(--transition);
        }
        .print-invoice-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
        }
        
        /* تحسينات إضافية للفواتير */
        .invoices-table-container {
            position: relative;
            overflow: hidden;
        }
        
        .invoices-table-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
            margin-bottom: 1rem;
            position: relative;
        }
        
        /* تحسينات جدول الفواتير */
        #invoices-table {
            min-width: 1200px;
            margin-bottom: 0;
        }
        
        #invoices-table th {
            white-space: nowrap;
            position: sticky;
            top: 0;
            background: #f8f9fa;
            z-index: 10;
        }
        
        #invoices-table td {
            vertical-align: middle;
        }
        
        .invoice-actions-cell {
            min-width: 300px;
            white-space: nowrap;
        }
        
        .invoice-actions-buttons {
            display: flex;
            gap: 5px;
            flex-wrap: nowrap;
            justify-content: flex-end;
        }
        
        .invoice-actions-buttons .btn {
            flex-shrink: 0;
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
        }

        .input-with-addon .input-group-text {
            min-width: 64px;
            justify-content: center;
            font-weight: 600;
        }
        .input-with-addon .form-control {
            padding-right: 0.75rem;
            padding-left: 0.75rem !important;
        }

        /* تحسينات جدول المبيعات (تمرير أفقي وتنظيم) */
        .sales-table-container {
            position: relative;
            overflow: hidden;
        }
        .sales-table-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
            margin-bottom: 1rem;
            position: relative;
        }
        #sales-table {
            min-width: 1100px;
            margin-bottom: 0;
        }
        #sales-table th {
            white-space: nowrap;
            position: sticky;
            top: 0;
            background: #f8f9fa;
            z-index: 10;
        }
        
        /* تحسينات الطباعة - تم التعديل لضمان طباعة صفحة واحدة */
        @media print {
            body * {
                visibility: hidden;
                margin: 0 !important;
                padding: 0 !important;
            }
            
            .invoice-print-container,
            .invoice-print-container * {
                visibility: visible;
            }
            
            .invoice-print-container {
                position: absolute;
                left: 0;
                top: 0;
                width: 100% !important;
                height: auto !important;
                max-height: none !important;
                background: white;
                color: black;
                padding: 10mm !important;
                box-shadow: none;
                font-size: 12pt !important;
                page-break-inside: avoid !important;
                page-break-after: avoid !important;
            }
            
            .no-print {
                display: none !important;
            }
            
            .print-btn {
                display: none !important;
            }
            
            .modal-backdrop {
                display: none !important;
            }
            
            .modal {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                width: 100% !important;
                height: 100% !important;
                margin: 0 !important;
                padding: 0 !important;
                background: white !important;
                box-shadow: none !important;
                overflow: visible !important;
            }
            
            .modal-dialog {
                max-width: 100% !important;
                margin: 0 !important;
                width: 100% !important;
                height: 100% !important;
            }
            
            .modal-content {
                border: none !important;
                box-shadow: none !important;
                height: 100% !important;
                background: transparent !important;
                overflow: visible !important;
            }
            
            .modal-header, .modal-footer {
                display: none !important;
            }
            
            .modal-body {
                padding: 0 !important;
                background: white !important;
                height: 100% !important;
                overflow: visible !important;
            }
            
            .btn {
                display: none !important;
            }
            
            .table {
                page-break-inside: auto !important;
            }
            
            tr {
                page-break-inside: avoid !important;
                page-break-after: auto !important;
            }
            
            /* إضافة خاصية لمنع تقسيم الفاتورة */
            .invoice-print-container {
                page-break-inside: avoid !important;
                page-break-after: avoid !important;
            }
            
            /* تقليل الهوامش وتكبير الخطوط */
            @page {
                margin: 5mm !important;
                size: A4 portrait;
            }
            
            /* تكبير الخطوط قليلاً للطباعة */
            .invoice-print-container h1 {
                font-size: 20pt !important;
                margin-bottom: 10px !important;
            }
            
            .invoice-print-container h2, .invoice-print-container h3 {
                font-size: 16pt !important;
                margin-bottom: 8px !important;
            }
            
            .invoice-print-container p, .invoice-print-container td, .invoice-print-container th {
                font-size: 10pt !important;
                line-height: 1.2 !important;
            }
            
            /* تقليل حجم الجدول */
            .invoice-items-table th,
            .invoice-items-table td {
                padding: 4px !important;
                font-size: 9pt !important;
            }
            
            /* تقليل حجم الهوامش في الفاتورة */
            .invoice-header,
            .invoice-info,
            .invoice-footer {
                padding: 8px !important;
                margin-bottom: 10px !important;
            }
            
            /* تقليل حجم الخطوط في التذييل */
            .invoice-footer p {
                font-size: 8pt !important;
                margin: 2px 0 !important;
            }
        }
        
        .print-section {
            font-family: 'Cairo', sans-serif;
        }
        
        /* تحسينات خاصة للطباعة في المودال */
        .invoice-print-container {
            max-width: 190mm; /* أقل من A4 بقليل */
            min-height: auto; /* إزالة الارتفاع الثابت */
            margin: 0 auto;
            padding: 15px;
            background: white;
            color: black;
            font-family: 'Cairo', sans-serif;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            page-break-inside: avoid;
        }
        
        /* تنسيق زر الطباعة في المودال */
        #print-invoice-btn {
            position: relative;
            z-index: 1000;
        }
        
        /* تصميم مضغوط للطباعة */
        .compact-table {
            font-size: 9pt;
        }
        
        .compact-table th,
        .compact-table td {
            padding: 6px !important;
        }
        
        /* تحسينات الطباعة لضمان صفحة واحدة */
        .print-optimized {
            font-size: 10pt !important;
            line-height: 1.2 !important;
        }
        
        .print-optimized h1 {
            font-size: 18pt !important;
            margin: 10px 0 !important;
        }
        
        .print-optimized h2,
        .print-optimized h3 {
            font-size: 14pt !important;
            margin: 8px 0 !important;
        }
        
        .print-optimized .table th,
        .print-optimized .table td {
            padding: 4px !important;
            font-size: 9pt !important;
        }
        
        /* فاصل صفحات افتراضي */
        .page-break {
            page-break-before: always;
        }
        
        /* منع تقسيم الجداول */
        .no-break {
            page-break-inside: avoid;
        }
        
        /* سجل المبيعات اليومية - أنماط جديدة */
        .daily-sales-container {
            margin-top: 2rem;
        }
        
        .daily-sales-card {
            background: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
        }
        
        .daily-sales-card:hover {
            box-shadow: var(--shadow-hover);
        }
        
        .daily-sales-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            border-bottom: 2px solid var(--primary);
            padding-bottom: 1rem;
        }
        
        .daily-sales-header h5 {
            margin: 0;
            color: var(--primary);
            font-weight: 700;
        }
        
        .daily-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        
        .daily-summary-item {
            flex: 1;
            min-width: 180px;
            background: #f8f9fa;
            border-radius: 10px;
            padding: 1rem;
            text-align: center;
            border-top: 4px solid var(--primary);
        }
        
        .daily-summary-item h6 {
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            color: #666;
        }
        
        .daily-summary-item .value {
            font-size: 1.3rem;
            font-weight: bold;
        }
        
        .daily-summary-item.total .value {
            color: var(--primary);
        }
        
        .daily-summary-item.cash .value {
            color: #10b981;
        }
        
        .daily-summary-item.postponed .value {
            color: #f59e0b;
        }
        
        .daily-summary-item.clients .value {
            color: #3b82f6;
        }
        
        .daily-summary-item.products .value {
            color: #8b5cf6;
        }
        
        .daily-sales-table-container {
            max-height: 400px;
            overflow-y: auto;
        }
        
        .daily-sales-table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .daily-sales-table th {
            background-color: #f8f9fa;
            color: #666;
            font-weight: 600;
            padding: 0.8rem;
            border-bottom: 2px solid #eee;
            text-align: right;
            position: sticky;
            top: 0;
        }
        
        .daily-sales-table td {
            padding: 0.8rem;
            border-bottom: 1px solid #f5f5f5;
            text-align: right;
        }
        
        .daily-sales-table tr:hover {
            background-color: #f8f9fa;
        }
        
        .no-daily-sales {
            text-align: center;
            padding: 2rem;
            color: #666;
        }
        
        .no-daily-sales i {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        
        /* أنماط جديدة لعرض المنتجات في المبيعات والفواتير */
        .products-list-container {
            max-width: 300px;
        }
        
        .products-list {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 10px;
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #e9ecef;
        }
        
        .product-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 10px;
            margin-bottom: 6px;
            background: white;
            border-radius: 6px;
            border: 1px solid #e9ecef;
            transition: all 0.2s ease;
        }
        
        .product-item:hover {
            background: #f0f9ff;
            border-color: #b3e0ff;
        }
        
        .product-item:last-child {
            margin-bottom: 0;
        }
        
        .product-info {
            flex: 1;
        }
        
        .product-name {
            font-weight: 600;
            color: #333;
            font-size: 0.9rem;
            margin-bottom: 3px;
        }
        
        .product-details {
            display: flex;
            gap: 10px;
            font-size: 0.8rem;
            color: #666;
        }
        
        .product-code {
            background: #e9ecef;
            padding: 2px 6px;
            border-radius: 4px;
            font-family: monospace;
        }
        
        .product-quantity {
            color: var(--primary);
            font-weight: 600;
        }
        
        .product-price {
            color: var(--success);
            font-weight: 600;
        }
        
        .product-total {
            font-weight: 700;
            color: var(--primary-dark);
            font-size: 0.9rem;
            margin-top: 3px;
        }
        
        /* تم إزالة أنماط more-products */
        
        /* مودال عرض المنتجات */
        .products-modal-list {
            max-height: 400px;
            overflow-y: auto;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 8px;
            margin-top: 15px;
        }
        
        .product-modal-item {
            background: white;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 10px;
            border: 1px solid #e9ecef;
            transition: all 0.2s ease;
        }
        
        .product-modal-item:hover {
            border-color: #b3e0ff;
            box-shadow: 0 2px 8px rgba(0, 120, 183, 0.1);
        }
        
        .product-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        
        .product-modal-name {
            font-weight: 700;
            color: #333;
            font-size: 1rem;
        }
        
        .product-modal-code {
            background: var(--primary);
            color: white;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-family: monospace;
        }
        
        .product-modal-details {
            display: flex;
            gap: 15px;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px dashed #e9ecef;
        }
        
        .product-modal-detail {
            flex: 1;
            text-align: center;
        }
        
        .product-modal-label {
            font-size: 0.8rem;
            color: #666;
            margin-bottom: 3px;
        }
        
        .product-modal-value {
            font-weight: 600;
            color: #333;
        }
        
        .product-modal-price {
            color: var(--success);
        }
        
        .product-modal-quantity {
            color: var(--warning);
        }
        
        .product-modal-total {
            color: var(--primary);
        }
        
        .no-products-message {
            text-align: center;
            padding: 20px;
            color: #666;
            font-style: italic;
        }
        
        /* أنماط إضافية للجدول */
        .table-products-column {
            min-width: 250px;
            max-width: 300px;
        }
        
        .products-preview {
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .products-preview:hover {
            transform: translateY(-2px);
        }
        
        /* تحسينات للعرض على الأجهزة المحمولة */
        @media (max-width: 768px) {
            .products-list-container {
                max-width: 100%;
            }
            
            .table-products-column {
                min-width: 200px;
            }
            
            .product-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 5px;
            }
            
            .product-details {
                flex-wrap: wrap;
                gap: 5px;
            }
        }
        
        /* أنماط جديدة للمنتجات التي على وشك النفاذ والمنتجات المنتهية */
        .stock-alert-card {
            border-radius: 15px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: var(--transition);
        }
        
        .low-stock-alert-card {
            background: linear-gradient(135deg, #fff3cd, #ffecb5);
            border: 2px solid #ffc107;
        }
        
        .out-of-stock-alert-card {
            background: linear-gradient(135deg, #f8d7da, #f5c6cb);
            border: 2px solid #dc3545;
        }
        
        .stock-alert-card:hover {
            box-shadow: var(--shadow-hover);
            transform: translateY(-2px);
        }
        
        .low-stock-alert-card:hover {
            box-shadow: 0 15px 35px rgba(255, 193, 7, 0.2);
        }
        
        .out-of-stock-alert-card:hover {
            box-shadow: 0 15px 35px rgba(220, 53, 69, 0.2);
        }
        
        .stock-alert-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
        }
        
        .low-stock-alert-header {
            border-bottom: 2px solid #ffc107;
        }
        
        .out-of-stock-alert-header {
            border-bottom: 2px solid #dc3545;
        }
        
        .stock-alert-header h5 {
            margin: 0;
            font-weight: 700;
        }
        
        .low-stock-alert-header h5 {
            color: #856404;
        }
        
        .out-of-stock-alert-header h5 {
            color: #721c24;
        }
        
        .stock-alert-icon {
            font-size: 1.5rem;
            animation: pulse 2s infinite;
        }
        
        .low-stock-alert-icon {
            color: #856404;
        }
        
        .out-of-stock-alert-icon {
            color: #721c24;
        }
        
        .stock-product-item {
            background: white;
            border-radius: 10px;
            padding: 1rem;
            margin-bottom: 0.75rem;
            transition: all 0.2s ease;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .low-stock-product-item {
            border-left: 4px solid #ffc107;
        }
        
        .out-of-stock-product-item {
            border-left: 4px solid #dc3545;
        }
        
        .stock-product-item:hover {
            transform: translateX(-5px);
        }
        
        .low-stock-product-item:hover {
            background: #fff9e6;
        }
        
        .out-of-stock-product-item:hover {
            background: #f8d7da;
        }
        
        .stock-product-info {
            flex: 1;
        }
        
        .stock-product-name {
            font-weight: 600;
            color: #333;
            font-size: 1rem;
            margin-bottom: 5px;
        }
        
        .stock-product-details {
            display: flex;
            gap: 15px;
            font-size: 0.85rem;
            color: #666;
        }
        
        .stock-product-code {
            background: #e9ecef;
            padding: 3px 8px;
            border-radius: 4px;
            font-family: monospace;
        }
        
        .stock-product-quantity {
            font-weight: 700;
            font-size: 1.1rem;
        }
        
        .low-stock-product-quantity {
            color: #dc3545;
        }
        
        .out-of-stock-product-quantity {
            color: #721c24;
        }
        
        .stock-product-price {
            color: #28a745;
            font-weight: 600;
        }
        
        .stock-product-actions {
            display: flex;
            gap: 8px;
        }
        
        .no-stock-alerts {
            text-align: center;
            padding: 2rem;
            color: #666;
        }
        
        .no-stock-alerts i {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        
        /* أنماط جديدة لحقول اللون والمقاس */
        .product-color-badge {
            display: inline-block;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 2px solid #dee2e6;
            margin-right: 5px;
            vertical-align: middle;
        }
        
        .product-size-badge {
            display: inline-block;
            padding: 2px 8px;
            background: #e9ecef;
            border-radius: 4px;
            font-size: 0.8rem;
            color: #495057;
            border: 1px solid #ced4da;
        }
        
        /* أنماط جديدة لرسائل التنبيه */
        .custom-alert {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 9999;
            min-width: 350px;
            max-width: 500px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            animation: slideInRight 0.5s ease-out;
            border: none;
            overflow: hidden;
        }
        
        .custom-alert.hide {
            animation: slideOutRight 0.5s ease-out forwards;
        }
        
        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
        
        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }
        
        .custom-alert-header {
            display: flex;
            align-items: center;
            padding: 1rem 1.5rem;
            color: white;
            font-weight: 600;
        }
        
        .custom-alert-danger .custom-alert-header {
            background: linear-gradient(135deg, #dc3545, #c82333);
        }
        
        .custom-alert-warning .custom-alert-header {
            background: linear-gradient(135deg, #ffc107, #e0a800);
        }
        
        .custom-alert-success .custom-alert-header {
            background: linear-gradient(135deg, #28a745, #1e7e34);
        }
        
        .custom-alert-icon {
            font-size: 1.5rem;
            margin-left: 10px;
        }
        
        .custom-alert-body {
            padding: 1.5rem;
            background: white;
            color: #333;
        }
        
        .custom-alert-body h5 {
            margin-bottom: 10px;
            color: #333;
            font-weight: 700;
        }
        
        .custom-alert-body p {
            margin-bottom: 15px;
            color: #666;
            line-height: 1.5;
        }
        
        .custom-alert-footer {
            padding: 1rem 1.5rem;
            background: #f8f9fa;
            border-top: 1px solid #dee2e6;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        
        /* زر التنبيه */
        .alert-btn {
            padding: 0.5rem 1.5rem;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s ease;
            border: none;
            cursor: pointer;
        }
        
        .alert-btn-danger {
            background: #dc3545;
            color: white;
        }
        
        .alert-btn-danger:hover {
            background: #c82333;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
        }
        
        .alert-btn-primary {
            background: #007bff;
            color: white;
        }
        
        .alert-btn-primary:hover {
            background: #0056b3;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
        }
        
        /* تحسين عرض التنبيهات في الشاشات الصغيرة */
        @media (max-width: 768px) {
            .custom-alert {
                min-width: 90%;
                right: 5%;
                left: 5%;
            }
        }
