/* ============================================
   REFONTE VISUELLE MODERNE - STYLES CENTRALISÉS
   ============================================ */

/* Import de la police Manrope */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* ============================================
   VARIABLES CSS
   ============================================ */

:root {
    /* Couleurs principales */
    --color-primary: #1F3B70;
    --color-primary-light: #2A4E8A;
    --color-secondary: #FF9F3C;
    --color-secondary-dark: #e88a2a;
    --color-secondary-light: #FFB84D;
    
    /* Couleurs de fond */
    --color-bg-main: #F8FAFC;
    --color-bg-card: #FFFFFF;
    --color-bg-card-yellow: #FFFBEB;
    --color-bg-hover: rgba(0, 0, 0, 0.02);
    
    /* Couleurs de texte */
    --color-text-primary: #1F2937;
    --color-text-secondary: #4B5563;
    --color-text-tertiary: #6B7280;
    --color-text-light: #9CA3AF;
    --color-text-white: #FFFFFF;
    
    /* Couleurs de bordure */
    --color-border-light: rgba(15, 23, 42, 0.06);
    --color-border-medium: rgba(15, 23, 42, 0.10);
    --color-border-card: rgba(15, 23, 42, 0.08);
    
    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 30px 80px rgba(15, 23, 42, 0.20);
    --shadow-glow: 0 0 8px rgba(255, 159, 60, 0.4);
    
    /* Espacements (multiples de 8px) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 40px;
    --spacing-3xl: 48px;
    
    /* Rayons de bordure */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Cartes - Design System */
    --card-padding: var(--spacing-lg);
    --card-padding-sm: var(--spacing-md);
    --card-padding-xs: var(--spacing-sm);
    --card-radius: var(--radius-lg);
    --card-gap: var(--spacing-md);
    --card-gap-sm: var(--spacing-sm);
    --card-gap-lg: var(--spacing-lg);
    
    /* Hauteurs de ligne */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    
    /* Typographie */
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    
    /* Poids de police */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   RESET & BASE
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background:
        radial-gradient(1200px 600px at 50% -200px, rgba(31, 59, 112, 0.10), transparent 60%),
        radial-gradient(900px 500px at 90% 10%, rgba(255, 159, 60, 0.08), transparent 55%),
        var(--color-bg-main);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HIÉRARCHIE TYPOGRAPHIQUE
   ============================================ */

/* Titres de page - très marqués */
h1, .h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

h2, .h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    color: var(--color-text-primary);
}

h3, .h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    color: var(--color-text-primary);
}

/* Libellés secondaires - discrets mais lisibles */
.label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Valeurs importantes - très visibles */
.value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.value-large {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* Texte secondaire - contraste amélioré */
.text-secondary {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
}

.text-tertiary {
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
}

/* ============================================
   CARTES (CARDS)
   ============================================ */

.card {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.65), transparent 20%);
    opacity: 0.35;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   DASHBOARD STAT CARD - UNIFORME
   ============================================ */

/* ============================================
   DASHBOARD ÉLÈVE - DESIGN GLASSMORPHISM
   ============================================ */

/* Dashboard Wrapper */
.dashboard-wrapper {
    position: relative;
    width: 100%;
}

/* Labels et valeurs communes */
.dashboard-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-top: 4px;
}

.dashboard-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
}

/* ============================================
   DASHBOARD HERO CARD - Progression XP
   ============================================ */

.dashboard-hero-card {
    position: relative;
    border-radius: 20px;
    padding: 32px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
}

/* Fallback pour navigateurs sans backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .dashboard-hero-card {
        background: rgba(255, 255, 255, 0.95);
    }
}

.hero-gradient {
    background: linear-gradient(135deg, 
        rgba(31, 59, 112, 0.95) 0%, 
        rgba(42, 78, 138, 0.90) 50%,
        rgba(31, 59, 112, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(31, 59, 112, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.hero-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 8px rgba(255, 159, 60, 0.3));
    animation: float 3s ease-in-out infinite;
}

.hero-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.hero-xp-text {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.niveau-badge-hero {
    background: linear-gradient(135deg, 
        rgba(255, 159, 60, 0.25) 0%, 
        rgba(255, 184, 77, 0.20) 100%);
    border: 2px solid rgba(255, 159, 60, 0.4);
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 
        0 0 20px rgba(255, 159, 60, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15);
    line-height: 1.2;
    animation: pulse-glow 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.xp-bar-container-hero {
    height: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    margin: 16px 0 8px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xp-fill-hero {
    height: 100%;
    background: linear-gradient(90deg, 
        #FFD700 0%, 
        #FF9F3C 50%,
        #FFD700 100%);
    background-size: 200% 100%;
    border-radius: 12px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 
        0 0 20px rgba(255, 159, 60, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: shimmer 2s linear infinite;
}

.xp-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: shimmer-slide 2s ease-in-out infinite;
}

.xp-percentage-hero {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
}

/* ============================================
   PERFORMANCE CARDS - Glassmorphism
   ============================================ */

.perf-card {
    position: relative;
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out backwards;
}

.perf-card:nth-child(1) { animation-delay: 0.1s; }
.perf-card:nth-child(2) { animation-delay: 0.2s; }
.perf-card:nth-child(3) { animation-delay: 0.3s; }
.perf-card:nth-child(4) { animation-delay: 0.4s; }

/* Fallback pour navigateurs sans backdrop-filter */
@supports not (backdrop-filter: blur(16px)) {
    .perf-card {
        background: rgba(255, 255, 255, 0.95);
    }
}

.perf-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.perf-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.perf-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

.perf-card:hover .perf-card-icon {
    transform: scale(1.2) rotate(5deg);
}

/* Couleurs spécifiques par type de card */
.perf-card-yellow {
    background: linear-gradient(135deg, 
        rgba(255, 251, 235, 0.8) 0%, 
        rgba(254, 243, 199, 0.7) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.perf-card-yellow::before {
    background: radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.1), transparent 70%);
}

.perf-card-yellow:hover {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 
        0 12px 32px rgba(251, 191, 36, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

.perf-card-purple {
    background: linear-gradient(135deg, 
        rgba(243, 232, 255, 0.8) 0%, 
        rgba(233, 213, 255, 0.7) 100%);
    border-color: rgba(168, 85, 247, 0.3);
}

.perf-card-purple::before {
    background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.1), transparent 70%);
}

.perf-card-purple:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 
        0 12px 32px rgba(168, 85, 247, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

.perf-card-pink {
    background: linear-gradient(135deg, 
        rgba(253, 242, 248, 0.8) 0%, 
        rgba(251, 207, 232, 0.7) 100%);
    border-color: rgba(236, 72, 153, 0.3);
}

.perf-card-pink::before {
    background: radial-gradient(circle at 50% 0%, rgba(236, 72, 153, 0.1), transparent 70%);
}

.perf-card-pink:hover {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 
        0 12px 32px rgba(236, 72, 153, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

.perf-card-green {
    background: linear-gradient(135deg, 
        rgba(240, 253, 244, 0.8) 0%, 
        rgba(220, 252, 231, 0.7) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.perf-card-green::before {
    background: radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.1), transparent 70%);
}

.perf-card-green:hover {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 
        0 12px 32px rgba(34, 197, 94, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

.perf-card:hover::before {
    opacity: 1;
}

/* ============================================
   CARDS QUÊTES - Style amélioré
   ============================================ */

.dashboard-stat-card {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-align: left;
}

/* Fallback pour navigateurs sans backdrop-filter */
@supports not (backdrop-filter: blur(12px)) {
    .dashboard-stat-card {
        background: rgba(255, 255, 255, 0.95);
    }
}

.dashboard-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.6);
}

.quete-card {
    text-align: left;
    cursor: pointer;
}

.quete-icon {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

.quete-card:hover .quete-icon {
    transform: scale(1.15) rotate(-5deg);
}

.quete-card .quete-progress-bar {
    width: 100px;
    height: 8px;
    background: rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.quete-card .quete-progress-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.quete-jour .quete-progress-fill {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.quete-semaine .quete-progress-fill {
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* ============================================
   ACHIEVEMENT BANNER - Message de félicitations
   ============================================ */

.achievement-banner {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(255, 159, 60, 0.15) 0%, 
        rgba(255, 184, 77, 0.10) 100%);
    border: 2px solid rgba(255, 159, 60, 0.3);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 16px rgba(255, 159, 60, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: fadeInDown 0.5s ease-out;
}

.achievement-banner.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite, fadeInDown 0.5s ease-out;
}

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

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes shimmer-slide {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 159, 60, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(255, 159, 60, 0.6),
            0 6px 16px rgba(0, 0, 0, 0.2);
    }
}

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

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

/* ============================================
   RESPONSIVE DASHBOARD
   ============================================ */

@media (max-width: 768px) {
    .dashboard-hero-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .hero-xp-text {
        font-size: 24px;
    }
    
    .niveau-badge-hero {
        padding: 6px 16px;
        font-size: 0.875rem;
    }
    
    .xp-bar-container-hero {
        height: 14px;
        margin: 12px 0 6px 0;
    }
    
    .perf-card {
        padding: 20px;
        border-radius: 14px;
    }
    
    .perf-card-icon {
        font-size: 2rem;
    }
    
    .dashboard-stat-value {
        font-size: 28px;
    }
    
    .dashboard-stat-card {
        padding: 20px;
        border-radius: 14px;
    }
    
    .quete-card {
        text-align: center;
    }
    
    .quete-card .flex {
        flex-direction: column;
        gap: 12px;
    }
    
    .quete-card .quete-progress-bar {
        width: 100%;
    }
    
    .achievement-banner {
        padding: 16px 20px;
        border-radius: 14px;
    }
}

/* ============================================
   CARTE PROGRESSION
   ============================================ */

.card-progression {
    background: linear-gradient(145deg, #1a2744 0%, #243B67 50%, #1F3B70 100%);
    color: var(--color-text-white);
    border: none;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.15),
        0 10px 20px -5px rgba(31, 59, 112, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-progression::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 120%, rgba(250, 204, 21, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.card-progression::after {
    display: none;
}

/* Progression utilise la structure commune */
.card-progression .dashboard-card-title {
    color: rgba(255, 255, 255, 0.95);
}

/* Supprimer padding interne car dashboard-card a déjà le padding */
.progression-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--card-gap-lg);
    position: relative;
    z-index: 1;
}

.niveau-badge {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.2) 0%, rgba(251, 146, 60, 0.15) 100%);
    border: 1px solid rgba(250, 204, 21, 0.3);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: #fcd34d;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.15);
    line-height: var(--line-height-tight);
}

/* XP Section */
.xp-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.xp-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.xp-label {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.7);
    line-height: var(--line-height-normal);
}

.xp-percentage {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: rgba(255, 255, 255, 0.9);
    line-height: var(--line-height-normal);
}

.xp-bar-container {
    height: var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    overflow: hidden;
    position: relative;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
    border-radius: var(--radius-sm);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: xp-pulse 2s ease-in-out infinite;
}

@keyframes xp-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.xp-next-level {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.5);
    margin-top: var(--spacing-xs);
    margin-bottom: 0;
    text-align: center;
    line-height: var(--line-height-normal);
}

/* Quêtes - Design compact */
.quetes-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.quete-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-sm);
    min-height: auto;
    gap: var(--spacing-xs);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quete-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quete-icon {
    font-size: var(--font-size-xl);
    line-height: var(--line-height-tight);
}

.quete-label {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
}

.quete-badge {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-white);
    line-height: var(--line-height-tight);
}

.quete-progress-bar {
    width: 100%;
    height: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    overflow: hidden;
}

.quete-progress-fill {
    height: 100%;
    border-radius: var(--spacing-xs);
    transition: width 0.6s ease;
}

.quete-jour .quete-progress-fill {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

.quete-semaine .quete-progress-fill {
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.3);
}

/* Responsive dashboard cards */
@media (max-width: 768px) {
    .dashboard-card {
        padding: var(--card-padding-sm);
    }
    
    .dashboard-card-header {
        margin-bottom: var(--card-gap-sm);
    }
    
    .dashboard-card-title {
        font-size: var(--font-size-base);
    }
    
    .dashboard-card-body {
        gap: var(--card-gap);
    }
    
    .progression-card-content {
        gap: var(--card-gap);
    }
    
    .quetes-row {
        gap: var(--spacing-sm);
    }
    
    .quete-item {
        padding: var(--spacing-sm) var(--spacing-xs);
    }
    
    .niveau-badge {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    .xp-bar-container {
        height: var(--spacing-xs);
    }
    
    .quete-progress-bar {
        height: 3px;
    }
}

/* ============================================
   CARTE PERFORMANCES
   ============================================ */

.card-performances {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
}

/* Performances utilise la structure commune */
.card-performances .dashboard-card-title {
    color: var(--color-text-primary);
}

/* Stat cards - Design pill premium subtil */
.stat-card {
    transition: all var(--transition-base);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--card-padding-sm);
    border-radius: var(--radius-md);
    gap: var(--spacing-sm);
    text-align: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-medium);
}

/* Variantes de couleurs stat-cards - Subtiles */
.stat-card-amber {
    background: rgba(254, 243, 199, 0.4);
    border-color: rgba(251, 191, 36, 0.3);
}

.stat-card-blue {
    background: rgba(219, 234, 254, 0.4);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-card-purple {
    background: rgba(243, 232, 255, 0.4);
    border-color: rgba(139, 92, 246, 0.3);
}

.stat-card-emerald {
    background: rgba(209, 250, 229, 0.4);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-icon {
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-tight);
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

.stat-value-amber { color: #92400e; }
.stat-value-blue { color: #1e40af; }
.stat-value-purple { color: #6b21a8; }
.stat-value-emerald { color: #065f46; }

.stat-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: var(--line-height-normal);
}

.stat-label-amber { color: #78350f; }
.stat-label-blue { color: #1e3a8a; }
.stat-label-purple { color: #581c87; }
.stat-label-emerald { color: #064e3b; }

/* Animation pulse douce pour icon encouragement */
@keyframes pulse-gentle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-pulse-gentle {
    animation: pulse-gentle 2s infinite;
}

/* Responsive stat-cards (déjà géré par dashboard-card responsive ci-dessus) */
@media (max-width: 768px) {
    .stat-card {
        min-height: 100px;
        padding: var(--card-padding-xs);
    }
    
    .stat-value {
        font-size: var(--font-size-xl);
    }
    
    .stat-icon {
        font-size: var(--font-size-lg);
    }
    
    #mes-performances {
        gap: var(--spacing-sm);
    }
}

/* ============================================
   BOUTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-shadow: var(--shadow-sm);
    transform: translateY(0);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: var(--color-text-white);
    box-shadow: 0 10px 25px rgba(255, 159, 60, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--color-secondary-dark) 0%, #d67a1f 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid rgba(31, 59, 112, 0.35);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: rgba(31, 59, 112, 0.06);
    border-color: rgba(31, 59, 112, 0.55);
    color: var(--color-primary);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-medium);
    box-shadow: none;
}

.btn-outline:hover {
    background-color: var(--color-bg-hover);
    border-color: var(--color-text-tertiary);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--color-border-medium);
    color: var(--color-primary);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(31, 59, 112, 0.06);
    border-color: rgba(31, 59, 112, 0.35);
}

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

.progress-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    height: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
    border-radius: 6px;
    transition: width 0.7s ease;
    box-shadow: var(--shadow-glow);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: shimmer 2.6s infinite;
    opacity: 0.8;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--spacing-xs);
}

/* ============================================
   ONGLETS (TABS)
   ============================================ */

.tabs-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-bg-card);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-base);
    background-color: transparent;
    color: var(--color-text-secondary);
    border: none;
    touch-action: manipulation;
    user-select: none;
}

.tab:hover {
    color: var(--color-text-primary);
    background-color: var(--color-bg-hover);
}

.tab-active {
    background-color: var(--color-secondary);
    color: var(--color-text-white);
    font-weight: var(--font-weight-semibold);
    box-shadow: 0 8px 16px rgba(255, 159, 60, 0.18);
}

/* Tabs - finition premium */
.tabs-container {
    max-width: 100%;
    justify-content: center;
}

.tabs-container .tab {
    min-width: 0;
}

/* Sur très petit écran : éviter la 2e ligne (plus clean) */
@media (max-width: 420px) {
    .tabs-container {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tabs-container::-webkit-scrollbar {
        display: none;
    }
}

/* ============================================
   TABLES DE CLASSEMENT
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-bg-card);
}

.table thead {
    background-color: #F1F5F9;
    border-bottom: 1px solid var(--color-border-medium);
}

.table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--color-bg-hover);
}

.table tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.02);
}

.table tbody tr:nth-child(even):hover {
    background-color: var(--color-bg-hover);
}

.table .score-value {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
}

.table td:nth-child(3),
.table td:nth-child(4) {
    font-variant-numeric: tabular-nums;
}

/* Highlight top 3 (sans changer les données) */
.table tbody tr:nth-child(1) {
    background: rgba(255, 159, 60, 0.08);
}

.table tbody tr:nth-child(2) {
    background: rgba(31, 59, 112, 0.04);
}

.table tbody tr:nth-child(3) {
    background: rgba(139, 92, 246, 0.04);
}

/* ============================================
   MODALES
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: var(--spacing-md);
}

.modal {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    border: 1px solid var(--color-border-light);
    position: relative;
}

.modal::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.65), transparent 20%);
    opacity: 0.35;
}

.modal-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--color-border-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: var(--spacing-xl);
}

.modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* ============================================
   CARDS DE JEUX
   ============================================ */

.game-card {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    cursor: pointer;
    position: relative;
}

.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.65), transparent 20%);
    opacity: 0.35;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.game-card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.game-card-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--color-bg-main);
    color: var(--color-text-tertiary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-md);
}

.game-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-stat-pill {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    min-height: 110px;
}

.game-stat-pill .stat-label {
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.game-stat-pill .stat-value {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-2xl);
    line-height: 1.2;
}

/* ============================================
   HISTORIQUE
   ============================================ */

.history-item {
    position: relative;
    padding: var(--spacing-md);
    padding-left: calc(var(--spacing-md) + 10px);
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--transition-fast);
}

.history-item::before {
    content: "";
    position: absolute;
    left: var(--spacing-sm);
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: var(--radius-full);
    background: rgba(31, 59, 112, 0.25);
}

.history-item:hover {
    background-color: var(--color-bg-hover);
}

.history-item:last-child {
    border-bottom: none;
}

.history-score {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.history-time {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
}

/* Switch pour afficher/masquer dans classements */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-text-light);
    transition: var(--transition-base);
    border-radius: var(--radius-full);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-base);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background-color: var(--color-secondary);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    :root {
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --font-size-xl: 1.125rem;
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .btn {
        width: 100%;
    }
    
    .modal {
        max-width: 95vw;
        border-radius: var(--radius-xl);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-md);
    }
    
    .table {
        font-size: var(--font-size-xs);
    }
    
    .table th,
    .table td {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .game-card {
        padding: var(--spacing-md);
    }
    
    .game-card-title {
        font-size: var(--font-size-lg);
    }
    
}

@media (max-width: 480px) {
    .card {
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }
    
    .game-card {
        border-radius: var(--radius-md);
    }
}

/* ============================================
   UTILITAIRES
   ============================================ */

/* Support tactile global */
button, a, input, select, textarea, .game-card, .flip-card, label {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Éviter la sélection de texte sur les éléments interactifs */
button, .game-card, .flip-card, label {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Taille minimale pour les zones tactiles */
button, .game-card, input[type="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
}

/* ============================================
   PREFERS-REDUCED-MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .progress-bar::after {
        animation: none;
    }
    
    .card,
    .game-card,
    .btn {
        transition: none;
    }
}

/* ============================================
   INFO ÉLÈVE - COMPACT (sans avatar)
   ============================================ */

/* Le grand conteneur du haut : moins "gros bloc" */
#info-eleve.card {
    padding: 20px;
    border-radius: 24px;
}

@media (min-width: 768px) {
    #info-eleve.card {
        padding: 24px;
    }
}

/* Cartes Progression / Performances : moins hautes */
/* Override spécifique pour #info-eleve : les cartes dashboard gardent leur padding via --card-padding */

/* Titres des cartes : plus compacts */
.card-title {
    margin-bottom: 8px;
    font-size: 15px;
}

/* Progression : styles remplacés par nouveaux styles glassmorphism ci-dessus */

/* Buttons quêtes : responsive */
@media (max-width: 640px) {
    .defis-btn-jour,
    .defis-btn-semaine {
        padding: 12px 16px !important;
        min-height: 72px !important;
    }
    
    .defis-btn-jour span,
    .defis-btn-semaine span {
        font-size: var(--font-size-xs) !important;
    }
}

/* Performances : layout avec dots séparateurs */
.perf-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

#mes-performances {
    gap: 0;
}

#mes-performances .perf-line {
    padding: 10px 0;
}

/* Badges : alignement et taille cohérents */
#mes-performances span[id$="badge"] {
    min-width: 80px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .perf-line {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .perf-line > span:first-child {
        width: auto;
    }
    
    .perf-line > span:nth-child(2) {
        display: none; /* Cacher les dots sur mobile */
    }
    
    #mes-performances span[id$="badge"] {
        min-width: auto;
        width: 100%;
        text-align: left;
    }
}

/* ============================================
   GAME CARDS — UNIFORMES & PROPRES
   ============================================ */

.game-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px;
    border-radius: 18px;
}

/* Même hauteur sur desktop (pour aligner la grille) */
@media (min-width: 1024px) {
    .game-card {
        min-height: 360px;
    }
}

/* Header de carte : pas de wrap + alignement propre */
.game-card > div:first-child {
    flex-wrap: nowrap !important;
    align-items: center !important;
    margin-bottom: 12px !important;
}

/* Colonne icône+text : éviter que ça pousse */
.game-card > div:first-child .min-w-0 {
    min-width: 0;
}

/* Badge : compact + stable */
.game-card-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TITRE : 1 ligne, sinon … => cartes toutes identiques */
.game-card-title {
    margin: 4px 0 0 !important;
    font-size: 18px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Supprime l'espace du paragraphe vide */
.game-card p:empty {
    display: none;
}

/* Bloc stats : toujours 2 colonnes sur desktop, aligné */
.game-card > .grid {
    margin-bottom: 14px !important;
}

/* Stats : même hauteur, plus "premium" */
.game-stat-pill {
    min-height: 92px;
    padding: 12px;
    border-radius: 14px;
}

/* Boutons : collés en bas et identiques */
.game-card > div:last-child {
    margin-top: auto;
}

.game-card .btn {
    height: 44px;
    border-radius: 12px;
}

/* ============================================
   GAME CARDS — FIX DESIGN (index)
   ============================================ */

/* Carte plus compacte et moins "cliquable" */
.game-card {
    padding: 16px !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-sm) !important;
    cursor: default !important;
}

.game-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Header propre : icon + titre + badge + trophée */
.game-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.game-card-main {
    min-width: 0;
    flex: 1;
}

.game-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.game-card-title {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge catégorie : discret et sur la même ligne (conservé pour compatibilité) */
.game-card-badge {
    margin: 0 !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    background: rgba(31, 59, 112, 0.06) !important;
    border: 1px solid rgba(31, 59, 112, 0.12) !important;
    color: rgba(31, 59, 112, 0.78) !important;
}

/* Classe sr-only pour l'accessibilité (screen reader only) */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* Icône du jeu premium avec fond coloré */
.game-card-icon-wrap {
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1.5px solid !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

.game-card:hover .game-card-icon-wrap {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.game-card-icon-wrap svg {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
}

/* Ancien sélecteur pour compatibilité (peut être supprimé si non utilisé ailleurs) */
.game-card-icon {
    width: 44px !important;
    height: 44px !important;
}

/* Trophée discret (ghost) */
.trophy-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: rgba(31, 59, 112, 0.55);
    box-shadow: none;
    flex: 0 0 auto;
    transition: all var(--transition-base);
    cursor: pointer;
}

.trophy-btn:hover {
    background: rgba(31, 59, 112, 0.06);
    border-color: rgba(31, 59, 112, 0.22);
    color: rgba(31, 59, 112, 0.85);
}

/* Stats moins hautes */
.game-stat-pill {
    min-height: 88px !important;
    padding: 12px !important;
}

.game-stat-pill .stat-value {
    font-size: 22px !important;
}

/* Boutons : 50/50, mêmes tailles, jamais sur 2 lignes */
.game-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.game-actions .btn {
    width: 100%;
    white-space: nowrap;
}

/* Sur très petit écran : empiler les boutons */
@media (max-width: 420px) {
    .game-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================
   ADMIN UI (teacher.php)
   ========================= */
.admin{
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(31,59,112,0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(255,159,60,0.08), transparent 55%),
    #F6F7FB;
}

/* Surfaces */
.admin .admin-surface{
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}

/* Headings */
.admin .admin-title{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.admin .admin-subtitle{
  font-size: 13px;
  color: rgba(15,23,42,0.55);
}

/* Buttons (cohérents) */
.admin .btn-a{
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.admin .btn-a:active{ transform: translateY(1px); }

.admin .btn-a-primary{
  background: linear-gradient(180deg, #FFB24D 0%, #FF9F3C 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255,159,60,0.22);
}
.admin .btn-a-primary:hover{ box-shadow: 0 14px 30px rgba(255,159,60,0.26); }

.admin .btn-a-secondary{
  background: #fff;
  color: #1F3B70;
  border-color: rgba(31,59,112,0.25);
  box-shadow: none;
}
.admin .btn-a-secondary:hover{
  background: rgba(31,59,112,0.06);
  border-color: rgba(31,59,112,0.40);
}

.admin .btn-a-danger{
  background: #E35B52;
  color: #fff;
}
.admin .btn-a-danger:hover{ filter: brightness(0.95); }

.admin .btn-a-ghost{
  background: transparent;
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.18);
  box-shadow: none;
}
.admin .btn-a-ghost:hover{ background: rgba(255,255,255,0.10); }

/* Icon button (petit carré) */
.admin .icon-a{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}
.admin .icon-a:hover{ background: rgba(15,23,42,0.03); }

/* Badges (Actif/Inactif + codes) */
.admin .badge-a{
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(15,23,42,0.08);
}
.admin .badge-a-success{
  background: rgba(34,197,94,0.12);
  color: rgb(22,101,52);
  border-color: rgba(34,197,94,0.25);
}
.admin .badge-a-muted{
  background: rgba(15,23,42,0.04);
  color: rgba(15,23,42,0.65);
}
.admin .badge-a-code{
  background: #F8FAFC;
  color: rgba(15,23,42,0.75);
  font-variant-numeric: tabular-nums;
}

/* Tables plus premium */
.admin table{
  border-collapse: separate;
  border-spacing: 0;
}
.admin thead th{
  background: #F1F5F9;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(15,23,42,0.65);
}
.admin tbody tr:hover{
  background: rgba(15,23,42,0.02);
}
.admin tbody td{
  font-variant-numeric: tabular-nums;
}

/* Nav tabs : plus "pills" */
.admin .admin-tabs{
  background: #fff;
  border-bottom: 1px solid rgba(15,23,42,0.08);
}
.admin .admin-tabs-container{
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}
.admin .admin-tabs-container::-webkit-scrollbar{
  display: none;
}
.admin .admin-tab{
  height: 42px;
  padding: 0 14px;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  font-size: 14px;
  color: rgba(15,23,42,0.65);
  transition: all 0.2s ease;
  scroll-snap-align: start;
  flex-shrink: 0;
}
.admin .admin-tab:hover{ 
  background: rgba(15,23,42,0.03); 
}
.admin .admin-tab.is-active{
  background: #FF9F3C;
  color: #fff;
  box-shadow: 0 12px 24px rgba(255,159,60,0.22);
}
/* Style pills moderne sur desktop */
@media (min-width: 768px){
  .admin .admin-tab{
    border-radius: 20px;
    margin: 4px 2px;
  }
  .admin .admin-tab.is-active{
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255,159,60,0.3);
  }
}

/* Responsive : actions se replient proprement */
@media (max-width: 768px){
  .admin .admin-actions{
    flex-wrap: wrap;
    gap: 10px;
  }
  .admin .admin-tab{
    font-size: 13px;
    padding: 0 12px;
  }
}

/* =========================
   Filters (Types + Tools) — clean layout
   ========================= */

.filters-card{
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.filters-title{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(15,23,42,0.55);
  margin-bottom: 12px;
}

/* Chips : wrap propre */
.filters-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* Ligne outils desktop : recherche / tri / toggle */
.filters-tools{
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  align-items: center;
}

/* Search field premium */
.filters-search{
  position: relative;
}
.filters-search input{
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.12);
  background: #fff;
  font-size: 14px;
}
.filters-search input:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(31,59,112,0.16);
  border-color: rgba(31,59,112,0.35);
}
.filters-search-icon{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  font-size: 14px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* Select même hauteur que search */
#tri-jeux{
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.12);
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
  color: var(--color-text-primary);
}
#tri-jeux:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(31,59,112,0.16);
  border-color: rgba(31,59,112,0.35);
}

/* Wrapper toggle */
.records-toggle-wrap{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 220px;
}

/* Le toggle lui-même */
.records-toggle{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

/* Boutons : même taille, pas de retour ligne */
.records-toggle-btn{
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  color: rgba(31,59,112,0.75);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.records-toggle-btn:hover{
  background: rgba(31,59,112,0.06);
}

.records-toggle-btn.is-active{
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(31,59,112,0.18);
}

/* Disabled : propre */
.records-toggle-btn:disabled,
.records-toggle-btn.is-disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

/* Petit pied de note */
.filters-foot{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: rgba(15,23,42,0.55);
  font-size: 13px;
}
.filters-foot .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

/* Responsive : pile propre */
@media (max-width: 768px){
  .filters-tools{
    grid-template-columns: 1fr;
  }
  #tri-jeux{ 
    width: 100%; 
  }
  .records-toggle-wrap{ 
    justify-content: flex-start; 
  }
  .records-toggle{ 
    width: auto; 
  }
}

/* Classe de loading pour les badges de position (anti-clignotement) */
.is-loading {
  opacity: 0.7;
  transition: opacity 200ms ease;
}

/* ============================================
   CARDS DE CLASSEMENT
   ============================================ */

.card-nav {
    position: relative;
    overflow: hidden;
    min-height: 100px;
    max-height: 110px;
}

.card-nav:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.card-nav[aria-pressed="true"] {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-width: 2px;
}

/* Animation de transition pour les cards */
.card-nav {
    will-change: transform;
}

/* Responsive : Cards en colonne sur mobile */
@media (max-width: 768px) {
    .card-nav {
        min-height: 100px;
        max-height: none;
    }
}

/* ============================================
   DROPDOWN DE SAISON
   ============================================ */

.saison-selector {
    position: relative;
}

.saison-trigger {
    cursor: pointer;
    user-select: none;
}

.saison-trigger:hover {
    border-color: #1F3B70;
}

.saison-chevron {
    transition: transform 0.2s ease-in-out;
}

.saison-chevron.rotate-180 {
    transform: rotate(180deg);
}

.saison-dropdown {
    animation: dropdownFadeIn 0.2s ease-out;
}

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

.saison-option {
    cursor: pointer;
    user-select: none;
}

.saison-option:focus {
    outline: 2px solid #1F3B70;
    outline-offset: -2px;
}

/* Scrollbar personnalisée pour le dropdown */
.saison-dropdown::-webkit-scrollbar {
    width: 6px;
}

.saison-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.saison-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.saison-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Style pour Firefox */
.saison-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Input de recherche dans le dropdown */
#saison-search-input {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#saison-search-input:focus {
    border-color: #1F3B70;
    box-shadow: 0 0 0 3px rgba(31, 59, 112, 0.1);
}

/* ============================================
   MODAL DÉFIS - STYLE HARMONISÉ AVEC SITE
   ============================================ */

/* Modal principale */
.modal-defis-overlay {
    align-items: flex-end;
}

@media (min-width: 768px) {
    .modal-defis-overlay {
        align-items: center;
    }
}

.modal-defis-gamified {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-xl);
    position: relative;
    max-width: 580px;
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

@media (max-width: 767px) {
    .modal-defis-gamified {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        max-width: 100%;
    }
}

.modal-defis-header {
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border-medium);
    padding: 16px 20px;
    position: relative;
    flex-shrink: 0;
}

.defis-header-icon {
    width: 48px;
    height: 48px;
    background: var(--color-bg-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-light);
}

.defis-title {
    color: var(--color-text-primary);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.defis-subtitle {
    margin-top: 6px;
}

.defis-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-bg-main);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-light);
}

.defis-timer-text {
    color: var(--color-secondary);
    font-weight: var(--font-weight-bold);
}

.defis-close-btn {
    width: 40px;
    height: 40px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.defis-close-btn:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border-medium);
    color: var(--color-text-primary);
}

.modal-defis-body {
    background: var(--color-bg-card);
    padding: 16px 20px;
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

/* Container des défis - permet le scroll dans le body */
.defis-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

/* Stats header */
.defis-stats-header {
    background: var(--color-bg-main);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.defis-stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.defis-stats-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.defis-stats-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.defis-stats-progress {
    width: 100%;
    height: 8px;
    background: var(--color-bg-main);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--color-border-light);
}

.defis-stats-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
    border-radius: 999px;
    transition: width 0.6s ease;
    position: relative;
}

/* Liste des défis - scrollable avec cartes auto-hauteur */
.defis-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-height: 0;
}

/* Carousel supprimé - on utilise maintenant une liste unique pour tous les appareils */

/* Footer du modal - sticky unique */
.modal-defis-footer {
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border-medium);
    padding: 14px 20px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.defis-footer-cta {
    width: 100%;
    min-height: 48px;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-white);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.defis-footer-cta:hover {
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, var(--color-secondary-dark) 0%, #d67a1f 100%);
}

.defis-footer-cta:active {
    transform: translateY(1px);
}

.defis-footer-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

/* Cards de défis - COMPACTES avec auto-hauteur */
.defis-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: default;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    box-shadow: var(--shadow-sm);
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.defis-card:hover:not(.defis-card-complete) {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.defis-card-active {
    border-color: var(--color-primary);
    border-left-width: 3px;
}

.defis-card-complete {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Rareté des cartes - simplifiée */
.defis-card-common {
    border-left: 3px solid var(--color-border-medium);
}

.defis-card-rare {
    border-left: 3px solid var(--color-primary);
}

.defis-card-epic {
    border-left: 3px solid #8b5cf6;
}

.defis-card-legendary {
    border-left: 3px solid var(--color-secondary);
}

/* Badge de la carte */
.defis-card-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    margin-bottom: 4px;
    padding: 2px 6px;
    background: var(--color-bg-main);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
}

/* Header de la card - COMPACT */
.defis-card-header {
    display: flex;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(4px, 1vw, 8px);
}

.defis-card-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.defis-card-icon {
    font-size: 20px;
    display: block;
    line-height: 1;
}

.defis-card-complete-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: 12px;
    border: 2px solid var(--color-bg-card);
    box-shadow: var(--shadow-sm);
}

.defis-card-title-wrapper {
    flex: 1;
    min-width: 0;
    overflow: visible;
    word-wrap: break-word;
}

.defis-card-title {
    font-size: 15px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 4px 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.defis-card-subtitle {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* CTA par carte - compact */
.defis-card-cta {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border-light);
}

.defis-card-cta-btn {
    width: 100%;
    padding: 6px 12px;
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-white);
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    min-height: 36px;
}

.defis-card-cta-btn:hover {
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, var(--color-secondary-dark) 0%, #d67a1f 100%);
    transform: translateY(-1px);
}

.defis-card-cta-btn:active {
    transform: translateY(0);
}

.defis-card-rewards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.defis-reward-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: var(--color-bg-main);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
}

.defis-reward-compact {
    padding: 1px 4px;
    gap: 3px;
}

.defis-reward-icon {
    font-size: 12px;
}

.defis-reward-value {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-secondary);
}

/* Barre de progression - COMPACTE */
.defis-card-progress {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border-light);
}

.defis-progress-compact {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    text-align: center;
}

.defis-progress-bar-wrapper {
    width: 100%;
    height: 4px;
    background: var(--color-bg-main);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 4px;
    border: 1px solid var(--color-border-light);
}

.defis-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
    border-radius: 999px;
    transition: width 0.6s ease;
    position: relative;
}

.defis-progress-text {
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-tertiary);
    text-align: center;
    line-height: 1.2;
}

/* Message de complétion - COMPACT */
.defis-card-complete-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: #22c55e;
}

.defis-complete-icon {
    font-size: 18px;
}

/* Boutons individuels supprimés - utiliser le footer CTA */

/* État vide */
.defis-empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
}

.defis-empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.defis-empty-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

/* Animation de complétion - simplifiée */
.defis-card-just-completed {
    animation: complete-celebration 0.4s ease;
}

@keyframes complete-celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Expansion des cartes */
/* Expansion désactivée - layout stable */

/* Responsive - Bottom sheet mobile */
@media (max-width: 767px) {
    .modal-defis-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .modal-defis-gamified {
        border-radius: 16px 16px 0 0;
        margin: 0;
        max-width: 100%;
        max-height: 95dvh;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .modal-defis-header {
        padding: 14px 16px;
    }
    
    .defis-close-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .modal-defis-body {
        padding: 12px 16px;
        gap: 0;
    }
    
    .defis-stats-header {
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    
    .defis-list {
        gap: 10px;
    }
    
    .defis-card {
        padding: 12px 14px;
    }
    
    .defis-card-header {
        gap: 10px;
        margin-bottom: 8px;
    }
    
    .defis-card-icon {
        font-size: 18px;
    }
    
    .defis-card-badge {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .defis-card-title {
        font-size: 14px;
    }
    
    .defis-card-subtitle {
        font-size: 11px;
    }
    
    .defis-reward-compact {
        padding: 2px 5px;
        gap: 3px;
    }
    
    .defis-reward-icon {
        font-size: 11px;
    }
    
    .defis-reward-value {
        font-size: 10px;
    }
    
    .defis-card-cta-btn {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .defis-progress-compact {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .defis-progress-text {
        font-size: 9px;
    }
    
    .modal-defis-footer {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* Réduction des animations si préféré */
@media (prefers-reduced-motion: reduce) {
    .defis-card,
    .defis-progress-bar,
    .defis-card-btn {
        transition: none;
    }
    
    .defis-card-just-completed {
        animation: none;
    }
}

/* ============================================
   DASHBOARD - STYLES COMPACTS (OVERRIDE)
   ============================================ */

/* Dashboard Wrapper */
.dashboard-wrapper {
    width: 100%;
}

/* Dashboard Hero Card - COMPACT */
.dashboard-hero-card {
    background: linear-gradient(135deg, #1F3B70 0%, #2A4E8A 100%) !important;
    border-radius: 16px !important;
    padding: 16px !important;
    min-height: 120px !important;
    max-height: 140px !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(31, 59, 112, 0.15) !important;
    overflow: hidden;
    position: relative;
}

.dashboard-hero-card .flex {
    gap: 2px !important;
}

.dashboard-hero-card .flex.items-center.gap-2 {
    gap: 8px !important;
}

.dashboard-hero-card .mb-2 {
    margin-bottom: 8px !important;
}

.dashboard-hero-card.hero-gradient {
    background: linear-gradient(135deg, #1F3B70 0%, #2A4E8A 100%) !important;
    border: none;
}

/* Hero Elements - COMPACT */
.hero-icon {
    font-size: 36px !important;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    line-height: 1;
    margin: 0;
}

.hero-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.hero-xp-text {
    font-size: 20px !important;
    font-weight: 700;
    color: #ffffff !important;
    margin-top: 2px !important;
    line-height: 1.2;
}

.niveau-badge-hero {
    background: rgba(255, 159, 60, 0.2) !important;
    padding: 4px 10px !important;
    border-radius: 20px;
    font-size: 12px !important;
    font-weight: 700;
    color: #ffffff !important;
    border: 1px solid rgba(255, 159, 60, 0.3);
    box-shadow: 0 2px 8px rgba(255, 159, 60, 0.2);
    line-height: 1.2;
}

/* XP Bar Hero - COMPACT */
.xp-bar-container-hero {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 8px 0 4px 0 !important;
}

.xp-fill-hero {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.xp-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

.xp-percentage-hero {
    font-size: 11px !important;
    opacity: 0.8;
    margin-top: 4px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    line-height: 1;
}

/* S'assurer que tous les éléments stats sont visibles */
#meilleur-score-badge,
#nb-parties-badge,
#position-badge,
#position-defis-badge,
#xp-bar,
#xp-actuel,
#xp-necessaire,
#xp-pourcentage,
#niveau {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Perf Cards - COMPACT */
.perf-card {
    padding: 16px !important;
    border-radius: 12px;
    min-height: 90px !important;
    max-height: 90px !important;
    display: flex;
    flex-direction: column;
    gap: 4px !important;
    border: 1px solid;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.perf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.perf-card-icon {
    font-size: 28px !important;
    margin-bottom: 4px !important;
    transition: transform 0.2s ease;
    line-height: 1;
}

.perf-card:hover .perf-card-icon {
    transform: scale(1.1);
}

.perf-card .dashboard-stat-value {
    font-size: 24px !important;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0 !important;
    color: #1e293b !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.perf-card .dashboard-stat-label {
    font-size: 10px !important;
    margin-top: 0 !important;
    line-height: 1.2;
}

/* Couleurs Perf Cards - SOLIDES */
.perf-card-yellow {
    background: #FFFBEB;
    border-color: #FDE68A;
}

.perf-card-purple {
    background: #F3F4F6;
    border-color: #DDD6FE;
}

.perf-card-pink {
    background: #FCE7F3;
    border-color: #FBCFE8;
}

.perf-card-green {
    background: #ECFDF5;
    border-color: #A7F3D0;
}

/* Animations simplifiées */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Responsive - COMPACT */
@media (max-width: 768px) {
    .dashboard-hero-card {
        padding: 12px !important;
        min-height: 100px !important;
        max-height: 120px !important;
    }
    
    .perf-card {
        min-height: 80px !important;
        max-height: 80px !important;
        padding: 12px !important;
    }
    
    .hero-xp-text {
        font-size: 18px !important;
    }
    
    .perf-card .dashboard-stat-value {
        font-size: 20px !important;
    }
    
    .hero-icon {
        font-size: 28px !important;
    }
    
    .perf-card-icon {
        font-size: 24px !important;
    }
    
    .niveau-badge-hero {
        padding: 3px 8px !important;
        font-size: 11px !important;
    }
    
    .xp-bar-container-hero {
        margin: 6px 0 3px 0 !important;
        height: 8px;
    }
    
    .hero-label {
        font-size: 10px;
    }
    
    .xp-percentage-hero {
        font-size: 10px !important;
        margin-top: 2px !important;
    }
}

/* ============================================
   DASHBOARD LAYOUT 2 COLONNES
   ============================================ */

/* ============================================
   CARD PROGRESSION - Design amélioré avec fond dégradé subtil
   ============================================ */

.dashboard-card-progression {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    border: 1px solid rgba(31, 59, 112, 0.1);
    box-shadow: 0 4px 16px rgba(31, 59, 112, 0.06);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.dashboard-card-progression::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

/* Fallback pour navigateurs sans backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .dashboard-card-progression {
        background: linear-gradient(135deg, #1F3B70 0%, #2A4E8A 100%);
    }
}

/* Header Progression */
.progression-header {
    position: relative;
    z-index: 1;
}

.progression-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F3B70;
    letter-spacing: -0.02em;
}

/* Badge niveau amélioré */
.niveau-badge {
    background: linear-gradient(135deg, #FF9F3C 0%, #FFB84D 100%);
    box-shadow: 0 4px 12px rgba(255, 159, 60, 0.25);
    padding: 8px 20px;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 9999px;
    color: #78350F;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.niveau-star {
    font-size: 12px;
    animation: float 3s ease-in-out infinite;
}

/* Section XP améliorée */
.xp-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.xp-hero-info {
    margin-bottom: 6px;
}

.xp-hero-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3px;
}

.xp-hero-values {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.xp-current {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.xp-separator {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.xp-total {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Barre de progression XP améliorée */
.xp-progress-bar {
    height: 12px;
    background: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1F3B70 0%, #2A4E8A 100%);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(31, 59, 112, 0.4);
}

.xp-shimmer-effect {
    display: none;
}

.xp-hero-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
    white-space: nowrap;
    line-height: 1.2;
}

.xp-percentage {
    font-weight: 600;
}

.xp-next {
    font-weight: 500;
}

/* Quêtes en cards glassmorphism */
.quetes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.quete-card-modern {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quete-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.quete-card-modern:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-4px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

.quete-jour-modern {
    border-left: 3px solid #60a5fa;
}

.quete-jour-modern::before {
    background: radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.15), transparent 70%);
}

.quete-jour-modern:hover::before {
    opacity: 1;
}

.quete-semaine-modern {
    border-left: 3px solid #a78bfa;
}

.quete-semaine-modern::before {
    background: radial-gradient(circle at 50% 0%, rgba(167, 139, 250, 0.15), transparent 70%);
}

.quete-semaine-modern:hover::before {
    opacity: 1;
}

.quete-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quete-icon-modern {
    font-size: 20px;
    margin-bottom: 1px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.quete-card-modern:hover .quete-icon-modern {
    transform: scale(1.1) rotate(5deg);
}

.quete-info {
    flex: 1;
}

.quete-label-modern {
    font-size: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.quete-count-modern {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
}

.quete-rewards-modern {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.reward-item {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.3;
    white-space: nowrap;
}

/* Points défis section */
.defis-points-section {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.defis-points-label {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.defis-points-value {
    font-size: 14px;
    font-weight: 700;
    color: #FF9F3C;
    text-shadow: 0 0 10px rgba(255, 159, 60, 0.5);
}

/* ============================================
   CARD PERFORMANCES - Design moderne avec mini-cards
   ============================================ */

.dashboard-card-performances {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(31, 59, 112, 0.06);
    position: relative;
    overflow: hidden;
}

/* Header Performances */
.performances-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.performances-header-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.performances-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

/* Grid de mini-cards */
.perf-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.perf-mini-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.perf-mini-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.perf-mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.perf-mini-card:hover::before {
    opacity: 1;
}

/* Couleurs spécifiques par type */
.perf-card-score {
    background: linear-gradient(135deg, 
        rgba(255, 251, 235, 0.9) 0%, 
        rgba(254, 243, 199, 0.8) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.perf-card-score::before {
    background: radial-gradient(circle at 50% 0%, rgba(255, 159, 60, 0.1), transparent 70%);
}

.perf-card-score:hover {
    border-color: rgba(255, 159, 60, 0.5);
    box-shadow: 
        0 8px 24px rgba(255, 159, 60, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.perf-card-games {
    background: linear-gradient(135deg, 
        rgba(239, 246, 255, 0.9) 0%, 
        rgba(219, 234, 254, 0.8) 100%);
    border-color: rgba(96, 165, 250, 0.3);
}

.perf-card-games::before {
    background: radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.1), transparent 70%);
}

.perf-card-games:hover {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 
        0 8px 24px rgba(96, 165, 250, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.perf-card-position {
    background: linear-gradient(135deg, 
        rgba(243, 232, 255, 0.9) 0%, 
        rgba(233, 213, 255, 0.8) 100%);
    border-color: rgba(168, 85, 247, 0.3);
}

.perf-card-position::before {
    background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.1), transparent 70%);
}

.perf-card-position:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 
        0 8px 24px rgba(168, 85, 247, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.perf-card-defis {
    background: linear-gradient(135deg, 
        rgba(240, 253, 244, 0.9) 0%, 
        rgba(220, 252, 231, 0.8) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.perf-card-defis::before {
    background: radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.1), transparent 70%);
}

.perf-card-defis:hover {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 
        0 8px 24px rgba(34, 197, 94, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Contenu mini-card */
.perf-mini-icon {
    font-size: 24px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.perf-mini-card:hover .perf-mini-icon {
    transform: scale(1.15) rotate(5deg);
}

.perf-mini-content {
    flex: 1;
    min-width: 0;
}

.perf-mini-label {
    font-size: 9px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.perf-mini-value {
    font-size: 16px;
    font-weight: 700;
    color: #1F3B70;
    line-height: 1;
}

/* Message motivant moderne */
.message-motivant-modern {
    background: linear-gradient(135deg, 
        rgba(255, 251, 235, 0.95) 0%, 
        rgba(254, 243, 199, 0.9) 100%);
    border: 1px solid rgba(255, 159, 60, 0.3);
    border-left: 4px solid #FF9F3C;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 159, 60, 0.15);
    animation: fadeInUp 0.5s ease-out;
}

.message-icon {
    font-size: 18px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.message-text {
    font-size: 11px;
    font-weight: 500;
    color: #92400e;
    line-height: 1.3;
    flex: 1;
}

/* ============================================
   ANIMATIONS KEYFRAMES (si pas déjà définies)
   ============================================ */

@keyframes shimmer-slide {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* ============================================
   RESPONSIVE DASHBOARD
   ============================================ */

@media (max-width: 768px) {
    .dashboard-card-progression,
    .dashboard-card-performances {
        padding: 8px;
        border-radius: 12px;
    }
    
    .progression-title,
    .performances-title {
        font-size: 13px;
    }
    
    .niveau-badge-glow {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .xp-hero-section {
        padding: 6px;
    }
    
    .xp-current {
        font-size: 16px;
    }
    
    .xp-total {
        font-size: 11px;
    }
    
    .xp-bar-container-hero {
        height: 7px;
    }
    
    .xp-hero-footer {
        font-size: 8px;
    }
    
    .quetes-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .quete-card-modern {
        padding: 6px;
    }
    
    .quete-icon-modern {
        font-size: 18px;
    }
    
    .quete-count-modern {
        font-size: 14px;
    }
    
    .quete-label-modern {
        font-size: 7px;
    }
    
    .perf-cards-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .perf-mini-card {
        padding: 6px;
    }
    
    .perf-mini-icon {
        font-size: 20px;
    }
    
    .perf-mini-value {
        font-size: 14px;
    }
    
    .performances-header {
        margin-bottom: 6px;
        padding-bottom: 6px;
    }
    
    .performances-header-icon {
        font-size: 18px;
    }
    
    .defis-points-section {
        padding: 5px 8px;
    }
}

/* ============================================
   AMÉLIORATIONS TABLEAU DE BORD - NOUVEAUX STYLES
   ============================================ */

/* Cartes de quêtes modernisées */
.quest-card {
    background: white;
    border-radius: 16px;
    border: 2px solid transparent;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.quest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #E11D48 0%, #F43F5E 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quest-card:hover {
    border-color: rgba(225, 29, 72, 0.2);
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.12);
    transform: translateY(-2px);
}

.quest-card:hover::before {
    opacity: 1;
}

/* Quête journalière - accent rose/rouge */
.quest-card.daily {
    border-left: 4px solid #E11D48;
}

/* Quête hebdomadaire - accent violet */
.quest-card.weekly {
    border-left: 4px solid #7C3AED;
}

.quest-card.weekly::before {
    background: linear-gradient(90deg, #7C3AED 0%, #9333EA 100%);
}

.quest-card.weekly:hover {
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12);
}

/* Badge de points récompense */
.quest-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #F59E0B;
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.75rem;
    color: #92400E;
}

.quest-points-badge.weekly-badge {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    border-color: #7C3AED;
    color: #5B21B6;
}

/* Icône de progression */
.quest-progress {
    font-size: 0.875rem;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quest-progress-text {
    font-weight: 600;
    color: #1F3B70;
}

/* Cartes de performances avec design subtil */
.performance-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Accent de couleur subtil en haut */
.performance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.performance-card.score::before {
    background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 100%);
}

.performance-card.position::before {
    background: linear-gradient(90deg, #A855F7 0%, #C084FC 100%);
}

.performance-card.games::before {
    background: linear-gradient(90deg, #8B5CF6 0%, #A78BFA 100%);
}

.performance-card.challenges::before {
    background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
}

.performance-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Labels et valeurs */
.performance-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.performance-value {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Icônes améliorées */
.performance-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.performance-card.score .performance-icon {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

.performance-card.position .performance-icon {
    background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
}

.performance-card.games .performance-icon {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
}

.performance-card.challenges .performance-icon {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

/* Badge d'encouragement amélioré */
.achievement-badge {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE047 50%, #FBBF24 100%);
    border: 2px solid #F59E0B;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(251, 191, 36, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.achievement-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.achievement-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #78350F;
    font-size: 0.875rem;
}

/* Palette de couleurs consolidée */
:root {
    /* Couleurs primaires */
    --color-primary-900: #0F1F47;
    --color-primary-800: #1F3B70;
    --color-primary-700: #2A4E8A;
    --color-primary-600: #3B5FA3;
    --color-primary-500: #4C70BC;
    --color-primary-400: #7891CE;
    --color-primary-300: #A4B2E0;
    --color-primary-200: #CFD3F2;
    --color-primary-100: #E8EAFB;
    --color-primary-50: #F5F6FE;
    
    /* Couleurs secondaires (orange) */
    --color-secondary-900: #7C2D12;
    --color-secondary-800: #9A3412;
    --color-secondary-700: #C2410C;
    --color-secondary-600: #EA580C;
    --color-secondary-500: #FF9F3C;
    --color-secondary-400: #FFB84D;
    --color-secondary-300: #FDD17D;
    --color-secondary-200: #FEE8B0;
    --color-secondary-100: #FEF3DD;
    --color-secondary-50: #FFFBF0;
    
    /* Couleurs sémantiques */
    --color-success: #10B981;
    --color-success-bg: #D1FAE5;
    --color-warning: #F59E0B;
    --color-warning-bg: #FEF3C7;
    --color-error: #E11D48;
    --color-error-bg: #FFE4E6;
    --color-info: #3B82F6;
    --color-info-bg: #DBEAFE;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.12);
    --shadow-2xl: 0 24px 48px rgba(0, 0, 0, 0.16);
    
    /* Border radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations et micro-interactions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Animation de chargement */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Animation d'entrée */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation de progression */
@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-animated {
    animation: progressFill 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contraste et lisibilité */
.text-on-light {
    color: var(--color-gray-900);
}

.text-secondary-on-light {
    color: var(--color-gray-700);
}

.text-muted-on-light {
    color: var(--color-gray-600);
}

/* Focus visible pour la navigation au clavier */
*:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* États interactifs clairs */
button:hover:not(:disabled) {
    cursor: pointer;
    opacity: 0.9;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 200px;
}

/* Optimisation des animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive amélioré */
@media (max-width: 640px) {
    .dashboard-card-progression,
    .dashboard-card-performances {
        padding: 16px;
    }
    
    .progression-header .text-xl {
        font-size: 1.125rem;
    }
    
    .performance-value {
        font-size: 1.5rem;
    }
    
    .quest-card {
        padding: 16px;
    }
    
    .quest-card h4 {
        font-size: 0.875rem;
    }
    
    .performance-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .performance-label {
        font-size: 0.625rem;
    }
    
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .xp-section {
        padding: 16px;
    }
    
    .achievement-badge {
        padding: 12px 16px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .dashboard-card-progression,
    .dashboard-card-performances {
        padding: 18px;
    }
}

@media (min-width: 1025px) {
    .dashboard-layout {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* ============================================
   DASHBOARD COMPACT REDESIGN - Réduction 50% hauteur
   ============================================ */

/* Layout principal compact */
.dashboard-compact-layout {
    width: 100%;
}

.dashboard-compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* ============================================
   ZONE PROGRESSION COMPACTE
   ============================================ */

.compact-progression-zone {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Header progression inline */
.compact-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    gap: 8px;
}

.compact-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1F3B70;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-title .title-icon {
    font-size: 0.875rem;
    margin-right: 4px;
}

.niveau-badge-compact {
    background: linear-gradient(135deg, #FF9F3C, #FFB84D);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    word-break: keep-all;
    word-wrap: nowrap;
    overflow: hidden;
}

/* S'assurer que le span à l'intérieur reste inline */
.niveau-badge-compact #niveau {
    display: inline !important;
    white-space: nowrap;
    margin-left: 0.25em;
}

/* XP Section ultra-compacte */
.xp-compact {
    background: linear-gradient(135deg, rgba(31, 59, 112, 0.05), rgba(31, 59, 112, 0.02));
    border: 1px solid rgba(31, 59, 112, 0.1);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
}

.xp-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.xp-label-compact {
    font-size: 0.625rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-values-compact {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1F3B70;
}

.xp-values-compact #eleve-xp {
    font-size: 0.9375rem;
    color: #1F3B70;
}

.xp-remaining-inline {
    font-size: 0.6875rem;
    color: #64748b;
    font-weight: 500;
    margin-left: 8px;
}

.xp-row-2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xp-progress-compact {
    flex: 1;
    height: 6px;
    background: rgba(31, 59, 112, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.xp-progress-compact .xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1F3B70, #2A4E8A);
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.xp-percent-inline {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #1F3B70;
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
}

/* Quêtes compactes en ligne */
.quests-compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quest-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quest-compact.daily {
    border-color: rgba(239, 68, 68, 0.2);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.03), rgba(239, 68, 68, 0.01));
}

.quest-compact.weekly {
    border-color: rgba(147, 51, 234, 0.2);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.03), rgba(147, 51, 234, 0.01));
}

.quest-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quest-compact.daily:hover {
    border-color: rgba(239, 68, 68, 0.4);
}

.quest-compact.weekly:hover {
    border-color: rgba(147, 51, 234, 0.4);
}

.quest-icon-compact {
    font-size: 1.25rem;
    line-height: 1;
}

.quest-info-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quest-label-compact {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quest-progress-compact {
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
}

.quest-points-compact {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    align-self: center;
}

.quest-compact.daily .quest-points-compact {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.quest-compact.weekly .quest-points-compact {
    background: linear-gradient(135deg, #9333EA, #7C3AED);
    color: white;
}

/* ============================================
   ZONE PERFORMANCES COMPACTE
   ============================================ */

.compact-performances-zone {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.performances-compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
    flex: 1;
}

.perf-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(31, 59, 112, 0.02), rgba(31, 59, 112, 0.01));
    border: 1px solid rgba(31, 59, 112, 0.08);
    transition: all 0.2s ease;
}

.perf-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 59, 112, 0.12);
    border-color: rgba(31, 59, 112, 0.2);
}

.perf-compact.score {
    border-top: 2px solid #FFD700;
}

.perf-compact.position {
    border-top: 2px solid #3B82F6;
}

.perf-compact.games {
    border-top: 2px solid #10B981;
}

.perf-compact.challenges {
    border-top: 2px solid #8B5CF6;
}

.perf-icon-compact {
    font-size: 1.125rem;
    margin-bottom: 4px;
    line-height: 1;
}

.perf-label-compact {
    font-size: 0.625rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    margin-bottom: 4px;
}

.perf-value-compact {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Message motivant compact */
.achievement-compact {
    margin-top: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 1px solid #F59E0B;
    border-radius: 10px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400E;
}

/* ============================================
   RESPONSIVE COMPACT
   ============================================ */

@media (max-width: 1024px) {
    .performances-compact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .dashboard-compact-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .performances-compact-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .perf-value-compact {
        font-size: 1.125rem;
    }
    
    .perf-label-compact {
        font-size: 0.5625rem;
    }
    
    .quest-label-compact {
        font-size: 0.625rem;
    }
}

@media (max-width: 640px) {
    .compact-progression-zone,
    .compact-performances-zone {
        padding: 12px;
    }
    
    .performances-compact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .quests-compact-grid {
        grid-template-columns: 1fr;
    }
    
    .perf-value-compact {
        font-size: 1rem;
    }
}

/* ============================================
   OVERRIDE DES ANCIENS STYLES - Masquer anciens éléments
   ============================================ */

.dashboard-card-progression,
.dashboard-card-performances {
    display: none !important;
}

/* Padding compact pour la carte principale */
#info-eleve.card {
    padding: 20px !important;
}

@media (max-width: 768px) {
    #info-eleve.card {
        padding: 16px !important;
    }
}

/* ============================================
   INTERFACE GESTION DES ÉLÈVES - REFONTE
   ============================================ */

/* Header d'onglet élèves */
.eleves-header {
    margin-bottom: var(--spacing-lg);
}

.eleves-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.eleves-header p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Barre d'outils élèves */
.eleves-toolbar {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

/* Zone de recherche avec bouton clear */
.eleves-search-wrapper {
    position: relative;
}

.eleves-search-wrapper input {
    padding-right: 2.5rem;
}

.eleves-search-wrapper button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.eleves-search-wrapper #recherche-eleve-loading {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

/* Indicateurs statistiques */
.eleves-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.eleves-stats > div {
    background-color: var(--color-bg-main);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
}

.eleves-stats > div:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.eleves-stats > div .text-xs {
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.25rem;
}

.eleves-stats > div .text-lg {
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
}

/* Tableau élèves (desktop) */
.eleves-table-wrapper {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.eleves-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    padding: 0.625rem 1rem;
    border-bottom: 2px solid var(--color-border-medium);
    transition: background-color var(--transition-base);
}

.eleves-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.eleves-table thead th.sortable:hover {
    background-color: #f3f4f6;
}

.eleves-table thead th.sort-icon-active {
    background-color: #eef2ff !important;
    color: #4f46e5;
}

.eleves-table thead th .sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 0.375rem;
    transition: color var(--transition-base);
}

.eleves-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.eleves-table tbody tr:hover {
    background-color: #f9fafb;
}

.eleves-table tbody tr.bg-indigo-50 {
    background-color: #eef2ff !important;
    border-left: 4px solid #4f46e5;
}

.eleves-table tbody td {
    padding: 0.5rem 1rem;
    vertical-align: middle;
}

.eleves-table tbody td .badge-a {
    font-variant-numeric: tabular-nums;
}

/* Colonnes avec largeurs fixes pour éviter les chevauchements */
.eleves-table thead th:nth-child(1),
.eleves-table tbody td:nth-child(1) {
    width: 3rem;
    min-width: 3rem;
    max-width: 3rem;
}

.eleves-table thead th:nth-child(2),
.eleves-table tbody td:nth-child(2) {
    width: 6rem;
    min-width: 6rem;
    max-width: 6rem;
}

.eleves-table thead th:nth-child(3),
.eleves-table tbody td:nth-child(3) {
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
}

.eleves-table thead th:nth-child(4),
.eleves-table tbody td:nth-child(4) {
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
}

.eleves-table thead th:nth-child(5),
.eleves-table tbody td:nth-child(5) {
    width: 10rem;
    min-width: 10rem;
    max-width: 10rem;
}

.eleves-table thead th:nth-child(6),
.eleves-table tbody td:nth-child(6) {
    width: 6rem;
    min-width: 6rem;
    max-width: 6rem;
}

.eleves-table thead th:nth-child(7),
.eleves-table tbody td:nth-child(7) {
    width: 7rem;
    min-width: 7rem;
    max-width: 7rem;
}

.eleves-table thead th:nth-child(8),
.eleves-table tbody td:nth-child(8) {
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
}

.eleves-table thead th:nth-child(9),
.eleves-table tbody td:nth-child(9) {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
}

.eleves-table thead th:nth-child(10),
.eleves-table tbody td:nth-child(10) {
    width: 10rem;
    min-width: 10rem;
    max-width: 10rem;
}

/* Colonne Actions sticky à droite */
.eleves-table thead th:last-child,
.eleves-table tbody td:last-child {
    position: sticky;
    right: 0;
    background-color: #f9fafb;
    z-index: 5;
    width: 10rem;
    min-width: 10rem;
    max-width: 10rem;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
}

.eleves-table tbody tr:hover td:last-child {
    background-color: #f9fafb;
}

.eleves-table tbody tr.bg-indigo-50 td:last-child {
    background-color: #eef2ff !important;
}

/* Éviter les retours à la ligne dans les cellules */
.eleves-table tbody td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colonnes avec texte tronqué si nécessaire */
.eleves-table tbody td:nth-child(3),
.eleves-table tbody td:nth-child(4) {
    max-width: 8rem;
}

.eleves-table tbody td:nth-child(10) {
    max-width: 10rem;
}

/* Badges : affichage limité avec indicateur +N */
.eleves-table tbody td:nth-child(5) {
    white-space: nowrap;
    overflow: visible;
}

.eleves-badges-container {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.eleves-badges-container .badge-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    border: 1px solid var(--color-border-light);
    background-color: #f9fafb;
    border-radius: 0.25rem;
    padding: 0.125rem;
}

.eleves-badges-more {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 600;
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.125rem;
}

/* Colonne Actions : boutons toujours visibles */
.eleves-table tbody td:last-child .flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: nowrap;
}

.eleves-table tbody td:last-child button {
    flex-shrink: 0;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.5rem;
}

/* Cartes élèves (mobile) */
.eleves-cards-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.eleves-card {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-card);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    transition: all var(--transition-base);
}

.eleves-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.eleves-card.border-indigo-500 {
    border-color: #4f46e5;
    background-color: #eef2ff;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.eleves-card .eleve-checkbox {
    flex-shrink: 0;
}

.eleves-card .badge-a {
    font-size: var(--font-size-xs);
}

.eleves-card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
}

/* Responsive pour l'interface élèves */
@media (max-width: 768px) {
    /* Masquer le tableau sur mobile */
    .eleves-table-wrapper {
        display: none;
    }
    
    /* Afficher les cartes sur mobile */
    .eleves-cards-container {
        display: flex;
    }
    
    /* Ajuster la toolbar sur mobile */
    .eleves-toolbar {
        padding: var(--spacing-sm);
    }
    
    .eleves-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xs);
    }
    
    .eleves-stats > div {
        padding: var(--spacing-xs);
    }
    
    .eleves-stats > div .text-lg {
        font-size: var(--font-size-base);
    }
    
    .eleves-header h2 {
        font-size: var(--font-size-xl);
    }
}

@media (min-width: 769px) {
    /* Masquer les cartes sur desktop */
    .eleves-cards-container {
        display: none;
    }
    
    /* Afficher le tableau sur desktop */
    .eleves-table-wrapper {
        display: block;
    }
}

/* Amélioration des badges dans le tableau */
.eleves-table tbody td img[alt*="Badge"] {
    transition: transform var(--transition-base);
}

.eleves-table tbody td img[alt*="Badge"]:hover {
    transform: scale(1.15);
    z-index: 5;
    position: relative;
}

/* Amélioration des boutons d'action */
.eleves-table tbody td button,
.eleves-card button {
    transition: all var(--transition-base);
}

.eleves-table tbody td button:hover,
.eleves-card button:hover {
    transform: scale(1.1);
}

/* Animation pour la barre d'actions groupées (déjà existante mais on s'assure qu'elle fonctionne) */
#actions-groupees-badges {
    transition: transform var(--transition-slow), opacity var(--transition-slow);
}

#actions-groupees-badges.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* Amélioration de la checkbox "tout sélectionner" */
#select-all-eleves:indeterminate {
    background-color: #4f46e5;
    border-color: #4f46e5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3E%3C/svg%3E");
}

