* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 430px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.auth-container h1 {
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 12px;
    font-size: 28px;
}

.subtitle {
    color: #64748b;
    text-align: center;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

.form-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.btn {
    width: 100%;
    padding: 14px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    background: #1d4ed8;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: #64748b;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.message {
    padding: 12px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: #fee2e2;
    color: #b91c1c;
}
.chart-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,.05);
}

.chart-card svg {
    width: 220px;
    max-width: 100%;
}

.chart-legend p {
    color: #475569;
    margin: 15px 0;
}

.legend-admin,
.legend-user {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-admin {
    background: #2563eb;
}

.legend-user {
    background: #10b981;
}

@media (max-width: 600px) {
    .chart-card {
        flex-direction: column;
    }
}

.success {
    background: #dcfce7;
    color: #166534;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 25px 20px;
    }
}
/* =========================================
   TABLEAU DE BORD ADMINISTRATEUR
========================================= */

.admin-body {
    display: block;
    min-height: 100vh;
    padding: 40px 20px;
    background: #f1f5f9;
    color: #1e293b;
}

.admin-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* En-tête */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-bottom: 35px;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.04);
}

.admin-label {
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.admin-header h1 {
    margin: 8px 0;
    color: #1e3a8a;
    font-size: 30px;
}

.admin-header p {
    color: #64748b;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 20px;
}

.admin-profile strong,
.admin-profile span {
    display: block;
}

.admin-profile span {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
}

/* Statistiques */

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.04);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 12px;
    background: #dbeafe;
    font-size: 25px;
}

.stat-card p {
    color: #64748b;
    font-size: 14px;
}

.stat-card h2 {
    margin-top: 7px;
    color: #1e3a8a;
    font-size: 30px;
}

/* Section utilisateurs */

.admin-section {
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.04);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.section-heading h2 {
    color: #1e293b;
    font-size: 21px;
}

.section-heading p {
    margin-top: 7px;
    color: #64748b;
    font-size: 14px;
}

.user-count {
    padding: 9px 14px;
    border-radius: 20px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
}

/* Tableau */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    padding: 16px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.admin-table td {
    padding: 17px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 14px;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table .user-name {
    color: #1e293b;
    font-weight: 600;
}

.role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.role-admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.role-user {
    background: #dcfce7;
    color: #15803d;
}

.empty-message {
    text-align: center;
    color: #64748b;
}

/* Pied de page */

.admin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
    padding: 20px 5px;
    color: #64748b;
    font-size: 13px;
}

.logout-btn {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.logout-btn:hover {
    background: #1d4ed8;
}

/* Responsive */

@media (max-width: 700px) {

    .admin-body {
        padding: 20px 12px;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .admin-header h1 {
        font-size: 25px;
    }

    .admin-section {
        padding: 18px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-profile {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .admin-table {
        min-width: 650px;
    }
}
/* =========================================
   NAVIGATION LATERALE - JM PLATFORM
========================================= */

#sidebar-toggle {
    display: none;
}

.admin-body {
    display: block;
    padding: 0;
    min-height: 100vh;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.admin-sidebar {
    width: 260px;
    min-width: 260px;
    min-height: 100vh;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    background: #172554;
    color: white;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px 30px;
    font-size: 19px;
    font-weight: 700;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #2563eb;
    color: white;
    font-size: 17px;
    font-weight: 800;
}

.sidebar-heading {
    margin: 20px 10px 12px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.nav-link span {
    width: 22px;
    font-size: 19px;
    text-align: center;
}

.nav-link:hover {
    background: #263b70;
    color: white;
}

.nav-link.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
}

/* PROFIL ADMINISTRATEUR */

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
    padding: 15px 8px 5px;
    border-top: 1px solid #334477;
    min-width: 0;
}

.sidebar-user .profile-avatar {
    flex-shrink: 0;
    background: #3b82f6;
    color: white;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
    overflow-wrap: anywhere;
}

.sidebar-user strong {
    font-size: 13px;
    color: white;
}

.sidebar-user small {
    margin-top: 5px;
    color: #bfdbfe;
    font-size: 11px;
}

/* CONTENU PRINCIPAL */

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 30px 35px;
    background: #f1f5f9;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.04);
}

.topbar h1 {
    color: #1e3a8a;
    font-size: 25px;
}

.topbar p {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
}

.topbar-role {
    padding: 8px 14px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 25px;
    color: #1e3a8a;
}

/* ADAPTATION DES SECTIONS */

.admin-main .admin-stats {
    margin-bottom: 25px;
}

.admin-main .admin-section {
    margin-bottom: 25px;
}

.admin-main .admin-footer {
    margin-top: 25px;
}

/* RESPONSIVE MOBILE */

@media (max-width: 850px) {

    .admin-sidebar {
        position: fixed;
        z-index: 1000;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px;
        min-width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    #sidebar-toggle:checked ~ .admin-layout .admin-sidebar {
        transform: translateX(0);
    }

    .admin-main {
        width: 100%;
        padding: 20px;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        justify-content: flex-start;
    }

    .topbar-role {
        margin-left: auto;
    }
}

@media (max-width: 480px) {

    .admin-main {
        padding: 12px;
    }

    .topbar {
        gap: 12px;
        padding: 16px;
    }

    .topbar h1 {
        font-size: 19px;
    }

    .topbar p {
        font-size: 11px;
    }

    .topbar-role {
        padding: 6px 9px;
        font-size: 10px;
    }

    .admin-main .admin-section {
        padding: 16px;
    }
}
/* RECHERCHE ET FILTRAGE UTILISATEURS */

.user-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0 15px;
}

.search-box {
    flex: 1;
    min-width: 220px;
}

.search-box input,
.role-filter {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: #334155;
    font-size: 14px;
}

.search-box input:focus,
.role-filter:focus {
    outline: none;
    border-color: #2563eb;
}

.role-filter {
    width: 190px;
}

.filter-btn,
.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.filter-btn {
    background: #2563eb;
    color: white;
}

.filter-btn:hover {
    background: #1d4ed8;
}

.reset-btn {
    background: #e2e8f0;
    color: #334155;
}

.reset-btn:hover {
    background: #cbd5e1;
}

.filter-results {
    margin-bottom: 18px;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 600px) {
    .user-filters {
        flex-direction: column;
    }

    .role-filter {
        width: 100%;
    }
}
.admin-edit-btn {
    display: inline-block;
    padding: 7px 14px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.2s;
}

.admin-edit-btn:hover {
    background: #1d4ed8;
}
/* =================================
   FORMULAIRE DE MODIFICATION
================================= */

.edit-user-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: #f1f5f9;
}

.edit-user-card {
    width: 100%;
    max-width: 650px;
    padding: 35px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.edit-user-card h1 {
    color: #172554;
    font-size: 26px;
    margin-bottom: 8px;
}

.edit-user-card > p {
    color: #64748b;
    margin-bottom: 25px;
}

.edit-user-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edit-user-card label {
    color: #334155;
    font-weight: 600;
    margin-top: 10px;
}

.edit-user-card input,
.edit-user-card select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 15px;
    box-sizing: border-box;
}

.edit-user-card input:focus,
.edit-user-card select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.edit-user-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.edit-user-actions button {
    border: none;
    background: #2563eb;
    color: white;
    padding: 12px 22px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
}

.edit-user-actions button:hover {
    background: #1d4ed8;
}

.edit-user-actions a {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: #e2e8f0;
    color: #334155;
    border-radius: 7px;
    text-decoration: none;
}

.password-note {
    margin-top: 22px;
    font-size: 13px;
    color: #64748b;
}

.alert-error {
    padding: 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 7px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .edit-user-card {
        padding: 22px;
    }

    .edit-user-card h1 {
        font-size: 22px;
    }

    .edit-user-actions {
        flex-direction: column;
    }

    .edit-user-actions button,
    .edit-user-actions a {
        justify-content: center;
    }
}
.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-delete-btn {
    padding: 7px 14px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.admin-delete-btn:hover {
    background: #b91c1c;
}
/* Statistiques du tableau de bord */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.stats-grid .stat-card {
    min-width: 0;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
:root {
    --primary: #173b70;
    --secondary: #2563eb;
    --accent: #f59e0b;
    --dark: #172033;
    --light: #f5f8fc;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: min(1150px, 92%);
    margin: auto;
}

/* HEADER */

.header {
    background: var(--white);
    box-shadow: 0 2px 12px #00000012;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-size: 22px;
    font-weight: bold;
}

.logo-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--primary);
    border-radius: 10px;
    font-size: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 600;
    transition: color .3s;
}

.nav-links a:hover {
    color: var(--secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 11px 19px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: bold;
    transition: .3s;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
}

.btn-outline {
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.menu-toggle {
    display: none;
    border: 0;
    background: none;
    font-size: 27px;
    cursor: pointer;
}

/* SLIDER */

.slider {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: var(--primary);
}

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #10294ee8, #10294e65);
}

.slide-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
    color: white;
}

.slide-content span {
    color: #fbbf24;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.slide-content h1 {
    font-size: clamp(32px, 5vw, 55px);
    line-height: 1.15;
    margin: 18px 0;
}

.slide-content p {
    font-size: 18px;
    margin-bottom: 28px;
}

.slider-controls {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #ffffff80;
    cursor: pointer;
}

.slider-dot.active {
    background: white;
    width: 28px;
    border-radius: 10px;
}

/* FORMATIONS */

.section {
    padding: 75px 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 40px;
}

.section-heading h2 {
    color: var(--primary);
    font-size: 32px;
    margin-bottom: 10px;
}

.section-heading p {
    color: #64748b;
}

.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.formation-card {
    padding: 27px;
    background: white;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    box-shadow: 0 5px 20px #00000008;
}

.formation-card h3 {
    color: var(--primary);
    margin-bottom: 12px;
}

.formation-card p {
    color: #64748b;
    margin-bottom: 20px;
}

.empty-message {
    text-align: center;
    color: #64748b;
    grid-column: 1 / -1;
}

/* FOOTER */

.footer {
    background: #10294e;
    color: white;
    padding: 35px 0;
    text-align: center;
}

.footer p {
    color: #cbd5e1;
}

/* RESPONSIVE */

@media (max-width: 950px) {
    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 15px 0;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-actions {
        width: 100%;
    }

    .slider {
        height: 430px;
    }

    .slide-content p {
        font-size: 16px;
    }

    .section {
        padding: 50px 0;
    }
}

@media (max-width: 420px) {
    .logo {
        font-size: 18px;
    }

    .nav-actions .btn {
        padding: 9px 12px;
        font-size: 12px;
    }
}
