* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* LOGIN */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #1a237e;
    margin-bottom: 8px;
    font-size: 24px;
}

.login-box p {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: #1a237e;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #1a237e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #0d47a1;
}

.error-msg {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

/* DASHBOARD */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #1a237e;
    color: white;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-user {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.sidebar-user .name {
    font-weight: 600;
    font-size: 15px;
}

.sidebar-user .role {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu .menu-title {
    padding: 10px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.5;
    letter-spacing: 1px;
}

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.topbar h1 {
    font-size: 24px;
    color: #1a237e;
}

.btn-logout {
    padding: 8px 16px;
    background: #ffebee;
    color: #c62828;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card h3 {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.card .value {
    font-size: 32px;
    font-weight: 700;
    color: #1a237e;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-admin { background: #fce4ec; color: #c62828; }
.badge-bureau { background: #e8f5e9; color: #2e7d32; }
.badge-utilisateur { background: #e3f2fd; color: #1565c0; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

th {
    background: #f5f5f5;
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* AGENDA */
.btn-commission {
    padding: 12px 24px;
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #1565c0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-commission:hover, .btn-commission.selected {
    background: #1565c0;
    color: white;
}

.btn-creneau {
    padding: 8px 16px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-creneau:hover, .btn-creneau.selected {
    background: #2e7d32;
    color: white;
}

/* DASHBOARD PERSONNALISABLE */
.sortable-ghost {
    opacity: 0.4;
    background: #e3f2fd !important;
    border: 2px dashed #1a237e !important;
}

#dashboardBlocs > div {
    transition: transform 0.2s, box-shadow 0.2s;
}

#dashboardBlocs > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}

@keyframes progressBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

<!-- Réponse -->
                <div id="bcReponse" style="display:none;">
                    <div class="card" style="margin-bottom:15px; background:#f5f5f5; border-left:4px solid #888;">
                        <p style="font-size:13px; color:#555; margin:0;">❓ <strong id="bcQuestionPosee"></strong></p>
                    </div>
                    <div class="card" style="margin-bottom:15px; border-left:4px solid #1a237e;">
                        <h4 style="color:#1a237e; margin-bottom:10px;">🤖 Réponse de Claude</h4>
                        <div id="bcReponseTexte" style="font-size:14px; line-height:1.6;"></div>
                    </div>
                    <div id="bcGraphique" style="display:none; margin-bottom:15px;" class="card"></div>
                    <div class="card" style="background:#f9f9f9;">
                        <h4 style="color:#555; margin-bottom:10px; font-size:13px;">📚 Sources utilisées</h4>
                        <div id="bcSources"></div>
                    </div>
                </div>


.gu-unselectable { user-select: none !important; }

#zoneDossiersPersonnel, #zoneFichiersPersonnel {
    position: relative;
}
#zoneDossiersPersonnel > div, #zoneFichiersPersonnel > div {
    position: relative !important;
    flex-shrink: 0;
}

/* ─── RESPONSIVITÉ MOBILE ──────────────────────────────── */

/* Tablette : < 1024px */
@media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; }
}

/* Mobile : < 768px */
@media (max-width: 768px) {

    /* Sidebar cachée par défaut */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        width: 260px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        padding: 10px;
    }

    /* Topbar */
    .topbar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .topbar h2 { font-size: 16px; }

    /* Bouton hamburger */
    .btn-hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #1a237e;
        padding: 5px;
    }

    /* Overlay sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.open { display: block; }

    /* Cards dashboard en colonne */
    #dashboardBlocs {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* Tableaux scrollables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Formulaires pleine largeur */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Évite le zoom iOS */
    }

    /* Explorateur fichiers */
    #arborescencePersonnel {
        display: none;
    }
    #arborescencePersonnel.open {
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 998;
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }

    /* Messages */
    .messages-container {
        flex-direction: column !important;
    }
    #conversationsList {
        width: 100% !important;
        max-height: 200px;
        overflow-y: auto;
    }

    /* Boutons groupés */
    .cards {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Login */
    .login-box {
        padding: 20px;
        margin: 10px;
    }
  
    /* Profil */
    #section-profil > div {
        grid-template-columns: 1fr !important;
    }
    
    /* Commissions - explorateur */
    #panelFichiers {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    
    /* Assistant IA */
    #panelAssistant > div {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    
    /* Quizz */
    #panelQuizz > div {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    
    /* Messages */
    #section-messages > div {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    
    /* Base de connaissance */
    #section-base-connaissance .card {
        width: 100% !important;
    }

    /* Agenda bureau */
    #vue-bureau-agenda .card > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Suivi coûts */
    #contenuSuiviCouts > div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Dashboard blocs */
    #dashboardBlocs {
        grid-template-columns: 1fr !important;
    }
}

/* Très petit mobile : < 480px */
@media (max-width: 480px) {
    #dashboardBlocs {
        grid-template-columns: 1fr !important;
    }
    .cards {
        grid-template-columns: 1fr !important;
    }
    .topbar h2 { display: none; }
}   

/* ─── Badges niveau de risque (analyse IA documents personnels) ──────── */
.badge-risque {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.badge-risque-faible  { background: #e8f5e9; color: #2e7d32; }
.badge-risque-modere  { background: #fff8e1; color: #f57f17; }
.badge-risque-eleve   { background: #ffebee; color: #c62828; }
.badge-risque-inconnu { background: #f5f5f5; color: #666;    }