  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

        /* =========================================
           VARIABLES DU THÈME
           ========================================= */
        /* =========================================
           PALETTE — ROUGE / GRIS / NOIR
           Univers atelier : noir carbone, gris acier,
           rouge machine (celui des boutons de coupe).
           ========================================= */
        :root { 
            --primary: #E12D2D;        /* rouge machine */
            --primary-dark: #A81C1C;   /* rouge foncé */
            --bg: #0C0C0E;             /* noir carbone */
            --surface: #16161A; 
            --surface-hover: #202027;
            --text: #F5F5F7; 
            --text-light: #9A9AA5;     /* gris acier clair */
            --border: #2E2E36;         /* gris acier */
            --success: #10B981; 
            --danger: #EF4444; 
            --input-bg: #0C0C0E; 
            --th-bg: #121216;
            --waste-bg-1: #202027;
            --waste-bg-2: #16161A;
            --table-hover: rgba(255,255,255,0.03);
            --bar-bg: #121216;

            /* Repères des colonnes de saisie (voir plus bas) */
            --col-larg: #E12D2D;       /* LARGEUR — rouge */
            --col-haut: #C9CDD4;       /* HAUTEUR — gris clair */
        }

        :root[data-theme="light"] {
            --bg: #F4F4F5; 
            --surface: #FFFFFF; 
            --surface-hover: #FAFAFA;
            --text: #131316; 
            --text-light: #6B6B75; 
            --border: #E1E1E5; 
            --input-bg: #FAFAFA; 
            --th-bg: #FAFAFA;
            --waste-bg-1: #E1E1E5;
            --waste-bg-2: #F4F4F5;
            --table-hover: rgba(0,0,0,0.02);
            --bar-bg: #E1E1E5;

            --col-larg: #C81E1E;
            --col-haut: #52525B;
        }
        
        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }
        body { background-color: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow: hidden; transition: background-color 0.3s, color 0.3s; } 
        
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

        /* =========================================
           PORTAIL LANDING PREMIUM — NOUVELLE VERSION
           ========================================= */
        @import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&display=swap');

        @keyframes portalAppear {
            0% { opacity: 0; transform: scale(0.95) translateY(20px); }
            100% { opacity: 1; transform: scale(1) translateY(0); }
        }
        @keyframes fadeUp {
            0% { opacity: 0; transform: translateY(30px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes shimmer {
            0% { background-position: -200% center; }
            100% { background-position: 200% center; }
        }
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-8px); }
        }
        @keyframes pulse-ring {
            0% { transform: scale(1); opacity: 0.6; }
            100% { transform: scale(1.6); opacity: 0; }
        }
        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        #license-portal-wrapper {
            display: flex; justify-content: center; align-items: flex-start;
            position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
            overflow-y: auto;
            background: #070A12;
            background-image:
                radial-gradient(ellipse 80% 60% at 50% -10%, rgba(220,168,58,0.12) 0%, transparent 60%),
                radial-gradient(ellipse 40% 40% at 80% 80%, rgba(220,168,58,0.05) 0%, transparent 50%);
        }

        /* ── BARRE SUPÉRIEURE ── */
        .portal-topbar {
            position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
            display: flex; align-items: center; justify-content: space-between;
            padding: 16px 28px;
            background: rgba(7,10,18,0.8);
            backdrop-filter: blur(14px);
            border-bottom: 1px solid rgba(220,168,58,0.12);
        }
        .portal-topbar-brand {
            display: flex; align-items: center; gap: 10px;
            font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: 0.5px;
        }
        .portal-topbar-brand span { color: var(--primary); }
        .portal-topbar-logo {
            width: 32px; height: 32px; border-radius: 8px;
            background: var(--primary); display: flex; align-items: center; justify-content: center;
        }
        .portal-topbar-logo svg { width: 18px; height: 18px; fill: #000; }
        .portal-topbar-actions { display: flex; align-items: center; gap: 10px; }
        .btn-topbar { 
            background: transparent; border: 1px solid rgba(220,168,58,0.35);
            color: var(--primary); padding: 8px 16px; border-radius: 8px;
            font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: 0.2s;
        }
        .btn-topbar:hover { background: rgba(220,168,58,0.1); }
        .btn-topbar-primary {
            background: var(--primary); color: #000; border: none; padding: 9px 18px;
            border-radius: 8px; font-size: 0.85rem; font-weight: 800; cursor: pointer; transition: 0.2s;
        }
        .btn-topbar-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

        /* ── CONTENU PRINCIPAL ── */
        #portal-landing {
            width: 100%; max-width: 900px; margin: 0 auto;
            padding: 100px 24px 60px;
        }

        /* ── HERO ── */
        .portal-hero {
            text-align: center; padding: 60px 0 50px;
            animation: fadeUp 0.7s ease both;
        }
        .portal-hero-badge {
            display: inline-flex; align-items: center; gap: 8px;
            background: rgba(220,168,58,0.1); border: 1px solid rgba(220,168,58,0.3);
            color: var(--primary); padding: 7px 16px; border-radius: 50px;
            font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
            margin-bottom: 28px;
        }
        .portal-hero-badge::before {
            content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
            animation: pulse-ring 1.5s ease-out infinite;
        }
        .portal-hero h1 {
            font-family: 'Syne', 'Inter', sans-serif;
            font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800;
            color: #fff; line-height: 1.12; letter-spacing: -1.5px;
            margin-bottom: 22px;
        }
        .portal-hero h1 .gradient-text {
            background: linear-gradient(135deg, var(--primary) 0%, #F5D07A 40%, var(--primary) 70%, var(--primary-dark) 100%);
            background-size: 200% auto;
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: shimmer 3s linear infinite;
        }
        .portal-hero-sub {
            font-size: 1.05rem; color: #94A3B8; line-height: 1.7; max-width: 520px; margin: 0 auto 36px;
        }
        .portal-hero-cta {
            display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
        }
        .btn-hero-primary {
            background: var(--primary); color: #000; border: none;
            padding: 17px 36px; border-radius: 14px; font-size: 1rem; font-weight: 800;
            cursor: pointer; transition: 0.25s; display: flex; align-items: center; gap: 10px;
            box-shadow: 0 10px 30px rgba(220,168,58,0.35);
        }
        .btn-hero-primary:hover { background: #EAB53E; transform: translateY(-3px); box-shadow: 0 16px 40px rgba(220,168,58,0.45); }
        .btn-hero-secondary {
            background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.2);
            padding: 16px 28px; border-radius: 14px; font-size: 0.95rem; font-weight: 700;
            cursor: pointer; transition: 0.25s; display: flex; align-items: center; gap: 8px;
        }
        .btn-hero-secondary:hover { border-color: var(--primary); color: var(--primary); background: rgba(220,168,58,0.05); }

        /* ── STATS RAPIDES ── */
        .portal-stats {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
            margin: 0 0 64px; animation: fadeUp 0.7s 0.1s ease both; opacity: 0;
        }
        .stat-item {
            background: rgba(21,26,35,0.7); border: 1px solid rgba(42,50,65,0.8);
            border-radius: 16px; padding: 24px 16px; text-align: center;
            backdrop-filter: blur(8px); transition: 0.3s;
        }
        .stat-item:hover { border-color: rgba(220,168,58,0.3); transform: translateY(-3px); }
        .stat-number { font-size: 2rem; font-weight: 900; color: var(--primary); font-family: 'Syne', sans-serif; line-height: 1; }
        .stat-label { font-size: 0.78rem; color: #64748B; font-weight: 600; margin-top: 6px; }

        /* ── FEATURES GRID ── */
        .portal-features {
            margin-bottom: 64px; animation: fadeUp 0.7s 0.2s ease both; opacity: 0;
        }
        .section-label {
            font-size: 0.72rem; color: var(--primary); font-weight: 800; text-transform: uppercase;
            letter-spacing: 2px; margin-bottom: 12px;
        }
        .section-title {
            font-size: 1.7rem; font-weight: 800; color: #fff; margin-bottom: 8px;
            font-family: 'Syne', sans-serif; letter-spacing: -0.5px;
        }
        .section-sub { font-size: 0.92rem; color: #64748B; margin-bottom: 36px; }
        .features-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px;
        }
        .feature-card {
            background: rgba(21,26,35,0.8); border: 1px solid rgba(42,50,65,0.9);
            border-radius: 18px; padding: 28px 24px; position: relative; overflow: hidden;
            transition: 0.3s; cursor: default;
        }
        .feature-card::before {
            content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
            background: linear-gradient(90deg, transparent, var(--primary), transparent);
            opacity: 0; transition: 0.3s;
        }
        .feature-card:hover { border-color: rgba(220,168,58,0.25); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
        .feature-card:hover::before { opacity: 1; }
        .feature-icon {
            width: 48px; height: 48px; border-radius: 14px; margin-bottom: 18px;
            background: rgba(220,168,58,0.12); border: 1px solid rgba(220,168,58,0.2);
            display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
        }
        .feature-title { font-size: 1rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
        .feature-desc { font-size: 0.84rem; color: #64748B; line-height: 1.6; }
        .feature-tag {
            display: inline-block; margin-top: 14px;
            background: rgba(220,168,58,0.1); color: var(--primary);
            font-size: 0.68rem; font-weight: 800; padding: 4px 10px; border-radius: 6px;
            text-transform: uppercase; letter-spacing: 0.5px;
        }
        .feature-tag.free { background: rgba(16,185,129,0.1); color: #10B981; }

        /* ── TARIFS SECTION ── */
        .portal-pricing {
            margin-bottom: 64px; animation: fadeUp 0.7s 0.3s ease both; opacity: 0;
        }
        .pricing-grid-new {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
        }
        .price-card-new {
            background: rgba(21,26,35,0.8); border: 1px solid rgba(42,50,65,0.9);
            border-radius: 18px; padding: 24px 20px; text-align: center;
            position: relative; transition: 0.3s; overflow: hidden;
        }
        .price-card-new:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); border-color: rgba(220,168,58,0.3); }
        .price-card-new.featured {
            border-color: var(--primary);
            background: rgba(220,168,58,0.06);
            box-shadow: 0 0 0 1px rgba(220,168,58,0.3), 0 20px 40px rgba(220,168,58,0.12);
        }
        .price-popular-tag {
            position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
            background: var(--primary); color: #000; font-size: 0.62rem; font-weight: 900;
            padding: 4px 14px; border-radius: 0 0 10px 10px; text-transform: uppercase; letter-spacing: 0.5px;
        }
        .price-duration { font-size: 0.78rem; color: #64748B; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
        .price-amount { font-size: 1.7rem; font-weight: 900; color: var(--primary); font-family: 'Syne', sans-serif; line-height: 1; }
        .price-currency { font-size: 0.78rem; color: #94A3B8; font-weight: 600; margin-top: 4px; margin-bottom: 16px; }
        .price-bonus {
            display: inline-block; background: rgba(220,168,58,0.12); border: 1px solid rgba(220,168,58,0.25);
            color: var(--primary); font-size: 0.65rem; font-weight: 800; padding: 3px 8px;
            border-radius: 6px; margin-bottom: 16px; text-transform: uppercase;
        }
        .btn-price-order {
            width: 100%; background: var(--primary); color: #000; border: none;
            padding: 12px; border-radius: 10px; font-size: 0.85rem; font-weight: 800;
            cursor: pointer; transition: 0.2s;
        }
        .btn-price-order:hover { background: var(--primary-dark); transform: translateY(-2px); }
        .price-card-new:not(.featured) .btn-price-order {
            background: rgba(220,168,58,0.1); color: var(--primary);
            border: 1px solid rgba(220,168,58,0.3);
        }
        .price-card-new:not(.featured) .btn-price-order:hover { background: var(--primary); color: #000; }

        /* ── PORTAIL D'ACTIVATION ── */
        .portal-activation {
            animation: fadeUp 0.7s 0.4s ease both; opacity: 0;
            max-width: 480px; margin: 0 auto 60px;
        }
        .activation-card {
            background: rgba(21,26,35,0.9); border: 1px solid rgba(220,168,58,0.25);
            border-radius: 24px; padding: 36px 32px;
            box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 60px rgba(220,168,58,0.06);
        }
        .activation-header { text-align: center; margin-bottom: 28px; }
        .portal-icon {
            width: 68px; height: 68px; border-radius: 20px;
            background: linear-gradient(135deg, rgba(220,168,58,0.2), rgba(220,168,58,0.08));
            border: 1px solid rgba(220,168,58,0.3);
            display: flex; align-items: center; justify-content: center;
            margin: 0 auto 16px; position: relative;
        }
        .portal-icon::after {
            content: ''; position: absolute; inset: -6px; border-radius: 26px;
            border: 1px solid rgba(220,168,58,0.12);
        }
        .portal-icon svg { width: 30px; height: 30px; fill: var(--primary); }
        .activation-header h2 { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
        .subtitle { color: #64748B; font-size: 0.88rem; }

        .device-id-container {
            background: rgba(7,10,18,0.8); border: 1px dashed rgba(42,50,65,0.9);
            border-radius: 14px; padding: 16px; margin-bottom: 22px;
            display: flex; flex-direction: column; align-items: center; gap: 8px;
        }
        .device-label { color: var(--primary); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
        .id-row { display: flex; align-items: center; gap: 10px; }
        .device-id-text { font-size: 1.2rem; letter-spacing: 2px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: #fff; }
        .btn-copy-id { background: transparent; border: none; color: var(--primary); cursor: pointer; transition: 0.2s; }
        .btn-copy-id:hover { transform: scale(1.15); }

        .portal-input {
            width: 100%; padding: 16px 18px; font-size: 1rem;
            background: rgba(7,10,18,0.9); border: 1px solid rgba(42,50,65,0.9);
            color: white; border-radius: 12px; text-align: center;
            transition: 0.3s; margin-bottom: 14px; font-weight: 600; letter-spacing: 1px;
        }
        .portal-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(220,168,58,0.12); }

        .btn-unlock {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: #000; width: 100%; padding: 17px;
            border: none; border-radius: 12px; font-size: 1rem; font-weight: 900;
            cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
            transition: 0.3s; margin-bottom: 12px;
            box-shadow: 0 8px 24px rgba(220,168,58,0.3);
        }
        .btn-unlock:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(220,168,58,0.4); }

        .activation-divider {
            display: flex; align-items: center; gap: 12px; margin: 16px 0;
        }
        .activation-divider::before, .activation-divider::after {
            content: ''; flex: 1; height: 1px; background: rgba(42,50,65,0.9);
        }
        .activation-divider span { color: #3A4556; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }

        .btn-trial-new {
            width: 100%; padding: 15px; border-radius: 12px;
            background: transparent; border: 1px solid rgba(42,50,65,0.9);
            color: #94A3B8; font-size: 0.92rem; font-weight: 700; cursor: pointer;
            transition: 0.25s; display: flex; align-items: center; justify-content: center; gap: 10px;
            margin-bottom: 12px;
        }
        .btn-trial-new:hover { border-color: rgba(220,168,58,0.4); color: #fff; background: rgba(220,168,58,0.04); }
        .btn-trial-new svg { width: 18px; height: 18px; flex-shrink: 0; }
        .trial-limit-note {
            font-size: 0.72rem; color: #3A4556; text-align: center;
            margin-top: -6px; margin-bottom: 14px;
        }
        .trial-limit-note span { color: #94A3B8; }

        .btn-whatsapp-portal {
            width: 100%; background: rgba(37,211,102,0.08); border: 1px solid rgba(37,211,102,0.2);
            color: #25D366; padding: 14px; border-radius: 12px;
            font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: 0.2s;
            display: flex; align-items: center; justify-content: center; gap: 8px;
            margin-bottom: 10px;
        }
        .btn-whatsapp-portal:hover { background: rgba(37,211,102,0.14); transform: translateY(-1px); }

        .btn-guide-portal {
            background: transparent; border: none; color: #3A4556;
            width: 100%; font-size: 0.82rem; font-weight: 600; cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; padding: 8px;
        }
        .btn-guide-portal:hover { color: #94A3B8; }

        /* Ancien pricing (caché, conservé pour compat) */
        .pricing-grid { display: grid; gap: 8px; margin-top: 15px; text-align: left; }
        .price-card { display: flex; justify-content: space-between; align-items: center; background: #0B0F19; padding: 12px; border-radius: 8px; border: 1px solid var(--border); transition: 0.2s; }
        .price-card:hover { border-color: var(--primary); }
        .price-card.best-seller { border-color: var(--primary); background: rgba(220, 168, 58, 0.05); }
        .btn-order-sub { background: var(--primary); color: #000; border: none; padding: 8px 14px; border-radius: 6px; font-weight: 800; cursor: pointer; font-size: 0.75rem; transition: 0.2s; }
        .btn-order-sub:hover { background: var(--primary-dark); transform: translateY(-2px); }
        .price-badge { display: inline-block; background: rgba(220,168,58,0.15); color: var(--primary); font-size: 0.62rem; font-weight: 800; padding: 2px 6px; border-radius: 5px; margin-left: 4px; vertical-align: middle; }

        /* ── FOOTER PORTAL ── */
        .portal-footer {
            text-align: center; padding: 30px 0;
            border-top: 1px solid rgba(42,50,65,0.5);
            margin-top: 20px;
        }
        .portal-footer p { color: #3A4556; font-size: 0.78rem; margin-bottom: 8px; }
        .btn-about-portal {
            background: transparent; border: none; color: #3A4556;
            font-size: 0.78rem; cursor: pointer; transition: 0.2s;
        }
        .btn-about-portal:hover { color: #94A3B8; }

        /* ── RESPONSIVE PORTAL ── */
        @media (max-width: 640px) {
            .portal-topbar { padding: 14px 18px; }
            #portal-landing { padding: 80px 16px 40px; }
            .portal-hero { padding: 40px 0 36px; }
            .portal-hero h1 { font-size: 2rem; letter-spacing: -1px; }
            .portal-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
            .stat-number { font-size: 1.5rem; }
            .features-grid { grid-template-columns: 1fr; }
            .pricing-grid-new { grid-template-columns: 1fr 1fr; }
            .activation-card { padding: 28px 20px; }
        }

        #privacy-modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(11, 15, 25, 0.95); backdrop-filter: blur(10px);
            display: none; justify-content: center; align-items: center; z-index: 20000;
        }
        .privacy-modal { background: #151A23; border: 1px solid var(--border); padding: 30px; border-radius: 16px; max-width: 450px; width: 90%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
        .privacy-content { max-height: 250px; overflow-y: auto; margin: 20px 0; font-size: 0.85rem; color: #94A3B8; background: #0B0F19; padding: 15px; border-radius: 8px; text-align: left; line-height: 1.6; border: 1px solid var(--border); }
        .privacy-actions { display: flex; gap: 10px; }
        .btn-accept-priv { flex: 2; background: var(--success); color: white; border: none; padding: 14px; border-radius: 10px; font-weight: 800; cursor: pointer; transition: 0.2s; }
        .btn-accept-priv:hover { background: #059669; }
        .btn-refuse-priv { flex: 1; background: transparent; color: var(--danger); border: 1px solid var(--danger); padding: 14px; border-radius: 10px; font-weight: 700; cursor: pointer; transition: 0.2s; }
        .btn-refuse-priv:hover { background: rgba(239, 68, 68, 0.1); }

        .guide-step { display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start; text-align: left;}
        .guide-step-num { background: var(--surface-hover); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--primary); border: 2px solid var(--primary); flex-shrink: 0; }
        
        /* --- FENÊTRES MODALES CLASSIC --- */
        .about-modal-overlay, .share-modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(5px);
            display: none; justify-content: center; align-items: center; z-index: 10000;
            opacity: 0; transition: opacity 0.3s ease;
        }
        .about-modal-overlay.active, .share-modal-overlay.active { display: flex; opacity: 1; }
        
        .about-modal, .share-modal {
            background: #151A23; border: 1px solid var(--primary); border-radius: 16px;
            padding: 35px 30px; max-width: 500px; width: 90%; color: #F8FAFC;
            box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(220, 168, 58, 0.1); 
            position: relative; transform: translateY(20px); transition: transform 0.3s ease;
        }
        .about-modal { max-height: 90vh; overflow-y: auto; } 
        .about-modal::-webkit-scrollbar { width: 6px; }
        .about-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

        .share-modal { max-width: 350px; text-align: center; padding: 30px; }
        .about-modal-overlay.active .about-modal, .share-modal-overlay.active .share-modal { transform: translateY(0); }
        
        .btn-close-modal {
            position: absolute; top: 15px; right: 15px; background: rgba(255,255,255,0.05); border: none;
            color: #94A3B8; width: 35px; height: 35px; border-radius: 8px; cursor: pointer; 
            display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10;
        }
        .btn-close-modal:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
        
        .about-modal h3 { font-size: 1.5rem; margin-bottom: 15px; color: #FFFFFF; display: flex; align-items: center; gap: 10px;}
        .about-modal h3::before { content: ''; display: block; width: 4px; height: 20px; background: var(--primary); border-radius: 4px; }
        .about-modal p { color: #94A3B8; line-height: 1.6; margin-bottom: 20px; font-size: 0.95rem; }
        .about-modal ul { margin-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px;}
        .about-modal ul li { background: #0B0F19; padding: 12px 15px; border-radius: 8px; border: 1px solid #2A3241; font-size: 0.9rem; color: #CBD5E1; display: flex; align-items: flex-start; gap: 10px;}
        .about-modal ul li span { color: var(--primary); font-weight: bold; display: block; margin-bottom: 2px;}
        .about-modal ul li svg { min-width: 20px; color: var(--primary); margin-top: 2px; }

        .share-btn-group { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
        .btn-share-option {
            background: var(--surface-hover); border: 1px solid var(--border); color: var(--text);
            padding: 12px; border-radius: 10px; font-weight: 600; font-size: 1rem; cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s;
            text-decoration: none;
        }
        .btn-share-option:hover { border-color: var(--primary); color: var(--primary); }
        .btn-share-wa { color: #25D366; }
        .btn-share-wa:hover { border-color: #25D366; background: rgba(37, 211, 102, 0.1); color: #25D366;}

        /* =========================================
           LAYOUT : DASHBOARD
           ========================================= */
        #app-container { display: none; width: 100vw; height: 100vh; }

        .sidebar {
            width: 280px; background-color: var(--surface);
            border-right: 1px solid var(--border); display: flex; flex-direction: column;
            padding: 25px 20px; z-index: 10; overflow-y: auto;
            transition: background-color 0.3s, border-color 0.3s;
        }

        .sidebar-logo {
            display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
            font-size: 1.4rem; font-weight: 800; color: var(--text);
            text-transform: uppercase; letter-spacing: 1px;
            margin-bottom: 35px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
            transition: color 0.3s, border-color 0.3s;
        }
        .sidebar-title-wrapper { display: flex; align-items: center; gap: 10px; }
        .sidebar-logo img { height: 35px; border-radius: 8px; background: #FFF; padding: 2px;}
        .sidebar-logo span { color: var(--primary); }
        
        .btn-sidebar-action {
            background: rgba(220, 168, 58, 0.1); border: 1px solid var(--primary);
            color: var(--primary); padding: 6px 10px; border-radius: 8px;
            font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: 0.2s;
            display: flex; align-items: center; justify-content: center; gap: 6px; text-transform: none; letter-spacing: normal;
        }
        .btn-sidebar-action:hover { background: var(--primary); color: #000; }
        .btn-sidebar-action.icon-only { padding: 6px; } 

        .sidebar-section-title {
            font-size: 0.75rem; color: var(--text-light); text-transform: uppercase;
            letter-spacing: 1.5px; font-weight: 700; margin-bottom: 15px;
            transition: color 0.3s;
        }

        .nav-menu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 30px; }
        .nav-item {
            background: transparent; color: var(--text-light);
            border: 1px solid transparent; border-radius: 10px;
            padding: 12px 15px; text-align: left; font-size: 0.95rem; font-weight: 600;
            cursor: pointer; transition: all 0.3s; display: flex; align-items: center; gap: 12px;
        }
        .nav-item:hover { background: var(--table-hover); color: var(--text); }
        .nav-item.active { background: rgba(220, 168, 58, 0.1); border: 1px solid rgba(220, 168, 58, 0.3); color: var(--primary); }
        .nav-icon { font-size: 1.2rem; }

        .sidebar-settings { display: flex; flex-direction: column; gap: 15px; }
        .setting-group { display: flex; flex-direction: column; gap: 8px; }
        .setting-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-light); transition: color 0.3s;}
        .setting-group input, .setting-group select {
            background: var(--input-bg); border: 1px solid var(--border);
            color: var(--text); padding: 12px; border-radius: 8px; font-weight: 600;
            outline: none; transition: 0.3s; width: 100%;
        }
        .setting-group input:focus, .setting-group select:focus { border-color: var(--primary); }

        /* GESTION DES PAGES PRINCIPALES */
        .main-content {
            flex: 1; display: flex; flex-direction: column;
            background-color: var(--bg); overflow: hidden;
            transition: background-color 0.3s;
        }

        .app-page { display: flex; flex-direction: column; height: 100%; width: 100%; }

        .topbar {
            height: 70px; min-height: 70px; display: flex; justify-content: space-between; align-items: center;
            padding: 0 30px; border-bottom: 1px solid var(--border); background-color: var(--surface);
            transition: background-color 0.3s, border-color 0.3s;
        }
        
        .project-controls { display: flex; align-items: center; gap: 10px; }
        .project-select {
            background: var(--input-bg); color: var(--primary); border: 1px solid var(--border);
            padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 1rem;
            outline: none; cursor: pointer; max-width: 220px; text-overflow: ellipsis;
            transition: border-color 0.3s, box-shadow 0.3s;
        }
        .project-select:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(220,168,58,0.1); }
        
        .header-actions { display: flex; gap: 12px; align-items: center;}
        
        .btn-theme {
            background: transparent; color: var(--text-light); border: 1px solid var(--border);
            border-radius: 8px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
            cursor: pointer; transition: 0.2s;
        }
        .btn-theme:hover { color: var(--text); border-color: var(--text-light); background: var(--table-hover); }
        .btn-theme svg { width: 18px; height: 18px; }

        #abo-badge { display: none; background: rgba(16, 185, 129, 0.1); border: 1px solid var(--success); color: var(--success); padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase;}
        .btn-install { background: var(--primary); color: #000; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 700; cursor: pointer; display: none;}

        .workspace { flex: 1; padding: 30px; overflow-y: auto; position: relative; }

        /* --- TABLEAU UNIFIÉ --- */
        .table-card {
            background: var(--surface); border: 1px solid var(--border);
            border-radius: 16px; overflow: hidden; margin-bottom: 25px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: background-color 0.3s, border-color 0.3s;
        }
        .table-responsive { overflow-x: auto; }
        .horizontal-table { width: 100%; border-collapse: collapse; text-align: center; }
        .horizontal-table th {
            background: var(--th-bg); color: var(--text-light); padding: 16px;
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
            border-bottom: 1px solid var(--border); transition: background-color 0.3s, color 0.3s, border-color 0.3s;
        }
        .horizontal-table td {
            padding: 10px 16px; font-size: 1.05rem; color: var(--text); font-weight: 600;
            border-bottom: 1px solid var(--border); vertical-align: middle; transition: color 0.3s, border-color 0.3s;
        }
        .horizontal-table tr:hover { background: var(--table-hover); }
        
        .td-input {
            width: 100%; min-width: 80px; padding: 10px; border: 1px solid transparent;
            border-radius: 6px; font-size: 1rem; background: transparent;
            color: var(--text); font-weight: 600; text-align: center; transition: 0.2s;
        }
        .td-input:hover { background: var(--table-hover); border-color: var(--border); }
        .td-input:focus { border-color: var(--primary); background: var(--input-bg); outline: none; box-shadow: 0 0 10px rgba(220, 168, 58, 0.1); }
        .td-input-ref { text-align: left; min-width: 120px; }

        .qty-badge { display: inline-block; font-size: 0.7rem; color: #FFF; background: var(--text-light); padding: 2px 8px; border-radius: 4px; margin-top: 5px; font-weight: 800; }
        .horizontal-table th:nth-child(n+4) { color: var(--primary); }
        .horizontal-table th:nth-child(n+4) .qty-badge { background: var(--primary); color: #000; }

        .btn-delete-small { background: transparent; color: var(--text-light); border: none; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; margin: 0 auto;}
        .btn-delete-small:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

        /* --- BARRE D'ACTIONS --- */
        .action-bar { display: flex; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
        .btn-add {
            flex: 1; background: transparent; color: var(--text-light);
            border: 1px dashed var(--border); padding: 16px; border-radius: 12px;
            font-weight: 600; cursor: pointer; font-size: 1rem; transition: 0.2s;
            display: flex; align-items: center; justify-content: center; gap: 10px;
        }
        .btn-add:hover { border-color: var(--primary); color: var(--primary); background: rgba(220, 168, 58, 0.05); }

        .btn-optimize {
            flex: 2; background: var(--primary); color: #000;
            border: none; padding: 16px; border-radius: 12px;
            font-size: 1.05rem; font-weight: 800; cursor: pointer; text-transform: uppercase;
            letter-spacing: 1px; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px;
        }
        .btn-optimize:hover { background: var(--primary-dark); box-shadow: 0 10px 20px rgba(220, 168, 58, 0.2); transform: translateY(-2px);}

        /* --- RÉSULTAT D'OPTIMISATION --- */
        .opti-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 25px; padding-bottom: 20px;}
        
        .opti-card {
            background: var(--surface); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05); overflow: hidden; transition: background-color 0.3s, border-color 0.3s;
        }

        .opti-card-header {
            padding: 20px 25px; border-bottom: 1px solid var(--border); background: var(--table-hover);
            display: flex; justify-content: space-between; align-items: center; transition: background-color 0.3s, border-color 0.3s;
        }
        
        .opti-card-title { color: var(--text); font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 12px; letter-spacing: 0.5px; transition: color 0.3s;}
        .opti-card-title::before { content: ''; display: block; width: 4px; height: 18px; background: var(--primary); border-radius: 4px; }
        
        .opti-badge { background: rgba(220, 168, 58, 0.1); border: 1px solid rgba(220, 168, 58, 0.2); font-size: 0.8rem; padding: 6px 12px; border-radius: 8px; color: var(--primary); font-weight: 700; text-transform: uppercase; }
        
        .opti-card-body { padding: 20px 25px; display: flex; flex-direction: column; gap: 15px; }

        .opti-bar-item { background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px; transition: 0.3s; }
        .opti-bar-item:hover { border-color: rgba(220, 168, 58, 0.4); }

        .bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 0.9rem; }
        .bar-number { font-weight: 800; color: var(--text); font-size: 1rem; transition: color 0.3s;}
        .bar-waste { color: var(--text-light); font-weight: 500; transition: color 0.3s;}
        .bar-waste strong { color: var(--danger); font-weight: 700; }

        .bar-visual-container {
            display: flex; height: 26px; width: 100%; background: var(--bar-bg); border-radius: 6px; overflow: hidden;
            border: 1px solid var(--border); margin-bottom: 15px; transition: background-color 0.3s, border-color 0.3s;
        }
        
        .visual-cut {
            background: var(--primary); border-right: 1px solid var(--bar-bg); display: flex; align-items: center; justify-content: center;
            font-size: 0.75rem; font-weight: 800; color: #111111; overflow: hidden; white-space: nowrap; transition: 0.3s;
        }
        .visual-cut:hover { background: var(--primary-dark); }
        
        .visual-waste {
            background: repeating-linear-gradient(45deg, var(--waste-bg-1), var(--waste-bg-1) 6px, var(--waste-bg-2) 6px, var(--waste-bg-2) 12px);
            opacity: 0.8; border-left: 1px solid var(--danger); transition: background 0.3s;
        }

        .bar-details {
            font-family: monospace; color: var(--text-light); font-size: 0.9rem; letter-spacing: 1px; text-align: center; 
            background: var(--table-hover); padding: 8px; border-radius: 6px; border: 1px dashed var(--border); transition: background-color 0.3s, border-color 0.3s, color 0.3s;
        }

        /* =========================================
           STYLE MODULE VITRAGE (Intégré)
           ========================================= */
        .vitrage-card { background-color: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 25px; margin-bottom: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
        .vitrage-card-title { font-size: 1.1rem; font-weight: 800; color: var(--text); border-left: 4px solid var(--primary); padding-left: 12px; margin-bottom: 25px; line-height: 1.2;}
        .v-grid-header { display: grid; grid-template-columns: 1fr 1fr 0.8fr 1.2fr 40px; gap: 10px; margin-bottom: 10px; padding: 0 5px;}
        .v-grid-header span { font-size: 0.65rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; text-align: center; letter-spacing: 0.5px;}
        .v-input-row { display: grid; grid-template-columns: 1fr 1fr 0.8fr 1.2fr 40px; gap: 10px; margin-bottom: 12px; align-items: center;}
        .v-input { background-color: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 14px 10px; text-align: center; font-size: 0.95rem; font-weight: 600; outline: none; transition: 0.2s; width: 100%;}
        .v-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220, 168, 58, 0.15);}
        select.v-input { text-align: left; padding-left: 15px; cursor: pointer; }
        .btn-v-add { background: transparent; border: 1px dashed var(--border); color: var(--primary); border-radius: 8px; padding: 14px; width: 100%; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; margin-top: 15px; transition: 0.2s;}
        .btn-v-add:hover { background: rgba(220, 168, 58, 0.05); border-color: var(--primary);}
        
        .res-panel { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); margin-bottom: 25px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05);}
        .res-header { background: var(--table-hover); color: var(--primary); padding: 16px 20px; font-weight: 800; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border);}
        .res-row { display: grid; grid-template-columns: 55% 45%; padding: 12px 20px; font-size: 0.95rem; border-bottom: 1px solid var(--border);}
        .res-label { color: var(--text-light); font-weight: 600; }
        .res-val { color: var(--text); font-weight: 700;}
        .res-table { width: 100%; border-collapse: collapse; text-align: left; }
        .res-table th { padding: 14px 20px; color: var(--text-light); font-weight: 700; font-size: 0.85rem; border-bottom: 2px solid var(--border); background: var(--surface); text-transform: uppercase;}
        .res-table td { padding: 12px 20px; color: var(--text); font-size: 0.95rem; border-bottom: 1px solid var(--border); font-weight: 600;}
        .res-table tr.highlight td { background-color: rgba(220, 168, 58, 0.1); color: var(--primary);} 

        .canvas-wrapper { background-color: #e0f2fe; background-image: linear-gradient(#bae6fd 1px, transparent 1px), linear-gradient(90deg, #bae6fd 1px, transparent 1px); background-size: 20px 20px; padding: 40px 20px; overflow-x: auto; border-top: 1px solid var(--border);}
        .glass-sheet { position: relative; background: #ffffff; border: 2px solid #1e293b; margin: 0 auto; box-shadow: 0 10px 25px rgba(0,0,0,0.25);}
        .glass-strip { position: absolute; left: 0; box-sizing: border-box; border-bottom: 1px solid #000; }
        .glass-piece { position: absolute; top: 0; box-sizing: border-box; border-right: 1px solid #000; border-left: 1px solid #94a3b8; border-top: 1px solid #94a3b8; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #0f172a; overflow: hidden; }
        .dim-w { position: absolute; top: 4px; font-size: 0.65rem; color: #475569; font-weight: 700; width: 100%; text-align: center;}
        .dim-h { position: absolute; left: 4px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; font-size: 0.65rem; color: #475569; font-weight: 700;}
        .ref-lbl { font-size: 1.1rem; font-weight: 900; color: #1e293b;}
        .waste-zone { position: absolute; background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 4px, #f1f5f9 4px, #f1f5f9 8px); border-left: 1px solid #e2e8f0; border-top: 1px solid #e2e8f0; }
        .c0 { background-color: #ede9fe; } .c1 { background-color: #fce7f3; } .c2 { background-color: #ffedd5; } .c3 { background-color: #e0f2fe; }

        /* =========================================
           STYLE ANNUAIRE FOURNISSEURS (PREMIUM)
           ========================================= */
        .partners-footer {
            margin-top: 30px; padding-top: 20px; border-top: 1px dashed var(--border);
            text-align: center; padding-bottom: 20px;
        }

        .partners-title {
            font-size: 0.75rem; color: var(--text-light); text-transform: uppercase;
            letter-spacing: 1px; margin-bottom: 15px; font-weight: 600;
        }

        .btn-directory {
            background: transparent; color: var(--text);
            border: 1px solid var(--border); padding: 10px 20px; border-radius: 50px;
            font-size: 0.85rem; font-weight: 600; cursor: pointer; 
            display: flex; align-items: center; justify-content: center; gap: 8px;
            transition: 0.2s; width: 100%; max-width: 280px; margin: 0 auto;
        }

        .btn-directory:hover { background: var(--surface-hover); border-color: var(--primary); color: var(--primary); }
        .btn-directory svg { color: var(--primary); }

        .search-supplier-wrapper {
            position: relative;
            max-width: 600px;
            margin: 0 auto 30px auto;
        }

        .search-supplier-input {
            width: 100%;
            padding: 18px 20px 18px 55px;
            border-radius: 16px;
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text);
            font-size: 1.05rem;
            font-weight: 500;
            transition: all 0.3s;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
        }

        .search-supplier-input:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 4px rgba(220, 168, 58, 0.15);
        }

        .search-supplier-wrapper svg {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-light);
            transition: color 0.3s;
        }

        .search-supplier-input:focus + svg {
            color: var(--primary);
        }

        .supplier-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 20px;
            padding-bottom: 30px;
        }

        .supplier-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 20px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        }

        .supplier-card:hover {
            border-color: var(--primary);
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.15), 0 0 20px rgba(220, 168, 58, 0.1);
        }

        .supplier-logo-box {
            width: 75px;
            height: 75px;
            border-radius: 14px;
            background: #FFFFFF;
            padding: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-shrink: 0;
            box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        }

        .supplier-logo-box img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .supplier-info-box {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 6px;
            overflow: hidden;
        }

        .supplier-name {
            font-size: 1.15rem;
            font-weight: 800;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .supplier-desc-short {
            font-size: 0.85rem;
            color: var(--text-light);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .supplier-arrow {
            color: var(--border);
            transition: 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .supplier-card:hover .supplier-arrow {
            color: var(--primary);
            transform: translateX(5px);
        }

        .supplier-profile-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(8px);
            display: none; justify-content: center; align-items: center; z-index: 10000;
            opacity: 0; transition: opacity 0.3s ease;
        }

        .supplier-profile-overlay.active { display: flex; opacity: 1; }

        .supplier-modern-card {
            background: var(--surface);
            border: 1px solid rgba(220, 168, 58, 0.3);
            border-radius: 24px; width: 90%; max-width: 400px;
            overflow: hidden; position: relative;
            box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 40px rgba(220, 168, 58, 0.1);
            transform: scale(0.9) translateY(20px); opacity: 0; 
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .supplier-profile-overlay.active .supplier-modern-card {
            transform: scale(1) translateY(0); opacity: 1;
        }

        .supp-card-header {
            background: #FFFFFF; height: 160px;
            display: flex; align-items: center; justify-content: center;
            padding: 30px; position: relative;
        }

        .supp-card-header img {
            max-height: 100%; max-width: 80%; object-fit: contain;
            filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
        }

        .supp-card-body { padding: 35px 25px; text-align: center; }
        .supp-card-body h2 { font-size: 1.6rem; color: var(--text); margin-bottom: 12px; font-weight: 800; }
        .supp-card-body p { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; margin-bottom: 30px; }
        .supp-card-actions { display: flex; flex-direction: column; gap: 12px; }

        .btn-modern-action {
            padding: 16px; border-radius: 14px; font-weight: 700; font-size: 1.05rem;
            display: flex; align-items: center; justify-content: center; gap: 10px;
            text-decoration: none; transition: all 0.3s; color: #FFF; border: none; cursor: pointer;
        }

        .btn-modern-wa { background: #25D366; }
        .btn-modern-wa:hover { background: #1EBE5D; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3); }
        
        .btn-modern-call { background: var(--surface-hover); color: var(--text); border: 1px solid var(--border); }
        .btn-modern-call:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); }

        @media (max-width: 900px) {
            #app-container { flex-direction: column; overflow-y: auto; }
            body { overflow: auto; }
            .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 15px; overflow-y: visible; }
            .sidebar-logo { margin-bottom: 20px; padding-bottom: 15px; }
            .nav-menu { flex-direction: row; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;}
            .nav-item { flex: 1; min-width: 140px; justify-content: center;}
            .sidebar-settings { flex-direction: row; flex-wrap: wrap; }
            .setting-group { flex: 1; min-width: 130px; }
            .main-content { overflow: visible; }
            
            .topbar { flex-direction: column; height: auto; padding: 15px; gap: 15px; align-items: flex-start; }
            .project-controls { width: 100%; justify-content: space-between; }
            .project-select { flex: 1; max-width: none; }
            .header-actions { width: 100%; justify-content: flex-end; }
            
            .workspace { padding: 15px; }
            .action-bar { flex-direction: column; }
            .opti-results { grid-template-columns: 1fr; }
            
            .supplier-grid { grid-template-columns: 1fr; gap: 15px; }
            .supp-card-header { height: 130px; }
        }
        .btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0B0F19;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(220, 168, 58, 0.2);
    transition: all 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 168, 58, 0.4);
}

.btn-download svg {
    stroke: #0B0F19;
}

/* =========================================
   ESSAI LIMITÉ / UPSELL / SÉCURITÉ UI
   ========================================= */
.btn-trial {
    background: transparent; color: var(--text); width: 100%;
    border: 1px solid var(--border); padding: 15px; border-radius: 12px;
    font-size: 1rem; font-weight: 700; cursor: pointer; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.25s;
}
.btn-trial:hover { border-color: var(--primary); color: var(--primary); background: rgba(220,168,58,0.06); }
.btn-trial svg { width: 18px; height: 18px; }

.btn-guide-portal {
    background: transparent; border: none; color: var(--text-light);
    width: 100%; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-bottom: 8px;
    display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s;
}
.btn-guide-portal:hover { color: var(--primary); }

/* Bandeau démo collant */
.trial-banner {
    display: none; align-items: center; justify-content: space-between; gap: 12px;
    background: linear-gradient(135deg, rgba(220,168,58,0.16), rgba(220,168,58,0.06));
    border: 1px solid rgba(220,168,58,0.4); border-radius: 14px;
    padding: 12px 16px; margin-bottom: 20px;
}
body.is-trial .trial-banner { display: flex; }
.trial-banner-text { font-size: 0.85rem; color: var(--text); font-weight: 600; line-height: 1.4; }
.trial-banner-text strong { color: var(--primary); }
.btn-trial-sub {
    background: var(--primary); color: #000; border: none; padding: 10px 16px; border-radius: 10px;
    font-weight: 800; font-size: 0.82rem; cursor: pointer; white-space: nowrap; transition: 0.2s; flex-shrink: 0;
}
.btn-trial-sub:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Modale d'incitation (upsell) */
.upsell-overlay {
    position: fixed; inset: 0; background: rgba(11,15,25,0.92); backdrop-filter: blur(10px);
    display: none; justify-content: center; align-items: center; z-index: 21000; padding: 20px;
}
.upsell-overlay.active { display: flex; }
.upsell-card {
    background: var(--surface); border: 1px solid rgba(220,168,58,0.35); border-radius: 20px;
    padding: 35px 28px; max-width: 380px; width: 100%; text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6); animation: portalAppear 0.4s cubic-bezier(0.16,1,0.3,1);
}
.upsell-icon {
    width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 18px;
    background: rgba(220,168,58,0.12); border: 1px solid rgba(220,168,58,0.4);
    display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.upsell-card h3 { color: var(--text); font-size: 1.35rem; margin-bottom: 10px; font-weight: 800; }
.upsell-card p { color: var(--text-light); font-size: 0.92rem; line-height: 1.6; margin-bottom: 22px; }
.upsell-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-upsell-primary { background: var(--primary); color: #000; border: none; padding: 15px; border-radius: 12px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.btn-upsell-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-upsell-secondary { background: transparent; color: var(--text-light); border: none; padding: 10px; font-weight: 600; cursor: pointer; }
.btn-upsell-secondary:hover { color: var(--text); }

/* =========================================
   GUIDE D'INSTALLATION
   ========================================= */
.guide-overlay {
    position: fixed; inset: 0; background: rgba(11,15,25,0.92); backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center; z-index: 21000; padding: 16px;
}
.guide-overlay.active { display: flex; }
.guide-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
    width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}
.guide-card-head { padding: 26px 26px 0; text-align: center; }
.guide-card-head h3 { color: var(--text); font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.guide-card-head p { color: var(--text-light); font-size: 0.88rem; }
.guide-tabs { display: flex; gap: 8px; padding: 18px 26px 0; }
.guide-tab {
    flex: 1; background: var(--input-bg); border: 1px solid var(--border); color: var(--text-light);
    padding: 11px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.guide-tab.active { background: rgba(220,168,58,0.1); border-color: var(--primary); color: var(--primary); }
.guide-tab svg { width: 16px; height: 16px; }
.guide-panel { display: none; padding: 22px 26px 26px; }
.guide-panel.active { display: block; }
.guide-phone-illus {
    width: 100%; max-width: 200px; margin: 0 auto 20px; display: block;
}
.ig-step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.ig-step-num {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #000;
    display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem;
}
.ig-step-body { font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.ig-step-body strong { color: var(--primary); }
.ig-step-body .ig-icon-inline { display: inline-flex; vertical-align: middle; margin: 0 2px; color: var(--primary); }
.guide-note {
    background: var(--input-bg); border: 1px dashed var(--border); border-radius: 10px;
    padding: 13px 15px; font-size: 0.82rem; color: var(--text-light); line-height: 1.5; margin-top: 6px;
}
.guide-note strong { color: var(--text); }

/* =========================================
   PERSONNALISATION VITRAGE
   ========================================= */
.btn-customize {
    background: transparent; border: 1px solid var(--border); color: var(--text-light);
    padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; transition: 0.2s;
}
.btn-customize:hover { border-color: var(--primary); color: var(--primary); }
.btn-customize svg { width: 15px; height: 15px; }

.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preset-chip {
    background: var(--input-bg); border: 1px solid var(--border); color: var(--text-light);
    padding: 7px 12px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: 0.2s;
}
.preset-chip:hover { border-color: var(--primary); color: var(--primary); }
.preset-chip.active { background: rgba(220,168,58,0.12); border-color: var(--primary); color: var(--primary); }

.custom-overlay {
    position: fixed; inset: 0; background: rgba(11,15,25,0.9); backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center; z-index: 21000; padding: 16px;
}
.custom-overlay.active { display: flex; }
.custom-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; padding: 28px 24px; position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}
.custom-card h3 { color: var(--text); font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.custom-card .cc-sub { color: var(--text-light); font-size: 0.85rem; margin-bottom: 22px; }
.cc-section-title { color: var(--primary); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 18px 0 10px; }
.cc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cc-item { display: flex; align-items: center; justify-content: space-between; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; }
.cc-item span { color: var(--text); font-weight: 600; font-size: 0.92rem; }
.cc-del { background: transparent; border: none; color: var(--text-light); cursor: pointer; padding: 4px; border-radius: 6px; transition: 0.2s; }
.cc-del:hover { background: rgba(239,68,68,0.1); color: var(--danger); }
.cc-add-row { display: flex; gap: 8px; }
.cc-add-row input { flex: 1; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); padding: 11px 12px; border-radius: 10px; font-weight: 600; outline: none; }
.cc-add-row input:focus { border-color: var(--primary); }
.cc-add-row .cc-add-btn { background: var(--primary); color: #000; border: none; border-radius: 10px; padding: 0 16px; font-weight: 800; cursor: pointer; }

/* =========================================
   PROPOSITIONS D'OPTIMISATION VITRAGE
   ========================================= */
.proposals-bar { margin-bottom: 22px; }
.proposals-label { font-size: 0.78rem; color: var(--text-light); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.proposals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.proposal-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px;
    cursor: pointer; transition: 0.2s; text-align: left; position: relative;
}
.proposal-card:hover { border-color: rgba(220,168,58,0.5); }
.proposal-card.active { border-color: var(--primary); background: rgba(220,168,58,0.06); box-shadow: 0 0 0 1px var(--primary); }
.proposal-card.best::after { content: '★ Recommandé'; position: absolute; top: -9px; right: 12px; background: var(--primary); color: #000; font-size: 0.62rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.proposal-name { font-size: 0.78rem; color: var(--text-light); font-weight: 700; margin-bottom: 8px; }
.proposal-sheets { font-size: 1.5rem; font-weight: 900; color: var(--text); }
.proposal-sheets span { font-size: 0.8rem; color: var(--text-light); font-weight: 600; }
.proposal-waste { font-size: 0.82rem; font-weight: 700; margin-top: 4px; }
.proposal-waste.low { color: var(--success); }
.proposal-waste.mid { color: var(--primary); }
.proposal-waste.high { color: var(--danger); }

/* =========================================
   CHIPS PROFILÉS (accès rapide)
   ========================================= */
.profile-chips-wrap { margin-bottom: 22px; }
.profile-chips-label { font-size: 0.72rem; color: var(--text-light); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.profile-chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.profile-chips::-webkit-scrollbar { display: none; }
.profile-chip {
    flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); color: var(--text-light);
    padding: 10px 16px; border-radius: 50px; font-size: 0.9rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: 0.2s; white-space: nowrap;
}
.profile-chip:hover { border-color: var(--primary); color: var(--text); }
.profile-chip.active { background: rgba(220,168,58,0.12); border-color: var(--primary); color: var(--primary); }

/* =========================================
   SIDEBAR : TIROIR MOBILE + BARRE BASSE
   ========================================= */
.sidebar-scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
    z-index: 14998; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.btn-drawer-close { display: none; }

.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around;
    box-shadow: 0 -8px 25px rgba(0,0,0,0.18);
}
.mbn-item {
    flex: 1; background: transparent; border: none; color: var(--text-light);
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
    font-size: 0.66rem; font-weight: 700; cursor: pointer; transition: 0.2s; border-radius: 10px;
}
.mbn-item svg { width: 22px; height: 22px; }
.mbn-item.active { color: var(--primary); }

@media (max-width: 900px) {
    #app-container { flex-direction: column; overflow-y: auto; }
    body { overflow: auto; }
    body.app-open { padding-bottom: 74px; }

    /* Sidebar devient un tiroir latéral */
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 84%; max-width: 320px;
        border-right: 1px solid var(--border); border-bottom: none;
        padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
        overflow-y: auto; z-index: 14999;
        transform: translateX(-105%); transition: transform 0.32s cubic-bezier(0.16,1,0.3,1);
        box-shadow: 12px 0 40px rgba(0,0,0,0.35);
    }
    body.drawer-open .sidebar { transform: translateX(0); }
    body.drawer-open .sidebar-scrim { opacity: 1; pointer-events: auto; }

    .btn-drawer-close {
        display: flex; align-items: center; justify-content: center;
        background: var(--input-bg); border: 1px solid var(--border); color: var(--text-light);
        width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
    }
    .sidebar-logo { margin-bottom: 20px; padding-bottom: 15px; }
    .nav-menu { flex-direction: column; gap: 8px; margin-bottom: 18px; }
    .nav-item { width: 100%; justify-content: flex-start; }
    .sidebar-settings { flex-direction: column; }
    .setting-group { width: 100%; }
    .main-content { overflow: visible; }

    .topbar { height: auto; min-height: 64px; padding: 12px 14px; gap: 12px; }
    .project-controls { flex: 1; min-width: 0; }
    .project-select { flex: 1; max-width: none; min-width: 0; }
    .header-actions { gap: 8px; }

    .workspace { padding: 16px 14px 30px; }
    .action-bar { flex-direction: column; }
    .opti-results { grid-template-columns: 1fr; }
    .supplier-grid { grid-template-columns: 1fr; gap: 15px; }
    .supp-card-header { height: 130px; }

    .mobile-bottom-nav { display: flex; }
    .btn-menu-toggle { display: flex !important; }
    .v-grid-header, .v-input-row { grid-template-columns: 1fr 1fr 0.7fr 1fr 34px; gap: 7px; }
    .v-input { padding: 12px 6px; font-size: 0.9rem; }
}

.btn-menu-toggle {
    display: none; align-items: center; justify-content: center;
    background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer; flex-shrink: 0;
}
.btn-menu-toggle:hover { border-color: var(--primary); color: var(--primary); }
/* ═══════════════════════════════════════════════════════════
   CONNEXION GOOGLE — système cloud (ajout transition Firebase)
   ═══════════════════════════════════════════════════════════ */
#google-signin-zone { margin-top: 4px; }

.btn-google-signin {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: #1F2733;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.btn-google-signin:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,0.28); }
.btn-google-signin:active { transform: translateY(0); }
.btn-google-signin:disabled { cursor: default; }
.btn-google-signin svg { flex: 0 0 auto; }

.google-signin-hint {
    margin: 10px 2px 0;
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.4;
}

/* — État connecté — */
.google-account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-hover);
}
.google-account-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.google-account-email {
    font-weight: 700;
    font-size: 0.9rem;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}
.google-account-status { font-size: 0.78rem; color: var(--text-light); }

.btn-google-signout {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.btn-google-signout:hover { color: #EF4444; border-color: #EF4444; }

.btn-wa-with-email {
    width: 100%;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #25D366;
    background: rgba(37, 211, 102, 0.10);
    color: #25D366;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background .15s ease;
}
.btn-wa-with-email:hover { background: rgba(37, 211, 102, 0.18); }

/* Mode clair : e-mail lisible sur fond blanc */
[data-theme="light"] .google-account-email { color: #1F2733; }

/* =========================================================
   REPÈRES DE SAISIE — COLONNES LARGEUR / HAUTEUR
   ---------------------------------------------------------
   Sur un chantier, inverser largeur et hauteur coûte une
   barre entière. Les deux colonnes sont donc distinguées
   par TROIS signaux redondants : la couleur, une bordure
   latérale, et une flèche d'orientation (↔ / ↕).
   La couleur seule ne suffit pas : elle disparaît en plein
   soleil et pose problème aux daltoniens.
   ========================================================= */

.horizontal-table th.col-larg,
.horizontal-table th.col-haut {
    position: relative;
    font-weight: 800;
    letter-spacing: .04em;
}

/* --- LARGEUR : rouge, flèche horizontale --- */
.horizontal-table th.col-larg {
    color: var(--col-larg);
    background: color-mix(in srgb, var(--col-larg) 14%, var(--th-bg));
    border-top: 3px solid var(--col-larg);
}
.horizontal-table td.col-larg {
    background: color-mix(in srgb, var(--col-larg) 7%, transparent);
    box-shadow: inset 3px 0 0 -1px color-mix(in srgb, var(--col-larg) 55%, transparent);
}
.horizontal-table td.col-larg .td-input {
    color: var(--col-larg);
    font-weight: 700;
    border-color: color-mix(in srgb, var(--col-larg) 40%, var(--border));
}
.horizontal-table td.col-larg .td-input:focus {
    border-color: var(--col-larg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--col-larg) 25%, transparent);
}

/* --- HAUTEUR : gris clair, flèche verticale --- */
.horizontal-table th.col-haut {
    color: var(--col-haut);
    background: color-mix(in srgb, var(--col-haut) 12%, var(--th-bg));
    border-top: 3px solid var(--col-haut);
}
.horizontal-table td.col-haut {
    background: color-mix(in srgb, var(--col-haut) 6%, transparent);
    box-shadow: inset 3px 0 0 -1px color-mix(in srgb, var(--col-haut) 55%, transparent);
}
.horizontal-table td.col-haut .td-input {
    color: var(--col-haut);
    font-weight: 700;
    border-color: color-mix(in srgb, var(--col-haut) 40%, var(--border));
}
.horizontal-table td.col-haut .td-input:focus {
    border-color: var(--col-haut);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--col-haut) 25%, transparent);
}

/* Flèche d'orientation sous l'intitulé */
.col-axe {
    display: block;
    font-size: 15px;
    line-height: 1;
    margin-top: 2px;
    opacity: .9;
}

/* Repli si color-mix n'est pas supporté (vieux navigateurs) */
@supports not (background: color-mix(in srgb, red 10%, black)) {
    .horizontal-table th.col-larg { background: rgba(225,45,45,.14); }
    .horizontal-table td.col-larg { background: rgba(225,45,45,.07); }
    .horizontal-table th.col-haut { background: rgba(201,205,212,.12); }
    .horizontal-table td.col-haut { background: rgba(201,205,212,.06); }
}
