/** 
 * ========================================================
 * Design System MRO Consulting 33 — Material 3 via Tailwind
 * ========================================================
 * Primary  : #DDAF25 (Jaune Doré)
 * Secondary: #26B4D8 (Bleu Cyan)
 * Surface  : #141218 (Dark)
 * Text     : #e6e1e5
 * ========================================================
 */

/* ── Tokens M3 — Variables CSS ─────────────────────────── */

:root {
    --md-sys-color-primary: #DDAF25;
    --md-sys-color-on-primary: #111111;
    --md-sys-color-primary-container: #3a2e00;
    --md-sys-color-on-primary-container: #ffe4a0;

    --md-sys-color-secondary: #26B4D8;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #004d63;
    --md-sys-color-on-secondary-container: #b4e8f7;

    --md-sys-color-surface: #141218;
    --md-sys-color-on-surface: #e6e1e5;
    --md-sys-color-on-surface-variant: #c4bfba;
    --md-sys-color-surface-variant: #1d1b20;
    --md-sys-color-surface-container: #1e1e2e;
    --md-sys-color-surface-container-low: #1a1820;
    --md-sys-color-surface-container-high: #2b2930;
    --md-sys-color-surface-container-highest: #36343b;
    --md-sys-color-outline: #4a4a5a;
    --md-sys-color-outline-variant: #9e9eae;

    --md-sys-color-tertiary: #FF9800;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #4E2700;
    --md-sys-color-on-tertiary-container: #ffd9a0;

    --md-sys-color-error: #f2726b;
    --md-sys-color-on-error: #601410;
    --md-sys-color-success: #66bb6a;
    --md-sys-color-warning: #ffd54f;

    /* Conteneurs sémantiques (status) */
    --md-sys-color-success-container: #1a3a1a;
    --md-sys-color-on-success-container: #a6e9a6;
    --md-sys-color-warning-container: #3a2e00;
    --md-sys-color-on-warning-container: #ffd54f;
    --md-sys-color-error-container: #3a1a1a;
    --md-sys-color-on-error-container: #ffb4ab;

    /* Variantes supplémentaires */
    --md-sys-color-primary-dark: #C49A20;

    /* Élévation M3 */
    --md-sys-elevation-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
    --md-sys-elevation-2: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --md-sys-elevation-3: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --md-sys-elevation-4: 0 14px 28px rgba(0,0,0,0.12), 0 6px 10px rgba(0,0,0,0.08);

    /* Arrondis M3 (12px à 28px) */
    --md-sys-shape-corner-small: 12px;
    --md-sys-shape-corner-medium: 16px;
    --md-sys-shape-corner-large: 20px;
    --md-sys-shape-corner-extra-large: 28px;

    /* Transitions */
    --md-sys-motion-duration: 200ms;
    --md-sys-motion-easing: cubic-bezier(0.2, 0, 0, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface-variant);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}


/* Capitalisation automatique des labels et titres */
/* Pas de text-transform forcé : norme française, majuscule en début de phrase uniquement */
/* ── Navigation Rail (Organisme) ───────────────────────── */

.nav-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    z-index: 100;
}

.nav-rail__logo {
    width: 48px;
    height: 48px;
    margin-bottom: 24px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-rail__items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    width: 100%;
    padding: 0 12px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.nav-rail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 52px;
    border-radius: var(--md-sys-shape-corner-large);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    transition: all var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-rail__item:hover {
    background: var(--md-sys-color-secondary-container);
}

.nav-rail__item--active {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.nav-rail__item .material-symbols-outlined {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-rail__bottom {
    padding: 12px;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: var(--md-sys-color-on-error);
    background: var(--md-sys-color-error, #d32f2f);
    border-radius: 9px;
}

/* ── Layout principal ──────────────────────────────────── */

.main-content {
    margin-left: 80px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-header__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.page-header__subtitle {
    color: var(--md-sys-color-on-surface-variant, #666);
    font-size: 1rem;
}

/* ── Breadcrumb backlink (Atome) ──────────────────────── */

.breadcrumb-back {
    text-decoration: none;
    color: var(--md-sys-color-secondary);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    transition: color 0.15s;
}
.breadcrumb-back:hover {
    color: var(--md-sys-color-primary);
}
.breadcrumb-back .material-symbols-outlined {
    font-size: 18px;
}

/* ── Badge row + small badge (Atome) ──────────────────── */

.badge-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.badge--sm {
    font-size: 0.8rem;
}
.badge--sm .material-symbols-outlined {
    font-size: 15px;
    vertical-align: middle;
}

/* ── Section heading (Atome) ─────────────────────────── */

.section-heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 20px;
}

/* ── Empty state (Molécule) ──────────────────────────── */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--md-sys-color-outline-variant);
}
.empty-state .material-symbols-outlined {
    font-size: 48px;
    color: var(--md-sys-color-outline);
    display: block;
    margin-bottom: 12px;
}
.empty-state p {
    color: var(--md-sys-color-on-surface-variant, #666);
    margin: 0;
    font-size: 0.9rem;
}
.empty-state--sm {
    padding: 24px;
}
.empty-state--sm .material-symbols-outlined {
    font-size: 32px;
}
.empty-state--sm p {
    font-size: 0.85rem;
}
.empty-state__hint {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}

/* ── Course content layout ───────────────────────────── */

.course-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── Cards M3 (Molécule) ──────────────────────────────── */

.card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px;
    overflow: hidden;
    transition: border-color var(--md-sys-motion-duration) var(--md-sys-motion-easing);
}

.card:hover {
    border-color: rgba(200, 169, 81, 0.2);
}

.card--outlined {
    box-shadow: none;
    border: 1px solid var(--md-sys-color-outline);
}

.card--outlined:hover {
    box-shadow: var(--md-sys-elevation-1);
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.card__subtitle {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}

.card__body {
    color: var(--md-sys-color-on-surface);
}

.card__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--md-sys-color-outline);
}

/* ── Boutons M3 (Atome) ───────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    text-decoration: none;
    line-height: 1.4;
}

.btn--primary {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn--primary:hover {
    box-shadow: var(--md-sys-elevation-2);
    filter: brightness(1.05);
}

.btn--secondary {
    background: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
}

.btn--secondary:hover {
    box-shadow: var(--md-sys-elevation-2);
    filter: brightness(1.05);
}

.btn--outlined {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.btn--outlined:hover {
    background: var(--md-sys-color-primary-container);
}

.btn--text {
    background: none;
    border: none;
    color: var(--md-sys-color-primary);
    padding: 10px 12px;
}

.btn--text:hover {
    background: var(--md-sys-color-primary-container);
}

.btn--danger {
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

.btn--sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

/* ── FAB (Floating Action Button) ──────────────────────── */

.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    box-shadow: var(--md-sys-elevation-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    z-index: 50;
}

.fab:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.18);
    transform: translateY(-2px);
}

.fab--extended {
    width: auto;
    padding: 16px 24px;
    gap: 12px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ── Champs de formulaire (Atome) ──────────────────────── */

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 1rem;
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface);
    transition: border-color var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    outline: none;
}

.form-input:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(221, 175, 37, 0.15);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
    line-height: 1.4;
}

/* ── Number input spinners ─ */
input[type="number"].form-input { -moz-appearance: textfield; padding-right: 36px; position: relative; }
input[type="number"].form-input::-webkit-inner-spin-button,
input[type="number"].form-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Custom spinner wrapper (added via JS or wrapping class) */
.form-number-wrap {
    position: relative; display: inline-flex; align-items: stretch;
}
.form-number-wrap .form-input { padding-right: 32px; }
.form-number-wrap__btns {
    position: absolute; right: 1px; top: 1px; bottom: 1px; width: 28px;
    display: flex; flex-direction: column; border-left: 1px solid var(--md-sys-color-outline);
    border-radius: 0 var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-small) 0;
    overflow: hidden;
}
.form-number-wrap__btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    border: none; background: var(--md-sys-color-surface-variant); cursor: pointer;
    color: var(--md-sys-color-on-surface); padding: 0; transition: background 0.15s;
}
.form-number-wrap__btn:hover { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.form-number-wrap__btn + .form-number-wrap__btn { border-top: 1px solid var(--md-sys-color-outline); }
.form-number-wrap__btn .material-symbols-outlined { font-size: 16px; }

/* ── Badges / Chips (Atome) ────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 4px;
}

.badge--primary {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.badge--secondary {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.badge--success {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.badge--warning {
    background: var(--md-sys-color-warning-container);
    color: var(--md-sys-color-on-warning-container);
}

.badge--error {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

/* ── Barre de progression (Molécule) ───────────────────── */

.progress {
    width: 100%;
    height: 8px;
    background: var(--md-sys-color-outline);
    border-radius: 100px;
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    border-radius: 100px;
    background: var(--md-sys-color-primary);
    transition: width 0.5s ease;
}

.progress__bar--secondary {
    background: var(--md-sys-color-secondary);
}

/* ── Flash Messages (Molécule) ─────────────────────────── */

.flash {
    padding: 14px 20px;
    border-radius: var(--md-sys-shape-corner-small);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flash--success {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
    border: 1px solid color-mix(in srgb, var(--md-sys-color-success) 30%, transparent);
}

.flash--error {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    border: 1px solid color-mix(in srgb, var(--md-sys-color-error) 30%, transparent);
}

.flash--warning {
    background: var(--md-sys-color-warning-container);
    color: var(--md-sys-color-on-warning-container);
    border: 1px solid color-mix(in srgb, var(--md-sys-color-warning) 30%, transparent);
}

/* ── Tableau (Organisme) ───────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--md-sys-color-surface-variant);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-on-surface-variant);
}

.data-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--md-sys-color-outline);
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: var(--md-sys-color-surface-variant);
}

/* ── Grille de cours ───────────────────────────────────── */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 24px;
    /* Empêche le débordement horizontal des items de grille */
    min-width: 0;
    width: 100%;
}

/* Contenant éventuel de card (cours-liste.php) */
.course-card-wrapper {
    min-width: 0;
}

/* ── Liste de cours (catalogue hiérarchique) ───────────── */

.courses-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (max-width: 768px) {
    .courses-grid { grid-template-columns: minmax(0, 1fr); }
}

/* -- Cours : carte moderne M3 -------------------------------- */

.cours-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large, 28px);
    /* overflow:hidden retiré — le dropdown doit pouvoir dépasser les bords */
    border: 1px solid var(--md-sys-color-outline);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s cubic-bezier(0.2,0,0,1), border-color 0.3s, transform 0.25s;
    /* Empêche la card de déborder son item de grille */
    min-width: 0;
    max-width: 100%;
}
.cours-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    border-color: var(--md-sys-color-primary);
    /* PAS de transform ici : transform crée un containing block CSS qui piège
       position:fixed sur les descendants (spec CSS Transforms niveau 1). */
}
.cours-card--publie {
    border-left: 4px solid var(--md-sys-color-success, #2e7d32);
}
.cours-card--brouillon {
    border-left: 4px solid var(--md-sys-color-warning, #f9a825);
}
.cours-card__hero {
    position: relative;
    height: 180px;
    overflow: hidden;
    border-radius: var(--md-sys-shape-corner-extra-large, 28px) var(--md-sys-shape-corner-extra-large, 28px) 0 0;
    background: linear-gradient(135deg, var(--md-sys-color-primary-container) 0%, var(--md-sys-color-secondary-container) 100%);
}
.cours-card__hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.2,0,0,1);
}
.cours-card:hover .cours-card__hero-img {
    transform: scale(1.05);
}
.cours-card__hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cours-card__hero-placeholder .material-symbols-outlined {
    font-size: 56px;
    color: var(--md-sys-color-primary);
    opacity: 0.35;
}
.cours-card__hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0,0,0,0.12));
    pointer-events: none;
}
.cours-card__hero-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 1;
}
.cours-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(8px);
}
.cours-card__badge .material-symbols-outlined { font-size: 14px; }
.cours-card__badge--success {
    background: rgba(46, 125, 50, 0.85);
    color: #fff;
}
.cours-card__badge--draft {
    background: rgba(249, 168, 37, 0.85);
    color: #fff;
}
.cours-card__badge--archive {
    background: rgba(120, 120, 120, 0.85);
    color: #fff;
}
.cours-card--archive {
    opacity: .65;
    filter: grayscale(.3);
}
.cours-card__badge--complete {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    gap: 4px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(46,125,50,0.4);
}
.cours-card--termine {
    border: 2px solid rgba(46,125,50,0.5);
    box-shadow: 0 0 12px rgba(46,125,50,0.15);
}
.cours-card--termine .cours-card__hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(46,125,50,0.08), transparent 60%);
    pointer-events: none;
}
.cours-card__body {
    padding: 20px 24px 12px;
    flex: 1;
}
.cours-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cours-card__desc {
    font-size: 0.84rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.55;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cours-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.cours-card__meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    background: var(--md-sys-color-surface-variant);
    padding: 3px 10px;
    border-radius: 100px;
}
.cours-card__meta-chip .material-symbols-outlined { font-size: 14px; }
.cours-card__meta-chip--date { color: var(--md-sys-color-outline-variant); background: transparent; }
.cours-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.cours-card__tag {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
}
.cours-card__tag--more {
    background: transparent;
    color: var(--md-sys-color-outline-variant);
}
.cours-card__progress {
    padding: 0 24px 10px;
}
.cours-card__progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.cours-card__progress-text {
    font-size: 0.7rem;
    color: var(--md-sys-color-outline-variant);
    font-weight: 500;
}
.cours-card__progress-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}
.cours-card__progress-track {
    height: 4px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 2px;
    overflow: hidden;
}
.cours-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ── Scores exercices H5P sur la card ── */
.cours-card__scores {
    padding: 8px 24px 10px;
    border-top: 1px solid rgba(0,0,0,0.04);
}
.cours-card__scores-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--md-sys-color-outline-variant);
}
.cours-card__scores-text {
    flex: 1;
    font-size: 0.78rem;
}
.cours-card__scores-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}
.cours-card__scores-badge--success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--md-sys-color-success, #22C55E);
}
.cours-card__scores-avg {
    font-size: 0.72rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 4px;
    padding-left: 22px;
}
.cours-card__scores-avg strong {
    color: var(--md-sys-color-primary);
}
.cours-card__lecons {
    padding: 8px 24px 12px;
    border-top: 1px solid rgba(0,0,0,0.04);
}
.cours-card__lecons-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--md-sys-color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.cours-card__lecons-label .material-symbols-outlined { font-size: 15px; }
.cours-card__lecons-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cours-card__lecon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--md-sys-shape-corner-small, 8px);
    background: var(--md-sys-color-surface-variant);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, transform 0.1s;
}
.cours-card__lecon:hover {
    background: rgba(38, 180, 216, 0.1);
    transform: translateX(3px);
}
.cours-card__lecon-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}
.cours-card__lecon-title {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.cours-card__lecon-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: var(--md-sys-color-secondary);
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.cours-card__lecon-edit:hover { background: rgba(38,180,216,0.15); }
.cours-card__lecon-edit .material-symbols-outlined { font-size: 16px; }
.cours-card__lecons-more {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
    text-align: center;
    padding: 4px 0;
    font-weight: 500;
}
.cours-card__actions {
    padding: 12px 16px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,0.04);
    margin-top: auto;
}
.cours-card__cta {
    flex: 1;
    justify-content: center;
    min-width: 0;
}
.cours-card__actions-secondary {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
/* Libellé visible sous l'icône Composer */
.cours-card__action-label {
    display: none;
}
/* ── Dropdown "..." menu ──────────────────────────────── */
.cours-card__more-menu {
    position: relative;
}
.cours-card__dropdown {
    display: none;
    /* position:fixed — échappe à tout overflow/stacking parent, positionné par JS */
    position: fixed;
    min-width: 200px;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.30);
    z-index: 9999;
    overflow: hidden;
    padding: 4px 0;
}
/* .is-open non utilisé : display contrôlé par JS portal (dropdown dans <body>) */
.cours-card__dropdown form {
    display: block;
}
.cours-card__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    transition: background 150ms;
    text-align: left;
    white-space: nowrap;
    box-sizing: border-box;
}
/* Neutraliser les styles navigateur par défaut sur <a> dans le dropdown */
a.cours-card__dropdown-item,
a.cours-card__dropdown-item:link,
a.cours-card__dropdown-item:visited,
a.cours-card__dropdown-item:hover,
a.cours-card__dropdown-item:active {
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
}
.cours-card__dropdown-item:hover {
    background: var(--md-sys-color-surface-variant);
}
.cours-card__dropdown-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}
.cours-card__dropdown-item--danger,
a.cours-card__dropdown-item--danger,
a.cours-card__dropdown-item--danger:link,
a.cours-card__dropdown-item--danger:visited {
    color: var(--md-sys-color-error);
    text-decoration: none;
}
.cours-card__dropdown-item--danger .material-symbols-outlined {
    color: var(--md-sys-color-error);
}
.cours-card__dropdown-divider {
    height: 1px;
    background: var(--md-sys-color-outline-variant);
    margin: 4px 0;
}
.cours-card__action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}
.cours-card__action-icon:hover {
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-primary);
}
.cours-card__action-icon .material-symbols-outlined { font-size: 18px; }
.cours-card__action-icon--danger:hover {
    background: rgba(186, 26, 26, 0.08);
    color: var(--md-sys-color-error);
}

/* ── Responsive : actions compactes sur petits écrans ── */
@media (max-width: 400px) {
    .cours-card__actions {
        padding: 10px 12px 14px;
        gap: 6px;
    }
    .cours-card__action-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }
    .cours-card__action-icon .material-symbols-outlined { font-size: 16px; }
    .cours-card__body { padding: 16px 16px 10px; }
    .cours-card__lecons { padding: 8px 16px 10px; }
    .cours-card__progress { padding: 0 16px 10px; }
}

/* ── Grille : éviter le débordement sous 360px ── */

.cours-container {
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-large, 20px);
    background: var(--md-sys-color-surface);
    overflow: hidden;
    transition: box-shadow 0.3s cubic-bezier(0.2,0,0,1), border-color 0.3s, transform 0.2s;
}
.cours-container:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-color: var(--md-sys-color-outline-variant);
    transform: translateY(-2px);
}
.cours-container--publie {
    border-left: 4px solid var(--md-sys-color-success, #2e7d32);
}

/* Photo à la une du cours */
.cours-container__photo {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--md-sys-color-surface-variant);
}
.cours-container__photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--md-sys-motion-duration) var(--md-sys-motion-easing);
}
.cours-container:hover .cours-container__photo-img {
    transform: scale(1.03);
}

.cours-container__header {
    padding: 24px 28px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: linear-gradient(135deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-surface-variant) 100%);
}
.cours-container__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}
.cours-container__identity {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}
.cours-container__icon {
    font-size: 32px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
    margin-top: 2px;
    background: var(--md-sys-color-primary-container);
    width: 48px;
    height: 48px;
    border-radius: var(--md-sys-shape-corner-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cours-container__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.cours-container__date {
    font-size: 0.78rem;
    color: var(--md-sys-color-outline-variant);
}
.cours-container__badges {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
}
.cours-container__desc {
    font-size: 0.88rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0 0 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cours-container__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}
.cours-container__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--md-sys-color-outline-variant);
    font-weight: 500;
}
.cours-container__meta-item .material-symbols-outlined {
    font-size: 16px;
}
.cours-container__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-left: 4px;
}
.cours-container__tag {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
}
.cours-container__tag--more {
    color: var(--md-sys-color-outline-variant);
    background: transparent;
}

/* ── Leçons dans le cours ──────────────────────────────── */

.cours-container__lecons {
    padding: 12px 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cours-container__lecons-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--md-sys-color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 6px;
    margin-bottom: 2px;
}
.cours-container__lecons-header .material-symbols-outlined {
    font-size: 15px;
}
.cours-container__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--md-sys-color-outline);
    font-size: 0.85rem;
    padding: 28px 20px;
}
.cours-container__empty .material-symbols-outlined {
    font-size: 22px;
}

.lecon-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--md-sys-shape-corner-medium, 12px);
    background: var(--md-sys-color-surface-variant);
    transition: background 0.2s cubic-bezier(0.2,0,0,1), transform 0.15s;
    text-decoration: none;
    cursor: pointer;
    color: inherit;
}
.lecon-card:hover {
    background: rgba(38, 180, 216, 0.08);
    transform: translateX(4px);
}
.lecon-card__num {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.lecon-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lecon-card__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lecon-card__desc {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lecon-card__meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lecon-card__blocs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: var(--md-sys-color-secondary);
    font-weight: 600;
    white-space: nowrap;
}
.lecon-card__blocs .material-symbols-outlined {
    font-size: 14px;
}
.lecon-card__duree {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: var(--md-sys-color-outline-variant);
    white-space: nowrap;
}
.lecon-card__duree .material-symbols-outlined {
    font-size: 14px;
}
.lecon-card__edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--md-sys-color-secondary);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.lecon-card__edit:hover {
    background: rgba(38, 180, 216, 0.15);
    color: var(--md-sys-color-primary);
}
.lecon-card__edit .material-symbols-outlined {
    font-size: 18px;
}

/* ── Progress bar (cours) ─────────────────────────────── */
.cours-container__progress {
    padding: 0 28px 16px;
}
.cours-container__progress-bar {
    height: 4px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 2px;
    overflow: hidden;
}
.cours-container__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.cours-container__progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 4px;
}

/* ── Footer du cours ───────────────────────────────────── */

.cours-container__footer {
    padding: 14px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: transparent;
}

/* ── Stats cards (Molécule) ────────────────────────────── */

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

.stat-card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large, 20px);
    padding: 24px;
    border: 1px solid rgba(200, 169, 81, 0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
    border-color: rgba(200, 169, 81, 0.3);
    transform: translateY(-2px);
}
.stat-card__icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}
.stat-card__icon .material-symbols-outlined {
    font-size: 28px;
}

.stat-card__value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card__label {
    font-size: 0.82rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

/* ── Login page ────────────────────────────────────────── */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-secondary) 100%);
}

.login-card {
    background: #ffffff;
    color: #111111;
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--md-sys-elevation-3);
    border: 2px solid var(--md-sys-color-secondary, #26B4D8);
}
.login-card .form-input {
    background: #f5f5f5;
    color: #111111;
    border-color: #ddd;
}
.login-card .form-input:focus {
    background: #ffffff;
    border-color: var(--md-sys-color-primary);
}
.login-card .form-label {
    color: #222222;
}
.login-card .form-hint {
    color: #777777;
}
.login-card a {
    color: #b8963e;
}

.login-card__title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.login-card__subtitle {
    text-align: center;
    color: #666666;
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* ── Messagerie interne ────────────────────────────────── */

.msg-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--md-sys-shape-corner-medium, 12px);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    cursor: pointer;
}
.msg-item:hover {
    background: var(--md-sys-color-surface-variant);
}
.msg-item--unread {
    background: rgba(38, 180, 216, 0.06);
}
.msg-item--unread .msg-item__name {
    font-weight: 700;
}
.msg-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    color: var(--md-sys-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.msg-item__body {
    flex: 1;
    min-width: 0;
}
.msg-item__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.msg-item__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}
.msg-item__date {
    font-size: 0.72rem;
    color: var(--md-sys-color-outline-variant);
    flex-shrink: 0;
}
.msg-item__preview {
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-item__badge {
    background: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Conversation thread ──────────────────────────────── */

.msg-thread {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.msg-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}
.msg-bubble--sent {
    align-self: flex-end;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-bottom-right-radius: 4px;
}
.msg-bubble--received {
    align-self: flex-start;
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    border-bottom-left-radius: 4px;
}
.msg-bubble__subject {
    font-weight: 600;
    font-size: 0.78rem;
    opacity: 0.8;
    margin-bottom: 4px;
}
.msg-bubble__text {
    word-break: break-word;
}
.msg-bubble__time {
    font-size: 0.68rem;
    opacity: 0.6;
    margin-top: 6px;
    text-align: right;
}

/* ── Reply bar ──────────────────────────────────────────── */

.msg-reply {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 16px;
    margin-top: 12px;
}
.msg-reply__input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.msg-reply__input {
    flex: 1;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 16px;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    outline: none;
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.msg-reply__input:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.12);
}
.msg-reply__send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}
.msg-reply__send:hover {
    background: var(--md-sys-color-secondary);
    transform: scale(1.05);
}
.msg-reply__send .material-symbols-outlined {
    font-size: 20px;
}


/* ── Mobile Menu ───────────────────────────────────────── */

.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    height: 56px;
    background: var(--md-sys-color-surface-container);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}
.mobile-topbar__btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--md-sys-shape-corner-full, 50%);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-topbar__btn .material-symbols-outlined { font-size: 24px; }
.mobile-topbar__brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* M3 Navigation Drawer (mobile) */
.mobile-drawer-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9995;
    background: rgba(0, 0, 0, 0.4);
}
.mobile-drawer-scrim.mobile-drawer--open {
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--md-sys-color-surface-container);
    z-index: 9996;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: var(--md-sys-elevation-3, 0 4px 16px rgba(0,0,0,.3));
    border-radius: 0 16px 16px 0;
}
.mobile-drawer--open .mobile-drawer {
    transform: translateX(0);
}

.mobile-drawer__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
}
.mobile-drawer__logo {
    width: 42px;
    height: 42px;
    border-radius: var(--md-sys-shape-corner-medium, 12px);
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    color: var(--md-sys-color-on-primary);
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mobile-drawer__brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.mobile-drawer__items {
    display: flex;
    flex-direction: column;
    padding: 8px 12px 24px;
    gap: 2px;
}

.mobile-drawer__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--md-sys-shape-corner-full, 28px);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background .15s;
    position: relative;
}
.mobile-drawer__item:hover,
.mobile-drawer__item:focus-visible {
    background: var(--md-sys-color-surface-container-high, rgba(255,255,255,.08));
}
.mobile-drawer__item:active {
    background: var(--md-sys-color-surface-container-highest, rgba(255,255,255,.12));
}
.mobile-drawer__item .material-symbols-outlined {
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}
.mobile-drawer__item--active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}
.mobile-drawer__item--active .material-symbols-outlined {
    color: var(--md-sys-color-on-secondary-container);
}

.mobile-drawer__badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error, #fff);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-drawer__divider {
    height: 1px;
    background: var(--md-sys-color-outline-variant);
    margin: 8px 16px;
}
.mobile-drawer__section-title {
    padding: 8px 16px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Force-hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-topbar,
    .mobile-drawer-scrim {
        display: none !important;
    }
}
/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
    .nav-rail {
        display: none;
    }
    .mobile-topbar {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 72px 16px 16px;
        /* Contraindre la largeur au viewport sans scroll horizontal */
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .courses-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .cours-container__photo {
        height: 140px;
    }

    .cours-container__header {
        padding: 16px 18px 12px;
    }
    .cours-container__lecons {
        padding: 10px 18px 16px;
    }
    .cours-container__footer {
        padding: 10px 18px;
    }
    .lecon-card__desc {
        display: none;
    }
    .cours-container__icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .cours-container__title {
        font-size: 1.1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* 2-col grids → stack on mobile */
    .grid-2col,
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .data-table { font-size: 0.82rem; display: block; overflow-x: auto; }
    .data-table th, .data-table td { padding: 8px 10px; white-space: nowrap; }

    .page-header__title { font-size: 1.3rem; }
    .page-header__subtitle { font-size: 0.85rem; }

    /* Page header: stack vertically on mobile */
    .page-header.flex.justify-between { flex-wrap: wrap; gap: 12px; }
    .page-header .flex.gap-2 { flex-wrap: wrap; width: 100%; }
    .page-header .btn--outlined { width: 100%; justify-content: center; font-size: 0.82rem; padding: 8px 12px; }
    .page-header .theme-switch { order: -1; }

    .res-tabs { gap: 0; }
    .res-tabs__item { padding: 8px 10px; font-size: 0.78rem; }
    .res-tabs__label { display: none; }

    /* H5P container: reduce min-height on mobile */
    .h5p-container__iframe { min-height: 320px !important; border-radius: 16px; }
    .h5p-container { border-radius: 16px; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ── H5P Score Dialog ─────────────────────────────────────── */

.h5p-dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.h5p-dialog-overlay--visible {
    display: flex;
}

.h5p-dialog {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--md-sys-elevation-3);
    animation: dialogSlideUp 0.25s ease;
}

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

.h5p-dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--md-sys-color-outline);
}

.h5p-dialog__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.h5p-dialog__body {
    padding: 16px 24px 24px;
    overflow-y: auto;
}

.h5p-dialog__close {
    min-width: 0;
    padding: 4px;
}

.score-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.score-clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ── H5P Container (Organisme) ─────────────────────────── */

.h5p-container {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
    transition: box-shadow var(--md-sys-motion-duration) var(--md-sys-motion-easing);
}

.h5p-container:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.h5p-container__iframe {
    width: 100%;
    border: none;
    border-radius: 24px;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.h5p-container__loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--md-sys-color-surface);
    z-index: 10;
}

.h5p-container__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--md-sys-color-outline);
    border-top-color: var(--md-sys-color-secondary);
    border-radius: 50%;
    animation: h5p-spin 0.8s linear infinite;
}

@keyframes h5p-spin {
    to { transform: rotate(360deg); }
}

.h5p-container__loader-text {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.h5p-container__feedback {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 0 0 24px 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

.h5p-container__feedback--success {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.h5p-container__feedback--failure {
    background: var(--md-sys-color-warning-container);
    color: var(--md-sys-color-on-warning-container);
}

.h5p-container__feedback-icon {
    font-size: 20px;
}

/* Fullscreen : permettre aux vidéos H5P de passer en plein écran */
.h5p-container:fullscreen,
.h5p-container:-webkit-full-screen {
    overflow: visible;
    border-radius: 0;
    background: #000;
    width: 100vw;
    height: 100vh;
}
.h5p-container:fullscreen .h5p-container__iframe,
.h5p-container:-webkit-full-screen .h5p-container__iframe {
    border-radius: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh !important;
}
.h5p-container:fullscreen .h5p-container__fullscreen-btn,
.h5p-container:-webkit-full-screen .h5p-container__fullscreen-btn {
    opacity: 1;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 20;
}

/* ── Bouton plein écran sur le container ────────────── */
.h5p-container__fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 15;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    backdrop-filter: blur(4px);
}
.h5p-container__fullscreen-btn .material-symbols-outlined {
    font-size: 20px;
}
.h5p-container:hover .h5p-container__fullscreen-btn {
    opacity: 1;
}
.h5p-container__fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}
/* Touch devices: always show fullscreen button */
@media (hover: none), (max-width: 768px) {
    .h5p-container__fullscreen-btn {
        opacity: 1;
    }
}

/* ── H5P Popup Overlay (plein écran) ───────────────── */
.h5p-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(6px);
}
.h5p-popup-overlay--active {
    opacity: 1;
    pointer-events: auto;
}
.h5p-popup-overlay__content {
    position: relative;
    width: 95vw;
    height: 92vh;
    max-width: 1400px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--md-sys-color-surface, #1a1a2e);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
}
.h5p-popup-overlay__iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.h5p-popup-overlay__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}
.h5p-popup-overlay__close .material-symbols-outlined {
    font-size: 22px;
}
.h5p-popup-overlay__close:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

/* ── GLB 3D Viewer — fullscreen ────────────────────── */
.mro-glb-viewer {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: var(--md-sys-shape-corner-small, 8px);
    overflow: hidden;
    background: #1a1a2e;
}
.mro-glb-viewer__iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.mro-glb-viewer__fullscreen {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--md-sys-color-primary, #DDAF25);
    color: #111;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
    transition: background .2s, transform .15s;
}
.mro-glb-viewer__fullscreen:hover {
    background: var(--md-sys-color-primary-dark, #C49A20);
    transform: scale(1.08);
}
.mro-glb-viewer__fullscreen .material-symbols-outlined {
    font-size: 22px;
}
/* Overlay fullscreen state */
.mro-glb-viewer--fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background: #000;
}
.mro-glb-viewer--fullscreen .mro-glb-viewer__fullscreen {
    display: none;
}
.mro-glb-viewer__close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10000;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--md-sys-color-primary, #DDAF25);
    color: #111;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    transition: background .2s, transform .15s;
}
.mro-glb-viewer__close:hover {
    background: var(--md-sys-color-primary-dark, #C49A20);
    transform: scale(1.1);
}
.mro-glb-viewer__close .material-symbols-outlined {
    font-size: 26px;
}
.mro-glb-viewer--fullscreen .mro-glb-viewer__close {
    display: flex;
}

/* ── Utilitaires ───────────────────────────────────────── */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* ── Barre de filtres (Molécule) ───────────────────────── */

.table-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    box-shadow: var(--md-sys-elevation-1);
}

.table-filters__search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.table-filters__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
}

.table-filters__search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 0.9rem;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.table-filters__search-input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.table-filters__search-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

.table-filters__select {
    padding: 10px 36px 10px 14px;
    border: 1px solid rgba(200, 169, 81, 0.25);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    background: var(--md-sys-color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23c8a951' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    min-width: 150px;
    min-height: 40px;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.table-filters__select:hover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-variant);
}

.table-filters__select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
    background-color: var(--md-sys-color-surface-variant);
}

.table-filters__count {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    margin-left: auto;
}

.table-filters__reset {
    padding: 8px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.table-filters__reset:hover {
    background: var(--md-sys-color-surface-variant);
}

/* Ligne masquée par filtre */
.data-table tbody tr.filtered-out,
.ana-table tbody tr.filtered-out,
.courses-grid > .filtered-out,
.courses-list > .filtered-out,
.data-table tbody tr.paginated-out,
.ana-table tbody tr.paginated-out,
.courses-grid > .paginated-out,
.courses-list > .paginated-out,
.groups-grid > .paginated-out,
.media-grid > .paginated-out {
    display: none !important;
}

@media (max-width: 768px) {
    .table-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .table-filters__search {
        min-width: 100%;
    }

    .table-filters__select {
        min-width: 100%;
    }

    .table-filters__count {
        margin-left: 0;
        text-align: center;
    }
}

/* ── Groupes ───────────────────────────────────────────── */

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.group-card {
    display: flex;
    flex-direction: column;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--md-sys-elevation-1);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--md-sys-motion-duration) var(--md-sys-motion-easing),
                transform var(--md-sys-motion-duration) var(--md-sys-motion-easing),
                border-color var(--md-sys-motion-duration) var(--md-sys-motion-easing);
}

.group-card:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-3px);
    border-color: rgba(200, 169, 81, 0.2);
}

.group-card__accent {
    height: 5px;
    flex-shrink: 0;
}

.group-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-card__top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.group-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--md-sys-shape-corner-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--md-sys-color-on-primary);
}

.group-card__avatar .material-symbols-outlined {
    font-size: 22px;
}

.group-card__info {
    flex: 1;
    min-width: 0;
}

.group-card__name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.group-card__date {
    font-size: 0.78rem;
    color: var(--md-sys-color-outline-variant, #999);
}

.group-card__desc {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.group-card__stats {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--md-sys-color-outline);
    font-size: 0.8rem;
    color: var(--md-sys-color-outline-variant, #888);
}

.group-card__stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.group-card__stat .material-symbols-outlined {
    font-size: 16px;
}

/* ── Groupe Détail (2 colonnes) ───────────────────────── */

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
}

.groupe-section {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: 24px;
}

.groupe-section__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--md-sys-color-on-surface);
}

.groupe-section__title .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-primary);
}

/* ── Membres list ──────────────────────────────────────── */

.membres-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.membre-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-surface-variant);
}

.membre-item__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.membre-item__info {
    flex: 1;
    min-width: 0;
}

.membre-item__name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.membre-item__email {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Cours accès list ──────────────────────────────────── */

.cours-acces-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cours-acces-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-surface-variant);
}

.cours-acces-item__info {
    flex: 1;
    min-width: 0;
}

.cours-acces-item__title {
    font-weight: 500;
    font-size: 0.9rem;
}

.cours-acces-item__dates {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

.cours-acces-item .badge {
    flex-shrink: 0;
}

.cours-acces-item--expire {
    opacity: 0.6;
}

/* ── Profil page ───────────────────────────────────────── */

.profil-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: 32px;
    text-align: center;
}

.profil-card__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 16px;
}

.profil-card__name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profil-card__email {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
}

.profil-card__stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--md-sys-color-outline);
}

.profil-card__stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--md-sys-color-primary);
}

.profil-card__stat-label {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

.profil-card__groups {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.profil-card__group-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

/* ── Dashboard sections ────────────────────────────────── */

.dashboard-section {
    margin-top: 32px;
}

.dashboard-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--md-sys-color-on-surface);
}

.dashboard-section__title .material-symbols-outlined {
    font-size: 22px;
    color: var(--md-sys-color-primary);
}

/* ── Activity feed ─────────────────────────────────────── */

.activity-feed {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    overflow: hidden;
}

.activity-feed__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.activity-feed__item:last-child {
    border-bottom: none;
}

.activity-feed__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--md-sys-color-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-feed__icon .material-symbols-outlined {
    font-size: 18px;
    color: var(--md-sys-color-primary);
}

.activity-feed__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-feed__text {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface);
    line-height: 1.4;
}

.activity-feed__meta {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
}

/* ── Inline create form ────────────────────────────────── */

.inline-create-form {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.inline-create-form__row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-create-form__field {
    flex: 1;
    min-width: 180px;
}

.inline-create-form__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 4px;
}

.inline-create-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 0.9rem;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s ease;
}

.inline-create-form__input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.inline-create-form__input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

.inline-create-form__color {
    width: 42px;
    height: 42px;
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 2px;
    cursor: pointer;
    background: transparent;
}

/* ── Accès badge ───────────────────────────────────────── */

.badge--actif {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.badge--expire {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.badge--futur {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ── Form add (inline selects) ─────────────────────────── */

.add-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 12px 0;
    border-top: 1px solid var(--md-sys-color-outline);
    margin-top: 12px;
}

.add-form select,
.add-form input[type="date"] {
    padding: 8px 10px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 0.85rem;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
}

.add-form select {
    flex: 1;
    min-width: 140px;
}

.add-form input[type="date"] {
    width: 140px;
}

/* ═══════════════════════════════════════════════════════════
   ANALYTICS DASHBOARD — Dark theme redesign
   ═══════════════════════════════════════════════════════════ */

/* ── KPI summary strip ─────────────────────────────────── */
.ana-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.ana-kpi {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(200,169,81,.15);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color .2s, transform .2s;
}
.ana-kpi:hover {
    border-color: rgba(200,169,81,.35);
    transform: translateY(-2px);
}
.ana-kpi__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ana-kpi__icon .material-symbols-outlined { font-size: 24px; }
.ana-kpi__icon--gold   { background: rgba(200,169,81,.12); color: #c8a951; }
.ana-kpi__icon--green  { background: rgba(34,197,94,.12);  color: #22c55e; }
.ana-kpi__icon--blue   { background: rgba(59,130,246,.12); color: #3b82f6; }
.ana-kpi__icon--red    { background: rgba(239,68,68,.12);  color: #ef4444; }
.ana-kpi__body { min-width: 0; }
.ana-kpi__value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}
.ana-kpi__label {
    font-size: .72rem;
    font-weight: 500;
    color: rgba(255,255,255,.45);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: 2px;
}

/* ── Dark analytics card ───────────────────────────────── */
.ana-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    border: 1px solid rgba(200,169,81,.12);
    margin-bottom: 24px;
    overflow: hidden;
    transition: border-color .2s;
}
.ana-card:hover { border-color: rgba(200,169,81,.25); }
.ana-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(200,169,81,.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.ana-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ana-card__title .material-symbols-outlined { font-size: 22px; color: #c8a951; }
.ana-card__subtitle { font-size: .78rem; color: rgba(255,255,255,.4); margin-top: 2px; }
.ana-card__body { padding: 0; }
.ana-card__empty {
    text-align: center;
    padding: 32px;
    color: rgba(255,255,255,.3);
    font-size: .85rem;
}
.ana-card__empty .material-symbols-outlined {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    color: rgba(200,169,81,.25);
}

/* ── Header stats (inline KPIs in card header) ─────────── */
.ana-header-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}
.ana-header-stat { text-align: center; }
.ana-header-stat__value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}
.ana-header-stat__label {
    font-size: .65rem;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 3px;
}

/* ── Circular gauge (SVG) ──────────────────────────────── */
.ana-gauge {
    width: 56px;
    height: 56px;
    position: relative;
    flex-shrink: 0;
}
.ana-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ana-gauge__bg   { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 5; }
.ana-gauge__fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
}
.ana-gauge__text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
}

/* ── Dark data table ───────────────────────────────────── */
.ana-table {
    width: 100%;
    border-collapse: collapse;
}
.ana-table thead { background: rgba(200,169,81,.06); }
.ana-table th {
    padding: 11px 16px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(200,169,81,.6);
    text-align: left;
    border-bottom: 1px solid rgba(200,169,81,.1);
}
.ana-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    color: rgba(255,255,255,.85);
    font-size: .87rem;
}
.ana-table tbody tr { transition: background .15s; }
.ana-table tbody tr:hover { background: rgba(200,169,81,.05); }
.ana-table a { color: rgba(255,255,255,.85); text-decoration: none; transition: color .15s; }
.ana-table a:hover { color: #c8a951; }

/* ── Score badge (inline) ──────────────────────────────── */
.ana-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .8rem;
}
.ana-score--excellent { background: rgba(34,197,94,.15);  color: #22c55e; }
.ana-score--medium    { background: rgba(245,158,11,.15); color: #f59e0b; }
.ana-score--low       { background: rgba(239,68,68,.15);  color: #ef4444; }
.ana-score--none      { color: rgba(255,255,255,.18); font-weight: 400; }

/* ── Score value color utility ─────────────────────────── */
.ana-val--success { color: #22c55e; }
.ana-val--warning { color: #f59e0b; }
.ana-val--danger  { color: #ef4444; }

/* ── Progress bar (dark) ───────────────────────────────── */
.ana-progress {
    height: 7px;
    background: rgba(255,255,255,.06);
    border-radius: 4px;
    overflow: hidden;
}
.ana-progress__fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}
.ana-progress__fill--green  { background: linear-gradient(90deg, #16a34a, #22c55e); }
.ana-progress__fill--yellow { background: linear-gradient(90deg, #d97706, #f59e0b); }
.ana-progress__fill--red    { background: linear-gradient(90deg, #dc2626, #ef4444); }
.ana-progress__fill--gold   { background: linear-gradient(90deg, #a68a3a, #c8a951); }

/* ── Student identity (avatar + name) ──────────────────── */
.ana-student {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ana-student__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c8a951, #a68a3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .72rem;
    color: #1a1a2e;
    flex-shrink: 0;
    text-transform: uppercase;
}
.ana-student__info { min-width: 0; }
.ana-student__name {
    font-weight: 600;
    font-size: .88rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ana-student__email {
    font-size: .72rem;
    color: rgba(255,255,255,.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Status indicator ──────────────────────────────────── */
.ana-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.ana-status--active   { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.4); }
.ana-status--inactive { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.3); }

/* ── Publication badge (dark variant) ──────────────────── */
.ana-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 600;
}
.ana-badge--published  { background: rgba(34,197,94,.12);  color: #22c55e; }
.ana-badge--draft      { background: rgba(245,158,11,.12); color: #f59e0b; }
.ana-badge--no-data    { background: rgba(255,255,255,.06); color: rgba(255,255,255,.35); }

/* ── Filter bar dark theme override ────────────────────── */
.ana-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    border: 1px solid rgba(200,169,81,.1);
}
.ana-filters__search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 200px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(200,169,81,.12);
    border-radius: 8px;
    padding: 0 12px;
}
.ana-filters__search .material-symbols-outlined {
    font-size: 20px;
    color: rgba(200,169,81,.5);
}
.ana-filters__search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 0;
    color: #fff;
    font-size: .85rem;
    outline: none;
}
.ana-filters__search input::placeholder { color: rgba(255,255,255,.3); }
.ana-filters select {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(200,169,81,.12);
    border-radius: 8px;
    padding: 9px 32px 9px 12px;
    color: rgba(255,255,255,.7);
    font-size: .82rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23c8a951' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.ana-filters select option { background: #1a1a2e; color: #fff; }
.ana-filters__count {
    font-size: .78rem;
    color: rgba(200,169,81,.5);
    margin-left: auto;
}
.ana-filters__reset {
    background: none;
    border: 1px solid rgba(200,169,81,.15);
    border-radius: 8px;
    padding: 7px 12px;
    color: rgba(200,169,81,.6);
    font-size: .78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: border-color .2s, color .2s;
}
.ana-filters__reset:hover { border-color: #c8a951; color: #c8a951; }

/* ── Profile button (dark) ─────────────────────────────── */
.ana-btn-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(200,169,81,.15);
    background: transparent;
    color: rgba(200,169,81,.6);
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.ana-btn-profile:hover {
    border-color: #c8a951;
    color: #c8a951;
    background: rgba(200,169,81,.08);
}
.ana-btn-profile .material-symbols-outlined { font-size: 18px; }

/* ── Analytics empty state (dark) ──────────────────────── */
.ana-empty {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    border: 1px solid rgba(200,169,81,.1);
}
.ana-empty .material-symbols-outlined {
    font-size: 48px;
    color: rgba(200,169,81,.25);
    display: block;
    margin-bottom: 12px;
}
.ana-empty p { color: rgba(255,255,255,.35); font-size: .88rem; margin: 0; }
.ana-empty a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 16px;
    border: 1px solid rgba(200,169,81,.25);
    border-radius: 8px;
    color: #c8a951;
    text-decoration: none;
    font-size: .82rem;
    transition: all .2s;
}
.ana-empty a:hover { background: rgba(200,169,81,.1); border-color: #c8a951; }

/* ── Results Command Center ────────────────────────────── */
/* ── Results Overview panels ───────────────────────────── */
.res-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.res-panel {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    overflow: hidden;
}
.res-panel__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--md-sys-color-on-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    opacity: .85;
}
.res-panel__header .material-symbols-outlined { font-size: 20px; color: var(--md-sys-color-primary); }
.res-panel__body { padding: 24px; }
.res-panel__big-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--md-sys-color-on-surface);
    line-height: 1;
}
.res-panel__small-label {
    font-size: .7rem;
    color: var(--md-sys-color-outline-variant);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 4px;
    display: block;
}
.res-panel__stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}
.res-panel__stat { text-align: center; }
.res-panel__stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--md-sys-color-on-surface);
    display: block;
    line-height: 1;
}
.res-panel__stat-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--md-sys-color-outline-variant);
    margin-top: 4px;
    display: block;
}

/* ── Distribution bar ─────────────────────────────────── */
.res-distrib-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.res-distrib-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
    opacity: .85;
}
.res-distrib-card__title .material-symbols-outlined { font-size: 20px; color: var(--md-sys-color-primary); }
.res-distrib-bar {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    height: 32px;
    margin-bottom: 12px;
}
.res-distrib-bar__segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    min-width: 28px;
    transition: flex .3s ease;
}
.res-distrib-bar__segment--excellent { background: var(--md-sys-color-success, #22c55e); }
.res-distrib-bar__segment--medium   { background: var(--md-sys-color-warning, #f59e0b); }
.res-distrib-bar__segment--low      { background: var(--md-sys-color-error, #ef4444); }
.res-distrib-bar__segment--none     { background: var(--md-sys-color-outline); }
.res-distrib-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: .75rem;
    color: var(--md-sys-color-outline-variant);
}
.res-distrib-legend__item { display: flex; align-items: center; gap: 5px; }
.res-distrib-legend__dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.res-distrib-legend__dot--excellent { background: var(--md-sys-color-success, #22c55e); }
.res-distrib-legend__dot--medium   { background: var(--md-sys-color-warning, #f59e0b); }
.res-distrib-legend__dot--low      { background: var(--md-sys-color-error, #ef4444); }
.res-distrib-legend__dot--none     { background: var(--md-sys-color-outline); }

/* ── Export bar & inline buttons ───────────────────────── */
.res-export-inline {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.res-export-inline__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    text-decoration: none;
}
.res-export-inline__btn:hover {
    transform: translateY(-1px);
}
.res-export-inline__btn .material-symbols-outlined {
    font-size: 18px;
}
.res-export-inline__btn--pdf {
    color: #c0392b;
}
.res-export-inline__btn--pdf:hover {
    background: rgba(192, 57, 43, 0.12);
    color: #a93226;
}
.res-export-inline__btn--csv {
    color: #16a34a;
}
.res-export-inline__btn--csv:hover {
    background: rgba(22, 163, 74, 0.12);
    color: #138a3e;
}
.res-export-inline__btn--json {
    color: var(--md-sys-color-primary, #DDAF25);
}
.res-export-inline__btn--json:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
    color: color-mix(in srgb, var(--md-sys-color-primary) 85%, #000);
}

/* ── Responsive analytics ──────────────────────────────── */
@media (max-width: 768px) {
    .res-overview-grid { grid-template-columns: 1fr; }
    .ana-kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .ana-kpi { padding: 14px 16px; }
    .ana-kpi__value { font-size: 1.3rem; }
    .ana-card__header { flex-direction: column; align-items: flex-start; }
    .ana-header-stats { width: 100%; justify-content: space-around; margin-top: 8px; }
    .ana-table th, .ana-table td { padding: 10px 10px; font-size: .8rem; }
    .ana-filters { flex-direction: column; }
    .ana-filters__search { width: 100%; }
}

/* ── Groupe meta form ──────────────────────────────────── */

.groupe-meta {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: 24px;
    margin-bottom: 24px;
}

.groupe-meta__form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.groupe-meta__field {
    flex: 1;
    min-width: 160px;
}

.groupe-meta__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 4px;
}

.groupe-meta__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 0.9rem;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
}

.groupe-meta__input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.groupe-meta__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Remove button (compact) ───────────────────────────── */

.btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--md-sys-color-outline-variant);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.btn-remove .material-symbols-outlined {
    font-size: 18px;
}

/* ── Scroll to top button ────────────────────────── */
.scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 200;
}
.scroll-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top:hover {
    background: var(--md-sys-color-primary-dark, #C49A20);
    box-shadow: var(--md-sys-elevation-4);
}
.scroll-top .material-symbols-outlined {
    font-size: 28px;
}

/* ── Profil page — enhanced layout ─────────────────────── */

.profil-hero {
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, color-mix(in srgb, var(--md-sys-color-primary) 70%, var(--md-sys-color-secondary)) 100%);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 40px 36px 32px;
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.profil-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.profil-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 20%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.profil-hero__avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.3);
    position: relative;
    z-index: 1;
}
.profil-hero__info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.profil-hero__name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}
.profil-hero__email {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    margin: 4px 0 10px;
}
.profil-hero__badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.profil-hero__badges .badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
}
.profil-hero__meta {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}
.profil-hero__meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.profil-hero__meta .material-symbols-outlined {
    font-size: 16px;
}

.profil-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
@media (max-width: 768px) {
    .profil-details-grid { grid-template-columns: 1fr; }
    .profil-hero { flex-direction: column; text-align: center; padding: 28px 20px 24px; }
    .profil-hero__badges { justify-content: center; }
    .profil-hero__meta { justify-content: center; flex-wrap: wrap; }
}

.profil-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--md-sys-color-on-surface);
}
.profil-section-title .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-primary);
}

.profil-contact-item:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface-variant)) !important;
    box-shadow: var(--md-sys-elevation-1);
}

.profil-progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profil-progress-ring svg {
    transform: rotate(-90deg);
}
.profil-progress-ring__label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

/* Formation tabs (sub-navigation Cours / Lecons) */
.formation-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--md-sys-color-outline-variant, #e0e0e0);
    padding-bottom: 0;
}

.formation-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant, #666);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 12px 12px 0 0;
    transition: color .2s, border-color .2s, background .2s;
}

.formation-tabs__tab .material-symbols-outlined {
    font-size: 20px;
}

.formation-tabs__tab:hover {
    color: var(--md-sys-color-on-surface, #1a1a1a);
    background: var(--md-sys-color-surface-variant, #f5f5f5);
}

.formation-tabs__tab--active {
    color: var(--md-sys-color-primary, #DDAF25);
    border-bottom-color: var(--md-sys-color-primary, #DDAF25);
    font-weight: 600;
}

/* ── Dashboard Scores Section (Élève) ────────────────── */
.dash-scores-section {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--md-sys-color-surface-container, #1e1e2e);
    border-radius: 16px;
    border: 1px solid rgba(200,169,81,.12);
}
.dash-scores-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
/* Toggle variant (button reset) */
.dash-scores-header--toggle {
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
    margin-bottom: 0;
}
.dash-scores-header__chevron {
    transition: transform .25s ease;
    color: var(--md-sys-color-outline);
}
.dash-scores-header--toggle[aria-expanded="true"] .dash-scores-header__chevron {
    transform: rotate(180deg);
}
.dash-scores-body {
    margin-top: 20px;
}
.dash-scores-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-scores-header__icon {
    font-size: 24px;
    color: var(--md-sys-color-primary);
}
.dash-scores-header__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.dash-scores-avg {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.dash-scores-avg .material-symbols-outlined { font-size: 18px; }
.dash-scores-avg__detail { font-weight: 400; opacity: .7; margin-left: 2px; }
.dash-scores-avg--success { background: rgba(76,175,80,.12); color: #66bb6a; }
.dash-scores-avg--warning { background: rgba(255,193,7,.12); color: #ffc107; }
.dash-scores-avg--danger  { background: rgba(244,67,54,.12); color: #ef5350; }

.dash-scores-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dash-score-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--md-sys-color-surface, #121212);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.dash-score-card:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.dash-score-card--success { border-left: 3px solid var(--md-sys-color-success, #66bb6a); }
.dash-score-card--fail    { border-left: 3px solid var(--md-sys-color-error, #ef5350); }

.dash-score-card__gauge {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.dash-score-card__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.dash-score-card__pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 700;
}

.dash-score-card__info {
    flex: 1;
    min-width: 0;
}
.dash-score-card__title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-score-card__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--md-sys-color-outline);
}
.dash-score-card__meta .material-symbols-outlined { font-size: 14px; }
.dash-score-card__sep { opacity: .4; margin: 0 2px; }
.dash-score-card__date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 2px;
}
.dash-score-card__date .material-symbols-outlined { font-size: 13px; }

.dash-score-card__badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.dash-score-card__badge .material-symbols-outlined { font-size: 16px; }
.dash-score-card--success .dash-score-card__badge { background: rgba(76,175,80,.12); color: #66bb6a; }
.dash-score-card--fail .dash-score-card__badge    { background: rgba(244,67,54,.12); color: #ef5350; }

/* ── Dashboard H5P Stats (Formateur/Admin) ───────────── */
.dash-h5p-stats {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--md-sys-color-surface-container, #1e1e2e);
    border-radius: 16px;
    border: 1px solid rgba(200,169,81,.12);
}
/* Toggle header (replaces static header) */
.dash-h5p-stats__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
}
.dash-h5p-stats__toggle .material-symbols-outlined {
    font-size: 24px;
    color: var(--md-sys-color-primary);
}
.dash-h5p-stats__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}
.dash-h5p-stats__chevron {
    transition: transform .25s ease;
}
.dash-h5p-stats__toggle[aria-expanded="true"] .dash-h5p-stats__chevron {
    transform: rotate(180deg);
}

/* Collapsible body */
.dash-h5p-stats__body {
    margin-top: 24px;
}

.dash-h5p-cours-group {
    margin-bottom: 20px;
}
.dash-h5p-cours-group__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 12px;
    background: rgba(200,169,81,.08);
    border-radius: 8px;
    margin-bottom: 10px;
}
.dash-h5p-cours-group__header .material-symbols-outlined {
    font-size: 18px;
    color: var(--md-sys-color-primary);
}

.dash-h5p-lecon-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--md-sys-color-outline);
    padding: 4px 12px 4px 24px;
    margin-bottom: 6px;
}
.dash-h5p-lecon-label .material-symbols-outlined { font-size: 16px; }

.dash-h5p-exercices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.dash-h5p-ex-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    background: var(--md-sys-color-surface, #121212);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.05);
    transition: transform .15s ease;
}
.dash-h5p-ex-card:hover { transform: translateX(3px); }

.dash-h5p-ex-card__left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.dash-h5p-ex-card__gauge {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}
.dash-h5p-ex-card__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.dash-h5p-ex-card__pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: 700;
}

.dash-h5p-ex-card__info { min-width: 0; }
.dash-h5p-ex-card__title {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.dash-h5p-ex-card__meta {
    font-size: 0.78rem;
    color: var(--md-sys-color-outline);
    margin-top: 2px;
}

.dash-h5p-ex-card__stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.dash-h5p-ex-card__stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    color: var(--md-sys-color-outline);
}
.dash-h5p-ex-card__stat .material-symbols-outlined { font-size: 16px; }
.dash-h5p-ex-card__stat--rate { font-weight: 600; }
.dash-h5p-ex-card__stat--success { color: #66bb6a; }
.dash-h5p-ex-card__stat--warning { color: #ffc107; }
.dash-h5p-ex-card__stat--danger  { color: #ef5350; }

/* ── Expand button per exercise card ── */
.dash-h5p-ex-card__expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px;
    background: var(--md-sys-color-surface-container, #1e1e2e);
    color: var(--md-sys-color-outline);
    cursor: pointer;
    transition: background .15s, color .15s, transform .25s;
}
.dash-h5p-ex-card__expand:hover {
    background: rgba(200,169,81,.12);
    color: var(--md-sys-color-primary);
}
.dash-h5p-ex-card__expand .material-symbols-outlined {
    font-size: 18px;
    transition: transform .25s ease;
}
.dash-h5p-ex-card__expand[aria-expanded="true"] .material-symbols-outlined {
    transform: rotate(180deg);
}

/* ── Attempt detail panel ── */
.dash-h5p-ex-detail {
    padding: 8px 12px 12px 56px;
    animation: h5pDetailSlide .2s ease;
}
@keyframes h5pDetailSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dash-h5p-ex-detail__loader {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--md-sys-color-outline);
    padding: 10px 0;
}
.dash-h5p-ex-detail__empty {
    font-size: .82rem;
    color: var(--md-sys-color-outline);
    padding: 8px 0;
}

/* Spinner */
@keyframes h5pSpin { to { transform: rotate(360deg); } }
.dash-h5p-spin { animation: h5pSpin .8s linear infinite; }

/* ── Attempts table ── */
.dash-h5p-attempts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}
.dash-h5p-attempts-table thead {
    background: rgba(200,169,81,.06);
}
.dash-h5p-attempts-table th {
    text-align: left;
    font-weight: 600;
    padding: 6px 10px;
    color: var(--md-sys-color-outline);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.dash-h5p-attempts-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    color: var(--md-sys-color-on-surface, #e0e0e0);
}
.dash-h5p-attempts-table__name { font-weight: 500; }

/* Score badge */
.dash-h5p-attempts-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .75rem;
}
.dash-h5p-attempts-badge--success { background: rgba(102,187,106,.15); color: #66bb6a; }
.dash-h5p-attempts-badge--warning { background: rgba(255,193,7,.15); color: #ffc107; }
.dash-h5p-attempts-badge--danger  { background: rgba(239,83,80,.15); color: #ef5350; }

/* Result icons */
.dash-h5p-attempts-icon--success { font-size: 18px; color: #66bb6a; }
.dash-h5p-attempts-icon--danger  { font-size: 18px; color: #ef5350; }

/* ── Attempts pagination ── */
.dash-h5p-attempts-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 0;
    font-size: .78rem;
    color: var(--md-sys-color-outline);
}
.dash-h5p-attempts-pagination__btns {
    display: flex;
    gap: 6px;
}
.dash-h5p-attempts-pagination__btn {
    padding: 4px 12px;
    border: 1px solid rgba(200,169,81,.2);
    border-radius: 6px;
    background: transparent;
    color: var(--md-sys-color-primary);
    font-size: .75rem;
    cursor: pointer;
    transition: background .15s;
}
.dash-h5p-attempts-pagination__btn:hover {
    background: rgba(200,169,81,.12);
}

/* ══════════════════════════════════════════════════════════
   THEME LIGHT — Surcharge des tokens via data-theme
   ══════════════════════════════════════════════════════════ */

[data-theme="light"] {
    --md-sys-color-primary: #DDAF25;
    --md-sys-color-on-primary: #111111;
    --md-sys-color-primary-container: #FFF3D0;
    --md-sys-color-on-primary-container: #3E2E00;

    --md-sys-color-secondary: #26B4D8;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #D4F1F9;
    --md-sys-color-on-secondary-container: #003544;

    --md-sys-color-surface: #ffffff;
    --md-sys-color-on-surface: #111111;
    --md-sys-color-on-surface-variant: #555555;
    --md-sys-color-surface-variant: #F5F5F5;
    --md-sys-color-surface-container: #ffffff;
    --md-sys-color-surface-container-low: #FAFAFA;
    --md-sys-color-surface-container-high: #F0F0F0;
    --md-sys-color-surface-container-highest: #E8E8E8;
    --md-sys-color-outline: #D0D0D0;
    --md-sys-color-outline-variant: #5c5c5c;

    --md-sys-color-tertiary: #FF9800;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #FFF3E0;
    --md-sys-color-on-tertiary-container: #4E2700;

    --md-sys-color-error: #DC2626;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-success: #16A34A;
    --md-sys-color-warning: #F59E0B;

    --md-sys-color-success-container: #DCFCE7;
    --md-sys-color-on-success-container: #166534;
    --md-sys-color-warning-container: #FEF3C7;
    --md-sys-color-on-warning-container: #92400E;
    --md-sys-color-error-container: #FEE2E2;
    --md-sys-color-on-error-container: #991B1B;

    --md-sys-color-primary-dark: #C49A20;
}

/* ── Light theme component overrides ───────────────────── */

[data-theme="light"] .card {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .card:hover {
    border-color: var(--md-sys-color-primary);
}
[data-theme="light"] .group-card {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .group-card:hover {
    border-color: var(--md-sys-color-primary);
}
[data-theme="light"] .stat-card {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .stat-card:hover {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-2);
}
[data-theme="light"] .dash-kpi-card {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .dash-kpi-card:hover {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-2);
}
[data-theme="light"] .dash-score-card {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .dash-h5p-stats {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .dash-h5p-ex-card__expand {
    border-color: var(--md-sys-color-outline);
    background: var(--md-sys-color-surface-container-low);
}
[data-theme="light"] .dash-h5p-attempts-table td {
    border-bottom-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .dash-h5p-attempts-table thead {
    background: var(--md-sys-color-surface-variant);
}
[data-theme="light"] .dash-h5p-attempts-pagination__btn {
    border-color: var(--md-sys-color-outline);
}

/* Analytics (dark-hardcoded) → light overrides */
[data-theme="light"] .ana-kpi__value { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-kpi__label { color: var(--md-sys-color-on-surface-variant); }
[data-theme="light"] .ana-card__title { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-card__subtitle { color: var(--md-sys-color-on-surface-variant); }
[data-theme="light"] .ana-card__empty { color: var(--md-sys-color-on-surface-variant); }
[data-theme="light"] .ana-card__empty .material-symbols-outlined { color: var(--md-sys-color-outline); }
[data-theme="light"] .ana-table thead { background: var(--md-sys-color-surface-variant); }
[data-theme="light"] .ana-table thead th { color: var(--md-sys-color-on-surface-variant); border-bottom-color: var(--md-sys-color-outline); }
[data-theme="light"] .ana-table td { border-bottom-color: var(--md-sys-color-outline); color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-table a { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-table a:hover { color: var(--md-sys-color-primary); }
[data-theme="light"] .ana-table tbody tr:hover { background: var(--md-sys-color-surface-variant); }
[data-theme="light"] .ana-score--none { color: #888; }
[data-theme="light"] .ana-gauge__bg { stroke: #e0e0e0; }
[data-theme="light"] .ana-gauge__text { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-header-stat__label { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-student__name { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-student__email { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-progress { background: var(--md-sys-color-surface-variant); }
[data-theme="light"] .ana-filters {
    background: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .ana-filters__search {
    background: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-outline);
}
[data-theme="light"] .ana-filters__search .material-symbols-outlined { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-filters__search input { color: var(--md-sys-color-on-surface); background: transparent; }
[data-theme="light"] .ana-filters__search input::placeholder { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-filters select {
    background: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .ana-filters select option { background: #fff; color: #333; }
[data-theme="light"] .ana-filters__count { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-filters__reset {
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-outline-variant);
}
[data-theme="light"] .ana-filters__reset:hover { border-color: var(--md-sys-color-primary); color: var(--md-sys-color-primary); }
[data-theme="light"] .ana-btn-profile {
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-outline-variant);
}
[data-theme="light"] .ana-btn-profile:hover {
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-variant);
}
[data-theme="light"] .ana-badge--no-data { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-empty {
    background: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .ana-empty p { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-empty .material-symbols-outlined { color: var(--md-sys-color-outline); }
[data-theme="light"] .ana-detail-header__value { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .ana-detail-header__label { color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .ana-card {
    background: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .ana-card:hover { border-color: var(--md-sys-color-primary); }
[data-theme="light"] .ana-card__header { border-bottom-color: var(--md-sys-color-outline); }
[data-theme="light"] .ana-card__title .material-symbols-outlined { color: var(--md-sys-color-primary); }
[data-theme="light"] .ana-kpi {
    background: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .ana-kpi:hover { border-color: var(--md-sys-color-primary); }
[data-theme="light"] .res-panel {
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .res-panel__header { border-color: var(--md-sys-color-outline-variant); }
[data-theme="light"] .res-distrib-card {
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .ana-val--success { color: #16a34a; }
[data-theme="light"] .ana-val--warning { color: #d97706; }
[data-theme="light"] .ana-val--danger  { color: #dc2626; }
[data-theme="light"] .ana-score--none { color: #888; }
[data-theme="light"] .ana-header-stat__value { color: var(--md-sys-color-on-surface); }
[data-theme="light"] .res-export-inline__btn--pdf { color: #c0392b; }
[data-theme="light"] .res-export-inline__btn--csv { color: #16a34a; }
[data-theme="light"] .res-export-inline__btn--json { color: var(--md-sys-color-primary, #DDAF25); }

/* Nav-rail light */
[data-theme="light"] .nav-rail {
    box-shadow: var(--md-sys-elevation-1);
}

/* Theme toggle button */
.theme-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    border: none;
    background: none;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    gap: 2px;
    border-radius: var(--md-sys-shape-corner-large);
    transition: background var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    width: 100%;
    font-family: inherit;
}
.theme-toggle:hover {
    background: var(--md-sys-color-surface-variant);
}
.theme-toggle .material-symbols-outlined {
    font-size: 22px;
}

@media (max-width: 640px) {
    .dash-score-card { flex-wrap: wrap; gap: 10px; }
    .dash-score-card__badge { width: 100%; justify-content: center; }
    .dash-h5p-ex-card { flex-direction: column; align-items: flex-start; }
    .dash-h5p-ex-card__stats { width: 100%; justify-content: flex-end; }
}

/* ── Dashboard Unified KPI Section ───────────────────── */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.dash-kpi-card {
    background: var(--md-sys-color-surface-container, #1e1e2e);
    border-radius: var(--md-sys-shape-corner-medium, 16px);
    border: 1px solid rgba(200,169,81,.08);
    padding: 20px;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.dash-kpi-card:hover {
    border-color: rgba(200,169,81,.2);
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.dash-kpi-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-kpi-card__title .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-primary);
}

/* KPI card internal layout */
.dash-kpi-card__detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 12px;
    justify-content: center;
}
.dash-kpi-card__detail .material-symbols-outlined {
    font-size: 16px;
}
.dash-kpi-card__stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 8px;
    padding: 16px 0;
}
.dash-kpi-card__stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.dash-kpi-card__stat-icon {
    font-size: 24px;
}
.dash-kpi-card__stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    line-height: 1;
}
.dash-kpi-card__stat-label {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
    font-weight: 500;
}
.dash-kpi-card__stat-divider {
    width: 1px;
    background: var(--md-sys-color-outline);
    align-self: stretch;
    opacity: 0.5;
}
.dash-kpi-card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    margin-top: 8px;
    border-radius: 10px;
    background: rgba(200, 169, 81, 0.08);
    color: var(--md-sys-color-primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.dash-kpi-card__link:hover {
    background: rgba(200, 169, 81, 0.18);
}
.dash-kpi-card__link .material-symbols-outlined {
    font-size: 18px;
}

/* Gauge ring (reusable) */
.dash-gauge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}
.dash-gauge__svg {
    width: 120px;
    height: 120px;
}
.dash-gauge__value {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}
.dash-gauge__label {
    font-size: 0.82rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 8px;
    text-align: center;
    font-weight: 500;
}

/* Status split display */
.dash-status-split {
    display: flex;
    justify-content: space-around;
    text-align: center;
}
.dash-status-split__divider {
    width: 1px;
    background: var(--md-sys-color-outline-variant);
}
.dash-status-split__value {
    font-size: 2rem;
    font-weight: 700;
}
.dash-status-split__value--success { color: var(--md-sys-color-success); }
.dash-status-split__value--warning { color: var(--md-sys-color-warning); }
.dash-status-split__label {
    font-size: 0.8rem;
    color: var(--md-sys-color-outline-variant);
}

/* Status bar */
.dash-status-bar {
    margin-top: 16px;
}
.dash-status-bar__track {
    height: 8px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 4px;
    overflow: hidden;
}
.dash-status-bar__fill {
    height: 100%;
    background: var(--md-sys-color-success);
    border-radius: 4px;
}
.dash-status-bar__label {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 4px;
    text-align: center;
}

/* Summary legend */
.dash-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    font-size: 0.85rem;
}
.dash-legend__item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dash-legend__item .material-symbols-outlined { font-size: 16px; vertical-align: middle; }

/* Quick links */
.dash-quick-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Progress per course row */
.dash-progress-row {
    margin-bottom: 12px;
}
.dash-progress-row__top {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.dash-progress-row__name {
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-progress-row__pct {
    font-weight: 600;
    color: var(--md-sys-color-primary);
}
.dash-progress-row__detail {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
    margin-top: 2px;
}

/* ── Trainer contact card (élève dashboard) ─────────── */
.dash-trainers {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.dash-trainer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 240px;
    max-width: 360px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid rgba(200, 169, 81, 0.15);
    border-radius: var(--md-sys-shape-corner-large, 16px);
    overflow: hidden;
    transition: box-shadow var(--md-sys-motion-duration) var(--md-sys-motion-easing),
                border-color var(--md-sys-motion-duration) var(--md-sys-motion-easing);
}
.dash-trainer-card:hover {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-2);
}
.dash-trainer-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.dash-trainer-card__info {
    flex: 1;
    min-width: 0;
}
.dash-trainer-card__label {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dash-trainer-card__name {
    font-weight: 600;
    font-size: 0.95rem;
}
.dash-trainer-card__icon {
    font-size: 22px;
    color: var(--md-sys-color-secondary);
}

/* ── Global select/dropdown unification ─────────────── */
select,
select.form-input,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--md-sys-color-surface, #1e1e2e);
    color: var(--md-sys-color-on-surface, #e8e4dc);
    border: 1px solid rgba(200, 169, 81, 0.25);
    border-radius: 10px;
    padding: 10px 36px 10px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23c8a951' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    outline: none;
    min-height: 40px;
    line-height: 1.4;
}
select:hover,
select.form-input:hover,
.form-select:hover {
    border-color: var(--md-sys-color-primary, #c8a951);
    background-color: var(--md-sys-color-surface-variant, #252540);
}
select:focus,
select.form-input:focus,
.form-select:focus {
    border-color: var(--md-sys-color-primary, #c8a951);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
    background-color: var(--md-sys-color-surface-variant, #252540);
}
select option {
    background: var(--md-sys-color-surface, #1e1e2e);
    color: var(--md-sys-color-on-surface, #e8e4dc);
    padding: 8px 12px;
}

/* ── Page Tabs (Utilisateurs / Groupes) ──────────────────── */
.page-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    padding-bottom: 0;
}
.page-tabs__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: color var(--md-sys-motion-duration) var(--md-sys-motion-easing),
                border-color var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    margin-bottom: -1px;
}
.page-tabs__tab .material-symbols-outlined {
    font-size: 20px;
}
.page-tabs__tab:hover {
    color: var(--md-sys-color-on-surface);
}
.page-tabs__tab--active {
    color: var(--md-sys-color-primary);
    border-bottom-color: var(--md-sys-color-primary);
}

/* ── Theme Toggle (Dashboard / Profile) ──────────────────── */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-full);
    padding: 4px;
}
.theme-switch__btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    background: transparent;
    color: var(--md-sys-color-outline);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    font-family: inherit;
}
.theme-switch__btn .material-symbols-outlined {
    font-size: 18px;
}
.theme-switch__btn--active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}
.theme-switch__btn:hover:not(.theme-switch__btn--active) {
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container-high);
}

/* ── Dashboard Activity Dropdown ─────────────────────────── */
.dash-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    user-select: none;
}
.dash-dropdown-chevron {
    transition: transform var(--md-sys-motion-duration) var(--md-sys-motion-easing);
    color: var(--md-sys-color-outline);
}
.dash-dropdown-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.dash-dropdown--open .dash-dropdown-chevron {
    transform: rotate(180deg);
}
.dash-dropdown--open .dash-dropdown-body {
    max-height: 600px;
}

/* ── Import CSV Dialog ────────────────────────────────────── */

.import-dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.import-dialog-overlay--visible {
    display: flex;
}

.import-dialog {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-extra-large);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--md-sys-elevation-3);
    animation: importDialogIn 0.25s ease;
}
@keyframes importDialogIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.import-dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.import-dialog__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--md-sys-color-on-surface);
}
.import-dialog__title .material-symbols-outlined {
    color: var(--md-sys-color-primary);
}
.import-dialog__close {
    min-width: 0;
    padding: 4px;
}

.import-dialog__body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Step indicator */
.import-dialog__step {
    display: flex;
    align-items: center;
    gap: 10px;
}
.import-dialog__step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.import-dialog__step-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Type chips */
.import-dialog__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.import-dialog__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    transition: all 0.2s ease;
}
.import-dialog__chip .material-symbols-outlined {
    font-size: 16px;
}
.import-dialog__chip:hover {
    background: rgba(200, 169, 81, 0.08);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
}
.import-dialog__chip--active {
    background: rgba(200, 169, 81, 0.15);
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    font-weight: 600;
}

/* Format preview */
.import-dialog__preview {
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 12px 16px;
}
.import-dialog__preview-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 6px;
}
.import-dialog__preview-code {
    display: block;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--md-sys-color-primary);
    word-break: break-all;
}

/* Template download link */
.import-dialog__template-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}
.import-dialog__template-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}
.import-dialog__template-link .material-symbols-outlined {
    font-size: 18px;
}

/* Dropzone */
.import-dialog__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 16px;
    border: 2px dashed var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-large);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}
.import-dialog__dropzone:hover {
    border-color: var(--md-sys-color-primary);
    background: rgba(200, 169, 81, 0.04);
}
.import-dialog__dropzone--filled {
    border-color: var(--md-sys-color-primary);
    border-style: solid;
    background: rgba(200, 169, 81, 0.06);
}
.import-dialog__dropzone-icon {
    font-size: 32px;
    color: var(--md-sys-color-outline);
    transition: color 0.2s;
}
.import-dialog__dropzone--filled .import-dialog__dropzone-icon {
    color: var(--md-sys-color-primary);
}
.import-dialog__dropzone-text {
    font-size: 0.88rem;
    color: var(--md-sys-color-on-surface-variant);
}
.import-dialog__dropzone--filled .import-dialog__dropzone-text {
    color: var(--md-sys-color-primary);
    font-weight: 500;
}
.import-dialog__dropzone-hint {
    font-size: 0.72rem;
    color: var(--md-sys-color-outline);
}

.import-dialog__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Light theme */
[data-theme="light"] .import-dialog__header {
    border-bottom-color: var(--md-sys-color-outline);
}
[data-theme="light"] .import-dialog__dropzone {
    border-color: var(--md-sys-color-outline-variant);
}
[data-theme="light"] .import-dialog__dropzone--filled {
    border-color: var(--md-sys-color-primary);
}

/* ── Light theme — Forms, tables, selects, pagination ── */
[data-theme="light"] .form-label {
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .form-input {
    border-color: var(--md-sys-color-outline);
}
[data-theme="light"] .form-hint {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .data-table th {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .data-table td {
    color: var(--md-sys-color-on-surface);
    border-top-color: var(--md-sys-color-outline);
}
[data-theme="light"] .data-table thead {
    background: var(--md-sys-color-surface-variant);
}
[data-theme="light"] .table-filters {
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .table-filters__search-input {
    background: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .table-filters__search-input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .table-filters__select {
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .table-filters__count {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .table-filters__reset {
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] select,
[data-theme="light"] select.form-input,
[data-theme="light"] .form-select {
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] select option {
    background: #fff;
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .pagination-bar {
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface-variant);
    box-shadow: var(--md-sys-elevation-1);
}
[data-theme="light"] .pagination-bar__select {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-color: var(--md-sys-color-outline);
}
[data-theme="light"] .pagination-bar__btn {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .pagination-bar__btn:hover:not(:disabled) {
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .pagination-bar__page {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .pagination-bar__page:hover {
    background: var(--md-sys-color-surface-variant);
}
[data-theme="light"] .pagination-bar__info {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .stat-card__label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .page-header__subtitle {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .empty-state p {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .section-heading {
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .dash-kpi-card__title {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-kpi-card__stat-label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-kpi-card__stat-value {
    color: var(--md-sys-color-on-surface);
}
[data-theme="light"] .dash-kpi-card__detail {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-gauge__label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-status-split__label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-status-bar__label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-trainer-card__label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-trainer-card {
    border-color: var(--md-sys-color-outline);
    background: var(--md-sys-color-surface);
}
[data-theme="light"] .dash-progress-row__detail {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .dash-dropdown-header {
    background: var(--md-sys-color-surface-variant);
}
[data-theme="light"] .page-tabs__tab {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .cours-card__lecons-more {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .import-dialog {
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-3);
}
[data-theme="light"] .import-dialog__chip {
    color: var(--md-sys-color-on-surface-variant);
    border-color: var(--md-sys-color-outline);
}
[data-theme="light"] .import-dialog__preview {
    background: var(--md-sys-color-surface-variant);
}
[data-theme="light"] .import-dialog__preview-label {
    color: var(--md-sys-color-on-surface-variant);
}
[data-theme="light"] .import-dialog__dropzone-text {
    color: var(--md-sys-color-on-surface-variant);
}

@media (max-width: 520px) {
    .import-dialog {
        max-width: 100%;
        border-radius: var(--md-sys-shape-corner-large);
    }
}

/* ═══════════════════════════════════════════════════════
   PAGINATION BAR
   ═══════════════════════════════════════════════════════ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 8px 16px;
    margin-top: 4px;
    border-radius: var(--md-sys-shape-corner-medium, 12px);
    background: var(--md-sys-color-surface-container, #1d1b20);
    color: var(--md-sys-color-on-surface-variant, #cac4d0);
    font-size: 0.8125rem;
    flex-wrap: wrap;
}

/* Per-page selector */
.pagination-bar__per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pagination-bar__per-page label {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
}
.pagination-bar__select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--md-sys-color-surface-container-high, #2b2930);
    color: var(--md-sys-color-on-surface, #e6e0e9);
    border: 1px solid var(--md-sys-color-outline-variant, #49454f);
    border-radius: var(--md-sys-shape-corner-extra-small, 4px);
    padding: 4px 28px 4px 10px;
    font-size: 0.8125rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23cac4d0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}
.pagination-bar__select:focus {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 1px;
}

/* Info text "1–25 sur 120" */
.pagination-bar__info {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

/* Navigation container */
.pagination-bar__nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Arrow buttons (first, prev, next, last) */
.pagination-bar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pagination-bar__btn:hover:not(:disabled) {
    background: var(--md-sys-color-surface-container-highest, #36343b);
    color: var(--md-sys-color-on-surface);
}
.pagination-bar__btn:disabled {
    opacity: 0.38;
    cursor: default;
}
.pagination-bar__btn .material-symbols-outlined {
    font-size: 20px;
}

/* Page number buttons container */
.pagination-bar__pages {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Individual page number button */
.pagination-bar__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 4px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pagination-bar__page:hover {
    background: var(--md-sys-color-surface-container-highest, #36343b);
    color: var(--md-sys-color-on-surface);
}
.pagination-bar__page--active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-weight: 600;
}
.pagination-bar__page--active:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

/* Ellipsis dots */
.pagination-bar__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 36px;
    color: var(--md-sys-color-outline);
    font-size: 0.875rem;
    pointer-events: none;
}

/* Light theme overrides */
[data-theme="light"] .pagination-bar__select {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-color: var(--md-sys-color-outline);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2349454f'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

/* Responsive */
@media (max-width: 600px) {
    .pagination-bar {
        justify-content: center;
        gap: 8px;
        padding: 8px;
    }
    .pagination-bar__per-page {
        order: 2;
    }
    .pagination-bar__info {
        order: 1;
        width: 100%;
        text-align: center;
    }
    .pagination-bar__nav {
        order: 3;
    }
}
