/* ------------------------------------------
   ANIMATIONS KEYFRAMES
   ------------------------------------------ */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Modals : keyframes de base dans css/eqm-modal.css */

/* ------------------------------------------
   CLASSES D'ANIMATION
   ------------------------------------------ */
.animate-float { animation: float 5s ease-in-out infinite; }
.animate-slide-up { animation: slideUp 0.6s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease-out forwards; }
.animate-pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }

/* Delais d'animation echelonnes */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.animate-on-load { opacity: 0; }

/* ------------------------------------------
   SCROLLBAR PERSONNALISEE (visible pour listes/tableaux)
   ------------------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-darker));
}
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--primary) #f1f5f9; }

/* ------------------------------------------
   CARTES NEUMORPHIQUES
   ------------------------------------------ */
.neu-card {
    background: linear-gradient(145deg, #ffffff, #f8faf9);
    box-shadow:
        8px 8px 20px rgba(0, 0, 0, 0.05),
        -8px -8px 20px rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------
   ELEMENTS DECORATIFS (BLOBS)
   ------------------------------------------ */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

/* ------------------------------------------
   PATTERN DE FOND
   ------------------------------------------ */
.pattern-bg {
    background-image: radial-gradient(
        circle at 1px 1px,
        rgba(var(--primary-rgb), 0.03) 1px,
        transparent 0
    );
    background-size: 32px 32px;
}

/* ------------------------------------------
   EFFET GLOW SUR ICONES
   ------------------------------------------ */
.icon-glow { position: relative; }
.icon-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    filter: blur(12px);
    opacity: 0.4;
    z-index: -1;
}

/* ------------------------------------------
   NAVIGATION - ELEMENT ACTIF
   ------------------------------------------ */
.nav-active {
    position: relative;
    background: transparent;
}
.nav-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 0 4px 4px 0;
}

/* ------------------------------------------
   SOUS-MENUS
   ------------------------------------------ */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.submenu.open {
    max-height: 60vh;
    overflow-y: auto;
}
.submenu::-webkit-scrollbar { width: 4px; }
.submenu::-webkit-scrollbar-track { background: transparent; }
.submenu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.submenu::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.submenu-toggle .chevron { transition: transform 0.3s ease; }

/* Lien du sous-menu actif (page courante) */
.submenu-link-active {
    background-color: transparent;
    color: rgb(30 41 59);
    font-weight: 600;
}
.submenu-toggle.open .chevron { transform: rotate(180deg); }

/* Sous-sous-menu Interface comptable */
.submenu-compta {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.submenu-compta.open { max-height: 250px; }
.submenu-compta-toggle .compta-chevron { transition: transform 0.3s ease; }
.submenu-compta-toggle.open .compta-chevron { transform: rotate(90deg); }

/* ------------------------------------------
   MENU UTILISATEUR (POPUP)
   ------------------------------------------ */
.user-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    margin-bottom: 8px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}
.user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ------------------------------------------
   SIDEBAR - MOBILE & DESKTOP
   ------------------------------------------ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 320px;
    max-width: 85vw;
    background: white;
    border-left: 1px solid #e2e8f0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}
.sidebar.open { transform: translateX(0); }

/* Sidebar Desktop - Positionnee a gauche */
@media (min-width: 1024px) {
    .sidebar {
        left: 0;
        right: auto;
        width: 300px;
        max-width: none;
        border-left: none;
        border-right: 1px solid #f1f5f9;
        transform: translateX(0);
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.05);
    }
    .sidebar .mobile-header { display: none; }
    .sidebar .desktop-header { display: block; }
}

/* ------------------------------------------
   OVERLAY SIDEBAR MOBILE
   ------------------------------------------ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

@media (min-width: 1024px) {
    .sidebar-overlay { display: none !important; }
}

/* ------------------------------------------
   GRAPHIQUES
   ------------------------------------------ */
.chart-container {
    position: relative;
    height: 260px;
}

/* ------------------------------------------
   UTILITAIRES
   ------------------------------------------ */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
}

/* ------------------------------------------
   ANIMATIONS SUPPLEMENTAIRES (LOGIN)
   ------------------------------------------ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }

/* ------------------------------------------
   PAGE DE CONNEXION - COTE IMAGE
   ------------------------------------------ */
.image-side {
    position: relative;
    overflow: hidden;
}
.image-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(6, 78, 59, 0.85) 0%,
        rgba(5, 150, 105, 0.7) 100%
    );
}
.image-bg {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><rect fill="%23065f46"/><g fill="%23047857" opacity="0.4"><circle cx="200" cy="300" r="150"/><circle cx="800" cy="200" r="200"/><circle cx="600" cy="700" r="180"/><circle cx="150" cy="800" r="120"/></g></svg>') center/cover;
}

@media (max-width: 1024px) {
    .image-side { display: none; }
}

/* ------------------------------------------
   CHAMPS DE SAISIE MINIMALISTES (LOGIN)
   ------------------------------------------ */
.input-minimal {
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    background: transparent;
    padding: 18px 0;
    font-size: 17px;
    transition: all 0.3s ease;
}
.input-minimal:focus {
    outline: none;
    border-color: var(--primary);
}
.input-minimal::placeholder {
    color: #9ca3af;
}

/* Input avec ic�ne */
.input-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: color 0.3s ease;
}
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* ------------------------------------------
   TEXTE AVEC DEGRADE (LOGIN)
   ------------------------------------------ */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ------------------------------------------
   BOUTONS (LOGIN)
   ------------------------------------------ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    border: 1px solid #e5e7eb;
    background: transparent;
    transition: all 0.3s ease;
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ------------------------------------------
   CHECKBOX PERSONNALISEE (LOGIN)
   ------------------------------------------ */
.checkbox-custom {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.checkbox-custom:checked {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
}
.checkbox-custom:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ------------------------------------------
   SEPARATEUR (LOGIN)
   ------------------------------------------ */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ------------------------------------------
   ELEMENTS DE LA PAGE DE CONNEXION
   ------------------------------------------ */
.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ================================================================
   PAGE LISTE CAVALIERS - VARIABLES CSS GLOBALES - THEME OPADDOCK
   ================================================================ */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-darker: #047857;
    --primary-light: #34d399;
    --primary-300: #6ee7b7;
    --primary-200: #a7f3d0;
    --primary-100: #d1fae5;
    --primary-50: #ecfdf5;
    --primary-50b: #f0fdf4;
    --primary-rgb: 16, 185, 129;
    --primary-ultra-light: rgba(16, 185, 129, 0.08);
    --primary-glow: rgba(16, 185, 129, 0.3);
    --secondary: #0d9488;
    --accent: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-strong: rgba(255, 255, 255, 0.85);
    --text-dark: #064e3b;
    --text-medium: #065f46;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 25px 60px rgba(0, 0, 0, 0.12);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* ================================================================
   BLOBS ANIMES - FOND DECORATIF FLOTTANT (LISTE CAVALIERS)
   ================================================================ */
.blob-1 {
    width: 500px; height: 500px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    top: -100px; left: -100px;
    animation: blobFloat1 20s ease-in-out infinite;
}
.blob-2 {
    width: 400px; height: 400px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    bottom: -80px; right: -80px;
    animation: blobFloat2 18s ease-in-out infinite;
}
.blob-3 {
    width: 300px; height: 300px;
    background: linear-gradient(135deg, var(--primary), var(--primary-300));
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: blobFloat3 22s ease-in-out infinite;
}

@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 80px) scale(1.15); }
    66% { transform: translate(-40px, 40px) scale(0.9); }
}
@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-70px, -50px) scale(1.1); }
    66% { transform: translate(50px, -80px) scale(0.95); }
}
@keyframes blobFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.25); }
}

/* ================================================================
   PATTERN DE FOND - GRILLE DE POINTS (LISTE CAVALIERS)
   ================================================================ */
.pattern-overlay {
    position: fixed; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(var(--primary-rgb), 0.04) 1px, transparent 0);
    background-size: 36px 36px;
    pointer-events: none; z-index: 0;
}

/* ================================================================
   CONTENEUR PRINCIPAL - PLEINE LARGEUR (LISTE CAVALIERS)
   ================================================================ */
.app-container {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 24px 32px;
    padding-right: 64px; /* ESPACE POUR L'INDEX ALPHABETIQUE */
}

@keyframes cardAppear {
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   BARRE D'OUTILS - RECHERCHE + BOUTONS DESKTOP (LISTE CAVALIERS)
   ================================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    animation: slideUp 0.6s ease-out both;
}

/* CHAMP DE RECHERCHE */
.search-box { flex: 1; position: relative; }

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: var(--glass-strong);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    font-family: 'Outfit', sans-serif;
    font-size: 15px; color: var(--text-dark);
    outline: none; transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-ultra-light), var(--shadow-md);
}

.search-box .search-icon {
    position: absolute; left: 18px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s;
    display: flex; align-items: center;
}
.search-box input:focus ~ .search-icon { color: var(--primary); }

/* BOUTONS DESKTOP */
.desktop-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 24px; border: none;
    border-radius: var(--radius-lg);
    font-family: 'Outfit', sans-serif;
    font-size: 15px; font-weight: 400;
    cursor: pointer; transition: all 0.3s ease;
    white-space: nowrap;
}
.desktop-btn.btn-filter {
    background: var(--glass-strong); backdrop-filter: blur(20px);
    color: var(--text-dark);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}
.desktop-btn.btn-filter:hover {
    background: var(--primary-ultra-light);
    border-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-2px);
}
.desktop-btn.btn-add {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.desktop-btn.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

/* ================================================================
   GRILLE DES CAVALIERS - 3 COLONNES FIXES
   ================================================================ */

/* ================================================================
   EN-TETE DE PAGE CAVALIERS
   ================================================================ */
.page-header-clients {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.12);
    animation: slideUp 0.5s ease-out both;
}
.page-header-left {
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.page-title-clients {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}
.page-count-badge {
    font-size: 15px;
    font-weight: 500;
    color: var(--primary-dark);
    background: var(--primary-ultra-light);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
}
.page-header-right { display: flex; align-items: center; }
.page-subtitle {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


/* ================================================================
   GRILLE DES CAVALIERS
   ================================================================ */
.riders-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    animation: slideUp 0.7s ease-out 0.15s both;
}


/* ================================================================
   CARTE CAVALIER
   ================================================================ */
a.rider-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: stretch;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    opacity: 0;
    transform: translateY(16px);
    animation: cardAppear 0.5s ease-out forwards;
}

a.rider-card:nth-child(3n+1) { animation-delay: 0.05s; }
a.rider-card:nth-child(3n+2) { animation-delay: 0.1s; }
a.rider-card:nth-child(3n+3) { animation-delay: 0.15s; }

a.rider-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.2);
}

a.rider-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
    opacity: 0;
    transition: opacity 0.35s ease;
}
a.rider-card:hover::before { opacity: 1; }

a.rider-card.hidden { display: none; }


/* ================================================================
   CARTE - PHOTO
   ================================================================ */
.rider-photo {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    background: linear-gradient(175deg, var(--primary-50b) 0%, var(--primary-50) 50%, #f8fafc 100%);
}

.rider-avatar-wrap { position: relative; }

.rider-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    object-fit: cover;
    transition: all 0.35s ease;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
}

a.rider-card:hover .rider-avatar {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.18);
}

.online-dot {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 14px; height: 14px;
    background: var(--primary);
    border: 2.5px solid white;
    border-radius: 50%;
}
.online-dot.on {
    animation: pulseOnline 2s ease-in-out infinite;
}
@keyframes pulseOnline {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(var(--primary-rgb), 0); }
}
.online-dot.off { background: #d1d5db; }


/* ================================================================
   CARTE - INFORMATIONS
   ================================================================ */
.rider-info {
    flex: 1;
    padding: 16px 18px 16px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.rider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 10px;
}

.rider-name {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.level-badge.g7 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.level-badge.g6 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.level-badge.g5 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.level-badge.g4 { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.level-badge.g3 { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.level-badge.g2 { background: linear-gradient(135deg, #f97316, #ea580c); }
.level-badge.g1 { background: linear-gradient(135deg, #ec4899, #db2777); }

.rider-reprise {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: var(--primary-dark);
    font-weight: 400;
    margin-bottom: 10px;
    padding: 3px 10px;
    background: rgba(var(--primary-rgb), 0.06);
    border-radius: 6px;
    width: fit-content;
}

.rider-metrics {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.metric-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    flex: 1;
    min-width: 0;
}
.metric-pill.hours {
    background: #eff6ff;
    border: 1px solid rgba(59, 130, 246, 0.1);
}
.metric-pill.bal-ok {
    background: var(--primary-50b);
    border: 1px solid rgba(22, 163, 74, 0.1);
}
.metric-pill.bal-due {
    background: #fef2f2;
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.mp-icon { font-size: 16px; flex-shrink: 0; }
.mp-val  { font-size: 15px; font-weight: 500; line-height: 1.2; }
.mp-val.blue  { color: #2563eb; }
.mp-val.green { color: var(--primary); }
.mp-val.red   { color: #dc2626; }


/* ================================================================
   INDEX ALPHABETIQUE
   ================================================================ */
.alpha-index {
    position: fixed;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 6px 3px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.alpha-letter {
    width: 30px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
}
.alpha-letter:hover {
    background: var(--primary-ultra-light);
    color: var(--primary-dark);
}
.alpha-letter.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.3);
}
.alpha-letter.disabled { color: #e5e7eb; cursor: default; }
.alpha-letter.disabled:hover { background: transparent; color: #e5e7eb; }


/* ================================================================
   MODAL FILTRE
   ================================================================ */
.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: visibility 0s .4s;
}
.filter-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: visibility 0s;
    animation: eqmFadeIn .4s cubic-bezier(.4, 0, .2, 1) forwards;
}

.filter-modal {
    position: fixed;
    z-index: 1001;
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 440px;
    max-width: 92vw;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: visibility 0s .5s;
}
.filter-modal.active {
    opacity: 1;
    visibility: visible;
    transition: visibility 0s;
    animation: eqmWowInCenter .5s cubic-bezier(.175, .885, .32, 1.1) forwards;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.filter-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-dark);
}
.filter-close {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-medium);
    transition: all 0.2s ease;
}
.filter-close:hover { background: #e5e7eb; }

.filter-label {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.filter-opt {
    padding: 8px 16px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-opt:hover {
    background: var(--primary-ultra-light);
    border-color: rgba(var(--primary-rgb), 0.3);
}
.filter-opt.active {
    background: var(--primary-ultra-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.filter-apply {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}
.filter-apply:hover {
    background: var(--primary-dark);
}


/* ================================================================
   BARRE DU BAS MOBILE
   ================================================================ */
.bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0 16px env(safe-area-inset-bottom, 0px);
    pointer-events: none;
    display: none;
}
.bottom-bar-inner {
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    pointer-events: all;
}
.bottom-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bottom-btn.btn-filter-mobile {
    background: #f3f4f6;
    color: var(--text-dark);
}
.bottom-btn.btn-add-mobile {
    background: var(--primary);
    color: white;
}


/* ================================================================
   MESSAGE VIDE + TOAST
   ================================================================ */
.empty-state { text-align: center; padding: 60px 24px; display: none; }
.empty-state.visible { display: block; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 15px; color: var(--text-light); font-weight: 500; }

/* Toast legacy #toast (modclielist1 afficherToast) - align� en haut � droite */
#toast.toast {
    position: fixed;
    top: 1rem; right: 1rem;
    transform: translateX(120%);
    padding: 12px 24px;
    background: #1e293b;
    color: white;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
#toast.toast.visible {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}


/* ================================================================
   SCROLLBAR (voir aussi section SCROLLBAR PERSONNALISEE en haut)
   ================================================================ */


/* ================================================================
   RESPONSIVE - TABLETTE (1024px)
   ================================================================ */
@media (max-width: 1024px) {
    .riders-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ================================================================
   RESPONSIVE - TABLETTE (768px)
   ================================================================ */
@media (max-width: 768px) {
    .app-container { padding: 16px 16px 110px; padding-right: 46px; }
    .page-header-clients { margin-bottom: 16px; padding-bottom: 12px; }
    .page-title-clients { font-size: 22px; }
    .page-subtitle { display: none; }
    .desktop-btn { display: none !important; }
    .bottom-bar { display: block; }
    .riders-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .rider-photo { padding: 14px 12px; }
    .rider-avatar { width: 76px; height: 76px; }
    .rider-info { padding: 14px 14px 14px 8px; }
    .rider-name { font-size: 16px; }
    .alpha-index { padding: 4px 2px; }
    .alpha-letter { width: 26px; height: 20px; font-size: 10px; }
    .filter-modal {
        top: auto; left: 0; right: 0; bottom: 0;
        transform: translateY(100%);
        width: 100%; max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 70vh;
        animation: none;
    }
    .filter-modal.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        animation: eqmSlideUp .5s cubic-bezier(.175, .885, .32, 1.1) forwards;
    }
}


/* ================================================================
   RESPONSIVE - SMARTPHONE (480px)
   ================================================================ */
@media (max-width: 480px) {
    .app-container { padding: 12px 10px 120px; padding-right: 40px; }
    .page-header-clients { flex-direction: column; align-items: flex-start; gap: 4px; }
    .page-title-clients { font-size: 20px; }
    .riders-grid { grid-template-columns: 1fr; gap: 10px; }

    a.rider-card {
        flex-direction: row;
        align-items: stretch;
    }

    .rider-photo {
        padding: 14px 10px;
        min-width: 100px;
        max-width: 100px;
    }
    .rider-avatar { width: 76px; height: 76px; border-width: 2.5px; }

    .rider-info { padding: 12px 12px 12px 6px; }

    .rider-header { margin-bottom: 3px; gap: 8px; }
    .rider-name { font-size: 15px; }
    .level-badge { font-size: 10px; padding: 2px 8px; }

    .rider-reprise { font-size: 12px; padding: 2px 8px; margin-bottom: 8px; }

    .rider-metrics { flex-direction: column; gap: 4px; }
    .metric-pill { padding: 5px 8px; }
    .mp-val { font-size: 12px; }
    .mp-icon { font-size: 13px; }

    .alpha-index { padding: 3px 2px; right: 3px; }
    .alpha-letter { width: 24px; height: 18px; font-size: 9px; border-radius: 5px; }
}

/* ================= TOAST NOTIFICATIONS ================= */
/* Conteneur : en haut droite, style notification moderne */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
#toast-container .toast {
    pointer-events: auto;
}
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: system-ui, -apple-system, sans-serif;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.toast.success {
    background: var(--primary-50);
    color: var(--primary);
}

.toast.error {
    background: #fef2f2;
    color: #dc2626;
}

.toast.warning {
    background: #fffbeb;
    color: #d97706;
}

.toast.info {
    background: #eff6ff;
    color: #2563eb;
}

.toast-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Mobile : tableaux - supprimer scroll horizontal, afficher 2 colonnes uniquement */
@media (max-width: 768px) {
    .table-scroll {
        overflow-x: hidden !important;
    }
    .table-scroll .data-table,
    .table-scroll .breakdown-table {
        min-width: 0;
    }
    /* Masquer colonnes 3 � avant-derni�re, garder 2 premi�res + colonne actions */
    .table-scroll .data-table thead th:nth-child(n+3):not(:last-child),
    .table-scroll .data-table tbody td:nth-child(n+3):not(:last-child),
    .table-scroll .data-table tfoot td:nth-child(n+3):not(:last-child),
    .table-scroll .breakdown-table thead th:nth-child(n+3):not(:last-child),
    .table-scroll .breakdown-table tbody td:nth-child(n+3):not(:last-child) {
        display: none;
    }
}

/* ================================================================
   ZONE TACTILE MINIMALE 44px (Apple/Google - accessibilite)
   Toute interaction : boutons, champs, liens cliquables, modales
   ================================================================ */
@media (max-width: 1024px) {
    button,
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    select,
    [role="button"],
    .cfg-btn,
    .cfg-btn-sm,
    .cfg-btn-outline,
    .cfg-btn-amber,
    .cfg-pill,
    .cfg-ibtn,
    .cfg-modal-close,
    .eqm-modal button,
    .eqm-modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    .eqm-modal select,
    .eqm-confirm-cancel,
    .eqm-confirm-ok,
    .eqm-modal-content button,
    .eqm-modal-content input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    .eqm-modal-content select,
    .eqm-modal-content [role="button"],
    .filter-modal button,
    .filter-modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    .filter-modal select,
    .alpha-letter,
    .se-stat-page .se-tab-btn,
    .sr-stat-page .sr-period-btn,
    .st-stat-page .st-tab-btn {
        min-height: 44px !important;
    }
    /* Croix fermeture modal : taille fixe, pas 44px */
    button.eqm-modal-close,
    .eqm-modal button.eqm-modal-close,
    .eqm-modal-content button.eqm-modal-close,
    .eqm-modal-header button.eqm-modal-close {
        min-height: 32px !important;
        max-height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        width: 32px !important;
        height: 32px !important;
    }
    /* Boutons compacts : zone tactile 44x44px */
    .eqm-chip-remove,
    .eqm-result-add {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    .cfg-fg input,
    .cfg-fg select {
        min-height: 44px !important;
    }
    /* Toggle : zone tactile elargie (hauteur min) */
    .cfg-toggle {
        min-height: 44px;
    }
}

/* --- Taille uniforme icones suppression (.72rem) --- */
.eqm-supprimer-groupe i,
.eqm-retirer-membre i {
    font-size: .72rem;
}

