:root {
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

.light {
    --card: rgba(255, 255, 255, 0.45);
    --card-subtle: rgba(255, 255, 255, 0.3);
    --border: rgba(255, 255, 255, 0.7);
    --text: #0f172a;
    --subtext: #334155;
    --input-bg: rgba(255, 255, 255, 0.7);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

.dark {
    --card: rgba(255, 255, 255, 0.08);
    --card-subtle: rgba(255, 255, 255, 0.03);
    --border: transparent;
    --text: #f8fafc;
    --subtext: #cbd5e1;
    --input-bg: rgba(0, 0, 0, 0.25);
    --shadow-hover: rgba(0, 0, 0, 0.8);
}

html.bg-default { background: #05080f; }
html.bg-mesh-1 { background: radial-gradient(at 0% 0%, #2a0845 0, transparent 50%), radial-gradient(at 100% 100%, #6441A5 0, transparent 50%), #0f0c29; }
html.bg-mesh-2 { background: radial-gradient(at 0% 100%, #0f2027 0, transparent 50%), radial-gradient(at 100% 0%, #203a43 0, transparent 50%), #2c5364; }
html.bg-mesh-3 { background: radial-gradient(at 100% 100%, #3a1c71 0, transparent 50%), radial-gradient(at 0% 0%, #d76d77 0, transparent 50%), #ffaf7b; }
html.bg-animated { background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364); }
.light.bg-animated { background: linear-gradient(to bottom, #74ebd5, #9face6); }
.light.bg-default { background: #f0f4f8; }
.light.bg-mesh-1 { background: radial-gradient(at 0% 0%, #e0c3fc 0, transparent 50%), radial-gradient(at 100% 100%, #8ec5fc 0, transparent 50%), #f8fafc; }
.light.bg-mesh-2 { background: radial-gradient(at 0% 100%, #a8e063 0, transparent 50%), radial-gradient(at 100% 0%, #56ab2f 0, transparent 50%), #e2e8f0; }
.light.bg-mesh-3 { background: radial-gradient(at 100% 100%, #ffecd2 0, transparent 50%), radial-gradient(at 0% 0%, #fcb69f 0, transparent 50%), #fff; }

.theme-blue   { --accent: #38bdf8; --accent-dark: #0284c7; --shadow-glow: rgba(56, 189, 248, 0.5); }
.theme-purple { --accent: #c084fc; --accent-dark: #9333ea; --shadow-glow: rgba(192, 132, 252, 0.5); }
.theme-green  { --accent: #4ade80; --accent-dark: #16a34a; --shadow-glow: rgba(74, 222, 128, 0.5); }
.theme-rose   { --accent: #fb7185; --accent-dark: #e11d48; --shadow-glow: rgba(251, 113, 133, 0.5); }
.theme-amber  { --accent: #facc15; --accent-dark: #ca8a04; --shadow-glow: rgba(250, 204, 21, 0.5); }

.light .icon-moon { display: inline-block; } .light .icon-sun { display: none; }
.dark .icon-moon { display: none; } .dark .icon-sun { display: inline-block; }

html, body { margin: 0; padding: 0; width: 100%; max-width: 100vw; overflow-x: hidden; }
body { color: var(--text); font-family: var(--font-family); padding: 20px 3vw 20px; box-sizing: border-box; min-height: 100vh; display: flex; flex-direction: column; }
html { transition: background 0.6s ease; min-height: 100vh; }

.icon { width: 18px; height: 18px; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; display: inline-block; transition: stroke 0.2s; }
.icon-lg { width: 22px; height: 22px; }
.header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.brand-container { display: flex; align-items: center; gap: 12px; }
.brand-logo-badge { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 8px 16px var(--shadow-glow); }
.brand-title { font-size: 1.45em; font-weight: 800; display: flex; align-items: center; gap: 8px; margin: 0; }
.version-tag { font-size: 0.45em; background: rgba(255,255,255,0.15); color: var(--accent); padding: 4px 10px; border-radius: 20px; font-weight: 800; border: 1px solid var(--accent); backdrop-filter: blur(5px); }

/* --- CORRECTION MOBILE POUR LE MENU UTILISATEUR --- */
.user-badge { 
    padding: 8px 16px; 
    border-radius: 30px; 
    font-weight: 700; 
    display: flex; 
    gap: 12px; 
    align-items: center; 
    font-size: 0.9em;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.user-badge::-webkit-scrollbar { display: none; } /* Safari/Chrome */
.user-badge > * { flex-shrink: 0; } /* Empêche l'écrasement des icônes sur petit écran */
/* ------------------------------------------------ */

.user-badge, .kpi-card, .card, .tab-nav, .welcome-banner {
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi-card { padding: 24px; border-radius: 20px; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth); }
.kpi-card:hover, .card:hover { transform: translateY(-4px); box-shadow: 0 20px 45px rgba(0,0,0,0.5); }
.kpi-title { font-size: 0.85em; font-weight: 700; color: var(--subtext); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 2em; font-weight: 800; }

.card { padding: 24px; border-radius: 22px; margin-bottom: 20px; transition: all 0.3s var(--ease-smooth); }

.tab-nav { display: flex; overflow-x: auto; gap: 6px; padding: 6px; border-radius: 16px; margin-bottom: 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn { flex: 1 1 auto; padding: 10px 14px; border: none; background: transparent; color: var(--subtext); font-weight: 700; font-size: 0.85em; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.25s var(--ease-smooth); white-space: nowrap; }
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.tab-btn.active { background: var(--accent); color: #0b0f19; box-shadow: 0 4px 16px var(--shadow-glow); transform: scale(1.03); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: slideUpFade 0.4s var(--ease-smooth); }

input:not([type="checkbox"]):not([type="radio"]), select, button { 
    padding: 12px 14px; margin: 6px 0; width: 100%; border-radius: 12px; 
    border: 1px solid var(--border); background: var(--input-bg); color: var(--text); 
    font-family: inherit; font-size: 14px; box-sizing: border-box; 
    transition: all 0.25s var(--ease-out-back); backdrop-filter: blur(10px); 
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus { 
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--shadow-glow); 
    background: rgba(255,255,255,0.1); transform: scale(1.01); 
}

input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 22px; height: 22px;
    background: var(--input-bg);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; margin-right: 12px;
    vertical-align: middle;
}
input[type="checkbox"]:checked {
    background: var(--accent); border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
    content: "✓"; color: #0b0f19; font-weight: 900; font-size: 14px;
}

select { background-color: var(--card) !important; }
.dark select, .dark select option { background-color: #0b1120 !important; color: #f8fafc !important; }
.light select, .light select option { background-color: #ffffff !important; color: #0f172a !important; }

button, .btn-action { cursor: pointer; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85em; }
button:hover, .btn-action:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow-hover); filter: brightness(1.15); }
button:active, .btn-action:active { transform: translateY(5px) scale(0.96) !important; box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important; filter: brightness(0.9); }

.theme-bubbles, .bg-bubbles { display: flex; gap: 8px; align-items: center; border-right: 1px solid rgba(255,255,255,0.2); padding-right: 12px; margin-right: 12px; }
.bubble { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: 2px solid rgba(255,255,255,0.2); }
.bubble:hover { transform: scale(1.3); box-shadow: 0 0 12px currentColor; }
.bubble:active { transform: scale(0.8); }

.fab-btn { position: fixed; bottom: 25px; right: 25px; width: 64px; height: 64px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 999; box-shadow: 0 10px 30px var(--shadow-glow); animation: pulseGlow 2.5s infinite; transition: transform 0.3s var(--ease-out-back); }
.fab-btn:hover { transform: scale(1.15) rotate(90deg); animation: none; box-shadow: 0 15px 40px var(--shadow-glow); }
.fab-btn:active { transform: scale(0.9) rotate(90deg) !important; }

.app-footer { text-align: center; padding: 25px; margin-top: auto; font-size: 0.85em; color: var(--subtext); font-weight: 600; letter-spacing: 0.05em; border-top: 1px solid rgba(255,255,255,0.1); border-radius: 24px 24px 0 0; background: var(--card); backdrop-filter: blur(20px); }
.contribution-card { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); padding: 16px; border-radius: 16px; transition: all 0.3s var(--ease-smooth); }
.contribution-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 10px 30px var(--shadow-hover); border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; transition: background 0.2s ease; }
th { font-size: 0.8em; text-transform: uppercase; color: var(--subtext); font-weight: 800; letter-spacing: 0.05em; }
tr:hover td { background: rgba(255,255,255,0.05); }
.badge-pill { padding: 6px 12px; border-radius: 20px; font-size: 0.75em; font-weight: 800; display: inline-block; backdrop-filter: blur(4px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.chart-container { position: relative; height: 260px; width: 100%; display: flex; justify-content: center; }
.flex-container { display: flex; gap: 16px; } .flex-col { flex: 1; min-width: 0; }

@media (max-width: 900px) { .flex-container { flex-direction: column; } body { padding: 10px 2vw 80px; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5); } 70% { box-shadow: 0 0 0 18px rgba(56, 189, 248, 0); } 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(25px) scale(0.98); filter: blur(8px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

/* =========================================
   6. PAYSAGES ANIMÉS
========================================= */
.animated-landscape { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1s ease; }
html.bg-animated .animated-landscape { opacity: 1; }

.cloud {
    position: absolute; background: rgba(255, 255, 255, 0.2); border-radius: 50px;
    animation: drift linear infinite;
    will-change: transform;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.cloud-1 { width: 120px; height: 40px; top: 15%; animation-duration: 80s; }
.cloud-1::before { width: 50px; height: 50px; top: -25px; left: 20px; }
.cloud-1::after { width: 40px; height: 40px; top: -15px; right: 20px; }
.cloud-2 { width: 80px; height: 25px; top: 30%; animation-duration: 120s; animation-delay: -40s; transform: scale(0.8) translate3d(0,0,0); }
.cloud-2::before { width: 35px; height: 35px; top: -15px; left: 15px; }

.tree { position: absolute; bottom: 0; width: 0; height: 0; border-left: 30px solid transparent; border-right: 30px solid transparent; border-bottom: 120px solid rgba(15, 23, 42, 0.15); transform-origin: bottom center; animation: windSway 6s ease-in-out infinite alternate; }
.dark .tree { border-bottom-color: rgba(255, 255, 255, 0.05); }
.tree-1 { left: 10%; border-bottom-width: 160px; animation-duration: 7s; }
.tree-2 { left: 15%; border-bottom-width: 100px; animation-delay: -2s; }
.tree-3 { right: 20%; border-bottom-width: 140px; animation-duration: 5s; }
.tree-4 { right: 12%; border-bottom-width: 180px; animation-delay: -4s; }

.house-container { position: absolute; bottom: 20px; right: 35%; width: 100px; height: 80px; background: rgba(15, 23, 42, 0.15); border-radius: 4px; }
.dark .house-container { background: rgba(255, 255, 255, 0.05); }
.house-container::before { content: ''; position: absolute; top: -40px; left: -10px; width: 0; height: 0; border-left: 60px solid transparent; border-right: 60px solid transparent; border-bottom: 40px solid rgba(15, 23, 42, 0.2); }
.dark .house-container::before { border-bottom-color: rgba(255, 255, 255, 0.08); }
.chimney { position: absolute; top: -30px; right: 15px; width: 15px; height: 25px; background: rgba(15, 23, 42, 0.2); }
.dark .chimney { background: rgba(255, 255, 255, 0.08); }
.smoke { position: absolute; top: -10px; left: 2px; width: 10px; height: 10px; background: rgba(15, 23, 42, 0.15); border-radius: 50%; animation: smokeRise 4s infinite linear; }
.smoke-2 { animation-delay: 2s; }
.dark .smoke { background: rgba(255, 255, 255, 0.1); }

@keyframes windSway { 0% { transform: rotate(-4deg); } 100% { transform: rotate(5deg); } }
@keyframes drift { from { transform: translateX(-200px) translate3d(0,0,0); } to { transform: translateX(110vw) translate3d(0,0,0); } }
@keyframes smokeRise { 0% { transform: translateY(0) scale(1); opacity: 0.8; } 100% { transform: translateY(-60px) scale(3); opacity: 0; } }