/* ============================================
   DESIGN SYSTEM - Porsche Club
   Standard : iOS + Material Design 3
   ============================================ */

/* â”€â”€ Google Fonts â”€â”€ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* â”€â”€ Variables â”€â”€ */
:root {
    /* Couleurs primaires */
    --c-black:    #0A0A0A;
    --c-gold:     #F5C518;
    --c-gold-dk:  #D4A017;
    --c-white:    #FFFFFF;

    /* Material 3 - Primary tonal */
    --m3-primary:        #1E40AF;
    --m3-primary-50:     #EFF6FF;
    --m3-primary-100:    #DBEAFE;
    --m3-primary-600:    #2563EB;
    --m3-primary-700:    #1D4ED8;
    --m3-secondary:      #0F766E;
    --m3-tertiary:       #B45309;
    --m3-outline:        #CBD5E1;

    /* Surfaces */
    --c-bg:       #F4F6FB;
    --c-surface:  #FFFFFF;
    --c-surface2: #F8FAFC;
    --c-surface3: #EEF2F7;
    --c-border:   #E2E8F0;

    /* Textes */
    --c-text:     #0F172A;
    --c-text2:    #475569;
    --c-text3:    #94A3B8;

    /* SÃ©mantiques */
    --c-green:    #10B981;
    --c-green-bg: #ECFDF5;
    --c-red:      #EF4444;
    --c-red-bg:   #FEF2F2;
    --c-orange:   #F59E0B;
    --c-orange-bg:#FFFBEB;
    --c-blue:     #3B82F6;
    --c-blue-bg:  #EFF6FF;

    /* Gradients */
    --grad-dark:  linear-gradient(
        135deg, #0A0A0A 0%, #1a1a2e 50%, #16213e 100%
    );
    --grad-gold:  linear-gradient(
        135deg, #F5C518 0%, #D4A017 100%
    );
    --grad-card:  linear-gradient(
        145deg, #ffffff 0%, #f8f9fa 100%
    );

    /* Rayons */
    --r-sm:   8px;
    --r-md:   12px;
    --r-lg:   16px;
    --r-xl:   20px;
    --r-2xl:  24px;
    --r-full: 999px;

    /* Ombres */
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);

    /* Layout */
    --header-h: 64px;
    --max-w:    680px;
}

/* â”€â”€ Reset â”€â”€ */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system,
                  BlinkMacSystemFont, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

/* Mobile : fond portrait — carte collée en haut */
.login-page {
    min-height: 100vh;
    background:
        url('../img/background_mobile.png')
        center top / cover no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 0.9rem;
    position: relative;
}

/* Voile léger — laisse la photo visible en bas */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.50) 0%,
        rgba(0,0,0,0.18) 55%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

.login-page::after { display: none; }

/* Desktop : fond paysage, formulaire à gauche */
@media (min-width: 768px) {
    .login-page {
        background:
            url('../img/background1.png')
            center / cover no-repeat;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 2rem 2rem 6vw;
    }
    .login-page::before {
        background: linear-gradient(
            to right,
            rgba(0,0,0,0.80) 0%,
            rgba(0,0,0,0.55) 38%,
            rgba(0,0,0,0.10) 62%,
            transparent 80%
        );
    }
}

/* Carte de connexion — verre sombre compact */
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(8,8,8,0.80);
    border-radius: 0 0 var(--r-2xl) var(--r-2xl);
    padding: 1.3rem 1.5rem 1.6rem;
    box-shadow:
        0 24px 60px rgba(0,0,0,0.6),
        inset 0 0 0 1px rgba(245,197,24,0.15);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 0 0 1px 1px;
    border-color: rgba(245,197,24,0.14);
    border-style: solid;
    border-top: none;
}

@media (min-width: 768px) {
    .login-card {
        border-radius: var(--r-2xl);
        padding: 2.5rem 2rem 2rem;
        border-top: 1px solid rgba(245,197,24,0.14);
    }
}

/* Logo */
.login-brand {
    text-align: center;
    margin-bottom: 1.1rem;
}

.login-logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.login-logo-wrap img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

@media (min-width: 768px) {
    .login-brand { margin-bottom: 2rem; }
}

.login-logo-wrap::after { display: none; }

.login-brand h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--c-gold);
    letter-spacing: -0.3px;
}

.login-brand p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* Champs dans la carte sombre */
.login-card .field-label {
    color: rgba(255,255,255,0.5);
}
.login-card .field-input {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
}
.login-card .field-input:focus {
    background: rgba(255,255,255,0.10);
    border-color: var(--c-gold);
    box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}
.login-card .field-input::placeholder {
    color: rgba(255,255,255,0.25);
}
.login-card .field-icon { opacity: 0.45; }
.login-card .remember-row span {
    color: rgba(255,255,255,0.55);
}
.login-card .field-btn { color: rgba(255,255,255,0.4); }
.login-card .field-btn:hover { color: rgba(255,255,255,0.8); }
.login-card .alert-error {
    background: rgba(185,28,28,0.25);
    border-color: rgba(252,165,165,0.3);
    color: #FCA5A5;
}
/* Espacement compacté sur mobile */
@media (max-width: 767px) {
    .login-card .field-group { margin-bottom: 0.75rem; }
    .login-card .field-input { padding: 0.72rem 1rem; }
    .login-card .field-input.has-icon { padding-left: 2.4rem; }
    .login-brand h1 { font-size: 1.2rem; }
    .login-brand p  { font-size: 0.82rem; }
    .login-footer-text { margin-top: 0.9rem; }
}

/* Tab switcher login/pseudo */
.login-tabs {
    display: flex;
    background: var(--c-bg);
    border-radius: var(--r-md);
    padding: 3px;
    margin-bottom: 1.5rem;
    gap: 3px;
}

.login-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: none;
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-text2);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.login-tab.active {
    background: white;
    color: var(--c-black);
    box-shadow: var(--shadow-xs);
}

/* Champs */
.field-group {
    margin-bottom: 1rem;
}

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--c-text2);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.field-input-wrap {
    position: relative;
}

.field-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    transition: all 0.2s;
    -webkit-appearance: none;
}

.field-input:focus {
    border-color: var(--c-gold);
    box-shadow: 0 0 0 3px rgba(245,197,24,0.12);
    outline: none;
    background: white;
}

.field-input::placeholder {
    color: var(--c-text3);
}

.field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.4;
    pointer-events: none;
}

.field-input.has-icon {
    padding-left: 2.5rem;
}

.field-btn {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--c-text3);
    padding: 0.3rem;
    border-radius: 6px;
    transition: color 0.2s;
}

.field-btn:hover { color: var(--c-text); }

/* Remember me */
.remember-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-black);
    cursor: pointer;
}

.remember-row span {
    font-size: 0.85rem;
    color: var(--c-text2);
    font-weight: 500;
}

/* Bouton login */
.btn-login {
    width: 100%;
    padding: 0.95rem;
    background: var(--c-black);
    color: var(--c-gold);
    border: none;
    border-radius: var(--r-md);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}

.btn-login:hover::after {
    background: rgba(255,255,255,0.05);
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login-arrow {
    margin-left: auto;
    opacity: 0.6;
    font-size: 1.1rem;
}

/* Error */
.login-error {
    background: var(--c-red-bg);
    border: 1px solid #FECACA;
    color: #B91C1C;
    padding: 0.75rem 1rem;
    border-radius: var(--r-md);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3);
}

/* ============================================
   APP HEADER
   ============================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
    background: var(--c-black);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05),
                var(--shadow-md);
}

.header-back {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: var(--r-md);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}

.header-back:hover {
    background: rgba(255,255,255,0.15);
}

.header-center {
    flex: 1;
    min-width: 0;
}

.header-center-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-center-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-top: 1px;
}

.header-user {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--c-gold);
}

.header-user-role {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: var(--r-md);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* ============================================
   QUICK STATS BAR
   ============================================ */
.stats-bar {
    background: white;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-right: 1px solid var(--c-border);
    flex-shrink: 0;
    min-width: 80px;
}

.stat-pill:last-child { border-right: none; }

.sp-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--c-black);
    line-height: 1;
}

.sp-label {
    font-size: 0.68rem;
    color: var(--c-text3);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.sp-highlight { background: #FFFCE6; }
.sp-highlight .sp-val { color: var(--c-gold-dk); }

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
    background: white;
    border-bottom: 1px solid var(--c-border);
    padding: 0.6rem 1rem;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    position: sticky;
    top: var(--header-h);
    z-index: 190;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input-wrap svg {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text3);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.65rem 0.8rem 0.65rem 2.3rem;
    background: var(--c-bg);
    border: 1.5px solid transparent;
    border-radius: var(--r-full);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--c-text);
    transition: all 0.2s;
    -webkit-appearance: none;
}

.search-input:focus {
    background: white;
    border-color: var(--c-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(245,197,24,0.1);
}

.search-clear {
    width: 28px;
    height: 28px;
    background: var(--c-text3);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================
   GROUPE SEPARATOR
   ============================================ */
.groupe-sep {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: var(--c-black);
    position: sticky;
    top: calc(var(--header-h) + 53px);
    z-index: 180;
}

.groupe-sep-badge {
    background: var(--grad-gold);
    color: var(--c-black);
    font-weight: 900;
    font-size: 0.78rem;
    padding: 0.18rem 0.55rem;
    border-radius: var(--r-sm);
    letter-spacing: 0.3px;
}

.groupe-sep-name {
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    font-weight: 600;
    flex: 1;
}

.groupe-sep-count {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-full);
}

/* ============================================
   PILOT CARD
   ============================================ */
.pilot-card {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    cursor: pointer;
    transition: background 0.12s;
    gap: 0.75rem;
    min-height: 72px;
    position: relative;
}

.pilot-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--c-border);
    transition: background 0.2s;
}

.pilot-card.noted::before {
    background: var(--c-green);
}

.pilot-card:active {
    background: var(--c-surface2);
}

.pilot-num-badge {
    width: 44px;
    height: 44px;
    background: var(--c-bg);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    color: var(--c-black);
    flex-shrink: 0;
    border: 1.5px solid var(--c-border);
}

.pilot-card.noted .pilot-num-badge {
    background: #ECFDF5;
    border-color: #6EE7B7;
    color: #065F46;
}

.pilot-details {
    flex: 1;
    min-width: 0;
}

.pilot-name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 3px;
}

.pilot-name-text {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.civ-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.civ-m {
    background: #EFF6FF;
    color: #1D4ED8;
}

.civ-f {
    background: #FDF2F8;
    color: #9D174D;
}

.pilot-car-row {
    font-size: 0.78rem;
    color: var(--c-text3);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pilot-right-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.pilot-score {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--c-black);
    line-height: 1;
}

.pilot-audits-badge {
    background: var(--c-green-bg);
    color: var(--c-green);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--r-full);
}

.pilot-no-score {
    width: 28px;
    height: 28px;
    border: 2px dashed var(--c-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text3);
    font-size: 0.7rem;
}

.pilot-chevron {
    color: var(--c-border);
    font-size: 1.2rem;
    font-weight: 300;
}

.pilot-fiche-btn {
    width: 28px;
    height: 28px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--c-text2);
    transition: all 0.15s;
}

.pilot-fiche-btn:hover {
    background: var(--c-black);
    color: var(--c-gold);
    border-color: var(--c-black);
}

/* ============================================
   MODAL - Bottom Sheet
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-sheet {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    background: var(--c-surface);
    border-radius: 24px 24px 0 0;
    /* Flex column : body scrolle, footer reste visible */
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 56px - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s
                cubic-bezier(0.32, 0.72, 0, 1);
    overscroll-behavior: contain;
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--c-border);
    border-radius: var(--r-full);
    margin: 10px auto 0;
}

/* Modal Header */
.modal-head {
    padding: 0.85rem 1.2rem;
    background: var(--grad-dark);
    margin-top: 0.3rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* Quand le panneau stats est présent, passer en align-items: flex-start */
.modal-head:has(.modal-head-right) {
    align-items: flex-start;
    justify-content: space-between;
}
.modal-head-left  { flex: 1; min-width: 0; }
.modal-head-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.12);
    padding-left: 0.75rem;
    padding-top: 0.1rem;
}
.mhr-stat { text-align: right; }
.mhr-val  { font-size: 1.05rem; font-weight: 800; color: var(--c-gold); line-height: 1; }
.mhr-lbl  { font-size: 0.58rem; color: rgba(255,255,255,0.42); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 1px; }

.modal-head::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(
        circle,
        rgba(245,197,24,0.08) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.modal-head-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--c-gold);
    line-height: 1;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.modal-head-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin: 0.2rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-head-meta {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* History — now sits below the note form */
.modal-history {
    padding: 0.8rem 1rem;
    background: var(--c-surface2);
    border-top: 1px solid var(--c-border);
    max-height: 160px;
    overflow-y: auto;
}

.history-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 0.84rem;
}

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

.h-note-chip {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.h-time {
    color: var(--c-text3);
    font-size: 0.78rem;
    min-width: 65px;
}

.h-comment {
    flex: 1;
    color: var(--c-text2);
    font-style: italic;
    font-size: 0.78rem;
}

.history-avg-bar {
    margin-top: 0.5rem;
    background: var(--grad-gold);
    border-radius: var(--r-sm);
    padding: 0.4rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.no-history {
    text-align: center;
    color: var(--c-text3);
    font-size: 0.85rem;
    padding: 0.5rem;
}

/* Note Section */
.modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
}

.note-display-big {
    text-align: center;
    margin: 0.5rem 0 1rem;
}

.note-display-num {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--c-black);
    line-height: 1;
    letter-spacing: -2px;
    transition: all 0.15s;
}

.note-display-den {
    font-size: 1.3rem;
    color: var(--c-text3);
    font-weight: 400;
    margin-left: 3px;
}

/* Note Buttons */
.note-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.note-btn {
    aspect-ratio: 1;
    border-radius: var(--r-md);
    border: 2px solid var(--c-border);
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    background: var(--c-surface);
    transition: all 0.12s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.note-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.12s;
}

.note-btn:active { transform: scale(0.9); }

/* Couleurs notes */
.note-btn[data-note="1"]  { color:#EF4444; border-color:#FCA5A5; }
.note-btn[data-note="2"]  { color:#F97316; border-color:#FDBA74; }
.note-btn[data-note="3"]  { color:#F59E0B; border-color:#FCD34D; }
.note-btn[data-note="4"]  { color:#EAB308; border-color:#FDE047; }
.note-btn[data-note="5"]  { color:#84CC16; border-color:#BEF264; }
.note-btn[data-note="6"]  { color:#22C55E; border-color:#86EFAC; }
.note-btn[data-note="7"]  { color:#10B981; border-color:#6EE7B7; }
.note-btn[data-note="8"]  { color:#14B8A6; border-color:#5EEAD4; }
.note-btn[data-note="9"]  { color:#3B82F6; border-color:#93C5FD; }
.note-btn[data-note="10"] { color:#6366F1; border-color:#A5B4FC; }

.note-btn.selected {
    background: var(--c-black) !important;
    border-color: var(--c-black) !important;
    color: var(--c-gold) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transform: scale(1.08);
}

/* Comment */
.note-comment-field {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface2);
    resize: none;
    transition: all 0.2s;
}

.note-comment-field:focus {
    border-color: var(--c-gold);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(245,197,24,0.1);
}

/* Modal Footer */
.modal-foot {
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1rem 0.75rem;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
}

.btn-cancel-modal {
    flex: 1;
    padding: 0.85rem;
    background: var(--c-bg);
    color: var(--c-text2);
    border: none;
    border-radius: var(--r-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-cancel-modal:hover {
    background: var(--c-border);
}

.btn-validate-modal {
    flex: 2;
    padding: 0.85rem;
    background: var(--c-black);
    color: var(--c-gold);
    border: none;
    border-radius: var(--r-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-validate-modal:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.btn-validate-modal:not(:disabled):active {
    transform: scale(0.98);
}

/* ============================================
   CLASSEMENT PAGE
   ============================================ */
/* ── Toolbar classement : segment + actions ── */
.cl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    background: white;
    border-bottom: 1px solid var(--c-border);
    gap: 0.5rem;
}

/* Segment control */
.seg-ctrl {
    display: inline-flex;
    background: var(--c-surface);
    border-radius: var(--r-full);
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}
.seg-btn {
    padding: 0.38rem 0.85rem;
    border-radius: var(--r-full);
    font-size: 0.78rem;
    font-weight: 700;
    border: none;
    background: none;
    color: var(--c-text3);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.seg-btn.active {
    background: var(--c-black);
    color: var(--c-gold);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* Boutons actions compacts */
.cl-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}
.cl-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.38rem 0.75rem;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid var(--c-border);
    background: white;
    color: var(--c-text2);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}
.cl-action-btn:hover,
.cl-action-btn:active {
    border-color: var(--c-black);
    color: var(--c-black);
}

/* Filtre catégories */
.filter-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: calc(var(--header-h) + 93px);
    z-index: 175;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    padding: 0.3rem 0.85rem;
    border-radius: var(--r-full);
    border: 1.5px solid var(--c-border);
    background: white;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    color: var(--c-text2);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.filter-chip small { font-size: 0.72rem; opacity: 0.7; font-weight: 400; }
.filter-chip.active {
    background: var(--c-gold);
    color: var(--c-black);
    border-color: var(--c-gold);
    font-weight: 700;
}

/* Section header classement */
.ranking-section-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: var(--c-black);
    position: sticky;
    top: calc(var(--header-h) + 93px);
    z-index: 170;
}

.rsh-badge {
    background: var(--grad-gold);
    color: var(--c-black);
    font-weight: 900;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
}

.rsh-badge-m { background: #BFDBFE; color: #1E40AF; }
.rsh-badge-f { background: #FBCFE8; color: #9D174D; }

.rsh-title {
    flex: 1;
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    font-weight: 600;
}

.rsh-count {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--r-full);
}

/* Ranking Item */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    gap: 0.75rem;
    transition: background 0.1s;
}

.ranking-item:active { background: var(--c-surface2); }

.rank-gold   .rank-medal { background:#FFF8DC; }
.rank-silver .rank-medal { background:#F3F4F6; }
.rank-bronze .rank-medal { background:#FFF7ED; }

.rank-medal {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--c-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--c-text2);
    flex-shrink: 0;
    border: 1.5px solid var(--c-border);
}

.rank-gold   .rank-medal { border-color:#FCD34D; }
.rank-silver .rank-medal { border-color:#D1D5DB; }
.rank-bronze .rank-medal { border-color:#FDBA74; }

.rank-info { flex: 1; min-width: 0; }

.rank-name {
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-meta {
    font-size: 0.76rem;
    color: var(--c-text3);
    margin-top: 2px;
}

.rank-score {
    text-align: right;
    flex-shrink: 0;
}

.rank-score-val {
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
}

.rank-score-audits {
    font-size: 0.7rem;
    color: var(--c-text3);
    margin-top: 2px;
}

/* Score colors */
.score-blue   { color: #6366F1; }
.score-green  { color: var(--c-green); }
.score-yellow { color: #D97706; }
.score-orange { color: #EA580C; }
.score-red    { color: var(--c-red); }

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.dash-section {
    padding: 1rem;
    background: var(--c-surface);
    margin-bottom: 0.5rem;
}

.dash-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.stat-card {
    background: var(--c-surface2);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-card-icon {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.stat-card-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--c-black);
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-card-val span {
    font-size: 1rem;
    color: var(--c-text3);
    font-weight: 400;
}

.stat-card-label {
    font-size: 0.78rem;
    color: var(--c-text2);
    font-weight: 500;
}

.stat-card-sub {
    font-size: 0.72rem;
    color: var(--c-green);
    font-weight: 600;
    margin-top: 2px;
}

.progress-bar-wrap {
    height: 3px;
    background: var(--c-border);
    border-radius: var(--r-full);
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--grad-gold);
    border-radius: var(--r-full);
}

/* Admin tiles */
.admin-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.admin-tile {
    background: var(--c-surface2);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.9rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: var(--c-text);
    transition: all 0.15s;
}

.admin-tile:active {
    background: var(--c-black);
    color: var(--c-gold);
    border-color: var(--c-black);
    transform: scale(0.97);
}

.admin-tile-ico  { font-size: 1.6rem; }
.admin-tile-lbl  { font-size:0.78rem;font-weight:700;
                   text-align:center; }
.admin-tile-sub  { font-size:0.68rem;color:var(--c-text3);
                   text-align:center; }

/* ============================================
   CLASSEMENT PAGE SHELL (MATERIAL-LIKE)
   ============================================ */
.classement-page {
    background: var(--c-bg);
}

.mini-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 0.6rem;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    z-index: 185;
}

.mini-stat {
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 0.55rem 0.45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 62px;
    justify-content: center;
}

.mini-stat-last {
    background: #FFFCE6;
    border-color: #FDE68A;
}

.ms-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--c-black);
    line-height: 1.1;
}

.ms-label {
    margin-top: 0.18rem;
    font-size: 0.68rem;
    color: var(--c-text2);
    text-align: center;
    font-weight: 600;
}

.ranking-list {
    padding-bottom: 0.75rem;
}

.ranking-section {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--c-black);
    position: sticky;
    top: calc(var(--header-h) + 146px + env(safe-area-inset-top, 0px));
    z-index: 170;
}

.ranking-section-femmes {
    background: #1a0a0a;
}

.rs-badge {
    background: var(--grad-gold);
    color: var(--c-black);
    font-weight: 900;
    font-size: 0.75rem;
    padding: 0.16rem 0.48rem;
    border-radius: 6px;
    white-space: nowrap;
}

.rs-badge-m { background: #BFDBFE; color: #1E40AF; }
.rs-badge-f { background: #FBCFE8; color: #9D174D; }

.ranking-section-title {
    flex: 1;
    color: rgba(255,255,255,0.92);
    font-size: 0.82rem;
    font-weight: 700;
}

.rs-count {
    color: rgba(255,255,255,0.58);
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 520px) {
    .mini-stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cl-toolbar {
        top: calc(var(--header-h) + 119px);
    }
    .filter-bar {
        top: calc(var(--header-h) + 159px);
    }
    .ranking-section {
        top: calc(var(--header-h) + 212px + env(safe-area-inset-top, 0px));
    }
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom,0px));
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--c-black);
    color: white;
    padding: 0.75rem 1.2rem;
    border-radius: var(--r-full);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 9000;
    transition: transform 0.3s
                cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: calc(100vw - 3rem);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-success { background: #065F46; }
.toast-error   { background: #991B1B; }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--r-md);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: var(--c-red-bg);
    color: #B91C1C;
    border: 1px solid #FECACA;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
}

.empty-icon  { font-size:3.5rem;margin-bottom:1rem; }
.empty-title { font-size:1rem;font-weight:700; }
.empty-sub   { font-size:0.85rem;color:var(--c-text2);
               margin-top:0.4rem; }

/* ============================================
   LOADING DOTS
   ============================================ */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 0.75rem;
}

.loading-dots span {
    width: 7px;
    height: 7px;
    background: var(--c-text3);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%,80%,100% { opacity:0.3;transform:scale(0.8); }
    40%          { opacity:1;transform:scale(1.1); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 640px) {
    .modal-overlay { align-items: center; }
    .modal-sheet {
        max-width: 480px;
        border-radius: var(--r-2xl);
        margin-bottom: 2rem;
        max-height: 90dvh;
    }
    .ranking-item,
    .pilot-card {
        max-width: var(--max-w);
        margin: 0 auto;
    }
}

/* ============================================
   SAFE AREA
   ============================================ */
.app-header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--header-h) +
            env(safe-area-inset-top, 0px));
}

/* ============================================
   EVENT PICKER (multi-event assign)
   ============================================ */
.event-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.6rem;
    background: var(--c-surface2, #F8F9FA);
    border: 1.5px solid var(--c-border, #E4E6EA);
    border-radius: 12px;
}

.event-pick-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    background: white;
    border: 1.5px solid var(--c-border, #E4E6EA);
    border-radius: 10px;
    cursor: pointer;
    transition: all .12s;
}
.event-pick-item:hover {
    border-color: #0A0A0A;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.event-pick-item input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: #0A0A0A;
    flex-shrink: 0;
}
.event-pick-item input[type="checkbox"]:checked +
.ep-info .ep-name {
    color: #0A0A0A;
}

.ep-info {
    flex: 1;
    display: flex; flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.ep-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--c-text);
}
.ep-date {
    font-size: 0.75rem;
    color: var(--c-text2);
    font-weight: 500;
}

/* ============================================
   MATERIAL 3 - GLOBAL POLISH
   ============================================ */
body {
    background:
        radial-gradient(1200px 600px at 0% -10%,
            rgba(37,99,235,0.05), transparent 60%),
        radial-gradient(900px 500px at 100% 0%,
            rgba(245,197,24,0.06), transparent 60%),
        var(--c-bg);
}

.dashboard-body,
.admin-body,
.page-body {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   SECTION TITLE BAR (M3 Headline)
   ============================================ */
.section-title-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--c-text2);
    padding: 0.25rem 0.25rem 0.25rem;
    margin-top: 0.25rem;
}

.section-title-bar::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
        to right, var(--c-border), transparent);
}

/* ============================================
   STATS GRID (M3 Filled Cards)
   ============================================ */
.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .stats-grid-2 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .stats-grid-2 .stat-card-big {
        grid-column: span 2;
    }
}

.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

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

.stat-card-big {
    background: linear-gradient(
        135deg, #ffffff 0%, var(--c-surface3) 100%);
}

.stat-card-big::before {
    content: '';
    position: absolute;
    inset: auto -30% -40% auto;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle,
        rgba(37,99,235,0.08), transparent 70%);
    pointer-events: none;
}

.sc-icon {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--m3-primary-50);
    color: var(--m3-primary);
    border-radius: 12px;
    margin-bottom: 0.25rem;
}

.sc-val {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1;
    letter-spacing: -0.5px;
}

.sc-total {
    font-size: 1rem;
    color: var(--c-text3);
    font-weight: 500;
}

.sc-label {
    font-size: 0.82rem;
    color: var(--c-text2);
    font-weight: 600;
}

.sc-sub {
    font-size: 0.72rem;
    color: var(--c-green);
    font-weight: 700;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sc-bar {
    height: 6px;
    background: var(--c-surface3);
    border-radius: var(--r-full);
    margin-top: 0.6rem;
    overflow: hidden;
}

.sc-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg, var(--m3-primary-600), var(--c-gold));
    border-radius: var(--r-full);
    transition: width 0.5s ease;
}

/* ============================================
   ADMIN MENU GRID (M3 Outlined Tiles)
   ============================================ */
.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .admin-menu-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .admin-menu-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.admin-tile {
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--c-text);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.admin-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--m3-primary-50);
    opacity: 0;
    transition: opacity 0.2s;
}

.admin-tile:hover {
    border-color: var(--m3-primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.admin-tile:hover::before { opacity: 0.35; }

.admin-tile:active {
    transform: scale(0.97);
}

.admin-tile-icon,
.admin-tile-ico {
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--m3-primary-50);
    color: var(--m3-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.admin-tile-label,
.admin-tile-lbl {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--c-text);
    position: relative;
    z-index: 1;
}

.admin-tile-sub {
    font-size: 0.7rem;
    color: var(--c-text3);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ============================================
   GROUPE STATS (cards modernes)
   ============================================ */
.groupe-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill,
        minmax(240px, 1fr));
    gap: 0.75rem;
}

.groupe-stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.9rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gsc-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gsc-code {
    background: var(--grad-gold);
    color: var(--c-black);
    font-weight: 900;
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.gsc-nom {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--c-text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsc-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.gsc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--c-surface2);
    border-radius: var(--r-md);
    padding: 0.45rem 0.3rem;
}

.gsc-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1;
}

.gsc-key {
    font-size: 0.65rem;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 3px;
}

.gsc-progress {
    position: relative;
    height: 8px;
    background: var(--c-surface3);
    border-radius: var(--r-full);
    overflow: hidden;
}

.gsc-progress-bar {
    height: 100%;
    background: linear-gradient(
        90deg, var(--c-green), var(--m3-primary-600));
    border-radius: var(--r-full);
    transition: width 0.5s ease;
}

.gsc-pct {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--c-text2);
}

/* ============================================
   EVAL CARDS (ActivitÃ© Ã©valuateurs)
   ============================================ */
.eval-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.eval-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.8rem 0.9rem;
    box-shadow: var(--shadow-xs);
    gap: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.eval-card:hover {
    border-color: var(--m3-primary-600);
    box-shadow: var(--shadow-sm);
}

.eval-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
    min-width: 0;
}

.eval-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--m3-primary-50);
    color: var(--m3-primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    border: 2px solid var(--c-surface);
    box-shadow: 0 0 0 1px var(--c-border);
    position: relative;
}

.eval-avatar.eval-online {
    box-shadow: 0 0 0 2px var(--c-green);
}

.eval-avatar.eval-online::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c-green);
    border: 2px solid var(--c-surface);
}

.eval-info {
    min-width: 0;
    flex: 1;
}

.eval-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.online-dot {
    background: var(--c-green-bg);
    color: var(--c-green);
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: var(--r-full);
    letter-spacing: 0.4px;
}

.eval-meta {
    font-size: 0.75rem;
    color: var(--c-text3);
    margin-top: 2px;
}

.eval-stats {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.eval-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--c-surface2);
    border-radius: var(--r-md);
    padding: 0.35rem 0.55rem;
    min-width: 52px;
}

.eval-stat.es-today {
    background: var(--c-green-bg);
    color: var(--c-green);
}

.es-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1;
}

.eval-stat.es-today .es-val { color: var(--c-green); }

.es-key {
    font-size: 0.62rem;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

.eval-stat.es-today .es-key { color: var(--c-green); }

/* ============================================
   ACTIVITY LIST
   ============================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-xs);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border-radius: var(--r-md);
    transition: background 0.15s;
}

.activity-item:hover { background: var(--c-surface2); }

.act-note {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
    color: white;
}

.act-note.note-green  { background: var(--c-green); }
.act-note.note-yellow { background: #D97706; }
.act-note.note-orange { background: #EA580C; }
.act-note.note-red    { background: var(--c-red); }

.h-note-chip.note-green  { background: var(--c-green-bg); color: var(--c-green); }
.h-note-chip.note-yellow { background: var(--c-orange-bg); color: #92400E; }
.h-note-chip.note-orange { background: #FFEDD5; color: #9A3412; }
.h-note-chip.note-red    { background: var(--c-red-bg); color: var(--c-red); }

.act-info {
    flex: 1;
    min-width: 0;
}

.act-pilot {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.act-num {
    font-size: 0.75rem;
    color: var(--c-text3);
    font-weight: 500;
}

.act-grp {
    background: var(--m3-primary-50);
    color: var(--m3-primary-700);
    font-size: 0.66rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
}

.act-meta {
    font-size: 0.74rem;
    color: var(--c-text3);
    margin-top: 2px;
}

/* ============================================
   GENERIC M3 BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1.2rem;
    border-radius: var(--r-full);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    letter-spacing: 0.2px;
    min-height: 42px;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--c-black);
    color: var(--c-gold);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--m3-primary-50);
    color: var(--m3-primary-700);
}

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

.btn-outline {
    background: transparent;
    color: var(--c-text);
    border: 1.5px solid var(--c-border);
}

.btn-outline:hover {
    border-color: var(--m3-primary-600);
    color: var(--m3-primary-700);
}

.btn-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.btn-danger:hover { background: #FECACA; }

.btn-success {
    background: var(--c-green-bg);
    color: var(--c-green);
}

.btn-full { width: 100%; }

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    min-height: 34px;
}

/* FAB (floating action button) */
.fab {
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom,0));
    right: 1.25rem;
    z-index: 500;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--c-black);
    color: var(--c-gold);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.fab:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.fab:active { transform: scale(0.95); }

/* ============================================
   DATA TABLE (admin pages)
   ============================================ */
.data-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.data-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface2);
}

.data-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Wrapper auto-scroll horizontal pour tables */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
}

/* ============================================
   ROLE PICKER — liste horizontale M3
   ============================================ */
.role-picker {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.4rem;
}
.role-picker label {
    cursor: pointer;
    border: 2px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.6rem 0.85rem;
    background: var(--c-surface);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    position: relative;
}
.role-picker label:hover {
    border-color: var(--m3-primary-600);
    background: var(--c-surface2);
}
.role-picker input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.role-picker label:has(input:checked) {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.07);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}
.role-picker .role-ico {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}
.role-picker .role-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}
.role-picker .role-name {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1.2;
}
.role-picker .role-desc {
    font-size: 0.69rem;
    color: var(--c-text2);
    line-height: 1.3;
}

/* ============================================
   USER ROW (liste utilisateurs propre)
   ============================================ */
.user-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
    transition: background 0.15s;
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--c-surface2); }

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--grad-gold);
    color: var(--c-black);
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.user-avatar.role-admin   { background: linear-gradient(135deg,#1A1A2E,#0A0A0A); color: var(--c-gold); }
.user-avatar.role-master  { background: linear-gradient(135deg,#7C3AED,#4C1D95); color: #fff; }
.user-avatar.role-coach   { background: linear-gradient(135deg,#3B82F6,#1E40AF); color: #fff; }
.user-avatar.role-evaluateur { background: var(--grad-gold); color: var(--c-black); }
.user-avatar.inactive { filter: grayscale(1); opacity: 0.5; }

.user-info {
    flex: 1;
    min-width: 0;
}
.user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.user-meta {
    font-size: 0.74rem;
    color: var(--c-text3);
    margin-top: 2px;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}
.user-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 520px) {
    .user-row { padding: 0.75rem; gap: 0.6rem; }
    .user-avatar { width: 38px; height: 38px; }
    .user-actions { width: 100%; justify-content: flex-start; padding-left: 50px; margin-top: 4px; }
    .user-row { flex-wrap: wrap; }
}

/* ============================================
   FAB (Floating Action Button) M3
   ============================================ */
.fab-add {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--c-black);
    color: var(--c-gold);
    border: none;
    border-radius: var(--r-full);
    padding: 0.9rem 1.3rem;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.2s;
}
.fab-add:hover { transform: translateY(-2px); }
.fab-add:active { transform: scale(0.95); }

/* ============================================
   QR PRINT SHEET amÃ©liorÃ©
   ============================================ */
.qr-info-banner {
    background: var(--m3-primary-50);
    border: 1px solid var(--m3-primary-100);
    border-radius: var(--r-lg);
    padding: 1rem;
    color: var(--c-text);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.qr-info-banner strong { color: var(--c-black); }

/* ============================================
   FORCE no-overflow sur containers principaux
   ============================================ */
.admin-body, .page-body, .dashboard-body {
    overflow-x: hidden;
}
.card-panel, .data-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   PILOT NOTES PAGE (mes notes par pilote)
   ============================================ */
.pilot-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pilot-note-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
}
.pilot-note-chip {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    color: white;
    font-size: 1.15rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pilot-note-body {
    flex: 1;
    min-width: 0;
}
.pilot-note-time {
    font-size: 0.75rem;
    color: var(--c-text3);
}
.pilot-note-comment {
    font-size: 0.82rem;
    color: var(--c-text2);
    font-style: italic;
    margin-top: 2px;
}
.table-wrap > .data-table {
    border: none;
    border-radius: 0;
}
.data-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead th {
    background: var(--c-surface2);
    padding: 0.65rem 0.9rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--c-text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--c-border);
}

.data-table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--c-surface2);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--r-full);
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--c-surface3);
    color: var(--c-text2);
}

.chip-success { background: var(--c-green-bg); color: var(--c-green); }
.chip-danger  { background: var(--c-red-bg);   color: var(--c-red); }
.chip-info    { background: var(--m3-primary-50); color: var(--m3-primary-700); }
.chip-warn    { background: var(--c-orange-bg); color: #92400E; }
.chip-gold    { background: var(--grad-gold);  color: var(--c-black); }

/* ============================================
   EVENT ROW (admin/evenements)
   ============================================ */
.event-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: var(--r-md);
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.event-row:hover {
    border-color: var(--m3-primary-600);
}

.event-row-main {
    flex: 1;
    min-width: 200px;
}

.event-row-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.event-row-meta {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.event-row-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.eval-card-inactive {
    background: var(--c-surface2);
}

/* ============================================
   FORM GROUPS
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--c-text2);
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    transition: all 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--m3-primary-600);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit,
        minmax(180px, 1fr));
    gap: 0.75rem;
}

.card-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1rem;
    box-shadow: var(--shadow-xs);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 520px) {
    .eval-stats {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .eval-card {
        flex-wrap: wrap;
    }
    .admin-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================
   RACING PREMIUM HEADER (refonte)
   ============================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 300;
    height: calc(var(--header-h) +
            env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    background:
        linear-gradient(180deg,
            rgba(245,197,24,0.10) 0%,
            transparent 60%),
        linear-gradient(135deg,
            #0A0A0A 0%, #14141F 50%, #0F1726 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow:
        0 1px 0 rgba(245,197,24,0.18),
        0 8px 24px rgba(0,0,0,0.25);
}

.app-header::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--c-gold) 30%,
        var(--c-gold) 70%,
        transparent);
    opacity: 0.85;
    pointer-events: none;
}

.hdr-icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s,
                transform 0.15s;
}
.hdr-icon-btn:hover {
    background: rgba(245,197,24,0.18);
    border-color: rgba(245,197,24,0.35);
    color: var(--c-gold);
}
.hdr-icon-btn:active { transform: scale(0.95); }

.hdr-back-btn {
    background: rgba(245,197,24,0.08);
    border-color: rgba(245,197,24,0.2);
}
.hdr-back-btn:hover {
    background: rgba(245,197,24,0.18);
    border-color: rgba(245,197,24,0.4);
    color: var(--c-gold);
}
.hdr-logout {
    background: rgba(239,68,68,0.10);
    border-color: rgba(239,68,68,0.18);
}
.hdr-logout:hover {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.35);
    color: #FCA5A5;
}

.hdr-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.25rem;
}

.hdr-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.hdr-brand-logo img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.hdr-brand-txt {
    min-width: 0;
    flex: 1;
}

.hdr-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.hdr-sub {
    margin-top: 1px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hdr-past {
    background: rgba(245,197,24,0.18);
    color: var(--c-gold);
    font-weight: 800;
    font-size: 0.6rem;
    letter-spacing: 0.6px;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(245,197,24,0.3);
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* ============================================
   APP DRAWER
   ============================================ */
.app-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    visibility: hidden;
    pointer-events: none;
}

.app-drawer.active {
    visibility: visible;
    pointer-events: auto;
}

.drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    transition: opacity 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.app-drawer.active .drawer-overlay { opacity: 1; }

.drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 340px);
    background: linear-gradient(180deg,
        #14141F 0%, #0A0A0A 100%);
    color: #fff;
    transform: translateX(-105%);
    transition: transform 0.3s
                cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 30px 0 60px rgba(0,0,0,0.4);
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.app-drawer.active .drawer-panel {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: linear-gradient(135deg,
        rgba(245,197,24,0.08), transparent 60%);
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--grad-gold);
    color: var(--c-black);
    font-weight: 900;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(245,197,24,0.4);
}

.drawer-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.drawer-role {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.drawer-close {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.drawer-close:hover {
    background: rgba(255,255,255,0.12);
}

.drawer-event {
    margin: 0.85rem 0.85rem 0.5rem;
    padding: 0.85rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
}

.drawer-event-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: rgba(255,255,255,0.5);
    font-weight: 800;
}

.drawer-event-name {
    margin-top: 0.3rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--c-gold);
}

.drawer-event-meta {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
}

.drawer-event-tag {
    display: inline-block;
    background: rgba(245,197,24,0.18);
    color: var(--c-gold);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
}

.drawer-event-btn {
    margin-top: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: var(--c-gold);
    color: var(--c-black);
    border: none;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.drawer-event-btn:hover { background: #FFD843; }
.drawer-event-btn:active { transform: scale(0.97); }

.drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.12s, color 0.12s;
    position: relative;
}

.drawer-link svg {
    color: rgba(255,255,255,0.55);
    transition: color 0.12s;
    flex-shrink: 0;
}

.drawer-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.drawer-link:hover svg { color: var(--c-gold); }

.drawer-link.active {
    background: linear-gradient(90deg,
        rgba(245,197,24,0.18),
        rgba(245,197,24,0.04));
    color: var(--c-gold);
}
.drawer-link.active svg { color: var(--c-gold); }

.drawer-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--c-gold);
}

/* ── Drawer accordion groups ── */
.drawer-group { display: flex; flex-direction: column; }

.drawer-group-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    color: rgba(255,255,255,0.78);
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    width: 100%;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    margin-top: 0.2rem;
}
.drawer-group-head svg { color: rgba(255,255,255,0.45); flex-shrink: 0; transition: color 0.12s; }
.drawer-group-head:hover { background: rgba(255,255,255,0.06); color: #fff; }
.drawer-group-head:hover svg { color: var(--c-gold); }
.drawer-group-chevron {
    margin-left: auto;
    color: rgba(255,255,255,0.25);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.drawer-group-chevron.open { transform: rotate(180deg); }

.drawer-group-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 0.25rem;
}

.drawer-link--sub {
    font-size: 0.875rem;
    padding: 0.62rem 0.85rem 0.62rem 2rem;
}
.drawer-link--sub svg { width: 18px; height: 18px; }

.drawer-footer {
    padding: 0.7rem 0.85rem
             calc(0.7rem + env(safe-area-inset-bottom, 0));
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drawer-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #FCA5A5;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: background 0.15s;
}
.drawer-logout:hover {
    background: rgba(239,68,68,0.22);
    color: #FECACA;
}

.drawer-version {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* mobile-bottom-nav → refonte complète en bas du fichier */

/* ============================================
   EVENT SWITCHER (modal)
   ============================================ */
.ev-switch-sheet {
    max-width: 540px;
}

.ev-switch-head {
    padding: 0.75rem 1.2rem 1rem;
}
.ev-switch-head h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--c-text);
}
.ev-switch-head p {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--c-text2);
    line-height: 1.4;
}

.ev-switch-list {
    padding: 0 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.ev-switch-form { margin: 0; }

.ev-switch-item {
    width: 100%;
    text-align: left;
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0.85rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s,
                transform 0.1s;
    font-family: inherit;
    color: var(--c-text);
}

.ev-switch-item:hover {
    border-color: var(--m3-primary-600);
    background: var(--m3-primary-50);
}

.ev-switch-item:active { transform: scale(0.99); }

.ev-switch-item.is-current {
    border-color: var(--c-black);
    background: linear-gradient(135deg,
        var(--m3-primary-50), #fff);
    box-shadow: var(--shadow-sm);
}

.ev-switch-info {
    min-width: 0;
    flex: 1;
}

.ev-switch-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ev-switch-meta {
    font-size: 0.78rem;
    color: var(--c-text3);
    margin-top: 2px;
}

.ev-switch-tags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* ============================================
   BOUTON FERMER MODAL (générique)
   ============================================ */
.modal-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ============================================
   PRINT MODAL (sÃ©lecteurs imprimer)
   ============================================ */
/* En-tête minimaliste pour la modal impression */
.pf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}
.pf-head-title {
    font-size: 0.97rem;
    font-weight: 800;
    color: var(--c-text);
}
.pf-close-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--c-surface2);
    color: var(--c-text2);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.pf-close-btn:hover { background: var(--c-border); color: var(--c-text); }

.print-modal-sheet {
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.print-form {
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.pf-section {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--c-border);
}
.pf-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.pf-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--c-text);
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pf-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
}
.pf-label-row .pf-label { margin-bottom: 0; }

.pf-actions-mini {
    display: flex;
    gap: 0.35rem;
}
.pf-mini-btn {
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    color: var(--c-text2);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.pf-mini-btn:hover {
    background: var(--c-surface);
    border-color: var(--c-text2);
    color: var(--c-text);
}

.pf-radio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}
.pf-radio { display: block; cursor: pointer; }
.pf-radio input { display: none; }

.pf-radio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 0.85rem 0.6rem;
    transition: all 0.15s;
    min-height: 100px;
    justify-content: center;
}
.pf-radio-card:hover {
    border-color: var(--c-text);
    background: var(--c-surface2);
}
.pf-radio input:checked + .pf-radio-card {
    border-color: var(--c-black);
    background: linear-gradient(135deg, var(--c-black), #1a1a2e);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.pf-radio-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    line-height: 1;
}
.pf-radio-title {
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.1;
}
.pf-radio-sub {
    font-size: 0.7rem;
    margin-top: 0.2rem;
    opacity: 0.7;
}

.pf-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.4rem;
}
.pf-check { display: block; cursor: pointer; }
.pf-check input { display: none; }
.pf-check-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: 10px;
    padding: 0.55rem 0.4rem;
    transition: all 0.12s;
    line-height: 1.1;
    position: relative;
}
.pf-check-card strong {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--c-text);
}
.pf-check-card small {
    font-size: 0.66rem;
    margin-top: 0.2rem;
    color: var(--c-text2);
    font-weight: 600;
}
.pf-check input:checked + .pf-check-card {
    border-color: var(--c-gold);
    background: #FFFBEB;
}
.pf-check input:checked + .pf-check-card::after {
    content: '\2713';
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 0.75rem;
    color: var(--c-gold-dk);
    font-weight: 900;
}

.pf-hint {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--c-text3);
    font-style: italic;
}

.pf-segment {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--c-surface2);
    border-radius: var(--r-md);
    padding: 4px;
    border: 1px solid var(--c-border);
}
.pf-segment label { display: block; cursor: pointer; }
.pf-segment input { display: none; }
.pf-segment label > span {
    display: block;
    text-align: center;
    padding: 0.55rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--c-text2);
    border-radius: 8px;
    transition: all 0.15s;
}
.pf-segment input:checked + span {
    background: #fff;
    color: var(--c-black);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.pf-search {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.92rem;
    font-family: inherit;
    margin-bottom: 0.7rem;
    background: var(--c-surface);
    color: var(--c-text);
}
.pf-search:focus {
    outline: none;
    border-color: var(--c-black);
}

.pf-pilot-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface2);
    padding: 0.3rem;
    -webkit-overflow-scrolling: touch;
}

.pf-pilot-item {
    display: block;
    cursor: pointer;
    margin-bottom: 0.3rem;
}
.pf-pilot-item:last-child { margin-bottom: 0; }
.pf-pilot-item input { display: none; }
.pf-pilot-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #fff;
    border: 1.5px solid var(--c-border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    transition: all 0.12s;
}
.pf-pilot-card:hover { border-color: var(--c-text2); }
.pf-pilot-item input:checked + .pf-pilot-card {
    border-color: var(--c-gold);
    background: #FFFBEB;
    box-shadow: 0 2px 8px rgba(245,197,24,0.25);
}

.pf-pilot-num {
    background: var(--c-black);
    color: var(--c-gold);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.78rem;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.pf-pilot-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.pf-pilot-info strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-pilot-info small {
    font-size: 0.72rem;
    color: var(--c-text3);
    font-weight: 500;
    margin-top: 1px;
}

@media (max-width: 480px) {
    .pf-radio-grid { grid-template-columns: repeat(3, 1fr); }
    .pf-checks { grid-template-columns: repeat(3, 1fr); }
    .pf-segment label > span {
        font-size: 0.75rem;
        padding: 0.45rem 0.3rem;
    }
}

/* ============================================================
   MOBILE BOTTOM NAV — escamotable avec toggle
   ============================================================ */

/* ─── Toggle pill — onglet icône collé au bord droit, mobile uniquement ─── */
.nav-toggle-pill {
    position: fixed;
    bottom: calc(1.8rem + env(safe-area-inset-bottom, 0px));
    right: 0;
    z-index: 1400;
    display: none;                /* activé par @media max-width:900px */
    align-items: center;
    justify-content: center;
    background: rgba(10,10,10,0.95);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-right: none;
    border-radius: 12px 0 0 12px;
    padding: 0.65rem 0.55rem 0.65rem 0.7rem;
    cursor: pointer;
    color: rgba(255,255,255,0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -4px 0 20px rgba(0,0,0,0.45);
    transition: color 0.2s, background 0.2s, padding-right 0.2s;
}
.nav-toggle-pill:hover {
    color: var(--c-gold);
    padding-right: 0.75rem;
}
.nav-toggle-pill svg { flex-shrink: 0; display: block; }

/* ─── Le nav pill — caché par défaut, s'ouvre au-dessus du toggle ─── */
.mobile-bottom-nav {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1390;
    background: linear-gradient(180deg,
        rgba(14,17,28,0.97) 0%,
        rgba(10,10,10,0.99) 100%);
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.45),
        0 4px 16px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.06);
    border-radius: 22px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.4rem;
    /* Animation */
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.32,0.72,0,1),
                opacity 0.22s ease;
}
.mobile-bottom-nav.nav-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-bottom-link {
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    border-radius: 14px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.15px;
    position: relative;
    transition: color 0.18s ease, background 0.18s ease;
    padding: 0.25rem 0.1rem;
}

.mobile-bottom-link svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
    stroke-width: 2;
}

.mobile-bottom-link span {
    line-height: 1;
    white-space: nowrap;
    transition: color 0.18s;
}

.mobile-bottom-link:hover {
    color: rgba(255,255,255,0.85);
}

.mobile-bottom-link.active {
    color: var(--c-gold);
    background: rgba(245,197,24,0.12);
}

.mobile-bottom-link.active svg {
    transform: translateY(-2px) scale(1.12);
    filter: drop-shadow(0 2px 6px rgba(245,197,24,0.4));
}

.mobile-bottom-link.active span {
    color: var(--c-gold);
    font-weight: 800;
}

/* Indicateur actif — pill doré sous l'icône */
.mobile-bottom-link.active::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 3px;
    background: var(--c-gold);
    opacity: 0.8;
}

/* Pill en onglet droit — pas de padding vertical supplémentaire */
body.has-mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 900px) {
    .mobile-bottom-nav { display: grid; }
    .nav-toggle-pill    { display: flex;  }
}

/* ============================================================
   M3 FAB (Floating Action Button)
   ============================================================ */
.m3-fab {
    position: fixed;
    bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
    right: 1.2rem;
    z-index: 1360;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: var(--grad-gold);
    color: var(--c-black);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 20px rgba(245,197,24,0.45),
        0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.m3-fab svg { width: 28px; height: 28px; stroke-width: 2.5; }
.m3-fab:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 8px 32px rgba(245,197,24,0.55), 0 4px 12px rgba(0,0,0,0.25);
}
.m3-fab:active { transform: scale(0.95); }
.m3-fab.open { transform: rotate(45deg); }

.m3-fab { display: none !important; }

/* ============================================================
   M3 LOCK BANNER
   ============================================================ */
.lock-banner {
    border-radius: var(--r-xl);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border: 1.5px solid;
    transition: all 0.3s ease;
}
.lock-banner.locked {
    background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
    border-color: #FECDD3;
}
.lock-banner.unlocked {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border-color: #BBF7D0;
}
.lock-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.lock-banner.locked  .lock-icon-wrap { background: #FECDD3; }
.lock-banner.unlocked .lock-icon-wrap { background: #BBF7D0; }
.lock-text { flex: 1; min-width: 0; }
.lock-title {
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.2;
}
.lock-banner.locked  .lock-title { color: #BE123C; }
.lock-banner.unlocked .lock-title { color: #15803D; }
.lock-sub {
    font-size: 0.8rem;
    color: var(--c-text2);
    margin-top: 3px;
    line-height: 1.35;
}

/* ============================================================
   EVENT CARDS M3 (liste événements)
   ============================================================ */
.evcard {
    background: var(--c-surface);
    border-radius: var(--r-xl);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
}
.evcard:hover { box-shadow: var(--shadow-md); }
.evcard-main {
    display: flex;
    align-items: stretch;
}
.evcard-accent {
    width: 5px;
    flex-shrink: 0;
}
.evcard-accent.s-preparation { background: var(--m3-primary-600); }
.evcard-accent.s-en_cours    { background: var(--c-green); }
.evcard-accent.s-verrouille  { background: var(--c-red); }
.evcard-accent.s-archive     { background: var(--c-text3); }
.evcard-body {
    flex: 1;
    padding: 0.9rem 0.85rem 0.75rem;
    min-width: 0;
}
.evcard-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    line-height: 1.25;
}
.evcard-meta {
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--c-text2);
}
.evcard-summary {
    margin-top: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.evcard-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--c-surface3);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    padding: 0.18rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--c-text2);
}
.evcard-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--c-border);
}
.evcard-detail {
    border-top: 1px solid var(--c-border);
    display: none;
    animation: slideDown 0.2s ease;
}
.evcard-detail.open { display: block; }

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

.evcard-section {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--c-border);
}
.evcard-section:last-child { border-bottom: none; }
.evcard-section-title {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--c-text2);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.evcard-section-title svg {
    width: 14px; height: 14px; opacity: 0.6;
}

/* ============================================================
   M3 EVAL PICK ROWS
   ============================================================ */
.m3-eval-list { display: flex; flex-direction: column; gap: 0.35rem; }

.m3-eval-row {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-radius: var(--r-md);
    border: 1.5px solid var(--c-border);
    background: var(--c-surface2);
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}
.m3-eval-row.is-checked {
    background: #EFF6FF;
    border-color: var(--m3-primary-100);
}
.m3-eval-chk { display: none; }
.m3-eval-box {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid var(--c-border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.m3-eval-row.is-checked .m3-eval-box {
    background: var(--m3-primary-600);
    border-color: var(--m3-primary-600);
}
.m3-eval-box-check {
    color: white;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
    display: none;
}
.m3-eval-row.is-checked .m3-eval-box-check { display: block; }
.m3-eval-info { flex: 1; min-width: 0; }
.m3-eval-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m3-eval-role {
    font-size: 0.7rem;
    color: var(--c-text2);
    margin-top: 1px;
    text-transform: capitalize;
}
.m3-coef-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.m3-coef-lbl {
    font-size: 0.66rem;
    font-weight: 800;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.m3-coef-inp {
    width: 58px;
    padding: 0.3rem 0.4rem;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--c-text);
    font-family: inherit;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.m3-coef-inp:focus {
    outline: none;
    border-color: var(--m3-primary-600);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

/* ============================================================
   M3 POSTE CARDS
   ============================================================ */
.m3-poste-list { display: flex; flex-direction: column; gap: 0.5rem; }
.m3-poste-card {
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    background: white;
    overflow: hidden;
    transition: border-color 0.15s, opacity 0.2s;
}
.m3-poste-card.inactive { opacity: 0.5; }
.m3-poste-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: var(--c-surface2);
}
.m3-poste-code {
    font-size: 0.7rem;
    font-weight: 900;
    background: var(--grad-gold);
    color: var(--c-black);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    -webkit-print-color-adjust: exact;
}
.m3-poste-nom { flex: 1; font-weight: 700; font-size: 0.88rem; color: var(--c-text); }
.m3-poste-ordre {
    font-size: 0.7rem;
    color: var(--c-text3);
    font-weight: 600;
    background: var(--c-surface3);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}
.m3-poste-head .toggle-switch { margin-left: auto; flex-shrink: 0; }
.m3-poste-acts { display: flex; gap: 0.3rem; margin-left: 0.3rem; }
.m3-ico-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    color: var(--c-text2);
    font-size: 0.8rem;
}
.m3-ico-btn:hover { background: var(--c-bg); border-color: var(--c-text2); }
.m3-ico-btn.del:hover { background: var(--c-red-bg); color: var(--c-red); border-color: #FECACA; }
.m3-ico-btn svg { width: 14px; height: 14px; }

.m3-poste-users-wrap {
    padding: 0.6rem 0.8rem 0.7rem;
    border-top: 1px solid var(--c-border);
}
.m3-poste-users-label {
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--c-text3);
    margin-bottom: 0.45rem;
}
.m3-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.45rem;
}
.m3-chip-inp { display: none; }
.m3-chip-lbl {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-full);
    border: 1.5px solid var(--c-border);
    background: var(--c-surface2);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--c-text2);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.m3-chip-inp:checked + .m3-chip-lbl {
    background: var(--m3-primary-50);
    border-color: var(--m3-primary-600);
    color: var(--m3-primary-700);
    font-weight: 700;
}
/* Chip : occupé dans un autre poste (non coché ici) */
.m3-chip-lbl--busy {
    opacity: 0.45;
    border-style: dashed;
    cursor: pointer;
}
/* Chip : double affectation (coché ici ET dans un autre poste) */
.m3-chip-lbl--double {
    border-color: #D97706;
    color: #92400E;
    background: #FFFBEB;
}
.m3-chip-inp:checked + .m3-chip-lbl--double {
    background: #FEF3C7;
    border-color: #B45309;
    color: #78350F;
    font-weight: 700;
}

/* Légende postes */
.m3-postes-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.55rem 0.75rem;
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.72rem;
    color: var(--c-text3);
}
.m3-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.m3-legend-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: var(--r-full);
    border: 1.5px solid var(--c-border);
    background: var(--c-surface2);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--c-text2);
    white-space: nowrap;
}
.m3-legend-chip.m3-legend-active {
    background: var(--m3-primary-50);
    border-color: var(--m3-primary-600);
    color: var(--m3-primary-700);
}
.m3-legend-chip.m3-legend-busy {
    opacity: 0.45;
    border-style: dashed;
}
.m3-legend-chip.m3-legend-double {
    background: #FEF3C7;
    border-color: #B45309;
    color: #78350F;
}

/* ============================================================
   EVX WIZARD (bottom sheet création événement)
   ============================================================ */
.evx-step {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--c-border);
}
.evx-step:last-child { border-bottom: none; }
.evx-step-head {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.evx-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-black);
    color: var(--c-gold);
    font-weight: 900;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.evx-step-title { font-size: 0.92rem; font-weight: 800; color: var(--c-text); }
.evx-step-sub {
    font-size: 0.78rem;
    color: var(--c-text2);
    margin-top: 3px;
    line-height: 1.4;
}
.evx-field-help {
    font-size: 0.73rem;
    color: var(--c-text3);
    margin-top: 0.2rem;
    line-height: 1.4;
}
.evx-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.55rem;
}
.evx-check-card {
    padding: 0.85rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface2);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    display: block;
}
.evx-check-card input[type="checkbox"] {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: var(--m3-primary-600);
}
.evx-check-card:has(input:checked) {
    border-color: var(--m3-primary-600);
    background: var(--m3-primary-50);
}
.evx-check-main {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--c-text);
    padding-right: 1.5rem;
    display: block;
}
.evx-check-sub {
    font-size: 0.76rem;
    color: var(--c-text2);
    line-height: 1.4;
    padding-right: 1.5rem;
    margin-top: 3px;
    display: block;
}
.evx-eval-list { display: flex; flex-direction: column; gap: 0.35rem; }
.evx-eval-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface2);
    transition: background 0.15s;
}
.evx-eval-row--admin {
    background: rgba(245,197,24,0.07);
    border-color: rgba(245,197,24,0.35);
    opacity: 0.85;
}
.evx-eval-row--admin .evx-eval-coef { opacity: 0.5; }
.evx-eval-row--inactive { opacity: 0.6; }
.evx-eval-row--inactive .evx-eval-name { text-decoration: line-through; text-decoration-color: var(--c-text3); }
.evx-eval-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}
.evx-eval-main input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--m3-primary-600);
    flex-shrink: 0;
}
.evx-eval-name { font-size: 0.86rem; font-weight: 600; color: var(--c-text); }
.evx-eval-coef-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.evx-coef-lbl {
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--c-text3);
    letter-spacing: 0.4px;
}
.evx-eval-coef {
    width: 58px;
    padding: 0.3rem 0.35rem;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--c-text);
    font-family: inherit;
    background: white;
}
.evx-eval-coef:focus { outline: none; border-color: var(--m3-primary-600); }
.evx-create-actions {
    padding: 0.85rem 1.2rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
    position: sticky;
    bottom: 0;
}

/* ============================================================
   DANGER ZONE M3
   ============================================================ */
.danger-zone {
    border: 1.5px solid #FECACA;
    border-radius: var(--r-xl);
    background: linear-gradient(135deg, #FFFBFB 0%, #FFF5F5 100%);
    padding: 1.1rem;
}
.danger-zone-title {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--c-red);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================================================
   ADD POSTE INLINE FORM
   ============================================================ */
.m3-add-poste {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--c-surface2);
    border: 1.5px dashed var(--c-border);
    border-radius: var(--r-md);
}
.m3-add-poste-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-text2);
    margin-bottom: 0.6rem;
}
.m3-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.m3-add-row .form-group { margin-bottom: 0; flex: 1; min-width: 90px; }
.m3-add-row .form-group.narrow { flex: 0 0 70px; }

/* ============================================================
   QR-CHIP FILTER TOOLBAR  (participants, saisie, evaluateurs…)
   ============================================================ */
.qr-toolbar {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}
.qr-toolbar::-webkit-scrollbar { display: none; }

.qr-chip {
    padding: 0.35rem 0.85rem;
    border-radius: var(--r-full);
    border: 1.5px solid var(--c-border);
    background: var(--c-surface);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    color: var(--c-text2);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.qr-chip:hover:not(.active) { border-color: var(--c-text3); color: var(--c-text); }
.qr-chip.active { background: var(--c-black); color: var(--c-gold); border-color: var(--c-black); }

/* ============================================================
   DECIMAL NOTE SELECTOR  (saisie modal)
   ============================================================ */
.note-decimal-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.3rem 0 0.75rem;
    flex-wrap: wrap;
}
.ndec-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.1rem;
}
.ndec-btn {
    padding: 0.28rem 0.65rem;
    border-radius: var(--r-full);
    border: 1.5px solid var(--c-border);
    background: white;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: var(--c-text2);
    transition: all 0.15s;
}
.ndec-btn.selected { background: var(--c-gold); color: var(--c-black); border-color: var(--c-gold); }
.ndec-btn:hover:not(.selected) { border-color: var(--c-gold); }

/* ============================================================
   EVAL TOAST  (config, evaluateurs, participants…)
   ============================================================ */
.eval-toast {
    position: fixed;
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: #16A34A;
    color: #fff;
    border-radius: var(--r-full);
    padding: 0.65rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,.28);
}
.eval-toast-error { background: #B91C1C; }

/* ============================================================
   CHECKBOX GROUP  (multi-groupe participants)
   ============================================================ */
.checkbox-group { display:flex; flex-direction:column; gap:0.35rem; padding:0.35rem 0; }
.checkbox-item { display:flex; align-items:center; gap:0.6rem; cursor:pointer; padding:0.2rem 0; }
.checkbox-item input[type=checkbox] { width:1.05rem; height:1.05rem; accent-color:var(--c-gold); cursor:pointer; flex-shrink:0; margin:0; }
.checkbox-label { font-size:0.88rem; font-weight:500; color:var(--c-text); }

/* ============================================================
   SIDEBAR DESKTOP (≥ 1024px)
   Le drawer devient une colonne latérale fixe et permanente.
   Sur mobile, comportement inchangé (overlay + animation).
   ============================================================ */
:root { --sidebar-w: 320px; }

@media (min-width: 1024px) {

    /* Sidebar : colonne fixe gauche */
    .app-drawer {
        position: fixed;
        left: 0; top: 0; bottom: 0; right: auto;
        width: var(--sidebar-w);
        z-index: 400;
        visibility: hidden;
        pointer-events: none;
    }
    .app-drawer.active {
        visibility: visible;
        pointer-events: auto;
    }

    /* Pas d'overlay sur desktop */
    .app-drawer .drawer-overlay { display: none !important; }

    /* Panel : toujours déplié, sans animation de glissement */
    .app-drawer .drawer-panel {
        position: absolute;
        inset: 0;
        width: var(--sidebar-w);
        transform: none !important;
        transition: none !important;
        border-right: 1px solid rgba(255,255,255,0.07);
        box-shadow: 2px 0 20px rgba(0,0,0,0.35);
    }

    /* Pas de bouton Fermer en mode sidebar */
    .app-drawer .drawer-close { display: none !important; }

    /* Pousse tout le contenu à droite de la sidebar — s'applique
       à toutes les pages, quel que soit leur container interne. */
    body {
        transition: padding-left 0.25s ease;
    }
    body.desktop-sidebar-open {
        padding-left: var(--sidebar-w);
    }

    /* Icône hamburger → icône "panneau toggle" sur desktop */
    body.desktop-sidebar-open .hdr-menu-btn .bar-mid {
        opacity: 0;
        transform: scaleX(0);
    }
    body.desktop-sidebar-open .hdr-menu-btn .bar-top {
        transform: rotate(45deg) translate(5px, 5px);
    }
    body.desktop-sidebar-open .hdr-menu-btn .bar-bot {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* Masquer la nav mobile sur desktop */
@media (min-width: 1024px) {
    .mobile-bottom-nav,
    .nav-toggle-pill { display: none !important; }
}

/* iOS-style toggle switch (global) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex: none !important;
    cursor: pointer;
    vertical-align: middle;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--c-border);
    border-radius: 999px;
    transition: background .2s;
}
.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s;
}
.toggle-switch input:checked + .slider { background: #16a34a; }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* ── Tooltip badge ── */
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-surface3);
    border: 1px solid var(--c-border);
    color: var(--c-text3);
    font-size: 0.65rem;
    font-weight: 800;
    font-style: normal;
    cursor: help;
    vertical-align: middle;
    margin-left: 5px;
    flex-shrink: 0;
    user-select: none;
    transition: background .12s, color .12s, border-color .12s;
}
.tip:hover, .tip:focus { background: var(--c-gold); color: var(--c-black); border-color: var(--c-gold); outline: none; }

/* Bulle gérée par JS – appendée au body, z-index illimité */
#_appTip {
    position: fixed;
    background: #0F172A;
    color: #F1F5F9;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    max-width: 240px;
    white-space: normal;
    pointer-events: none;
    z-index: 2147483647;
    box-shadow: 0 6px 24px rgba(0,0,0,.28);
    opacity: 0;
    transition: opacity .15s;
    text-align: left;
}
#_appTip.visible { opacity: 1; }
#_appTip::before {
    content: '';
    position: absolute;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border: 5px solid transparent;
}
#_appTip.above::before { top: 100%;    border-top-color:    #0F172A; }
#_appTip.below::before { bottom: 100%; border-bottom-color: #0F172A; }