/* =========================================
   1. CONFIGURATION GÉNÉRALE & FONTS
   ========================================= */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================
   2. PAGE PORTAIL (ACCUEIL)
   ========================================= */
.portal-body {
    height: 100vh;
    background-image: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    z-index: 1;
}

.portal-container {
    position: relative; z-index: 2; text-align: center; width: 100%; max-width: 900px; padding: 20px;
}

.portal-logo { width: 200px; margin-bottom: 20px; }
.portal-title { color: white; font-size: 40px; margin-bottom: 10px; }
.portal-subtitle { color: #cbd5e1; font-size: 18px; margin-bottom: 50px; }

.access-cards { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }

.access-card {
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2); padding: 40px; border-radius: 20px;
    width: 300px; text-decoration: none; color: white; transition: transform 0.3s, background 0.3s;
}
.access-card:hover { transform: translateY(-10px); background: rgba(255, 255, 255, 0.15); border-color: #FF3171; }

.icon-circle {
    width: 70px; height: 70px; background: white; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; margin: 0 auto 20px; font-size: 28px; color: #1e293b;
}

.access-card h3 { margin: 10px 0; font-size: 22px; }
.access-card p { font-size: 14px; color: #cbd5e1; line-height: 1.5; margin-bottom: 30px; }

.btn-fake {
    display: inline-block; padding: 10px 20px; border-radius: 50px; font-weight: 600;
    font-size: 14px; background: transparent; border: 1px solid white; transition: 0.3s;
}
.access-card.learner:hover .btn-fake { background: #FF3171; border-color: #FF3171; }
.access-card.trainer:hover .btn-fake { background: #3498db; border-color: #3498db; }

.portal-footer { margin-top: 60px; color: #64748b; font-size: 12px; }

/* =========================================
   3. PAGE DE CONNEXION (LOGIN)
   ========================================= */
.page-connexion {
    background-color: #f4f6f8; height: 100vh; display: flex; justify-content: center; align-items: center;
}
.boite-connexion {
    background-color: white; padding: 40px; border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); width: 100%; max-width: 400px; text-align: center;
}
.logo-login { width: 180px; margin-bottom: 20px; }
h2 { font-weight: 700; color: #333; margin-bottom: 5px; }
.sous-titre { font-weight: 300; color: #666; margin-bottom: 30px; font-size: 14px; }

.champ-saisie { text-align: left; margin-bottom: 20px; }
.champ-saisie label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: #333; }
.champ-saisie input, .champ-saisie select {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: 'Montserrat', sans-serif; box-sizing: border-box;
}
.bouton-rose {
    background-color: #FF3171; color: white; border: none; width: 100%; padding: 15px;
    border-radius: 50px; font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.3s; margin-top: 10px;
}
.bouton-rose:hover { background-color: #e02b63; }
.mot-de-passe-oublie { display: block; margin-top: 20px; color: #999; text-decoration: none; font-size: 12px; }
.wrapper-password { position: relative; width: 100%; }
.icone-oeil {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #999; z-index: 10;
}
.icone-oeil:hover { color: #FF3171; }

/* =========================================
   4. LAYOUT APPLICATION (LA CORRECTION EST ICI)
   ========================================= */
.app-body { background-color: #f4f6f8; overflow: hidden; height: 100vh; }
.app-container { display: flex; height: 100vh; }

/* Sidebar (Menu Gauche) */
.sidebar {
    width: 260px; 
    background-color: #2c3e50; /* <--- C'EST CETTE LIGNE QUI MANQUAIT ! */
    color: white; 
    display: flex; flex-direction: column; padding: 20px;
    flex-shrink: 0; 
}

.sidebar-header { text-align: center; margin-bottom: 40px; }
.logo-sidebar { width: 150px; }

.menu-liste { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.menu-liste li { margin-bottom: 10px; }
.menu-liste a {
    color: #bdc3c7; text-decoration: none; display: flex; align-items: center;
    padding: 12px 15px; border-radius: 10px; transition: 0.3s; font-weight: 500;
}
.menu-liste i { margin-right: 10px; width: 20px; }
.menu-liste a:hover { background-color: rgba(255, 255, 255, 0.1); color: white; }
.menu-liste li.active a {
    background: linear-gradient(45deg, #FF3171, #fb76a0); color: white;
    box-shadow: 0 4px 15px rgba(255, 49, 113, 0.4);
}

.btn-logout {
    color: #fb76a0; text-decoration: none; font-size: 14px; padding: 10px;
    display: block; text-align: center; border: 1px solid #fb76a0; border-radius: 8px; transition: 0.3s;
}
.btn-logout:hover { background-color: #FF3171; color: white; border-color: #FF3171; }

/* Contenu Principal */
.main-content { flex-grow: 1; padding: 40px; overflow-y: auto; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.text-rose { color: #FF3171; }
.avatar { width: 50px; border-radius: 50%; border: 2px solid #FF3171; }

/* Cartes */
.stats-grid, .grid-documents { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.stat-card, .doc-card { background: white; padding: 25px; border-radius: 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.stat-card h3 { margin-top: 0; font-size: 14px; color: #888; text-transform: uppercase; font-weight: 600; }
.gros-chiffre { font-size: 40px; font-weight: 700; color: #2c3e50; margin: 10px 0; }
.barre-progression { background-color: #eee; height: 8px; border-radius: 10px; overflow: hidden; }
.niveau { background-color: #FF3171; height: 100%; }
.btn-action {
    background-color: #FF3171; color: white; border: none; padding: 10px 20px;
    border-radius: 8px; cursor: pointer; font-weight: 600; width: 100%; box-sizing: border-box;
}
.btn-action:hover { background-color: #fb76a0; }
.btn-small { background: none; border: 1px solid #ddd; padding: 8px 15px; border-radius: 6px; cursor: pointer; }

/* Signature */
.boite-signature {
    background: white; padding: 40px; border-radius: 15px; text-align: center;
    max-width: 700px; margin: 0 auto; box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
#zone-signature {
    border: 2px dashed #bdc3c7; border-radius: 8px; background-color: #fafafa;
    cursor: url('images/stylo.png') 0 30, auto; margin: 20px 0; touch-action: none; max-width: 100%;
}
.btn-gris {
    background-color: #ecf0f1; color: #2c3e50; border: 1px solid #bdc3c7;
    padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; margin-right: 10px;
}

/* Documents */
.doc-card { display: flex; align-items: center; transition: transform 0.2s; }
.doc-card:hover { transform: translateY(-5px); }
.icon-doc {
    width: 50px; height: 50px; border-radius: 10px; display: flex;
    justify-content: center; align-items: center; font-size: 24px; margin-right: 15px; flex-shrink: 0;
}
.icon-doc.pdf { background-color: #ffebee; color: #e74c3c; }
.icon-doc.word { background-color: #e3f2fd; color: #2980b9; }
.icon-doc.excel { background-color: #e8f5e9; color: #2ecc71; }
.icon-doc.ppt { background-color: #fff3e0; color: #e67e22; }
.icon-doc.link { background-color: #ffebee; color: #ff0000; }
.info-doc { flex-grow: 1; overflow: hidden; }
.info-doc h3 { margin: 0; font-size: 16px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-doc p { margin: 5px 0 0; font-size: 12px; color: #999; }
.btn-download {
    background-color: #f4f6f8; color: #333; border: none; padding: 10px;
    border-radius: 8px; cursor: pointer; text-decoration: none; font-size: 14px; transition: 0.3s;
}
.btn-download:hover { background-color: #FF3171; color: white; }

/* =========================================
   7. RESPONSIVE (MOBILE & TABLETTE)
   ========================================= */
@media (max-width: 768px) {
    .app-body { height: auto !important; overflow: auto !important; overflow-x: hidden; }
    .app-container { flex-direction: column; height: auto !important; }
    .sidebar {
        width: 100%; height: auto; flex-direction: row; align-items: center;
        justify-content: space-between; padding: 10px 15px; z-index: 100;
        background-color: #2c3e50 !important; /* Force le bleu sur mobile aussi */
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    .logo-sidebar { width: 100px; margin-bottom: 0; }
    .menu-liste { display: flex; overflow-x: auto; padding-bottom: 5px; margin-left: 10px; }
    .menu-liste li { margin-bottom: 0; margin-right: 10px; }
    .menu-liste a { font-size: 12px; padding: 8px; white-space: nowrap; }
    .sidebar-footer { display: none; }
    .main-content { width: 100%; padding: 20px; overflow: visible !important; height: auto !important; }
    .stats-grid, .grid-documents, .access-cards { display: flex; flex-direction: column; gap: 20px; }
    .portal-container { padding: 20px; margin-top: 50px; }
    .portal-title { font-size: 28px; }
    .portal-body { height: auto; padding: 20px 0; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .boite-connexion { width: 90%; margin: 20px auto; }
}
/* =========================================
   8. PIVOT FORMATION - UI FORMATEUR (PF)
   ========================================= */

.pf-toolbar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:16px;
}

.pf-search {
    background:white;
    border:1px solid #e2e8f0;
    border-radius:999px;
    padding:10px 12px;
    display:flex;
    align-items:center;
    gap:10px;
    box-shadow:0 5px 20px rgba(0,0,0,0.04);
    min-width:280px;
}
.pf-search i { color:#94a3b8; }
.pf-search input {
    border:none;
    outline:none;
    width:260px;
    font-family:'Montserrat', sans-serif;
    font-size:14px;
}

.pf-chip {
    background:#0f172a;
    color:white;
    padding:10px 12px;
    border-radius:999px;
    font-weight:800;
    font-size:12px;
    display:inline-flex;
    align-items:center;
    gap:10px;
}

.pf-pill {
    background:#f1f5f9;
    border:1px solid #e2e8f0;
    color:#0f172a;
    padding:8px 10px;
    border-radius:999px;
    font-weight:800;
    font-size:12px;
    display:inline-flex;
    align-items:center;
    gap:8px;
}

.pf-grid {
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap:16px;
}

.pf-card {
    background:white;
    border:1px solid #e2e8f0;
    border-radius:18px;
    padding:16px;
    box-shadow:0 5px 20px rgba(0,0,0,0.05);
    cursor:pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.pf-card:hover {
    transform: translateY(-3px);
    border-color:#FF3171;
}

.pf-card-top {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
}

.pf-card-title {
    font-weight:900;
    font-size:16px;
    color:#0f172a;
}
.pf-card-sub {
    margin-top:4px;
    color:#64748b;
    font-size:13px;
    font-weight:600;
}

.pf-meta {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
}

.pf-badge {
    font-size:12px;
    font-weight:900;
    padding:8px 10px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}
.pf-badge-ok {
    background:#dcfce7;
    border:1px solid #86efac;
    color:#166534;
}
.pf-badge-warn {
    background:#fff7ed;
    border:1px solid #fdba74;
    color:#9a3412;
}

.pf-card-footer {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:14px;
    padding-top:12px;
    border-top:1px solid #f1f5f9;
}
.pf-arrow {
    width:34px;
    height:34px;
    border-radius:999px;
    background:#FF3171;
    color:white;
    display:flex;
    justify-content:center;
    align-items:center;
}

.pf-empty {
    background:white;
    border:1px dashed #cbd5e1;
    border-radius:18px;
    padding:26px;
    text-align:center;
    color:#64748b;
    box-shadow:0 5px 20px rgba(0,0,0,0.03);
}
.pf-empty-icon {
    width:60px;
    height:60px;
    border-radius:18px;
    margin:0 auto 12px;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:24px;
    background:#f1f5f9;
    color:#0f172a;
}
.pf-empty h3 { margin:0 0 6px; color:#0f172a; }
.pf-empty p { margin:0; }
