/* =========================================
   VARIABLES GLOBALES
========================================= */
:root {
    --primary: #4AB0C1;
    --dark: #0A192F;
    --crimson-red: #E53E3E;
}

/* =========================================
   LAYOUT GLOBAL
========================================= */

body {
    display: flex;
    height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #F4F7F6;
    overflow: hidden;
}

main {
    flex: 1;
}

.main-container {
    flex: 1; /* Prend tout l'espace disponible entre le header et le footer */
    display: flex;
    align-items: center; /* Centre verticalement le contenu au milieu de l'écran */
    justify-content: center; /* Centre horizontalement */
    gap: 50px; /* Espace entre ton texte de gauche et ton formulaire de droite */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* =========================================
   HEADER
========================================= */

.main-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background-color: #0A192F;
    color: #FFFFFF;
    padding: 20px 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-img {
    height: 35px;
    width: auto;
}

.logo-text {
    color: #4AB0C1;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    transform: translateY(-0.70px);
}

.btn-back-header {
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.8rem;
    margin-left: auto;
}

.btn-back-header:hover {
    background-color: #FFFFFF;
    color: #0A192F;
}

/* =========================================
   FOOTER
========================================= */

.main-footer {
    background-color: #0A192F;
    color: #FFFFFF;
    padding: 15px;
    display: flex;
    justify-content: center;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* =========================================
   MEDIA QUERIES — HEADER & FOOTER
========================================= */

@media (min-width: 768px) {
    .main-header,
    .main-footer {
        padding: 20px 50px;
    }

    .logo-img { height: 50px; }
    .logo-text { font-size: 1.4rem; }
    .main-footer { font-size: 0.9rem; }
}

/* =========================================
   PAGE ACCUEIL
========================================= */

.accueil-section {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    gap: 40px;
    align-items: center;
    background-color: #F4F7F6;
}

.accueil-text {
    text-align: center;
    color: #333;
}

.accueil-text h1 {
    color: #0A192F;
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.feature-badge {
    background-color: #FFFFFF;
    padding: 10px 15px;
    border-radius: 9px;
    font-weight: bold;
    color: #0A192F;
    border-left: 4px solid #4AB0C1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.login-card {
    background-color: #FFFFFF;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.login-card h2 {
    color: #0A192F;
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #CCC;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-submit {
    width: 100%;
    background-color: #4AB0C1;
    color: #FFFFFF;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
    border-radius: 9px;
}

.btn-submit:hover {
    background-color: #388a99;
}

@media (min-width: 768px) {
    .accueil-section {
        flex-direction: row;
        justify-content: center;
        padding: 50px;
    }

    .accueil-text {
        flex: 1;
        max-width: 500px;
        text-align: left;
    }

    .accueil-text h1 {
        font-size: 2.8rem;
    }

    .features {
        flex-direction: row;
        width: 100%;
    }
}

/* =========================================
   PAGE PROFIL
========================================= */

.profil-wrapper {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 30px;
    background-color: #F4F7F6;
    flex: 1;
}

.profil-sidebar {
    background-color: #FFFFFF;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-placeholder {
    width: 90px;
    height: 90px;
    background-color: #0A192F;
    color: #4AB0C1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.user-info {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    text-align: left;
    width: 100%;
}

.user-info li {
    padding: 12px 0;
    border-bottom: 1px solid #EEE;
    font-size: 0.95rem;
    color: #333;
}

.btn-logout {
    width: 100%;
    background-color: transparent;
    color: #CC0000;
    border: 1px solid #CC0000;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    box-sizing: border-box;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: rgba(204, 0, 0, 0.05);
}

.profil-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-card {
    background-color: #FFFFFF;
    padding: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.content-card h2 {
    color: #0A192F;
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* =========================================
   BARRE DE PROGRESSION
========================================= */

.progression-bar-container {
    width: 100%;
    background-color: #EEE;
    border-radius: 20px;
    height: 25px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    transform: translateZ(0);
    isolation: isolate;
}

.progression-bar-filler {
    background-color: #4AB0C1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: inherit;
}

.progression-text {
    color: #FFFFFF;
    font-weight: bold;
    padding-right: 15px;
    font-size: 0.85rem;
}

.progression-summary {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
    font-style: italic;
}

/* =========================================
   TABLEAU DES MODULES (Version Finale Sans Bug)
========================================= */

.modules-table {
    display: block;
    width: 100%;
    border-collapse: collapse;
}

.modules-table thead {
    display: none;
}

.modules-table tbody, 
.modules-table tr {
    display: block;
    width: 100%;
}

.modules-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 20px 0;
    border-bottom: 1px solid #E2E8F0;
}

.modules-table tr:last-child {
    border-bottom: none;
}

.modules-table td {
    display: block;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
    text-align: left !important;
    vertical-align: middle;
}

/* --- STYLE SUR MOBILE --- */

.modules-table td:nth-child(1) {
    grid-column: span 2;
    font-size: 0.85rem;
    font-weight: bold !important; /* REPASSÉ EN GRAS ICI */
    text-transform: none !important; /* DESACTIVATION DES MAJUSCULES */
    color: var(--primary);
    letter-spacing: 0.5px;
}

.modules-table td:nth-child(2) {
    grid-column: span 2;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 4px;
}

.modules-table td:nth-child(3) {
    grid-column: span 1;
    justify-self: start;
}

.modules-table td:nth-child(4) {
    grid-column: span 1;
    justify-self: end;
    font-weight: bold;
    color: #4A5568;
    font-size: 0.95rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    text-align: center;
}

.status-done  { background-color: rgba(0, 204, 0, 0.1); color: #008800; border: 1px solid #008800; }
.status-doing { background-color: rgba(255, 165, 0, 0.1); color: #CC8400; border: 1px solid #CC8400; }
.status-todo  { background-color: #F4F7F6; color: #666; border: 1px solid #CCC; }


/* --- STYLE SUR PC (Écrans > 768px) --- */

@media (min-width: 768px) {
    .modules-table {
        display: table;
        table-layout: fixed;
    }

    .modules-table thead {
        display: table-header-group;
    }

    .modules-table tbody {
        display: table-row-group;
    }

    .modules-table tr {
        display: table-row;
        grid-template-columns: none;
        gap: 0;
    }

    .modules-table th,
    .modules-table td {
        display: table-cell;
        padding: 18px 15px !important;
        border-bottom: 1px solid #EEE !important;
    }

    /* Première colonne "Module X" sur PC */
    .modules-table th:nth-child(1), 
    .modules-table td:nth-child(1) { 
        width: 15%; 
        font-size: 1rem; 
        color: inherit; 
        font-weight: bold !important; /* MIS EN GRAS ICI POUR LE PC */
        text-transform: none !important; /* PAS DE MAJUSCULES SUR PC */
    }
    
    .modules-table th:nth-child(2), .modules-table td:nth-child(2) { width: 50%; font-size: 1rem; margin-bottom: 0; }
    .modules-table th:nth-child(3), .modules-table td:nth-child(3) { width: 20%; text-align: center !important; justify-self: auto; }
    .modules-table th:nth-child(4), .modules-table td:nth-child(4) { width: 15%; text-align: center !important; justify-self: auto; font-size: 1rem; }

    .modules-table tr:last-child td {
        border-bottom: none !important;
    }
}

/* =========================================
   BADGES (PROFIL)
========================================= */

.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.badge-item {
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: default;
}

.badge-item.earned {
    border: 2px solid #4AB0C1;
    color: #0A192F;
    background-color: rgba(74, 176, 193, 0.1);
}

.badge-item.locked {
    border: 2px dashed #CCC;
    color: #999;
}

/* =========================================
   CARD HEADER FLEX
========================================= */

.card-header-flex {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.card-header-flex h2 {
    margin-bottom: 0;
}

.card-header-flex div {
    width: 100%;
    justify-content: space-between;
}

.btn-access {
    color: #0A192F;
    border: 1px solid #0A192F;
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-access:hover {
    background-color: #0A192F;
    color: #FFFFFF;
}

@media (min-width: 481px) {
    .btn-access {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) {
    .card-header-flex {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .card-header-flex div {
        width: auto;
    }

    .btn-access {
        flex: none;
        text-align: left;
        justify-content: flex-start;
    }
}

/* =========================================
   MEDIA QUERIES — PROFIL
========================================= */

@media (min-width: 768px) {
    .profil-wrapper {
        flex-direction: row;
        justify-content: center;
        padding: 50px;
        align-items: flex-start;
    }

    .profil-sidebar {
        flex: 0 0 280px;
        position: sticky;
        top: 30px;
    }

    .profil-content {
        flex: 1;
        max-width: 850px;
    }

    .badges-grid {
        justify-content: flex-start;
    }
}

/* =========================================
   PAGE MODULE
========================================= */

.module-wrapper {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

.module-card {
    background-color: #FFFFFF;
    border: 1px solid #e2e8f0;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module-card h1 {
    color: #0A192F;
    border-bottom: 3px solid #4AB0C1;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

/* Message alerte succès */
.alert-box.success-msg {
    position: relative;
    background-color: #E6F4EA;
    border-left: 5px solid #34A853;
    color: #137333;
    padding: 15px 40px 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: fadeInDown 0.5s ease-out;
}

.btn-close-alert {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #137333;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.btn-close-alert:hover {
    opacity: 0.7;
}

.module-link {
    text-decoration: none;
    color: #0A192F;
    transition: color 0.3s;
}

.module-link:hover {
    color: #4AB0C1;
}

/* QCM */
.qcm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 25px 0;
}

.qcm-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #EEE;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.qcm-option:hover {
    background-color: #F8F9FA;
    border-color: #4AB0C1;
}

.qcm-option input {
    margin-right: 12px;
}

@media (min-width: 768px) {
    .qcm-grid {
        grid-template-columns: 1fr 1fr;
    }

    .module-wrapper {
        padding: 50px 20px;
    }
}

/* =========================================
   PAGE MODULES (CATALOGUE)
========================================= */

.modules-intro {
    text-align: center;
    margin-bottom: 30px;
}

.modules-intro h1 { color: #0A192F; margin-bottom: 10px; }
.modules-intro p  { color: #666; }

.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 90%;
    max-width: 700px;
    margin: 0 auto;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.module-icon { font-size: 2rem; }

.module-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.module-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.difficulty-stars { color: #FFB020; }
.meta-time { font-size: 0.85rem; font-weight: bold; color: #333; }

.btn-module {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    margin-top: 20px;
}

/* =========================================
   PROFIL ADMIN — STATS
========================================= */

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.7rem;
    font-weight: bold;
    color: #4AB0C1;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (min-width: 601px) {
    .stats-grid {
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
    }
}

/* =========================================
   PAGE PROGRESSION GLOBALE
========================================= */

.progression-page .progression-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
}

@media (min-width: 900px) {
    .progression-page .progression-grid { grid-template-columns: 1fr 1fr; }
}

.progression-page .progression-card {
    background-color: rgba(74, 176, 193, 0.05);
    border: 1px solid rgba(74, 176, 193, 0.2);
    border-radius: 20px;
    padding: 20px 15px;
    display: flex;
    align-items: center;
    min-height: 220px;
    box-sizing: border-box;
}

.progression-page .progression-flex {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.progression-page .circular-progress {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.progression-page .circular-progress::before {
    content: "";
    position: absolute;
    width: 68px;
    height: 68px;
    background-color: #f8fcfc;
    border-radius: 50%;
}

.progression-page .progress-value {
    position: relative;
    font-weight: bold;
    font-size: 1.2rem;
    color: #0A192F;
}

.progression-page .progression-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.progression-page .progression-list li {
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: flex;
}

.progression-page .progression-list strong {
    min-width: 110px;
    display: inline-block;
}

@media (min-width: 601px) {
    .progression-page .progression-flex  { gap: 30px; }
    .progression-page .progression-card  { padding: 30px 25px; }
    .progression-page .circular-progress { width: 100px; height: 100px; }
    .progression-page .circular-progress::before { width: 80px; height: 80px; }
}

/* =========================================
   PAGE BADGES
========================================= */

.badges-page .badges-list-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px auto;
}

.badges-page .badge-full-card {
    background-color: #FFFFFF;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #EEE;
    transition: transform 0.2s ease;
}

.badges-page .badge-full-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.badges-page .badge-full-card.earned {
    border-left: 8px solid #4AB0C1;
}

.badges-page .badge-full-card.locked {
    opacity: 0.7;
    background-color: #FAFAFA;
}

.badges-page .badge-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.badges-page .badge-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
}

.badges-page .badge-status-label {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    background: #EEE;
}

.badges-page .earned .badge-status-label {
    background-color: rgba(74, 176, 193, 0.1);
    color: #4AB0C1;
}

.badges-page .badge-details h2 {
    margin: 0 0 10px 0;
    color: #0A192F;
    font-size: 1.5rem;
}

.badges-page .congrats-msg {
    color: #2D6A4F;
    font-weight: bold;
    margin-bottom: 15px;
}

.badges-page .locked-msg {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.badges-page .skills-intro {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.badges-page .skills-list {
    list-style: none;
    padding: 0;
}

.badges-page .skills-list li {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    text-align: left;
}

.badges-page .skills-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4AB0C1;
    font-weight: bold;
}

@media (min-width: 701px) {
    .badges-page .badge-full-card {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 40px;
    }

    .badges-page .skills-list li {
        text-align: left;
    }
}

/* =========================================
   PAGE RÉSULTATS QCM
========================================= */

.result-page .result-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.result-page .result-card {
    background: #FFFFFF;
    border-radius: 25px;
    padding: 50px 40px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #EEE;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-page .result-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 20px;
}

.result-page h1 {
    color: #0A192F;
    margin-bottom: 10px;
}

.result-page .score-display {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.result-page .score-circle {
    width: 150px;
    height: 150px;
    border: 8px solid #4AB0C1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(74, 176, 193, 0.05);
}

.result-page .score-circle.failure {
    border-color: #FFB020;
    background-color: rgba(255, 176, 32, 0.05);
}

.result-page .score-number {
    font-size: 3rem;
    font-weight: bold;
    color: #0A192F;
}

.result-page .score-total {
    color: #888;
    font-size: 1.2rem;
}

.result-page .reward-box,
.result-page .feedback-box {
    background: #F8FCFC;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px dashed #4AB0C1;
}

.result-page .badge-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.result-page .badge-emoji { font-size: 2.5rem; }
.result-page .badge-name  { font-weight: bold; color: #0A192F; }

.result-page .result-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-page .btn-outline {
    text-decoration: none;
    color: #4AB0C1;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 10px;
    transition: 0.3s;
}

.result-page .btn-outline:hover {
    color: #0A192F;
}

@media (min-width: 600px) {
    .result-page .result-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* =========================================
   GESTION UTILISATEURS / TABLEAU ADMIN
========================================= */

.user-management-section .mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.user-management-section .mgmt-search-area {
    margin-bottom: 20px;
}

.user-management-section .mgmt-input {
    width: 100%;
    max-width: 350px;
    padding: 10px 15px;
    border: 1px solid #DDD;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.user-management-section .mgmt-input:focus {
    border-color: #4AB0C1;
    box-shadow: 0 0 5px rgba(74, 176, 193, 0.2);
}

/* --- OPTIMISATION DE LA TABLE ADMIN --- */
.profil-content .modules-table {
    table-layout: auto; /* Permet un redimensionnement basé sur le contenu réel */
    width: 100%;
}

@media (min-width: 768px) {
    /* On applique les largeurs d'équilibrage UNIQUEMENT si le tableau contient la jauge admin */
    .profil-content td .progression-bar-container,
    .profil-content th:nth-child(3) {
        text-align: left !important;
    }

    /* Ces règles ciblent spécifiquement la table de l'interface Admin */
    .profil-content th:has(a[href*="sort=nom"]),
    .profil-content td:first-child:has(strong) {
        width: 25%;
    }
    
    .profil-content th:has(a[href*="sort=service"]) {
        width: 20%;
    }

    .profil-content th:has(a[href*="sort=progression"]) {
        width: 40%;
    }

    /* Restauration des proportions d'origine et équilibrées pour la table du collaborateur */
    .profil-content .modules-table:not(:has(a[href*="sort="])) th:nth-child(1),
    .profil-content .modules-table:not(:has(a[href*="sort="])) td:nth-child(1) { width: 15%; }
    
    .profil-content .modules-table:not(:has(a[href*="sort="])) th:nth-child(2),
    .profil-content .modules-table:not(:has(a[href*="sort="])) td:nth-child(2) { width: 50%; }
    
    .profil-content .modules-table:not(:has(a[href*="sort="])) th:nth-child(3),
    .profil-content .modules-table:not(:has(a[href*="sort="])) td:nth-child(3) { width: 20%; text-align: center !important; }
    
    .profil-content .modules-table:not(:has(a[href*="sort="])) th:nth-child(4),
    .profil-content .modules-table:not(:has(a[href*="sort="])) td:nth-child(4) { width: 15%; text-align: center !important; }
}

.user-management-section .mgmt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.user-management-section .mgmt-table th {
    text-align: left;
    padding: 12px 10px;
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid #F4F7F6;
}

.user-management-section .mgmt-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #EEE;
    vertical-align: middle;
    background-color: #FFFFFF;
}

.user-management-section .mgmt-table tr:last-child td {
    border-bottom: none;
}

.user-management-section .user-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.user-management-section .u-name {
    font-weight: 700;
    color: #0A192F;
    font-size: 1rem;
}

.user-management-section .u-email {
    font-size: 0.75rem;
    color: #888;
}

.user-management-section .u-service {
    background: #F0F4F8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.user-management-section .u-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.user-management-section .u-btn {
    border: 1px solid #DDD;
    background: white;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.user-management-section .u-btn:hover {
    border-color: #4AB0C1;
    background: #F8FCFC;
}

.user-management-section .u-btn-del:hover {
    border-color: #CC0000;
    background: #FFF5F5;
}

/* Masquer la 2e colonne sur mobile, afficher à partir de 769px */
.user-management-section .mgmt-table th:nth-child(2),
.user-management-section .mgmt-table td:nth-child(2) {
    display: none;
}

@media (min-width: 769px) {
    .user-management-section .mgmt-table th:nth-child(2),
    .user-management-section .mgmt-table td:nth-child(2) {
        display: table-cell;
    }
}

/* =========================================
   AJOUTER UTILISATEUR
========================================= */

.add-user-page .form-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #EEE;
    padding-bottom: 15px;
}

.add-user-page .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

@media (min-width: 600px) {
    .add-user-page .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.add-user-page .form-group label {
    display: block;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #0A192F;
}

.add-user-page input,
.add-user-page select {
    width: 100%;
    padding: 12px;
    border: 1px solid #DDD;
    border-radius: 8px;
    background-color: #FFF;
    font-size: 0.95rem;
}

.add-user-page .form-footer {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    padding-top: 20px;
    border-top: 1px solid #F5F5F5;
}

.progression-page .btn-progression,
.add-user-page .btn-progression,
.user-management-section .btn-progression {
    display: inline-block;
    background-color: #4AB0C1;
    color: #FFFFFF;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 10px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
}

.progression-page .btn-progression:hover,
.add-user-page .btn-progression:hover,
.user-management-section .btn-progression:hover {
    background-color: #3d93a1;
    color: #FFFFFF;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(74, 176, 193, 0.3);
}

.add-user-page .btn-cancel {
    text-decoration: none;
    color: #888;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 10px;
}

.btn-cancel:hover {
    color: #CC0000;
}

/* =========================================
   TRI / FILTRES — PROFIL ADMIN
========================================= */

.sort-link {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: color 0.2s;
}

.sort-icon {
    font-size: 0.8rem;
    color: #b3b3b3;
    transition: color 0.2s;
}

.sort-link:hover .sort-icon {
    color: #4AB0C1;
}

/* =========================================
   MODULE — SIDEBAR & STRUCTURE
========================================= */

.course-container {
    display: block;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.course-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 10000;
    transition: 0.3s ease;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    padding: 15px;
    overflow-y: auto;
}

.course-sidebar.active {
    left: 0;
}

.sidebar-sticky {
    background: transparent;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #EEE;
}

.sidebar-sticky h3 {
    color: #0A192F;
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #4AB0C1;
    padding-bottom: 10px;
}

.nav-main {
    display: block;
    font-weight: 800;
    font-size: 0.85rem;
    color: #0A192F;
    text-transform: uppercase;
    text-decoration: none;
    margin-top: 20px;
    letter-spacing: 0.5px;
}

.nav-sub {
    margin-left: 5px;
    padding-left: 20px;
    list-style: none;
    margin-bottom: 10px;
}

.nav-sub li a {
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    display: block;
    padding: 5px 0;
    transition: 0.3s;
}

.nav-sub li a:hover {
    color: #4AB0C1;
    transform: translateX(3px);
}

.course-main {
    width: 100%;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 993px) {
    .course-sidebar {
        position: sticky;
        top: 20px;
        left: auto;
        height: auto;
        width: 280px;
        background: transparent; /* IMPORTANT : On retire le fond blanc du parent */
        box-shadow: none;        /* On retire l'ombre du parent */
        padding: 0;
        z-index: auto;
    }

    .sidebar-sticky {
        /* On donne l'aspect "Carte" seulement sur PC */
        background: white;
        padding: 25px;
        border-radius: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        border: 1px solid #EEE;
        display: block;
    }
}

/* Bordures colorées des cartes de cours */
.card-essentiel { border-left: 4px solid var(--primary); }
.card-menace     { border-left: 4px solid #f59e0b; }
.card-reflexes   { border-left: 4px solid var(--dark); }
.card-situation  { border-left: 4px solid var(--primary); }

.card-conclusion {
    border: 2px dashed var(--primary);
    background-color: #F0F8F9;
}

/* =========================================
   IMAGES DANS LE MODULE
========================================= */

.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-solution {
    background-color: #4AB0C1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-solution:hover {
    background-color: #0A192F;
}

.phishing-exercise h3 {
    color: #0A192F;
    margin-top: 30px;
}

/* =========================================
   GRILLE PHISHING
========================================= */

.phishing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0;
}

.phishing-tile {
    background-color: #f8fafc;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.phishing-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #4AB0C1;
}

.phishing-tile h4 {
    margin: 0 0 10px 0;
    color: #0A192F;
    font-size: 1.1rem;
    font-weight: 700;
}

.phishing-tile p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

@media (min-width: 993px) {
    .phishing-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================================
   BURGER & SIDEBAR MOBILE
========================================= */

.burger-menu {
    display: block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.close-sidebar-btn {
    display: block;
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    z-index: 10001;
    transition: 0.2s ease;
    padding: 5px;
}

.close-sidebar-btn:hover {
    color: #E53E3E;
    transform: scale(1.1);
}

@media (min-width: 993px) {
    .burger-menu { display: none; }
    .close-sidebar-btn { display: none; }

    .course-container {
        display: flex;
        margin: 40px auto;
        gap: 30px;
        align-items: flex-start;
    }

    .course-sidebar {
        position: -webkit-sticky;
        position: sticky;
        top: 20px;
        left: auto;
        width: 280px;
        max-width: none;
        height: fit-content;
        box-shadow: none;
        padding: 0;
        overflow-y: visible;
        z-index: auto;
    }

    .course-main {
        width: auto;
        padding: 0;
    }
}

/* =========================================
   GRILLE D'URGENCE
========================================= */

.emergency-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 30px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.emergency-grid .phishing-tile {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 993px) {
    .emergency-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .emergency-grid .phishing-tile {
        min-height: 180px;
        width: auto;
    }
}

/* =========================================
   MODAL ZOOM IMAGE
========================================= */

.modal-zoom {
    display: none;
    position: fixed;
    z-index: 30000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.modal-zoom img {
    max-width: 95%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 50px;
    cursor: pointer;
}

.zoomable {
    cursor: zoom-in;
    transition: 0.3s;
}

.zoomable:hover {
    opacity: 0.8;
}

/* =========================================
   ENCADRÉS D'INFORMATION
========================================= */

.info-box,
.info-box-crimson {
    padding: 15px 25px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-box {
    background-color: #f0f9ff;
    border-left: 5px solid #4AB0C1;
    color: #0369a1;
}

.info-box-crimson {
    background-color: #fff5f5;
    border-left: 5px solid #e53e3e;
}

.info-box-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.tile-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.info-box-title .tile-icon {
    font-size: 1.3rem;
    margin-bottom: 0;
}

.info-box-crimson .tile-icon {
    color: #e53e3e;
}

.tile-icon-grid {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

/* =========================================
   QCM DYNAMIQUE (module.php)
========================================= */

.quiz-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quiz-progress {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: bold;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.quiz-option {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-option:hover:not(.disabled) {
    border-color: var(--primary);
    background-color: #f0f9ff;
}

.quiz-option.selected {
    border-color: var(--primary);
    background-color: #f0f9ff;
}

.quiz-option.correct {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #065f46;
}

.quiz-option.wrong {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
}

.quiz-option.disabled {
    cursor: default;
}

.quiz-feedback {
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    animation: fadeIn 0.4s ease;
}

.quiz-feedback.correct-bg { background-color: #ecfdf5; border-left: 5px solid #10b981; }
.quiz-feedback.wrong-bg   { background-color: #fef2f2; border-left: 5px solid #ef4444; }

.quiz-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.btn-quiz-next {
    background-color: var(--dark);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-quiz-next:hover {
    background-color: var(--primary);
    transform: translateX(5px);
}

/* =========================================
   RÉSULTATS FINAUX DU QUIZ
========================================= */

.quiz-result-wrapper {
    text-align: center;
    padding: 30px 10px;
}

.result-emoji  { font-size: 4rem; margin: 20px 0; }
.result-score  { font-size: 1.5rem; margin-bottom: 10px; }
.result-text   { color: #64748b; margin-bottom: 35px; }

.result-buttons-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-result-secondary {
    background: transparent;
    color: var(--dark);
    border: 2px solid var(--dark);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-result-secondary:hover {
    background: var(--dark);
    color: white;
}

.btn-result-primary {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
}

.btn-result-primary:hover {
    background: #388a99;
    border-color: #388a99;
    box-shadow: 0 4px 12px rgba(74, 176, 193, 0.3);
}

/* =========================================
   ANIMATIONS
========================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}