﻿/* Le Pain D'Aujourd'hui — Styles de l'interface de gestion (index.html) */
        :root {
            --primary: #6366f1; --primary-dark: #4f46e5; --primary-light: #818cf8;
            --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: visible; 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; border-radius: 24px 24px 0 0; }
        .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%); animation: headerFlow 8s ease-in-out infinite; }
        @keyframes headerFlow { 0%, 100% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(5deg) scale(1.05); } }
        .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; position: sticky; top: 0; z-index: 900; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
        .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 infinite; }
        .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 15px currentColor; animation: lightPulse 1.5s ease-in-out infinite; }
        .stock-light.red { background: var(--danger); color: var(--danger); box-shadow: 0 0 20px var(--danger); }
        .stock-light.green { background: var(--success); color: var(--success); box-shadow: 0 0 20px var(--success); }
        @keyframes lightPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.1); } }
        .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: #3730a3; }
        .type-badge.VIREMENT { background: #cffafe; color: #155e75; }
        .type-badge.FACTURE { background: #dbeafe; color: #1e40af; }
        .type-badge.BON_ACHAT { background: #e0e7ff; color: #3730a3; }
        .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; } }
    
/* ---- Page Achat ---- */
.ach-cats-grid{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.ach-cat-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:2px solid var(--primary-light);border-radius:20px;cursor:pointer;font-size:.85rem;font-weight:600;color:var(--dark);background:var(--white);transition:all .2s;user-select:none}
.ach-cat-chip:hover{border-color:var(--primary)}
.ach-cat-chip.on{background:var(--primary);color:#fff;border-color:var(--primary)}
.ach-cat-chip.on i{color:#fff}
.ach-pay-block{margin-top:14px}
#section-achat .payment-method{cursor:pointer}
#section-achat .payment-method span{display:block;margin-top:6px;font-weight:600;font-size:.85rem}
#section-achat .cart-item{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--gray-light,#eee)}
#section-achat .cart-item:last-child{border-bottom:none}


/* ---- Pages Produits & Stock ---- */
.produits-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px}
.produit-card{position:relative;background:var(--white);border:1px solid var(--gray-light,#eee);border-radius:16px;overflow:hidden;cursor:pointer;transition:all .2s;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.produit-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.12)}
.produit-photo{width:100%;aspect-ratio:1/1;overflow:hidden;background:var(--gray-light,#f3f4f6)}
.produit-photo img{width:100%;height:100%;object-fit:cover}
.produit-noimg{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--primary-light,#c4b5fd);font-size:2.4rem}
.produit-info{padding:12px}
.produit-info strong{display:block;font-size:.95rem;color:var(--dark)}
.produit-ing{margin-top:4px;font-size:.78rem;color:var(--gray);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.produit-del{position:absolute;top:8px;right:8px;width:32px;height:32px;border:none;border-radius:50%;background:rgba(239,68,68,.92);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s}
.produit-card:hover .produit-del{opacity:1}
.prod-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;z-index:9999;padding:20px}
.prod-modal-overlay.show{display:flex}
.prod-modal-box{background:var(--white);border-radius:20px;width:100%;max-width:520px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.prod-modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--gray-light,#eee)}
.prod-modal-head h3{margin:0;font-size:1.15rem;color:var(--dark)}
.prod-modal-x{cursor:pointer;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--gray);transition:all .2s}
.prod-modal-x:hover{background:var(--gray-light,#f3f4f6);color:var(--danger)}
.prod-modal-body{padding:22px}
.prod-modal-foot{display:flex;gap:12px;justify-content:flex-end;padding:18px 22px;border-top:1px solid var(--gray-light,#eee)}
.prod-photo-zone{border:2px dashed var(--primary-light,#c4b5fd);border-radius:14px;min-height:160px;display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;background:var(--gray-light,#fafafa)}
.prod-photo-zone img{width:100%;max-height:240px;object-fit:contain}
#prod-photo-placeholder{display:flex;flex-direction:column;align-items:center;gap:8px;color:var(--gray);font-size:.9rem}
#prod-photo-placeholder i{font-size:2rem}
.stock-badge{display:inline-block;padding:4px 12px;border-radius:20px;font-size:.78rem;font-weight:700}
.stock-badge.b-green{background:#dcfce7;color:#166534}
.stock-badge.b-warning{background:#fef3c7;color:#92400e}
.stock-badge.b-danger{background:#fee2e2;color:#991b1b}


.prod-ing-picker{display:flex;flex-wrap:wrap;gap:8px;max-height:220px;overflow-y:auto;padding:4px;border:1px solid var(--gray-light,#eee);border-radius:12px}
.prod-ing-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:2px solid var(--primary-light,#c4b5fd);border-radius:20px;cursor:pointer;font-size:.85rem;font-weight:600;color:var(--dark);background:var(--white);transition:all .2s;user-select:none}
.prod-ing-chip:hover{border-color:var(--primary)}
.prod-ing-chip.on{background:var(--primary);color:#fff;border-color:var(--primary)}
.prod-ing-chip.on i{color:#fff}


.prod-ing-picker .ing-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:10px;width:100%}
.prod-ing-picker .ing-row.on{background:rgba(99,102,241,.08)}
.ing-check{display:flex;align-items:center;gap:8px;font-weight:600;font-size:.88rem;color:var(--dark);cursor:pointer;flex:1}
.ing-qty{display:flex;align-items:center;gap:6px}
.ing-qty input{width:90px;padding:6px 8px;border:1px solid var(--gray-light,#ddd);border-radius:8px}
.ing-qty input:disabled{background:#f3f4f6}
.ing-qty span{font-size:.8rem;color:var(--gray);min-width:40px}
.produit-prix{display:block;margin-top:3px;font-weight:700;color:var(--primary);font-size:.85rem}


.client-list-avatar{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;flex-shrink:0}


.prodmod-preview{border:1px solid var(--gray-light,#eee);border-radius:12px;padding:10px;max-height:240px;overflow:auto}
.prodmod-line{display:flex;justify-content:space-between;gap:10px;padding:6px 4px;font-size:.86rem;border-bottom:1px dashed var(--gray-light,#eee)}
.prodmod-line:last-child{border-bottom:none}
.prodmod-line.insuff{color:var(--danger);font-weight:600}
.prodmod-totals{margin-top:10px;padding:10px;background:var(--gray-light,#f7f7f8);border-radius:10px;font-size:.9rem}
.prodmod-totals>div{display:flex;justify-content:space-between;padding:3px 0}

        /* PWA : masquer le bouton plein ecran sur mobile et en mode app installee */
        @media (max-width: 820px) { .fullscreen-btn { display: none !important; } }
        @media (display-mode: standalone) { .fullscreen-btn { display: none !important; } }
        @media (display-mode: fullscreen) { .fullscreen-btn { display: none !important; } }

/* MAJ-150 — message de secours « fichiers manquants » (1re ligne de la page) : invisible quand tout est bien chargé.
   Il apparaît au bout de 12 secondes seulement si le programme (dossier js) n'a pas pu démarrer. */
#aide-fichiers{position:fixed;left:0;right:0;bottom:0;z-index:2147483646;background:#b91c1c;color:#fff;padding:12px 16px;font:600 14px Arial,sans-serif;text-align:center;opacity:0;pointer-events:none;animation:aideFichiers 1ms linear 12s forwards}
html.app-prete #aide-fichiers{display:none}
@keyframes aideFichiers{to{opacity:1}}

/* @fin-fichier — ne pas supprimer cette ligne : elle prouve que le fichier est arrivé en entier sur l'appareil */
