:root {
    --primary: #1a6b3c;
    --primary-light: #2d9d5e;
    --secondary: #e8f5e9;
    --accent: #f39c12;
    --danger: #e74c3c;
    --success: #27ae60;
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #dce1e7;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 10px;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 58px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nav-links { display: flex; gap: 4px; }

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-btn:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-btn.active { background: rgba(255,255,255,0.25); color: white; font-weight: 600; }

/* ── Container ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; }

h1 { font-size: 1.7rem; margin-bottom: 24px; color: var(--text); }
h2 { font-size: 1.2rem; margin-bottom: 16px; color: var(--text); }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modele-card.trained { border-left-color: var(--success); }
.modele-card.trained .stat-value { color: var(--success); }

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

/* ── Courses Grid ── */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.course-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 4px solid var(--border);
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border-left-color: var(--primary);
}

.course-card.quinte { border-left-color: var(--accent); }

.course-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.course-numero {
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
}

.course-card.quinte .course-numero { background: var(--accent); }

.course-heure {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.course-hippodrome {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 4px;
}

.course-nom {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tag {
    font-size: 0.73rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--secondary);
    color: var(--primary);
    font-weight: 600;
}

.tag.quinte-tag { background: #fef3cd; color: #856404; }

/* ── Toolbar ── */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #c5cdd6; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #219a52; }
.btn-danger { background: var(--danger); color: white; }

/* ── Inputs ── */
.input-field {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.88rem;
    background: white;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus { border-color: var(--primary); }

.input-sm { width: 70px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 0.82rem; }
.input-md { width: 150px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 0.82rem; }

/* ── Tables ── */
.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 11px 14px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--secondary); }

.data-table tr.rank-1 td { background: #fff9e6; font-weight: 600; }
.data-table tr.rank-2 td { background: #f8f9fa; }
.data-table tr.rank-3 td { background: #f0f7f4; }

/* ── Score Badge ── */
.score-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    min-width: 48px;
    text-align: center;
}

.score-high { background: #d4edda; color: #155724; }
.score-mid { background: #fff3cd; color: #856404; }
.score-low { background: #f8d7da; color: #721c24; }

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab {
    padding: 9px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Chart ── */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Form ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.83rem; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.partant-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

/* ── Result / Info boxes ── */
.result-box {
    margin-top: 14px;
    padding: 14px;
    background: var(--secondary);
    border-radius: 7px;
    border-left: 4px solid var(--primary);
    font-size: 0.88rem;
    line-height: 1.6;
}

.result-box.error { background: #fde8e8; border-left-color: var(--danger); }
.result-box.success { background: #e8f8f0; border-left-color: var(--success); }

.info-box {
    padding: 12px 16px;
    background: var(--secondary);
    border-radius: 7px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 999;
    transition: opacity 0.3s;
    max-width: 320px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ── Loading ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin-bottom: 14px;
}

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

/* ── Misc ── */
.hidden { display: none !important; }
.placeholder { color: var(--text-muted); font-style: italic; padding: 20px 0; }

.badge-quinte {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
    margin-left: 6px;
}

.rank-medal { font-size: 1.1rem; }

@media (max-width: 768px) {
    .navbar { padding: 0 12px; }
    .nav-brand { font-size: 1rem; }
    .nav-btn { padding: 7px 10px; font-size: 0.8rem; }
    .container { padding: 16px 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard : sections par date + réunions + podium ─────────────────── */
.date-section {
    margin-bottom: 28px;
}
.date-title {
    font-size: 1.25rem;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: linear-gradient(90deg, var(--primary, #2c7be5), transparent 70%);
    color: #fff;
    border-radius: 8px;
    text-transform: capitalize;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.date-iso {
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: normal;
}
.reunion-title {
    font-size: 1rem;
    margin: 14px 0 8px;
    padding: 6px 12px;
    background: var(--bg-light, #f5f5f5);
    border-left: 4px solid var(--primary, #2c7be5);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.reunion-count {
    color: var(--text-muted, #888);
    font-weight: normal;
    font-size: 0.82em;
}
.reunion-courses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.course-card.done {
    background: linear-gradient(180deg, #eef7ee 0%, #fff 50%);
    border-left: 3px solid #27ae60;
}
.course-card.done .course-heure {
    color: #27ae60;
    font-weight: 700;
    font-size: 0.85rem;
}
.course-card.upcoming .course-heure {
    color: var(--primary, #2c7be5);
    font-weight: 700;
}
.course-podium {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
    font-size: 0.82rem;
}
.podium-row {
    display: flex;
    gap: 6px;
    align-items: center;
    line-height: 1.3;
}
.podium-rank {
    min-width: 22px;
    font-size: 1rem;
}
.podium-num {
    color: var(--text-muted, #888);
    font-size: 0.78rem;
    min-width: 26px;
}
.podium-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ── Mobile first ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .reunion-courses {
        grid-template-columns: 1fr;
    }
    .date-title {
        font-size: 1.05rem;
        padding: 8px 10px;
    }
    .reunion-title {
        font-size: 0.95rem;
    }
    .course-card {
        min-height: 48px;
    }
    /* touch targets */
    .btn, .nav-btn, .tab {
        min-height: 44px;
    }
}

/* ── Barre de recherche courses ───────────────────────────────────────── */
.course-search-bar {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg-light, #f7f7fa);
    border-radius: 10px;
    align-items: center;
}
.course-search-bar input[type="search"],
.course-search-bar select {
    padding: 10px 12px;
    border: 1px solid #d0d0d8;
    border-radius: 8px;
    font-size: 0.92rem;
    min-height: 44px;
    background: #fff;
    font-family: inherit;
}
.course-search-bar input[type="search"]:focus,
.course-search-bar select:focus {
    outline: 2px solid var(--primary, #2c7be5);
    outline-offset: 0;
}
.course-card.highlight {
    box-shadow: 0 0 0 3px var(--primary, #2c7be5), 0 4px 12px rgba(44,123,229,0.3);
    transition: box-shadow 0.2s;
}
.reunion-group-hidden,
.course-card-hidden,
.date-section-hidden {
    display: none !important;
}

@media (max-width: 700px) {
    .course-search-bar {
        grid-template-columns: 1fr 1fr;
    }
    .course-search-bar input[type="search"] {
        grid-column: 1 / -1;
    }
    .course-search-bar select {
        font-size: 0.85rem;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   PHASE 2 — Mobile-first (Afrique : 360-414px, Android bas de gamme)
   ══════════════════════════════════════════════════════════════════════════ */

/* Bottom nav : cachée par défaut (desktop), affichée en mobile */
.bottom-nav { display: none; }

.bnav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 4px;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    min-height: 56px;
    -webkit-tap-highlight-color: rgba(44, 123, 229, 0.15);
    transition: color 0.15s;
}
.bnav-btn.active { color: var(--primary); font-weight: 700; }
.bnav-btn:active { background: rgba(44, 123, 229, 0.08); }
.bnav-ico { font-size: 1.35rem; line-height: 1; }
.bnav-lbl { font-size: 0.68rem; letter-spacing: 0.2px; }

/* ── Breakpoint mobile (≤768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Masquer la top nav et utiliser bottom nav */
    .navbar .nav-links { display: none; }
    .navbar {
        height: 52px;
        padding: 0 14px;
    }
    .nav-brand { font-size: 1.05rem; }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #fff;
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Laisser de la place sous le contenu pour la bottom-nav */
    .container {
        padding: 14px 12px 84px;
    }

    /* Tables : scroll horizontal si trop large */
    .data-table, table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Boutons plus gros (touch-friendly) */
    .btn, button.btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    /* Inputs pleine largeur */
    .input-field, input[type="text"], input[type="email"], input[type="password"],
    input[type="date"], input[type="time"], input[type="number"], input[type="search"], select {
        width: 100%;
        min-height: 44px;
        font-size: 16px; /* >=16px évite le zoom iOS au focus */
    }

    /* Cartes plus compactes */
    .card { padding: 14px; border-radius: 12px; }
    h1 { font-size: 1.35rem; margin-bottom: 14px; }
    h2 { font-size: 1.05rem; }

    /* Stats grid : 2 colonnes */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Course search bar : empile sur 1 col pour les plus petits */
    .course-search-bar { gap: 8px; }
}

/* ── Très petits écrans (≤400px, low-end Afrique) ───────────────────────── */
@media (max-width: 400px) {
    .container { padding: 12px 8px 80px; }
    .card { padding: 12px; }
    .nav-brand { font-size: 0.95rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px 8px; }

    .reunion-courses {
        grid-template-columns: 1fr !important;
    }
    .course-search-bar {
        grid-template-columns: 1fr !important;
    }
    .course-search-bar select,
    .course-search-bar input[type="search"] {
        grid-column: 1 / -1;
    }

    .bnav-lbl { font-size: 0.62rem; }
    .bnav-ico { font-size: 1.25rem; }
}

.course-selector { min-width: 300px; flex: 1; }

/* Indicateur réseau */
.net-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #c0392b;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    animation: netpulse 2s ease-in-out infinite;
}
.net-indicator.hidden { display: none !important; }
.net-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(255,255,255,0.9);
}
@keyframes netpulse { 0%,100% { opacity: 1 } 50% { opacity: 0.65 } }
@media (max-width: 500px) {
    .net-indicator .net-lbl { display: none; }
    .net-indicator { padding: 4px 8px; border-radius: 50%; }
}

/* Bouton "Installer l'app" dans la navbar */
.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-install:hover { background: rgba(255,255,255,0.28); }
.btn-install:active { background: rgba(255,255,255,0.38); }
.btn-install.hidden { display: none !important; }
.btn-install-ico { font-size: 1rem; }
@media (max-width: 500px) {
    .btn-install-lbl { display: none; }
    .btn-install { padding: 6px 10px; border-radius: 50%; min-width: 36px; min-height: 36px; justify-content: center; }
}

/* Page Analyse : tableaux denses → lisibles sur mobile */
@media (max-width: 768px) {
    .course-selector { min-width: 0; width: 100%; flex: 1 1 100%; }
    #page-analyse .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    #page-analyse .toolbar .btn { width: 100%; }

    .data-table th, .data-table td {
        padding: 8px 6px;
        font-size: 0.82rem;
        white-space: nowrap;
    }
    .data-table th:first-child, .data-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--card-bg);
        box-shadow: 2px 0 4px rgba(0,0,0,0.05);
        z-index: 1;
    }

    /* Onglets : scroll horizontal si trop larges */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        flex-wrap: nowrap;
    }
    .tabs .tab { flex-shrink: 0; }
}

/* Safe area top pour iPhone avec notch */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
        height: calc(58px + env(safe-area-inset-top));
    }
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER site + Bannière Jeu Responsable
   ══════════════════════════════════════════════════════════════════════ */
.site-footer {
    margin-top: 40px;
    padding: 24px 16px 32px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}
.footer-brand strong { color: var(--text); font-size: 0.95rem; }
.footer-tagline { display: block; margin-top: 2px; font-size: 0.8rem; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: color 0.15s, border-color 0.15s;
}
.footer-links a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.footer-legal {
    font-size: 0.75rem;
    opacity: 0.8;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

/* Bannière jeu responsable (sticky bottom) */
.rg-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9000;
    background: #3b0a0a;
    color: #fff0f0;
    border-top: 2px solid #ff4d6d;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    animation: rg-slide-up 0.35s ease-out;
}
.rg-banner.hidden { display: none; }
.rg-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.rg-text { flex: 1; min-width: 220px; font-size: 0.88rem; line-height: 1.4; }
.rg-text strong { color: #ffcbcb; }
.rg-dismiss {
    background: #ff4d6d;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.rg-dismiss:hover { background: #ff3355; }

@keyframes rg-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Dark mode : footer plus contrasté */
[data-theme="dark"] .site-footer {
    background: #07100d;
    border-top-color: #1e3528;
}
[data-theme="dark"] .footer-links a:hover { color: var(--primary); }

/* ══════════════════════════════════════════════════════════════════════
   DARK MODE — palette néon vert Equinox
   ══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --primary:       #00ff88;
    --primary-light: #33ffaa;
    --secondary:     #0f2a1c;
    --accent:        #00c2ff;
    --danger:        #ff4d6d;
    --success:       #00ff88;
    --bg:            #0a1410;
    --card-bg:       #101d18;
    --text:          #e8f5ee;
    --text-muted:    #8ca89a;
    --border:        #1e3528;
    --shadow:        0 2px 10px rgba(0,255,136,0.08);
}

[data-theme="dark"] body {
    background: radial-gradient(circle at 20% 0%, #0f2a1c 0%, #0a1410 60%);
}

[data-theme="dark"] .navbar {
    background: linear-gradient(90deg, #0a1410, #0f2a1c);
    border-bottom: 1px solid #1e3528;
    box-shadow: 0 0 20px rgba(0,255,136,0.15);
}
[data-theme="dark"] .nav-brand { color: var(--primary); text-shadow: 0 0 12px rgba(0,255,136,0.4); }
[data-theme="dark"] .nav-btn { color: rgba(232,245,238,0.65); }
[data-theme="dark"] .nav-btn:hover { background: rgba(0,255,136,0.08); color: var(--primary); }
[data-theme="dark"] .nav-btn.active { background: rgba(0,255,136,0.15); color: var(--primary); box-shadow: 0 0 10px rgba(0,255,136,0.2); }

[data-theme="dark"] .bottom-nav { background: #0a1410; border-top: 1px solid #1e3528; }
[data-theme="dark"] .bnav-btn { color: var(--text-muted); }
[data-theme="dark"] .bnav-btn.active { color: var(--primary); }

[data-theme="dark"] .stat-card,
[data-theme="dark"] .course-card,
[data-theme="dark"] .result-box,
[data-theme="dark"] .data-table {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
}
[data-theme="dark"] .stat-value { color: var(--primary); }
[data-theme="dark"] .stat-label { color: var(--text-muted); }
[data-theme="dark"] .modele-card.trained {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0,255,136,0.2);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #0a1410;
    font-weight: 700;
    border: none;
    box-shadow: 0 0 15px rgba(0,255,136,0.3);
}
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 0 25px rgba(0,255,136,0.5); }
[data-theme="dark"] .btn-secondary { background: #1e3528; color: var(--primary); border: 1px solid var(--border); }
[data-theme="dark"] .btn-success { background: var(--primary); color: #0a1410; }

[data-theme="dark"] .input-field,
[data-theme="dark"] select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="search"] {
    background: #0a1410;
    color: var(--text);
    border: 1px solid var(--border);
}
[data-theme="dark"] .input-field:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0,255,136,0.25);
    outline: none;
}

[data-theme="dark"] .data-table th { background: #0f2a1c; color: var(--primary); border-bottom: 1px solid var(--border); }
[data-theme="dark"] .data-table td { border-bottom: 1px solid var(--border); color: var(--text); }
[data-theme="dark"] .data-table tr:hover { background: rgba(0,255,136,0.04); }

[data-theme="dark"] .tabs { border-bottom: 1px solid var(--border); }
[data-theme="dark"] .tab { color: var(--text-muted); background: transparent; }
[data-theme="dark"] .tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); }

[data-theme="dark"] #quinte-focus-card {
    background: linear-gradient(135deg, #0f2a1c, #1a3d2a) !important;
    border: 1px solid var(--primary) !important;
    color: var(--text);
    box-shadow: 0 0 25px rgba(0,255,136,0.15) !important;
}

/* Bouton toggle thème */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 8px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .theme-toggle { border-color: var(--border); color: var(--primary); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(0,255,136,0.1); }

/* ── Badges ML sur course cards ─────────────────────────────────────────── */
.course-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.ml-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
    letter-spacing: 0.3px;
}
.ml-badge.value-bet {
    background: linear-gradient(135deg, #ffd700, #ff9500);
    color: #1a1a1a;
    box-shadow: 0 1px 3px rgba(255,149,0,0.4);
}
.ml-badge.conf-high {
    background: rgba(0, 255, 136, 0.15);
    color: #00c26a;
    border: 1px solid rgba(0, 255, 136, 0.5);
}
.ml-badge.conf-mid {
    background: rgba(0, 194, 255, 0.12);
    color: #0090c2;
    border: 1px solid rgba(0, 194, 255, 0.4);
}
[data-theme="dark"] .ml-badge.value-bet {
    box-shadow: 0 0 8px rgba(255,215,0,0.5);
}
[data-theme="dark"] .ml-badge.conf-high {
    color: #00ff88;
    box-shadow: 0 0 6px rgba(0,255,136,0.3);
}
[data-theme="dark"] .ml-badge.conf-mid {
    color: #00c2ff;
}
