* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Inter", sans-serif; background: #f8f9fa; min-height: 100vh; }

/* LOADER AUTH */
.auth-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.auth-loader.hide {
    opacity: 0;
    pointer-events: none;
}
.auth-loader .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e5e5;
    border-top-color: #0d0d0d;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cacher contenu pendant vérification */
body.auth-checking .sidebar,
body.auth-checking .main-content {
    opacity: 0;
}

/* SIDEBAR */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; background: #ffffff; border-right: 1px solid #e5e5e5; display: flex; flex-direction: column; z-index: 100; }
.sidebar-header { padding: 24px; border-bottom: 1px solid #e5e5e5; }
.sidebar-logo { display: flex; align-items: center; text-decoration: none; }
.sidebar-logo img { height: 40px; width: auto; }
.sidebar-nav { flex: 1; padding: 16px; overflow-y: auto; }
.nav-section { margin-bottom: 32px; }
.nav-section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: #999; margin-bottom: 8px; padding: 0 12px; letter-spacing: 0.5px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 4px; border-radius: 8px; color: #666; text-decoration: none; font-size: 0.9rem; transition: all 0.2s ease; cursor: pointer; }
.nav-item:hover { background: #f8f9fa; color: #0d0d0d; }
.nav-item.active { background: #0d0d0d; color: #ffffff; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer { padding: 16px; border-top: 1px solid #e5e5e5; }
.user-info { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 8px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #FFFF10 0%, #fff4a4 100%); display: flex; align-items: center; justify-content: center; font-weight: 600; color: #0d0d0d; font-size: 0.9rem; }
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 0.9rem; font-weight: 500; color: #0d0d0d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: #999; }
.btn-logout { width: 100%; padding: 10px 12px; background: transparent; border: 1px solid #e5e5e5; border-radius: 8px; color: #666; font-family: "Inter", sans-serif; font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-logout:hover { background: #fee; border-color: #fcc; color: #c33; }
.btn-logout svg { width: 16px; height: 16px; }

/* MAIN CONTENT */
.main-content { margin-left: 280px; padding: 32px; min-height: 100vh; }
.page-header { margin-bottom: 32px; }
.page-title { font-size: 2rem; font-weight: 600; color: #0d0d0d; margin-bottom: 8px; }
.page-subtitle { font-size: 1rem; color: #666; font-weight: 300; }

/* LAYOUT 2 COLONNES */
.dashboard-layout { display: grid; grid-template-columns: 1fr 350px; gap: 24px; }
.main-column { display: flex; flex-direction: column; gap: 24px; }
.sidebar-column { display: flex; flex-direction: column; gap: 24px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.stat-card { background: #ffffff; border-radius: 12px; padding: 24px; border: 1px solid #e5e5e5; transition: all 0.2s ease; }
.stat-card:hover { border-color: #FBE01D; box-shadow: 0 4px 12px rgba(251, 224, 29, 0.15); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #FFFF10 0%, #fff4a4 100%); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.stat-icon svg { width: 20px; height: 20px; color: #0d0d0d; }
.stat-value { font-size: 1.75rem; font-weight: 600; color: #0d0d0d; margin-bottom: 4px; }
.stat-label { font-size: 0.875rem; color: #666; }

/* CONTENT SECTIONS */
.content-section { background: #ffffff; border-radius: 12px; padding: 24px; border: 1px solid #e5e5e5; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.25rem; font-weight: 600; color: #0d0d0d; }
.btn-view-all { font-size: 0.875rem; color: #666; text-decoration: none; transition: color 0.2s ease; cursor: pointer; }
.btn-view-all:hover { color: #0d0d0d; }

/* DOCUMENTS */
.document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.document-card { background: #f8f9fa; border-radius: 10px; padding: 20px; cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; }
.document-card:hover { background: #ffffff; border-color: #e5e5e5; transform: translateY(-2px); }
.document-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.document-icon { width: 36px; height: 36px; border-radius: 8px; background: #ffffff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.document-icon svg { width: 18px; height: 18px; color: #0d0d0d; }
.document-info { flex: 1; min-width: 0; }
.document-title { font-size: 0.95rem; font-weight: 500; color: #0d0d0d; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-meta { font-size: 0.8rem; color: #999; }
.document-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5e5e5; }
.document-type { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; background: #e5e5e5; color: #666; font-weight: 500; }
.document-actions { display: flex; gap: 8px; }
.action-btn { width: 28px; height: 28px; border-radius: 6px; background: transparent; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; color: #666; }
.action-btn:hover { background: #e5e5e5; color: #0d0d0d; }
.action-btn svg { width: 16px; height: 16px; }

/* QUIZ */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.quiz-card { background: #f8f9fa; border-radius: 10px; padding: 20px; cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; }
.quiz-card:hover { background: #ffffff; border-color: #e5e5e5; transform: translateY(-2px); }
.quiz-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.quiz-icon { width: 48px; height: 48px; border-radius: 10px; background: linear-gradient(135deg, #FFFF10 0%, #fff4a4 100%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quiz-icon svg { width: 24px; height: 24px; color: #0d0d0d; }
.quiz-info { flex: 1; min-width: 0; }
.quiz-title { font-size: 1rem; font-weight: 500; color: #0d0d0d; margin-bottom: 4px; }
.quiz-meta { display: flex; gap: 16px; font-size: 0.8rem; color: #999; margin-top: 8px; }

/* ÉVÉNEMENTS */
.events-section { background: #ffffff; border-radius: 12px; padding: 24px; border: 1px solid #e5e5e5; }
.events-section h3 { font-size: 1.25rem; font-weight: 600; color: #0d0d0d; margin-bottom: 20px; }
.event-card { padding: 16px; background: #f8f9fa; border-radius: 10px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s ease; }
.event-card:hover { background: #ffffff; border: 1px solid #e5e5e5; }
.event-date { font-size: 0.75rem; color: #667eea; font-weight: 600; margin-bottom: 6px; }
.event-title { font-size: 0.95rem; font-weight: 500; color: #0d0d0d; margin-bottom: 4px; }
.event-location { font-size: 0.8rem; color: #999; display: flex; align-items: center; gap: 4px; }
.event-location svg { width: 12px; height: 12px; }
.empty-events { text-align: center; padding: 40px 20px; color: #999; font-size: 0.9rem; }

/* MODAL QUIZ */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; border-radius: 16px; padding: 32px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal-title { font-size: 1.5rem; font-weight: 600; color: #0d0d0d; }
.btn-close-modal { background: none; border: none; cursor: pointer; color: #666; padding: 4px; }
.btn-close-modal:hover { color: #0d0d0d; }
.quiz-detail { margin-bottom: 16px; }
.quiz-detail-label { font-size: 0.875rem; color: #666; margin-bottom: 4px; }
.quiz-detail-value { font-size: 1rem; color: #0d0d0d; font-weight: 500; }
.quiz-description { font-size: 0.95rem; color: #666; line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; }
.btn-modal { flex: 1; padding: 14px 24px; border-radius: 8px; font-family: inherit; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #0d0d0d; color: white; border: none; }
.btn-primary:hover { background: #FFFF10; color: black; }
.btn-secondary { background: transparent; color: #666; border: 1px solid #e5e5e5; }
.btn-secondary:hover { border-color: #0d0d0d; color: #0d0d0d; }

/* VUES */
.view-section { display: none; }
.view-section.active { display: block; }

/* RESPONSIVE */
@media (max-width: 1200px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar-column { order: -1; }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-280px); transition: transform 0.3s ease; }
    .main-content { margin-left: 0; }
}