/* IZGestia — css/style.css : tout le design de l'application */
        :root {
            --primary: #6366f1; --primary-dark: #16688A; --primary-light: #4FC6DF;
            --secondary: #0ea5e9; --secondary-dark: #0284c7;
            --success: #10b981; --success-dark: #059669;
            --warning: #f59e0b; --warning-dark: #d97706;
            --danger: #ef4444; --danger-dark: #dc2626;
            --info: #06b6d4; --dark: #1e293b; --darker: #0f172a;
            --light: #f8fafc; --gray: #64748b; --gray-light: #e2e8f0; --white: #ffffff;
            --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
            --gradient-secondary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
            --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
            --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #fcd34d 100%);
            --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 50%, #fca5a5 100%);
            --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; background: var(--gradient-primary); color: var(--dark); min-height: 100vh; }
        .container { max-width: 1400px; margin: 0 auto; padding: 20px; }
        .main-card { background: var(--white); border-radius: 24px; box-shadow: var(--shadow-xl); overflow: hidden; min-height: 90vh; border: 1px solid rgba(255, 255, 255, 0.2); }
        .header { background: var(--gradient-dark); color: var(--white); padding: 35px; text-align: center; position: relative; overflow: hidden; }
        .header::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 30%, rgba(99, 102, 241, 0.1) 50%, rgba(139, 92, 246, 0.1) 70%, transparent 90%); }
        
        .title-container { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 15px; position: relative; z-index: 2; }
        .electric-logo { font-size: 4.5rem; animation: logoFloat 3s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5)); position: relative; }
        .electric-logo i { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        @keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
        .header h1 { font-size: 3.2rem; margin: 0; font-weight: 800; background: linear-gradient(135deg, #a78bfa, #c084fc, #e879f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: 3px; text-transform: uppercase; }
        .header .subtitle { font-size: 1.1rem; opacity: 0.9; margin-top: 10px; position: relative; z-index: 2; color: #94a3b8; font-weight: 300; letter-spacing: 2px; }
        .nav-tabs { display: flex; background: var(--white); border-bottom: 2px solid var(--gray-light); padding: 0 20px; flex-wrap: wrap; gap: 5px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
        .nav-tab { padding: 16px 20px; background: none; border: none; font-size: 0.9rem; font-weight: 600; color: var(--gray); cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 8px; white-space: nowrap; position: relative; border-radius: 8px 8px 0 0; flex-shrink: 0; }
        .nav-tab i { font-size: 1.1rem; transition: transform 0.3s ease; }
        .nav-tab:hover { color: var(--primary); background: linear-gradient(to top, rgba(99, 102, 241, 0.05), transparent); }
        .nav-tab:hover i { transform: translateY(-2px); }
        .nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: linear-gradient(to top, rgba(99, 102, 241, 0.1), transparent); }
        .content { padding: 30px; background: var(--light); }
        .section { display: none; animation: fadeIn 0.4s ease; }
        .section.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
        h2 { color: var(--dark); font-size: 1.8rem; font-weight: 700; margin-bottom: 25px; display: flex; align-items: center; gap: 12px; border-left: 5px solid var(--primary); padding-left: 20px; }
        h2 i { color: var(--primary); background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        h3 { color: var(--dark); font-size: 1.3rem; font-weight: 600; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
        .btn { padding: 12px 24px; border: none; border-radius: 12px; cursor: pointer; font-size: 0.95rem; font-weight: 600; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-flex; align-items: center; gap: 10px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
        .btn::before { content: ""; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transform: translate(-50%, -50%); transition: width 0.5s, height 0.5s; }
        .btn:hover::before { width: 300px; height: 300px; }
        .btn:active { transform: scale(0.97); }
        .btn-primary { background: var(--gradient-primary); color: var(--white); box-shadow: var(--shadow-md), var(--shadow-glow); }
        .btn-success { background: var(--gradient-success); color: var(--white); box-shadow: var(--shadow-md), 0 0 20px rgba(16, 185, 129, 0.2); }
        .btn-danger { background: var(--gradient-danger); color: var(--white); box-shadow: var(--shadow-md), 0 0 20px rgba(239, 68, 68, 0.2); }
        .btn-warning { background: var(--gradient-warning); color: var(--dark); box-shadow: var(--shadow-md); }
        .btn-secondary { background: var(--gradient-dark); color: var(--white); }
        .btn-info { background: var(--gradient-secondary); color: var(--white); box-shadow: var(--shadow-md); }
        .btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 8px; }
        .btn-xs { padding: 4px 10px; font-size: 0.7rem; border-radius: 6px; }
        .form-container { background: var(--white); padding: 30px; border-radius: 20px; margin-bottom: 30px; border: 1px solid var(--gray-light); box-shadow: var(--shadow-md); }
        .form-group { margin-bottom: 20px; position: relative; }
        .form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--dark); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 2px solid var(--gray-light); border-radius: 12px; font-size: 1rem; transition: all 0.3s; background: var(--white); color: var(--dark); }
        .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
        .form-row { display: flex; gap: 20px; margin-bottom: 20px; }
        .form-row .form-group { flex: 1; }
        .suggestions-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border: 2px solid var(--primary); border-top: none; border-radius: 0 0 12px 12px; max-height: 250px; overflow-y: auto; z-index: 100; display: none; box-shadow: var(--shadow-lg); }
        .suggestions-dropdown.show { display: block; }
        .suggestions-dropdown .suggestion-item { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--gray-light); font-size: 0.9rem; transition: background 0.2s; }
        .suggestions-dropdown .suggestion-item:hover { background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1)); }
        .suggestions-dropdown .suggestion-item:last-child { border-bottom: none; }
        .suggestions-dropdown .suggestion-item .sugg-reference { color: var(--primary); font-weight: 600; font-size: 0.8rem; }
        .suggestions-dropdown .suggestion-item .sugg-stock { color: var(--gray); font-size: 0.75rem; float: right; }
        .table-container { background: var(--white); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-md); margin-top: 20px; border: 1px solid var(--gray-light); }
        .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
        table { width: 100%; border-collapse: collapse; min-width: 600px; }
        th { background: var(--gradient-dark); color: var(--white); padding: 16px 20px; text-align: left; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
        td { padding: 14px 20px; border-bottom: 1px solid var(--gray-light); color: var(--dark); }
        tr { transition: background 0.2s ease; }
        tr:hover { background: linear-gradient(to right, rgba(99, 102, 241, 0.03), transparent); }
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; margin-bottom: 35px; }
        .stat-card { background: var(--white); padding: 30px 25px; border-radius: 20px; box-shadow: var(--shadow-md); text-align: center; border: none; position: relative; overflow: hidden; transition: all 0.3s ease; }
        .stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--gradient-primary); }
        .stat-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
        .stat-value { font-size: 2.8rem; font-weight: 800; background: linear-gradient(135deg, var(--dark), var(--primary-dark)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        .stat-unit { font-size: 0.9rem; color: var(--gray); margin-left: 5px; font-weight: 400; }
        .alert { padding: 18px 25px; border-radius: 16px; margin-bottom: 25px; display: flex; align-items: flex-start; gap: 18px; border: none; position: relative; overflow: hidden; box-shadow: var(--shadow-md); flex-wrap: wrap; }
        .alert-warning { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-left: 6px solid var(--warning); color: #92400e; }
        .alert-danger { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-left: 6px solid var(--danger); color: #991b1b; }
        .alert-info { background: linear-gradient(135deg, #eff6ff, #dbeafe); border-left: 6px solid var(--info); color: #1e3a8a; }
        .alert-critical { background: linear-gradient(135deg, #fee2e2, #fecaca); border-left: 6px solid var(--danger); color: #991b1b; animation: alertPulse 1s ease-in-out 3; }
        .alert-fournisseur { background: linear-gradient(135deg, #fff7ed, #ffedd5); border-left: 6px solid #f97316; color: #7c2d12; }
        @keyframes alertPulse { 0%, 100% { box-shadow: var(--shadow-md); } 50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.5); } }
        .progress-container { margin: 25px 0; }
        .progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; color: var(--dark); }
        .progress-bar { height: 12px; background: var(--gray-light); border-radius: 100px; overflow: hidden; }
        .progress-fill { height: 100%; background: var(--gradient-primary); border-radius: 100px; transition: width 0.5s ease; }
        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px); z-index: 1000; align-items: flex-start; justify-content: center; padding: 15px; overflow-y: auto; }
        .modal-content { background: var(--white); border-radius: 28px; padding: 35px; width: 90%; max-width: 800px; position: relative; animation: modalSlideIn 0.3s ease; box-shadow: var(--shadow-xl); max-height: 90vh; overflow-y: auto; margin: 20px auto; }
        @keyframes modalSlideIn { from { opacity: 0; transform: translateY(-30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
        .close { position: absolute; right: 25px; top: 25px; font-size: 28px; cursor: pointer; color: var(--gray); transition: all 0.3s; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--light); }
        .close:hover { color: var(--danger); background: #fee2e2; transform: rotate(90deg); }
        .login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--gradient-primary); }
        .login-box { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); padding: 45px; border-radius: 32px; width: 100%; max-width: 450px; box-shadow: var(--shadow-xl); text-align: center; border: 1px solid rgba(255, 255, 255, 0.3); }
        .login-box h2 { color: var(--primary); margin-bottom: 10px; font-size: 2.2rem; border: none; padding: 0; justify-content: center; }
        .login-box p { color: var(--gray); margin-bottom: 35px; }
        .login-box input { width: 100%; padding: 16px 18px; margin-bottom: 20px; border: 2px solid var(--gray-light); border-radius: 16px; font-size: 1rem; transition: all 0.3s; background: var(--white); }
        .login-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
        .stock-light { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 10px; vertical-align: middle; box-shadow: 0 0 6px currentColor; }
        .stock-light.red { background: var(--danger); color: var(--danger); box-shadow: 0 0 6px var(--danger); }
        .stock-light.green { background: var(--success); color: var(--success); box-shadow: 0 0 6px var(--success); }
        
        .price { font-weight: 700; color: var(--success-dark); }
        .price::after { content: " DH"; font-size: 0.85em; opacity: 0.7; }
        #notification { position: fixed; top: 20px; right: 20px; padding: 16px 28px; border-radius: 16px; color: var(--white); z-index: 1000; display: none; animation: slideIn 0.3s ease; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 90vw; }
        @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        @keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
        .payment-methods { display: flex; gap: 20px; margin-bottom: 25px; }
        .payment-method { flex: 1; padding: 20px; border: 2px solid var(--gray-light); border-radius: 20px; cursor: pointer; text-align: center; transition: all 0.3s; background: var(--white); }
        .payment-method:hover, .payment-method.active { border-color: var(--primary); background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05)); transform: translateY(-3px); box-shadow: var(--shadow-md); }
        .payment-method i { font-size: 2.5rem; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 12px; }
        .hidden { display: none !important; }
        .text-center { text-align: center; }
        .mt-20 { margin-top: 20px; }
        .mb-20 { margin-bottom: 20px; }
        .cart-container { background: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 25px; border: 2px solid var(--primary-light); }
        .cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
        .cart-items { max-height: 300px; overflow-y: auto; }
        .cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--gray-light); flex-wrap: wrap; gap: 8px; }
        .cart-total { text-align: right; font-size: 1.2rem; font-weight: 700; margin-top: 15px; padding-top: 10px; border-top: 2px solid var(--primary); }
        .remise-totale { background: #fef3c7; border: 2px dashed var(--warning); border-radius: 12px; padding: 15px; margin-top: 15px; }
        .badge { display: inline-block; padding: 6px 14px; border-radius: 100px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
        .badge-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }
        .badge-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
        .badge-danger { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }
        .badge-info { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
        .barcode-simple { border: 2px solid var(--gray-light) !important; background: var(--white) !important; padding: 12px 16px !important; border-radius: 12px !important; font-size: 1rem !important; text-align: left !important; letter-spacing: normal !important; width: 100% !important; }
        .barcode-simple:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important; outline: none !important; }
        .client-list-container, .fournisseur-list-container { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
        .client-list-sidebar, .fournisseur-list-sidebar { background: var(--white); border-radius: 16px; padding: 15px; box-shadow: var(--shadow-md); max-height: 600px; overflow-y: auto; }
        .client-list-item, .fournisseur-list-item { padding: 12px 15px; margin-bottom: 5px; border-radius: 12px; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; display: flex; align-items: center; gap: 10px; }
        .client-list-item:hover, .fournisseur-list-item:hover { background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05)); border-color: var(--primary-light); }
        .client-list-item.active, .fournisseur-list-item.active { background: var(--gradient-primary); color: var(--white); }
        .client-detail-content { background: var(--white); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-md); }
        .client-header-info { background: var(--gradient-dark); color: var(--white); padding: 20px; border-radius: 16px; margin-bottom: 20px; }
        .situation-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 500px; }
        .situation-table th { background: var(--dark); color: var(--white); padding: 12px 10px; font-size: 0.8rem; }
        .situation-table td { padding: 10px; border-bottom: 1px solid var(--gray-light); }
        .reste-total { background: var(--gradient-primary); color: var(--white); padding: 15px 20px; border-radius: 12px; margin-top: 20px; font-size: 1.3rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
        .type-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-align: center; min-width: 80px; }
        .type-badge.BL { background: #dbeafe; color: #1e40af; }
        .type-badge.VERSEMENT { background: #d1fae5; color: #065f46; }
        .type-badge.SOLDE_INITIAL { background: #fef9c3; color: #713f12; font-weight: bold; }
        .type-badge.CHEQUE { background: #fce7f3; color: #9d174d; }
        .type-badge.LCN { background: #e0e7ff; color: #0F5273; }
        .type-badge.VIREMENT { background: #cffafe; color: #155e75; }
        .type-badge.FACTURE { background: #dbeafe; color: #1e40af; }
        .type-badge.BON_ACHAT { background: #e0e7ff; color: #0F5273; }
        .type-badge.REMISE { background: #fecaca; color: #991b1b; }
        .photo-thumbnail { width: 150px; height: auto; cursor: pointer; border-radius: 8px; transition: transform 0.2s; }
        .photo-thumbnail:hover { transform: scale(1.05); }
        .photo-fullscreen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
        .photo-fullscreen img { max-width: 90%; max-height: 90%; object-fit: contain; }
        .bon-photo-upload-area { border: 2px dashed var(--primary-light); border-radius: 16px; padding: 30px; text-align: center; background: var(--light); cursor: pointer; transition: all 0.3s; margin-bottom: 20px; }
        .bon-photo-upload-area:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
        .bon-photo-card { background: var(--white); border-radius: 12px; padding: 15px; margin-bottom: 10px; border: 1px solid var(--gray-light); display: flex; align-items: center; gap: 15px; }
        .bon-photo-card img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; cursor: pointer; }
        .categorie-simple-card { background: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 15px; border: 1px solid var(--gray-light); display: flex; align-items: center; justify-content: space-between; }
        .categorie-simple-info { display: flex; align-items: center; gap: 15px; flex: 1; }
        .categorie-simple-info i { font-size: 1.5rem; color: var(--primary); }
        .user-role-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; margin-left: 10px; background: rgba(255,255,255,0.2); color: white; }
        .fullscreen-btn { position: fixed; top: 15px; right: 15px; z-index: 9999; background: var(--gradient-primary); color: white; border: none; border-radius: 50%; width: 45px; height: 45px; cursor: pointer; box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: all 0.3s; }
        .fullscreen-btn:hover { transform: scale(1.1); }
        .btn-confirm-lcn { background: linear-gradient(135deg, #10b981, #34d399) !important; color: white !important; border: none !important; padding: 8px 16px !important; border-radius: 20px !important; cursor: pointer !important; font-weight: bold !important; font-size: 0.85rem !important; box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3) !important; white-space: nowrap !important; transition: all 0.3s !important; }
        .btn-confirm-lcn:hover { transform: scale(1.05) !important; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5) !important; }
        .mobile-card { display: none; }
        .situation-action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
        .lcn-alert-item { padding: 10px 12px; background: rgba(255,255,255,0.9); border-radius: 8px; border-left: 4px solid #3b82f6; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
        .date-filter-bar { background: var(--white); border-radius: 16px; padding: 15px 20px; margin-bottom: 15px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 15px; flex-wrap: wrap; border: 1px solid var(--gray-light); }
        .date-filter-bar label { font-weight: 600; font-size: 0.85rem; color: var(--dark); white-space: nowrap; }
        .date-filter-bar input[type="date"] { padding: 8px 12px; border: 2px solid var(--gray-light); border-radius: 10px; font-size: 0.85rem; transition: all 0.3s; }
        .date-filter-bar input[type="date"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); outline: none; }
        .date-filter-bar .btn-reset { padding: 8px 16px; font-size: 0.85rem; border-radius: 10px; background: var(--light); color: var(--gray); border: 1px solid var(--gray-light); cursor: pointer; }
        .payment-mode-link { color: var(--primary); cursor: pointer; text-decoration: underline; font-weight: 600; transition: all 0.2s; }
        .payment-mode-link:hover { color: var(--primary-dark); text-decoration: none; }
        .mobile-transaction-card { background: var(--white); border: 1px solid var(--gray-light); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
        .mobile-transaction-card .mtc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 5px; }
        .mobile-transaction-card .mtc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; font-size: 0.8rem; }
        .mobile-transaction-card .mtc-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
        .auto-save-indicator { position: fixed; bottom: 15px; right: 15px; background: var(--gradient-success); color: white; padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; z-index: 9999; box-shadow: var(--shadow-md); display: none; align-items: center; gap: 8px; animation: fadeIn 0.3s ease; }
        .photo-upload-mini { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; padding: 6px 10px; background: var(--light); border-radius: 8px; border: 1px dashed var(--primary-light); font-size: 0.8rem; color: var(--primary); transition: all 0.2s; }
        .photo-upload-mini:hover { background: rgba(99, 102, 241, 0.1); border-color: var(--primary); }
        .photo-upload-mini img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
        .traite-filter-bar { background: var(--white); border-radius: 16px; padding: 12px 20px; margin-bottom: 15px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--gray-light); }
        .traite-filter-bar button { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--gray-light); background: var(--white); cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
        .traite-filter-bar button.active { background: var(--gradient-primary); color: white; border-color: var(--primary); }
        .cheque-trait-card { background: var(--white); border: 1px solid var(--gray-light); border-radius: 12px; padding: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
        .cheque-trait-card img { width: 120px; height: auto; max-height: 120px; object-fit: contain; border-radius: 8px; cursor: pointer; border: 1px solid var(--gray-light); }
        .cheque-trait-card .info { flex: 1; min-width: 150px; }
        .search-bar-cheque { background: var(--white); border-radius: 16px; padding: 12px 20px; margin-bottom: 15px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 10px; border: 1px solid var(--gray-light); }
        .search-bar-cheque input { flex: 1; padding: 10px 14px; border: 2px solid var(--gray-light); border-radius: 10px; font-size: 0.9rem; min-width: 200px; }
        .search-bar-cheque input:focus { outline: none; border-color: var(--primary); }
        .articles-history-modal-content { max-width: 1000px; width: 95%; }
        .articles-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 15px; }
        .articles-table th { background: var(--gradient-dark); color: white; padding: 12px 10px; font-size: 0.8rem; text-align: left; }
        .articles-table td { padding: 10px; border-bottom: 1px solid var(--gray-light); }
        .articles-table tr:hover { background: rgba(99, 102, 241, 0.03); }
        .articles-summary { background: var(--gradient-primary); color: white; padding: 15px 20px; border-radius: 12px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
        .btn-articles-history { background: linear-gradient(135deg, #8b5cf6, #6366f1); color: white; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: all 0.3s; white-space: nowrap; box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2); }
        .btn-articles-history:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }
        .btn-articles-history-fournisseur { background: linear-gradient(135deg, #f97316, #ea580c); }
        .btn-articles-history-fournisseur:hover { box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4); }
        @media (max-width: 900px) { .client-list-container, .fournisseur-list-container { grid-template-columns: 1fr; gap: 15px; } .client-list-sidebar, .fournisseur-list-sidebar { max-height: 200px; overflow-x: auto; display: flex; flex-wrap: nowrap; gap: 8px; padding: 10px; } .client-list-item, .fournisseur-list-item { flex-shrink: 0; white-space: nowrap; margin-bottom: 0; font-size: 0.85rem; padding: 10px 14px; } .client-list-sidebar input, .fournisseur-list-sidebar input { margin-bottom: 10px; } .client-list-sidebar > div:first-child { min-width: 100%; } .situation-table { min-width: 100%; font-size: 0.75rem; } .situation-table th, .situation-table td { padding: 8px 6px; font-size: 0.7rem; } .desktop-table { display: none; } .mobile-card { display: block; } .client-header-info h3 { font-size: 1.1rem; } .client-header-info > div { grid-template-columns: 1fr 1fr !important; gap: 10px !important; } .reste-total { font-size: 1rem; } .reste-total span { font-size: 0.9rem; } .modal-content { padding: 20px 15px; width: 95%; border-radius: 20px; } .modal-content h3 { font-size: 1rem; } .modal-content table { min-width: 100%; font-size: 0.65rem; } .modal-content th, .modal-content td { padding: 4px 3px; font-size: 0.6rem; } .close { right: 10px; top: 10px; font-size: 22px; width: 32px; height: 32px; } .date-filter-bar { flex-direction: column; align-items: stretch; } }
        @media (max-width: 768px) { .container { padding: 5px; } .content { padding: 10px; } .nav-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 5px; gap: 3px; } .nav-tab { padding: 10px 12px; font-size: 0.7rem; border-radius: 20px; border: 1px solid var(--gray-light); border-bottom: 1px solid var(--gray-light); flex-shrink: 0; } .nav-tab.active { border-left: none; border-color: var(--primary); background: var(--gradient-primary); color: white; } .nav-tab i { font-size: 0.85rem; } .form-row { flex-direction: column; gap: 10px; } .stats-grid { grid-template-columns: 1fr; gap: 10px; } .header h1 { font-size: 1.8rem; } .header { padding: 20px 10px; } .electric-logo { font-size: 2.5rem; } .title-container { flex-direction: column; gap: 10px; } .payment-methods { flex-direction: column; } h2 { font-size: 1.3rem; border-left-width: 3px; padding-left: 10px; } .btn { padding: 10px 15px; font-size: 0.85rem; width: 100%; justify-content: center; } .btn-sm { width: auto; padding: 6px 12px; font-size: 0.75rem; } .stat-value { font-size: 2rem; } .form-container { padding: 15px; border-radius: 14px; } table { min-width: 100%; font-size: 0.7rem; } th, td { padding: 8px 6px; font-size: 0.7rem; } .reste-total { font-size: 1rem; flex-direction: column; text-align: center; } .situation-action-row { flex-direction: column; } .situation-action-row .btn { width: 100%; } .cart-item { flex-direction: column; align-items: flex-start; } .alert { flex-direction: column; gap: 10px; padding: 12px 15px; } .lcn-alert-item { flex-direction: column; align-items: flex-start; } .btn-confirm-lcn { align-self: flex-end; } .consult-bon-content-inner { padding: 10px !important; } .consult-bon-content-inner table { font-size: 0.55rem !important; } .consult-bon-content-inner th, .consult-bon-content-inner td { padding: 2px 2px !important; } .cheque-trait-card { flex-direction: column; align-items: flex-start; } .search-bar-cheque { flex-direction: column; } .search-bar-cheque input { width: 100%; } .articles-table { font-size: 0.7rem; } .articles-table th, .articles-table td { padding: 6px 4px; } }
        @media (max-width: 480px) { .header h1 { font-size: 1.4rem; letter-spacing: 1px; } .subtitle { font-size: 0.75rem; } .nav-tab { font-size: 0.65rem; padding: 8px 10px; } .nav-tab i { font-size: 0.75rem; } .bon-photo-card { flex-direction: column; text-align: center; } .bon-photo-card img { width: 80px; height: 80px; } .stat-card { padding: 15px 10px; } .stat-value { font-size: 1.5rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; } .client-header-info > div { grid-template-columns: 1fr !important; text-align: center; } .client-header-info { padding: 12px; } .situation-table th, .situation-table td { padding: 5px 3px; font-size: 0.6rem; } .type-badge { font-size: 0.6rem; padding: 2px 6px; min-width: 50px; } .situation-table th:nth-child(4), .situation-table td:nth-child(4) { display: none; } .situation-table th:nth-child(2), .situation-table td:nth-child(2) { display: none; } }
        @media print { body * { visibility: hidden; } .print-section, .print-section * { visibility: visible; } .print-section { position: absolute; left: 0; top: 0; width: 100%; background: white; padding: 20px; font-size: 12px; } .no-print { display: none !important; } }
            /* ===== Scanner IA — carte du tableau de vérification ===== */
        .dsk-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px 14px;margin-bottom:14px;}
        .dsk-tablewrap{border:1px solid #dbe2ea;border-radius:16px;overflow:auto;max-height:56vh;box-shadow:0 10px 28px rgba(15,23,42,0.10);background:#fff;}
        .dsk-table{width:100%;min-width:900px;border-collapse:separate;border-spacing:0;}
        .dsk-table thead th{position:sticky;top:0;z-index:2;background:linear-gradient(135deg,var(--primary),var(--primary-dark,#0F5273));color:#fff;font-size:0.7rem;letter-spacing:0.08em;text-transform:uppercase;padding:13px 11px;text-align:left;white-space:nowrap;}
        .dsk-table tbody td{padding:11px 10px;border-bottom:1px solid #eef2f7;vertical-align:middle;background:#fff;}
        .dsk-table tbody tr:nth-child(even) td{background:#f8fafc;}
        .dsk-table tbody tr:hover td{background:#eef4ff;}
        .dsk-table tbody tr:last-child td{border-bottom:none;}
        .dsk-table input[type=text],.dsk-table input[type=number],.dsk-table select{border:1.5px solid #dbe2ea;border-radius:9px;padding:8px 9px;font-size:0.85rem;background:#fff;transition:border-color 0.2s,box-shadow 0.2s;}
        .dsk-table input:focus,.dsk-table select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(14,156,190,0.14);}
        .dsk-table input[type=checkbox]{width:17px;height:17px;accent-color:var(--primary);cursor:pointer;}
        .dsk-pv-vide{border:1.8px solid #ef4444 !important;background:#fef2f2 !important;}
        .dsk-pv-ok{border:1.8px solid #16a34a !important;background:#f0fdf4 !important;}
        .dsk-badge{display:inline-block;margin-top:5px;padding:2px 9px;border-radius:999px;font-size:0.6rem;font-weight:800;letter-spacing:0.03em;}
        .dsk-badge.exist{background:#dcfce7;color:#166534;}
        .dsk-badge.nouveau{background:#e0e7ff;color:#0F5273;}
        .dsk-total{font-weight:800;color:#0f172a;white-space:nowrap;}
        .dsk-okcheck{display:inline-flex;width:18px;height:18px;border-radius:50%;background:#16a34a;color:#fff;font-size:0.68rem;align-items:center;justify-content:center;margin-left:6px;vertical-align:middle;}
        .dsk-del{width:32px;height:32px;border-radius:50%;border:none;background:#fee2e2;color:#b91c1c;cursor:pointer;transition:all 0.2s;display:inline-flex;align-items:center;justify-content:center;}
        .dsk-del:hover{background:#ef4444;color:#fff;transform:scale(1.08);}
                /* ===== Barre de chargement du Scanner : brillance animée ===== */
        #dsk-progress-fill{background-size:200% 100% !important;animation:dskBarShine 1.1s linear infinite;}
        @keyframes dskBarShine{to{background-position:-200% 0;}}
                /* ===== THÈME IZGestia : bleu du logo officiel ===== */
        :root {
            --primary: #0E9CBE;
            --primary-dark: #16688A;
            --primary-light: #4FC6DF;
            --gradient-primary: linear-gradient(135deg, #16688A 0%, #0E9CBE 55%, #2BC5DE 100%);
        }
        /* ===== Confort application native (mobile) ===== */
        html { -webkit-text-size-adjust: 100%; }
        * { -webkit-tap-highlight-color: transparent; }
        @media (max-width: 768px) {
            input, select, textarea { font-size: 16px !important; } /* empêche le zoom automatique iOS */
        }
        /* ===== Bannière d'installation ===== */
        #iz-install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 99999; background: #FFFFFF; border: 1px solid #d3e6ef; border-radius: 18px; box-shadow: 0 12px 40px rgba(15,23,42,0.22); padding: 12px 14px; display: flex; align-items: center; gap: 12px; animation: izBannerUp 0.45s cubic-bezier(0.22,1,0.36,1); }
        @keyframes izBannerUp { from { transform: translateY(90px); opacity: 0; } to { transform: none; opacity: 1; } }
        #iz-install-banner img { width: 48px; height: 48px; border-radius: 12px; border: 1px solid #e2e8f0; }
        #iz-install-banner .izb-t { font-weight: 800; color: #0f172a; font-size: 0.95rem; }
        #iz-install-banner .izb-s { color: #64748b; font-size: 0.75rem; }
        #iz-install-banner .izb-btn { margin-left: auto; background: var(--gradient-primary); color: #fff; border: none; border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
        #iz-install-banner .izb-x { background: none; border: none; color: #94a3b8; font-size: 1.1rem; cursor: pointer; padding: 4px 6px; }
        #iz-ios-guide { position: fixed; inset: 0; background: rgba(15,23,42,0.78); backdrop-filter: blur(6px); z-index: 100000; display: flex; align-items: center; justify-content: center; }
        #iz-ios-guide .izg-card { background: #fff; border-radius: 22px; padding: 22px 20px; width: calc(100% - 28px); max-width: 520px; margin-bottom: 120px; animation: izBannerUp 0.4s cubic-bezier(0.22,1,0.36,1); }
        #iz-ios-guide h3 { font-size: 1.15rem; font-weight: 800; color: #0f172a; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
        #iz-ios-guide .izg-step { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; color: #334155; font-size: 0.95rem; }
        #izg-arrow { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); font-size: 3.2rem; color: #FFFFFF; text-shadow: 0 4px 18px rgba(0,0,0,0.5); z-index: 100001; animation: izArrowBounce 0.9s ease-in-out infinite; pointer-events: none; line-height: 1; }
        #izg-arrow.izg-top { bottom: auto; top: calc(10px + env(safe-area-inset-top)); left: auto; right: 24px; transform: none; animation-name: izArrowBounceUp; }
        @keyframes izArrowBounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(14px); } }
        @keyframes izArrowBounceUp { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
        .izg-share-ic { display: inline-flex; vertical-align: middle; }
        #iz-ios-guide .izg-n { width: 28px; height: 28px; border-radius: 50%; background: var(--gradient-primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        /* Accessibilité / appareils lents : animations réduites si l'utilisateur le demande au système */
        @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
