
        /* ==================================================== */
        /* DESIGN ET MISE EN PAGE                               */
        /* ==================================================== */
        :root { --bleu-nuit: #0f172a; --bleu-hover: #1e293b; --bleu-electrique: #2563eb; --orange-vif: #f97316; --orange-hover: #ea580c; --fond-ecran: #f1f5f9; --texte-principal: #334155; --gris-bordure: #cbd5e1; --vert-succes: #10b981; }
        body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; display: flex; height: 100vh; background-color: var(--fond-ecran); color: var(--texte-principal); overflow: hidden; }
        #contenu-app { display: none; width: 100%; height: 100vh; }
        
        #ecran-connexion { display: flex; justify-content: center; align-items: center; height: 100vh; width: 100vw; background-color: var(--bleu-nuit); position: fixed; top: 0; left: 0; z-index: 9999; }
        .box-connexion { background: white; width: 380px; text-align: center; padding: 40px 30px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); border-top: 5px solid var(--orange-vif); box-sizing: border-box;}
        .box-connexion h2 { color: var(--bleu-nuit); margin-top: 0; margin-bottom: 5px; font-size: 22px; text-transform: uppercase; letter-spacing: 1px;}
        .box-connexion p { color: #64748b; font-size: 13px; margin-bottom: 25px; }

        #mobile-header { display: none; }
        #overlay-menu { display: none; }

        .menu-lateral { width: 260px; background-color: var(--bleu-nuit); color: white; padding: 25px 0 0 0; display: flex; flex-direction: column; z-index: 100; box-shadow: 4px 0 15px rgba(0,0,0,0.1); overflow-y: auto;}
        .menu-lateral h2 { text-align: center; margin-bottom: 30px; font-size: 1.4rem; color: #ffffff; letter-spacing: 1px; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; margin-left: 20px; margin-right: 20px;}
        .menu-lateral a { display: block; color: #cbd5e1; padding: 15px 25px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: all 0.3s ease; font-weight: 500; font-size: 14px;}
        .menu-lateral a:hover { background-color: var(--bleu-hover); color: white; padding-left: 32px; }
        .menu-lateral a.actif { background-color: var(--bleu-electrique); color: white; font-weight: bold; border-left: 6px solid var(--orange-vif); padding-left: 19px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
        
        .contenu-principal { flex-grow: 1; padding: 30px 40px; overflow-y: auto; height: 100vh; box-sizing: border-box; position: relative; }
        .carte { 
    background: white; padding: 25px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.04); 
    border: 1px solid #ffffff; margin-bottom: 25px; position: relative; 
    transition: box-shadow 0.3s ease; box-sizing: border-box;
    animation: apparitionDouce 0.4s ease-out; /* On ajoute l'animation ici */
}

/* On crée la règle de l'animation juste en dessous */
@keyframes apparitionDouce {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
        
        #cloud-status { position: absolute; top: 20px; right: 40px; font-size: 13px; font-weight: bold; color: var(--vert-succes); background: #ecfdf5; padding: 8px 18px; border-radius: 30px; border: 1px solid #a7f3d0; display: flex; align-items: center; gap: 8px; z-index: 1000;}
        .pulse { display: inline-block; width: 10px; height: 10px; background-color: var(--vert-succes); border-radius: 50%; animation: blink 1.5s infinite; }
        @keyframes blink { 0% { opacity: 1; } 70% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { opacity: 1; } }

        /* DESIGN DES SECTIONS AUTOCERFA */
        .mega-form-section { margin-bottom: 45px; }
        .mega-form-titre { 
            color: #334155; 
            font-size: 18px; 
            font-weight: normal; 
            text-transform: uppercase; 
            margin-bottom: 25px; 
            border-bottom: 2px solid var(--orange-vif); 
            padding-bottom: 10px; 
            display: flex; 
            justify-content: center; 
            align-items: center;
            position: relative;
        }
        
        .grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 60px; }
        
        /* DESIGN DES CHAMPS SANS BORDURES (Style AutoCerfa) */
        .form-groupe { 
            margin-bottom: 5px; 
            background-color: #ffffff; 
            border-bottom: 1px solid #cbd5e1; 
            padding: 8px 12px 4px 12px; 
            border-radius: 2px 2px 0 0; 
            transition: all 0.2s; 
        }
        .form-groupe label { 
            display: flex; 
            align-items: center; 
            font-size: 12px; 
            color: #64748b; 
            margin-bottom: 4px; 
            font-weight: normal; 
        }
        .icon-help { 
            background: #334155; 
            color: white; 
            border-radius: 50%; 
            display: inline-flex; 
            align-items: center;
            justify-content: center;
            width: 14px; 
            height: 14px; 
            font-size: 10px; 
            margin-left: 8px; 
            font-weight: bold; 
            cursor: help;
        }
        .form-groupe input, .form-groupe select { 
            width: 100%; 
            border: none; 
            background: transparent; 
            padding: 4px 0; 
            font-size: 15px; 
            color: #0f172a; 
            outline: none; 
        }
        
        /* SURBRILLANCE EXACTE AUTOCERFA */
        .form-groupe.champ-surligne { 
            background-color: #fef0d8 !important; 
            border-bottom: 2px solid #f97316 !important; 
        }
        .form-groupe.champ-surligne label { 
            color: #78350f !important; 
        }

        .btn-principal { padding: 16px 20px; background-color: var(--orange-vif); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 16px; width: 100%; transition: all 0.3s ease; margin-bottom: 20px; text-transform: uppercase;}
        .btn-principal:hover { background-color: var(--orange-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4); }
        .btn-supprimer { background-color: #ef4444; padding: 6px 12px; color: white; border:none; border-radius: 4px; cursor: pointer;}
        .btn-editer { background-color: var(--bleu-electrique); padding: 6px 12px; color: white; border:none; border-radius: 4px; cursor: pointer; margin-right: 5px;}
        
        .table-standard, .table-mon-stock, .table-ventes { width: 100%; border-collapse: separate; border-spacing: 0; background: white; border-radius: 8px; border: 1px solid #e2e8f0; font-size: 13px;}
        .table-standard th, .table-mon-stock th, .table-ventes th { background-color: #f8fafc; color: #64748b; padding: 16px 12px; text-align: left; font-size: 11px; text-transform: uppercase; border-bottom: 2px solid #e2e8f0; }
        .table-standard td, .table-mon-stock td, .table-ventes td { padding: 16px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;}
        .badge-ordre { background-color: #e0f2fe; color: var(--bleu-electrique); padding: 6px 10px; border-radius: 6px; font-weight: bold; display: inline-block; min-width: 25px; text-align: center; border: 1px solid #bae6fd;}
        .badge-facture { background-color: var(--vert-succes); color: white; padding: 5px 10px; border-radius: 4px; font-weight: bold; font-size: 12px;}

        .dashboard-grid { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
        .dash-card { background: #ffffff; border-top: 5px solid var(--bleu-electrique); padding: 25px; border-radius: 10px; flex: 1; min-width: 200px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease; box-sizing: border-box;}
        .dash-card h3 { margin: 0 0 10px 0; font-size: 13px; color: #64748b; text-transform: uppercase; }
        .dash-card p { margin: 0; font-size: 34px; font-weight: 800; color: var(--bleu-nuit); }
        
        .doc-section { margin-bottom: 30px; background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; box-sizing: border-box;}
        .doc-section h3 { color: var(--bleu-nuit); border-bottom: 2px solid var(--orange-vif); padding-bottom: 8px; font-size: 15px; display: inline-block; margin-bottom: 15px; }
        .doc-list { list-style: none; padding: 0; margin: 0; }
        .doc-list li { margin-bottom: 12px; }
        .doc-list a { color: var(--bleu-electrique); text-decoration: none; font-size: 14px; display: flex; align-items: center; transition: color 0.2s; font-weight: 500; cursor:pointer;}
        .doc-list a:hover { color: var(--orange-vif); text-decoration: underline;}

        .table-police { width: 100%; border-collapse: collapse; font-size: 10px; background: white; white-space: nowrap; border: 2px solid #cbd5e1;}
        .table-police th, .table-police td { border: 1px solid #cbd5e1; padding: 8px; text-align: center; }
        .table-police th { background-color: var(--bleu-nuit); color: #ffffff; font-weight: bold; text-transform: uppercase; font-size: 9px; }
        .table-police .th-main { background-color: #1e293b; font-size: 10px; }
        .police-td-left { text-align: left !important; white-space: normal; min-width: 120px; font-size: 10px; line-height: 1.3; }

        #bandeau-edition { display: none; background-color: var(--bleu-electrique); color: white; padding: 15px; border-radius: 8px; margin-bottom: 10px; font-weight: bold; align-items: center; justify-content: space-between;}
        #btn-annuler-edition { background: white; color: var(--bleu-electrique); border: none; padding: 6px 12px; border-radius: 4px; font-weight: bold; cursor: pointer; }
        
        #menu-documents-rapides { display: none; background-color: #f8fafc; border: 2px solid #8b5cf6; padding: 15px; border-radius: 8px; margin-bottom: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);}
        .titre-docs-rapides { color: #8b5cf6; font-size: 14px; font-weight: bold; margin-top: 0; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px;}
        .grille-boutons-docs { display: flex; gap: 10px; flex-wrap: wrap; }
        .btn-doc-auto { background-color: white; border: 1px solid #cbd5e1; color: var(--bleu-nuit); padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: all 0.2s;}
        .btn-doc-auto:hover { border-color: #8b5cf6; color: #8b5cf6; box-shadow: 0 4px 6px rgba(139, 92, 246, 0.2); transform: translateY(-2px);}

        /* RESPONSIVE MOBILE */
        @media (max-width: 768px) {
            #contenu-app { flex-direction: column; }
            #mobile-header { display: flex; justify-content: space-between; align-items: center; background: var(--bleu-nuit); color: white; padding: 15px 20px; z-index: 1000;}
            .menu-lateral { position: fixed; top: 0; left: -300px; height: 100vh; width: 260px; transition: left 0.3s ease; z-index: 2000; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
            .menu-lateral.ouvert { left: 0; }
            #overlay-menu { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); z-index: 1999; }
            #overlay-menu.ouvert { display: block; }
            .contenu-principal { width: 100%; padding: 15px; height: calc(100vh - 65px); }
            .grid-2-col { grid-template-columns: 1fr; gap: 10px; }
            .box-connexion { width: 90%; padding: 30px 20px; }
            .btn-editer, .btn-supprimer { width: 100%; margin:0; text-align:center; margin-bottom: 5px;}
        }

        /* STYLE POUR L'IMPRESSION */
        #zone-impression { display: none; }
        @media print {
            @page { margin: 10mm; }
            html, body { display: block !important; height: auto !important; overflow: visible !important; background-color: white !important; margin: 0 !important; padding: 0 !important; color: black !important;}
            #ecran-connexion, .menu-lateral, .contenu-principal, #mobile-header, #overlay-menu { display: none !important; }
            #zone-impression { display: block !important; position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; }
            .format-police { display: block !important; width: 100%; }
            @page police-page { size: A4 landscape; margin: 5mm; }
            .format-police { page: police-page; }
            .cerfa-container { font-family: Arial, sans-serif; font-size: 12px; line-height: 1.4; }
            .cerfa-header { text-align: center; border-bottom: 2px solid black; padding-bottom: 10px; margin-bottom: 20px; }
            .cerfa-titre { font-size: 18px; font-weight: bold; margin: 5px 0; }
            .cerfa-num { font-size: 14px; color: #555; }
            .cerfa-section { border: 1px solid #000; margin-bottom: 15px; padding: 10px; position: relative; }
            .cerfa-section-titre { background: white; font-weight: bold; position: absolute; top: -10px; left: 10px; padding: 0 5px; font-size: 14px; }
            .cerfa-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
            .cerfa-col { flex: 1; padding: 0 10px; }
            .cerfa-label { color: #555; font-size: 10px; display: block; }
            .cerfa-value { font-weight: bold; font-size: 13px; border-bottom: 1px dotted #ccc; display: block; min-height: 18px; }
            .cerfa-signatures { display: flex; justify-content: space-between; margin-top: 30px; }
            .cerfa-box-sign { border: 1px dashed #000; width: 45%; height: 100px; padding: 5px; }
        }
        /* ==================================================== */
/* NOTIFICATIONS (TOASTS)                               */
/* ==================================================== */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: white;
    color: var(--bleu-nuit);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(150%); /* Caché sur la droite au début */
    transition: transform 0.3s ease-out;
    border-left: 5px solid var(--bleu-electrique);
}

.toast.show {
    transform: translateX(0); /* Glisse vers la gauche pour s'afficher */
}

.toast.success { border-left-color: var(--vert-succes); }
.toast.error { border-left-color: #ef4444; }

/* ==================================================== */
/* FENETRES DE CONFIRMATION (MODALES)                   */
/* ==================================================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.7); /* Fond noir transparent */
    display: flex; justify-content: center; align-items: center;
    z-index: 10001; /* Au-dessus de tout le reste */
}
.modal-box {
    background: white; padding: 25px 30px; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); width: 400px; max-width: 90%;
    border-top: 5px solid #ef4444; /* Bordure rouge en haut */
    animation: popModal 0.2s ease-out;
}
@keyframes popModal {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.btn-secondaire {
    padding: 10px 20px; background-color: #e2e8f0; color: #334155;
    border: none; border-radius: 8px; cursor: pointer; font-weight: bold;
    transition: background 0.2s;
}
.btn-secondaire:hover { background-color: #cbd5e1; }

/* --- ASTUCE : BOUTON DE SAUVEGARDE TOUJOURS VISIBLE (CORRIGÉ) --- */
#btn-validation-dossier {
    position: fixed !important;
    bottom: 30px !important;
    right: 40px !important;
    width: 350px !important;
    z-index: 1000 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    border: 3px solid white !important;
    margin: 0 !important;
}

/* Et on l'adapte pour que ça reste joli sur téléphone mobile : */
@media (max-width: 768px) {
    #btn-validation-dossier {
        right: 50% !important;
        transform: translateX(50%) !important;
        width: 90% !important;
        bottom: 20px !important;
    }
}

/* --- ASTUCE : DESIGN DES BOUTONS FILTRES --- */
.btn-filtre {
    background-color: white; 
    border: 1px solid #cbd5e1; 
    color: var(--bleu-nuit);
    padding: 8px 14px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: all 0.2s;
}
.btn-filtre:hover { 
    border-color: var(--bleu-electrique); 
    background-color: #f1f5f9; 
    transform: translateY(-2px);
}
.btn-filtre.actif { 
    background-color: var(--bleu-electrique); 
    color: white; 
    border-color: var(--bleu-electrique); 
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}
    