/* =============================================
   LT Formations — Plateforme CSS
   Charte graphique : Kaki + Gris Foncé
   ============================================= */

:root {
    --kaki-primary:  #6b7f5d;
    --kaki-light:    #8a9f7a;
    --kaki-dark:     #4a5c3f;
    --kaki-xlight:   #f0f4ed;
    --grey-dark:     #2d2d2d;
    --grey-medium:   #4a4a4a;
    --grey-light:    #6b6b6b;
    --grey-lighter:  #e5e5e5;
    --grey-bg:       #f7f7f7;
    --white:         #ffffff;
    --black:         #1a1a1a;
    --danger:        #c0392b;
    --warning:       #e67e22;
    --success:       #27ae60;
    --info:          #2980b9;

    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow:    0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius:    10px;
    --radius-sm: 6px;
}

/* =============================================
   Reset
   ============================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-main); color: var(--grey-dark); background: var(--grey-bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
input, button, select, textarea { font-family: inherit; }

/* =============================================
   Utilitaires
   ============================================= */
.container        { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm     { max-width: 480px;  margin: 0 auto; padding: 0 1.5rem; }
.text-center      { text-align: center; }
.text-kaki        { color: var(--kaki-primary); }
.text-danger      { color: var(--danger); }
.text-success     { color: var(--success); }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* =============================================
   Boutons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
    text-align: center;
}
.btn-primary   { background: var(--kaki-primary); color: var(--white); }
.btn-primary:hover { background: var(--kaki-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline   { background: transparent; color: var(--kaki-primary); border: 2px solid var(--kaki-primary); }
.btn-outline:hover { background: var(--kaki-primary); color: var(--white); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #a93226; }
.btn-sm        { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-full      { width: 100%; justify-content: center; }

/* =============================================
   Formulaires
   ============================================= */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--grey-medium);
    margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--grey-lighter);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--grey-dark);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--kaki-primary);
    box-shadow: 0 0 0 3px rgba(107, 127, 93, 0.12);
}
.form-input.error { border-color: var(--danger); }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; }
.form-hint  { font-size: 0.8rem; color: var(--grey-light); margin-top: 0.3rem; }

/* Input avec icône */
.input-wrapper { position: relative; }
.input-wrapper .input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-light);
    font-size: 0.95rem;
}
.input-wrapper .form-input { padding-left: 2.5rem; }
.input-wrapper .input-toggle {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-light);
    cursor: pointer;
    font-size: 0.95rem;
}
.input-wrapper .input-toggle:hover { color: var(--kaki-primary); }

/* =============================================
   Alertes
   ============================================= */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
.alert-success { background: #eafaf1; color: #1e8449; border-left: 4px solid var(--success); }
.alert-danger  { background: #fdedec; color: #c0392b; border-left: 4px solid var(--danger); }
.alert-info    { background: #eaf4fb; color: #1a5276; border-left: 4px solid var(--info); }

/* =============================================
   Header AUTH (connexion/inscription)
   ============================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--kaki-dark) 0%, var(--grey-dark) 100%);
}

.auth-topbar {
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.auth-topbar .logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
}
.auth-topbar .logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.auth-topbar .back-link {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.auth-topbar .back-link:hover { color: var(--white); }

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
}

.auth-card-header { text-align: center; margin-bottom: 2rem; }
.auth-card-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--grey-dark);
    margin-bottom: 0.4rem;
}
.auth-card-header p { font-size: 0.9rem; color: var(--grey-light); }

.auth-divider {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
    color: var(--grey-light);
    font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--grey-lighter);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--grey-light);
}
.auth-switch a { color: var(--kaki-primary); font-weight: 600; }
.auth-switch a:hover { color: var(--kaki-dark); text-decoration: underline; }

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

/* Barre de force du mot de passe */
.password-strength { margin-top: 0.5rem; }
.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--grey-lighter);
    overflow: hidden;
    margin-bottom: 0.3rem;
}
.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: var(--transition);
    width: 0%;
}
.strength-fill.weak   { width: 33%; background: var(--danger); }
.strength-fill.medium { width: 66%; background: var(--warning); }
.strength-fill.strong { width: 100%; background: var(--success); }
.strength-label { font-size: 0.75rem; color: var(--grey-light); }

/* Checkbox custom */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
.checkbox-group input[type="checkbox"] { margin-top: 0.2rem; accent-color: var(--kaki-primary); }
.checkbox-label { font-size: 0.875rem; color: var(--grey-medium); }
.checkbox-label a { color: var(--kaki-primary); text-decoration: underline; }

/* =============================================
   LAYOUT PLATEFORME (sidebar + main)
   ============================================= */
.platform-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--grey-dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.sidebar-logo span { font-size: 1rem; font-weight: 700; color: var(--white); }
.sidebar-logo .badge-role {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--kaki-primary);
    color: var(--white);
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user .user-name { font-size: 0.9rem; font-weight: 600; }
.sidebar-user .user-email { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.sidebar-nav .nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0.75rem 1.25rem 0.25rem;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    border-radius: 0;
    transition: var(--transition);
    position: relative;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.sidebar-nav a.active {
    background: rgba(107,127,93,0.2);
    color: var(--white);
    border-right: 3px solid var(--kaki-light);
}
.sidebar-nav a.active i { color: var(--kaki-light); }
.sidebar-nav a i { font-size: 1rem; width: 18px; text-align: center; }
.sidebar-nav .badge-count {
    margin-left: auto;
    background: var(--kaki-primary);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
}

.sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.75rem 0;
}
.sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
    transition: var(--transition);
}
.sidebar-bottom a:hover { color: var(--danger); background: rgba(192,57,43,0.08); }
.sidebar-bottom a i { font-size: 1rem; width: 18px; text-align: center; }

/* --- Contenu principal --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top bar */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--grey-lighter);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--grey-dark); }
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--grey-light); }
.breadcrumb a:hover { color: var(--kaki-primary); }
.breadcrumb .sep { color: var(--grey-lighter); }

.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--kaki-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Page content zone */
.page-content {
    padding: 2rem;
    flex: 1;
}
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--grey-dark); margin-bottom: 0.25rem; }
.page-header p { color: var(--grey-light); font-size: 0.9rem; }

/* =============================================
   Stats cards (dashboard)
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-icon.kaki    { background: var(--kaki-xlight);  color: var(--kaki-primary); }
.stat-icon.blue    { background: #eaf4fb; color: var(--info); }
.stat-icon.green   { background: #eafaf1; color: var(--success); }
.stat-icon.orange  { background: #fef9e7; color: var(--warning); }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--grey-dark); }
.stat-label { font-size: 0.8rem; color: var(--grey-light); margin-top: 0.2rem; }

/* =============================================
   Cards formations
   ============================================= */
.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.formation-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.formation-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.formation-card-img {
    height: 170px;
    background: linear-gradient(135deg, var(--kaki-dark), var(--kaki-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
}
.formation-card-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }

.formation-card-body { padding: 1.25rem; }
.formation-card-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--grey-dark); }
.formation-card-body p  { font-size: 0.85rem; color: var(--grey-light); margin-bottom: 1rem; line-height: 1.5; }

.progress-bar-wrapper { margin-bottom: 0.4rem; }
.progress-bar-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--grey-light); margin-bottom: 0.3rem; }
.progress-bar {
    height: 6px;
    background: var(--grey-lighter);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--kaki-primary);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.formation-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--grey-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--grey-light);
}

/* Badge statut */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.badge-success  { background: #eafaf1; color: #1e8449; }
.badge-warning  { background: #fef9e7; color: #d68910; }
.badge-danger   { background: #fdedec; color: #c0392b; }
.badge-kaki     { background: var(--kaki-xlight); color: var(--kaki-dark); }
.badge-grey     { background: var(--grey-lighter); color: var(--grey-medium); }

/* =============================================
   Tables
   ============================================= */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--grey-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.table-card-header h2 { font-size: 1rem; font-weight: 700; color: var(--grey-dark); }
.table-search {
    position: relative;
    min-width: 220px;
}
.table-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.2rem;
    border: 1.5px solid var(--grey-lighter);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}
.table-search input:focus { border-color: var(--kaki-primary); }
.table-search i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-light);
    font-size: 0.8rem;
}

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--grey-bg);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-light);
    border-bottom: 1px solid var(--grey-lighter);
    white-space: nowrap;
}
tbody td {
    padding: 0.9rem 1rem;
    font-size: 0.875rem;
    color: var(--grey-dark);
    border-bottom: 1px solid var(--grey-lighter);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--grey-bg); }

.table-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--kaki-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.table-user-info { display: flex; align-items: center; gap: 0.75rem; }
.table-user-name  { font-weight: 600; font-size: 0.875rem; }
.table-user-email { font-size: 0.75rem; color: var(--grey-light); }

.actions-cell { display: flex; align-items: center; gap: 0.5rem; }
.action-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
}
.action-btn.edit   { background: #eaf4fb; color: var(--info); }
.action-btn.delete { background: #fdedec; color: var(--danger); }
.action-btn.block  { background: #fef9e7; color: var(--warning); }
.action-btn:hover  { opacity: 0.75; transform: scale(1.08); }

/* =============================================
   Lecteur vidéo (leçon)
   ============================================= */
.lesson-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
.video-player-wrapper {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
}
.video-player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lesson-sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.lesson-sidebar-card h3 {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-bottom: 1px solid var(--grey-lighter);
    color: var(--grey-dark);
}
.lesson-list { max-height: 60vh; overflow-y: auto; }
.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--grey-lighter);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--grey-medium);
}
.lesson-item:last-child { border-bottom: none; }
.lesson-item:hover   { background: var(--grey-bg); }
.lesson-item.active  { background: var(--kaki-xlight); color: var(--kaki-dark); font-weight: 600; }
.lesson-item.done .lesson-check { color: var(--success); }
.lesson-item.active .lesson-check { color: var(--kaki-primary); }
.lesson-check { font-size: 0.85rem; width: 16px; flex-shrink: 0; color: var(--grey-lighter); }

/* =============================================
   Modales
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--grey-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--grey-light);
    transition: var(--transition);
    padding: 0.2rem;
}
.modal-close:hover { color: var(--danger); }
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--grey-lighter); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* =============================================
   Responsive
   ============================================= */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--grey-dark);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

/* Overlay sombre derrière la sidebar ouverte sur mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ---- Tablet (≤ 900px) ---- */
@media (max-width: 900px) {
    .sidebar {
        left: -260px;
        z-index: 101;
    }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }

    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; align-items: center; }

    /* Lesson layout en colonne */
    .lesson-layout { grid-template-columns: 1fr; }
    .lesson-list   { max-height: 40vh; }

    /* Stats 2 colonnes */
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Admin formation grid 2 colonnes */
    .formations-admin-grid { grid-template-columns: 1fr 1fr; }

    /* Table card header empilé */
    .table-card-header { flex-direction: column; align-items: flex-start; }
    .table-search { min-width: 100%; }

    /* Topbar */
    .topbar { padding: 0 1rem; }
    .breadcrumb { display: none; }
}

/* ---- Mobile (≤ 600px) ---- */
@media (max-width: 600px) {
    /* Layout */
    .page-content { padding: 1rem; }
    .topbar { padding: 0 0.75rem; height: 56px; }
    .topbar-title { font-size: 1rem; }
    .topbar-avatar { width: 32px; height: 32px; font-size: 0.8rem; }

    /* Stats et grilles */
    .stats-grid { grid-template-columns: 1fr; }
    .formations-grid { grid-template-columns: 1fr; }
    .formations-admin-grid { grid-template-columns: 1fr; }

    /* Auth */
    .auth-card { padding: 2rem 1.25rem; }
    .auth-topbar { padding: 1rem; }

    /* Page header */
    .page-header h1 { font-size: 1.3rem; }

    /* Promo banner empilé */
    .promo-banner { flex-direction: column; padding: 1.2rem 1rem; }
    .promo-banner h2 { font-size: 1rem; }

    /* Catalogue */
    .catalogue-grid { grid-template-columns: 1fr !important; }

    /* Filtres catalogue */
    .cat-filters { gap: 0.5rem; }
    .cat-filters .btn { padding: 0.4rem 0.85rem; font-size: 0.82rem; }

    /* Tables */
    .table-wrapper { -webkit-overflow-scrolling: touch; }
    thead th, tbody td { font-size: 0.78rem; padding: 0.65rem 0.75rem; }

    /* Modales full-width */
    .modal { margin: 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; }
    .modal-overlay { align-items: flex-end; padding: 0; }

    /* Quiz / cards génériques */
    .card { padding: 1rem !important; }

    /* Boutons pleine largeur sur petits écrans */
    .btn-full-mobile { width: 100%; justify-content: center; }

    /* Sidebar logo texte caché en mode ouvert si trop étroit */
    .sidebar { width: 240px; min-width: 240px; }
}

/* ---- Très petit mobile (≤ 400px) ---- */
@media (max-width: 400px) {
    .page-content { padding: 0.75rem; }
    .stat-card { flex-direction: column; text-align: center; gap: 0.5rem; }
    .stat-icon { margin: 0 auto; }
    .topbar-title { font-size: 0.9rem; }
}

/* =============================================
   Admin — Grille 2 colonnes (dashboard)
   ============================================= */
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
    .admin-grid-2 { grid-template-columns: 1fr; }
}

/* =============================================
   Admin — Grille formations
   ============================================= */
.formations-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.admin-formation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.admin-formation-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.afc-header {
    background: var(--kaki-primary);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.afc-icon { font-size: 1.5rem; color: rgba(255,255,255,0.9); }
.afc-actions { display: flex; gap: .4rem; }
.afc-actions .action-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: .8rem;
}
.afc-actions .action-btn:hover { background: rgba(255,255,255,0.3); }
.afc-body {
    padding: 1.1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.afc-titre {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.afc-desc {
    font-size: .82rem;
    color: var(--grey-light);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.afc-stats {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    color: var(--grey-light);
    padding-top: .5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}
.afc-stats span { display: flex; align-items: center; gap: .3rem; }
