/* Profile Page Styles - Premium Redesign */

/* Variables spécifiques au profil (ne pas surcharger les tokens globaux) */
:root {
    --profile-bg: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --primary-soft: rgba(59, 130, 246, 0.1);
    --primary-text: #2563eb;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(59, 130, 246, 0.15);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --input-bg: #fafbfc;
    --detail-gradient: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    --title-gradient: -webkit-linear-gradient(45deg, #1e293b, #475569);
}

[data-theme="dark"] {
    --profile-bg: #0f172a;
    --card-bg: #1e293b;
    --card-border: #334155;
    --primary-soft: rgba(59, 130, 246, 0.2);
    --primary-text: #60a5fa;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    --input-bg: #0f172a;
    --detail-gradient: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --title-gradient: none;
}

[data-theme="neon"] {
    --profile-bg: #0f0f2d;
    --card-bg: #161633;
    --card-border: #2a2a5a;
    --primary-soft: rgba(0, 255, 159, 0.1);
    --primary-text: #00ff9f;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
    --shadow-hover: 0 20px 40px -10px rgba(0, 255, 159, 0.15);
    --input-bg: #1e1e42;
    --detail-gradient: linear-gradient(135deg, #161633 0%, #1e1e42 100%);
    --title-gradient: none;
}

[data-theme="forest"] {
    --profile-bg: #eeece6;
    --card-bg: #faf8f4;
    --card-border: #c8c1b3;
    --primary-soft: rgba(27, 94, 59, 0.1);
    --primary-text: #1b5e3b;
    --shadow-soft: 0 10px 40px -10px rgba(27, 94, 59, 0.1);
    --shadow-hover: 0 20px 40px -10px rgba(27, 94, 59, 0.18);
    --input-bg: #f5f2ec;
    --detail-gradient: linear-gradient(135deg, #faf8f4 0%, #edeae2 100%);
    --title-gradient: -webkit-linear-gradient(45deg, #1a2b17, #2d8659);
}

.profile-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 2rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}



.btn-danger-outline {
    background: rgba(254, 242, 242, 0.5);
    border: 1px solid #fee2e2;
    color: #ef4444;
}

[data-theme="dark"] .btn-danger-outline,
[data-theme="neon"] .btn-danger-outline {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.btn-danger-outline:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

[data-theme="dark"] .btn-danger-outline:hover,
[data-theme="neon"] .btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
    color: #fff;
}

.profile-layout {
    display: grid !important;
    grid-template-columns: 320px 1fr !important;
    gap: 3rem !important;
    min-height: 700px;
    align-items: start;
}

.profile-sidebar {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.profile-content {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

/* Ensure mobile-only elements don't take grid space on desktop */
.btn-floating-menu,
.mobile-nav-header {
    display: none !important;
}

@media (max-width: 1024px) {
    .profile-layout {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        min-height: 100vh;
        position: relative;
    }

    .profile-container {
        padding: 0;
    }

    /* Mutual Exclusion & Smooth Transitions */
    .profile-sidebar {
        display: none !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        grid-column: 1 !important;
        /* Force column on mobile */
        width: calc(100% - 20px) !important;
        height: auto !important;
        z-index: 10;
        background: var(--card-bg);
        padding: 1.5rem 1.25rem;
        padding-top: 5rem;
        transform: none !important;
        border-radius: 20px;
        box-shadow: var(--shadow-soft);
        margin: 10px;
        overflow-y: auto;
        opacity: 0;
        animation: fadeInMob 0.3s ease forwards;
        min-height: calc(100vh - 20px);
    }

    .profile-sidebar.mobile-visible {
        display: flex !important;
    }

    .profile-content {
        display: block;
        grid-column: 1 !important;
        /* Force column on mobile */
        padding: 1.5rem 1rem;
        padding-top: 5rem;
        min-height: calc(100vh - 20px);
        border-radius: 20px;
        box-shadow: var(--shadow-soft);
        border: none;
        background: var(--card-bg);
        margin: 10px;
        width: calc(100% - 20px);
        opacity: 1;
    }

    .profile-content:not(.mobile-hidden) {
        animation: fadeInMob 0.3s ease;
    }

    .profile-content.mobile-hidden {
        display: none !important;
    }

    @keyframes fadeInMob {
        from {
            opacity: 0;
            transform: translateY(5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Floating Hamburger Button */
    .btn-floating-menu {
        display: flex !important;
        position: absolute;
        top: 85px;
        left: 40px;
        z-index: 90;
        width: 38px;
        height: 38px;
        background: white;
        border: 1px solid var(--card-border);
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        color: #000;
    }

    .btn-floating-menu i {
        font-size: 20px;
    }

    .btn-floating-menu.active {
        background: var(--primary-soft);
        color: var(--primary-text);
        border-color: transparent;
    }

    [data-theme="dark"] .btn-floating-menu,
    [data-theme="neon"] .btn-floating-menu {
        background: #1e293b;
        color: #fff;
        border-color: #334155;
    }

    /* Mobile Navigation Header */
    .mobile-nav-header {
        display: flex !important;
        align-items: center;
        padding: 0 0 1rem 40px;
        border-bottom: 1px solid var(--card-border);
        margin-bottom: 1.5rem;
        min-height: 40px;
    }

    .mobile-title {
        font-size: 1.15rem;
        /* Reduced to avoid title wrapping */
        font-weight: 800;
        margin: 0;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .section-title {
        font-size: 1.4rem;
        /* Standardized */
        margin-top: 1rem;
    }

    .section-desc {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .setting-item {
        padding: 1.5rem !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1.5rem;
    }

    .theme-selector-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .theme-card {
        padding: 1.25rem;
        width: 100%;
    }

    .theme-preview {
        height: 120px;
    }
}

/* Hide mobile header on desktop */
.mobile-header {
    display: none;
}

/* Sidebar Styles */
.profile-sidebar {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Bordure subtile ajustée */
    position: sticky;
    top: 100px;
    /* Sticky pour suivre le scroll */
}

.user-summary {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    /* Dégradé plus vibrant */
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    margin-bottom: 0.5rem;
    border: 4px solid var(--card-bg);
    /* Bordure adaptative */
}

.user-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0;
}

.user-role {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    /* Les couleurs de badges sont gérées dans style.css normalement, mais on assure un fallback */
    background: var(--primary-soft);
    color: var(--primary-text);
    font-weight: 700;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.menu-item i:first-child {
    font-size: 1.4rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.menu-item .arrow-icon {
    margin-left: auto;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

/* Explicitly prevent hover color changes */
.menu-item:hover {
    background: var(--profile-bg);
    color: var(--text-main) !important;
}

.menu-item:hover i:first-child {
    color: var(--primary-text);
    opacity: 1;
}

.menu-item.active {
    background: var(--primary-soft);
    color: var(--primary-text);
}

.menu-item.active i:first-child {
    color: var(--primary-text);
    opacity: 1;
}

.menu-item.active .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

/* Content Styles - Glass effect look */
.profile-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    min-height: 600px;
    animation: fadeIn 0.4s ease-out;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    /* Propriété standard ajoutée */
    -webkit-text-fill-color: transparent;
}

/* Fallback couleur si gradient undefined ou none (hack CSS) */
[data-theme="dark"] .section-title,
[data-theme="neon"] .section-title {
    -webkit-text-fill-color: var(--text-main);
    background: none;
}


.section-desc {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Tab Content Wrapper */
.tab-content {
    width: 100%;
}

/* Settings Group */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    background: var(--card-bg);
    cursor: default;
}

/* .setting-item:hover removed */

/* Explicitly prevent hover interference */
.setting-item:hover:not(.disabled) {
    border-color: var(--primary-text);
    background: var(--card-bg);
}



.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    width: 100%;
}

.theme-card {
    cursor: pointer;
    border: 3px solid var(--card-border);
    border-radius: 28px;
    padding: 1.5rem;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.theme-card:hover {
    border-color: #94a3b8;
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.theme-card.active {
    border-color: var(--primary-text);
    background: var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-text), 0 20px 40px -10px var(--primary-soft);
}

.theme-card.active::after {
    content: '\eb7a';
    /* ri-checkbox-circle-fill */
    font-family: 'remixicon';
    position: absolute;
    top: 18px;
    right: 18px;
    color: var(--primary-text);
    font-size: 1.6rem;
    background: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-preview {
    width: 100%;
    height: 140px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    display: flex;
    background: #f1f5f9;
    transition: transform 0.5s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-sidebar {
    width: 35px;
    height: 100%;
    background: #e2e8f0;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 12px 6px;
    gap: 8px;
}

.preview-sidebar::before {
    content: '';
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    margin-bottom: 4px;
    opacity: 0.8;
}

.preview-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-header {
    height: 22px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.preview-header::after {
    content: '';
    width: 30%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

.preview-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-line {
    height: 6px;
    width: 100%;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
}

.preview-line.short {
    width: 60%;
}

/* Dark Preview Adjustments */
.dark .theme-preview {
    background: #0f172a;
    border-color: #1e293b;
}

.dark .preview-sidebar {
    background: #1e293b;
    border-right-color: rgba(255, 255, 255, 0.05);
}

.dark .preview-sidebar::before {
    background: #334155;
}

.dark .preview-header {
    background: #1e293b;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.dark .preview-header::after {
    background: #334155;
}

.dark .preview-line {
    background: rgba(255, 255, 255, 0.08);
}

.theme-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    z-index: 2;
}

.theme-label i {
    font-size: 1.4rem;
}

.setting-item.disabled {
    opacity: 0.8;
    /* Increased from 0.5 for better visibility */
    background: var(--input-bg);
    cursor: not-allowed;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.setting-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.setting-item h4 {
    margin: 0 0 0.25rem 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.setting-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Data Grid with improved cards */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.data-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.data-card:hover {
    color: var(--text-main) !important;
    border-color: rgba(59, 130, 246, 0.3);
}

/* Petit accent coloré au survol ou par défaut */
.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.3s ease;
}

/* .data-card:hover::before removed */


.data-card label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.75rem;
}

.data-card .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-word;
}

/* Stats Grid - Fixed Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Fallback for smaller screens */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    color: var(--text-main) !important;
    box-shadow: var(--shadow-hover);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-trend {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

/* Details Grid Row (Mobile Forfaits) */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 cards on the same line */
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.stat-progress-container {
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    width: 100%;
    margin-top: 4px;
    overflow: hidden;
}

.stat-progress-bar {
    height: 100%;
    background: var(--primary-text);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .stat-progress-container,
[data-theme="neon"] .stat-progress-container {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.form-row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Detail Card Style */
.detail-card {
    background: var(--detail-gradient);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.detail-card:hover {
    color: var(--text-main) !important;
    border-color: var(--primary-text);
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}


.empty-widget {
    padding: 4rem;
    text-align: center;
    border: 2px dashed var(--card-border);
    border-radius: var(--radius-lg);
    background: var(--input-bg);
}

/* Form Styles */
.input-wrapper {
    position: relative;
    transition: all 0.2s ease;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    /* Espace pour l'icône */
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--input-bg);
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-main);
}

.form-input:focus {
    background: var(--card-bg);
    border-color: var(--primary-text);
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
}

.form-input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-text);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-text);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: #1d4ed8;

    box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--profile-bg);
    color: var(--text-main) !important;
    border-color: #cbd5e1;
}

.btn-danger-outline {
    background: rgba(254, 242, 242, 0.5);
    border: 1px solid #fee2e2;
    color: #ef4444;
}

.btn-danger-outline:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Celestial Theme Overrides for Gamification Header */
/* Celestial Theme Overrides for Gamification Header */
.gamification-header.celestial-theme {
    background: transparent !important;
    border: none !important;
    padding: 0 2rem 2rem 2rem;
    box-shadow: none !important;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* New "Flat Planet" Level Indicator V3 */
.celestial-theme .level-planet {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    /* Elegant Flat Gradient */
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    box-shadow:
        0 10px 25px rgba(99, 102, 241, 0.4),
        0 0 0 4px rgba(255, 255, 255, 0.05);
    /* Subtle rim */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    margin-right: 2.5rem;
    animation: planetFloat 6s ease-in-out infinite;
}

/* Planet Ring */
.celestial-theme .level-planet::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg) skewX(20deg);
    width: 150%;
    height: 35%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-left-color: rgba(255, 255, 255, 0.1);
    border-right-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    z-index: -1;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

@keyframes planetFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.celestial-theme .level-planet .level-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.celestial-theme .level-planet .level-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.1em;
    margin-top: 2px;
}

/* XP Bar Container - Minimalist */
.celestial-theme .xp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.celestial-theme .xp-bar-container {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none;
    height: 6px;
    border-radius: 3px;
    box-shadow: none;
    overflow: hidden;
}

.celestial-theme .xp-bar {
    background: linear-gradient(90deg, #6366f1, #a855f7) !important;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
    border-radius: 3px;
    position: relative;
}

.celestial-theme .xp-bar::after {
    display: none;
    /* Remove supernova head */
}

.celestial-theme .xp-text {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.celestial-theme .leaderboard-btn {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.celestial-theme .leaderboard-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Tiered Trophy System Styles */
.tiered-trophy-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;

    /* --- UNIFIED CONSTELLATION CARDS (V40) --- */
    .constellation-card,
    .progression-path-card {
        /* background: linear-gradient(135deg, #0d0d12 0%, #1a1a24 100%) !important; Removed */
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-lg);
        padding: 1.5rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
        position: relative;
        overflow: visible;
        /* Allow labels to overflow if needed */
        min-height: 480px;
        display: flex;
        flex-direction: column;
    }

    .constellation-card::before,
    .progression-path-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image:
            radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
        background-size: 40px 40px;
        pointer-events: none;
        z-index: 0;
    }

    .path-header {
        position: relative;
        z-index: 10;
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .path-label {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-main);
        margin: 0;
    }

    .path-meta {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin: 0;
    }

    .constellation-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: #fff;
        /* background: linear-gradient(135deg, var(--primary), var(--primary-dark)); */
        background: var(--icon-bg, linear-gradient(135deg, var(--primary), var(--primary-dark)));
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .path-realm-container {
        position: relative;
        flex: 1;
        width: 100%;
        min-height: 300px;
        z-index: 5;
    }

    .stars-connection-svg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
        overflow: visible;
    }

    .star-line {
        stroke: rgba(255, 255, 255, 0.1);
        stroke-width: 1.5;
        stroke-dasharray: 4;
        transition: all 1s ease;
    }

    /* STAR CORE & GLOW */
    .star-core {
        width: 48px !important;
        height: 48px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.2);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2;
    }

    .unlocked .star-core {
        background: radial-gradient(circle at 30% 30%, #fff, rgba(255, 255, 255, 0.8)) !important;
        border-color: #fff !important;
        color: var(--primary);
        box-shadow: 0 0 20px #fff, 0 0 40px rgba(255, 255, 255, 0.3);
        animation: celestialPulse 4s infinite ease-in-out;
    }

    @keyframes celestialPulse {

        0%,
        100% {
            transform: scale(1);
            filter: brightness(1);
        }

        50% {
            transform: scale(1.1);
            filter: brightness(1.3);
        }
    }

    .constellation-star {
        text-align: center;
        transform: translate(-50%, -50%);
        z-index: 3;
    }

    .constellation-star .node-label {
        position: absolute;
        top: 55px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: rgba(255, 255, 255, 0.9) !important;
        text-shadow: 0 2px 8px #000;
        white-space: normal;
        pointer-events: none;
        width: max-content;
        text-align: center;
    }

    .constellation-star .node-description {
        bottom: 120%;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        background: rgba(0, 0, 0, 0.95);
        padding: 0.5rem 0.75rem;
        border-radius: 4px;
        font-size: 0.7rem;
        width: 150px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 100;
        border: 1px solid rgba(255, 255, 255, 0.1);
        line-height: 1.4;
        color: #fff;
    }

    .constellation-star:hover .node-description {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .constellation-star:hover {
        transform: translate(-50%, -50%);
        /* No scale, just maintain center */
        z-index: 10;
    }

    .unlocked:hover .star-core {
        filter: brightness(1.25);
        box-shadow: 0 0 30px #fff, 0 0 60px rgba(255, 255, 255, 0.4);
    }

    /* --- Constellation Icon Theme Overrides (V40) --- */
    .theme-sales_perso .constellation-icon,
    .theme-sales_team .constellation-icon {
        background: linear-gradient(135deg, #facc15, #ca8a04);
    }

    .theme-nps .constellation-icon {
        background: linear-gradient(135deg, #34d399, #059669);
    }

    .theme-game_snake .constellation-icon {
        background: linear-gradient(135deg, #22c55e, #14532d);
    }

    .theme-game_hextris .constellation-icon {
        background: linear-gradient(135deg, #d946ef, #701a75);
    }

    .theme-game_2048 .constellation-icon {
        background: linear-gradient(135deg, #6366f1, #312e81);
    }

    .theme-delay .constellation-icon {
        background: linear-gradient(135deg, #06b6d4, #0891b2);
    }

    .theme-game_meta .constellation-icon {
        background: linear-gradient(135deg, #fbbf24, #b45309);
    }

    .theme-game_virus_strike .constellation-icon {
        background: linear-gradient(135deg, #22c55e, #14532d);
        /* Scribe / Matrix Green */
    }

    .theme-game_skyline_builder .constellation-icon {
        background: linear-gradient(135deg, #0ea5e9, #0369a1);
        /* Turris Babel / Electric Blue */
    }

    .theme-game_flappy_box .constellation-icon {
        background: linear-gradient(135deg, #4ade80, #16a34a);
        /* Flappy Box / Green */
    }

    .theme-discovery_exploration .constellation-icon {
        background: linear-gradient(135deg, #10b981, #064e3b);
    }

    .theme-discovery_expertise .constellation-icon {
        background: linear-gradient(135deg, #3b82f6, #1e3a8a);
    }

    .theme-discovery_mastery .constellation-icon {
        background: linear-gradient(135deg, #ef4444, #c2410c);
        /* Phénix / Red-Orange */
    }

    .realm-node .node-label {
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 5px rgba(0, 0, 0, 0.5);
    }

    .progression-path-card {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: var(--radius-lg);
        padding: 2.5rem;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-soft);
        position: relative;
        overflow: hidden;
        margin-bottom: 2.5rem;
    }

    .path-header {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
        position: relative;
        z-index: 10;
    }

    .path-icon {
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, var(--primary-text), #818cf8);
        color: white;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(var(--primary-rgb, 59, 130, 246), 0.3);
    }

    .path-label {
        font-size: 1.5rem;
        font-weight: 800;
        margin: 0;
        color: #fff !important;
        /* Force white for visibility */
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    /* FORCED CONTRAST FOR THEMED CARDS */
    .progression-path-card[class*="theme-"] .path-label {
        color: #ffffff !important;
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    }

    .progression-path-card[class*="theme-"] .path-meta {
        color: rgba(255, 255, 255, 0.8) !important;
        font-weight: 700;
    }

    .progression-path-card[class*="theme-"] .path-icon {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .path-meta {
        font-size: 0.95rem;
        color: var(--text-muted);
        font-weight: 600;
    }

    .path-track-container {
        padding: 4rem 1rem 4rem 1rem;
        overflow-x: auto;
        width: 100%;
    }

    .path-track {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        min-width: 600px;
        /* Ensure horizontal line on small space */
        padding: 0 20px;
    }

    .track-line-bg {
        position: absolute;
        top: 20px;
        left: 40px;
        right: 40px;
        height: 4px;
        background: var(--card-border);
        z-index: 1;
        border-radius: 2px;
    }

    .track-line-fill {
        position: absolute;
        top: 20px;
        left: 40px;
        height: 4px;
        background: var(--primary-text);
        z-index: 2;
        border-radius: 2px;
        transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .tier-node {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        position: relative;
        z-index: 5;
        flex: 1;
        cursor: help;
        transition: transform 0.3s ease;
    }

    .tier-node:hover {
        transform: translateY(-5px);
    }

    .tier-node.staggered-down:hover {
        transform: translateY(5px);
    }

    .node-dot {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--card-bg);
        border: 3px solid var(--card-border);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: var(--text-muted);
        transition: all 0.4s ease;
        box-shadow: 0 0 0 4px var(--card-bg);
    }

    .tier-node.unlocked .node-dot {
        background: var(--primary-text);
        border-color: var(--primary-text);
        color: white;
        box-shadow: 0 0 15px var(--primary-soft);
    }

    /* --- Constellation/Celestial Theme Base for ALL Nodes --- */
    .constellation-star .node-dot,
    .realm-node .node-dot {
        background: rgba(15, 23, 42, 0.6) !important;
        /* Darker glass base */
        border: 3px solid rgba(255, 255, 255, 0.3) !important;
        /* Silver border for locked */
        color: rgba(255, 255, 255, 0.5) !important;
        /* Dim icon */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(4px);
        width: 48px !important;
    }

    /* --- CLEANED UP PRIVACY STYLES --- */



    /* Unlocked / Gold Override */
    .constellation-star.unlocked .node-dot,
    .realm-node.unlocked .node-dot {
        background: rgba(15, 23, 42, 0.8) !important;
        border-color: #eab308 !important;
        color: #fbbf24 !important;
        box-shadow: 0 0 20px rgba(234, 179, 8, 0.4), inset 0 0 10px rgba(234, 179, 8, 0.2) !important;
    }

    /* Brighter Halo on Hover (Unlocked) */
    .constellation-star.unlocked:hover .node-dot,
    .realm-node.unlocked:hover .node-dot {
        box-shadow: 0 0 35px rgba(234, 179, 8, 0.8), inset 0 0 20px rgba(234, 179, 8, 0.5) !important;
        background: rgba(15, 23, 42, 0.95) !important;
        transform: scale(1.1);
        border-color: #fce7f3;
    }

    /* Locked/Standard Hover Effect */
    .constellation-star:not(.unlocked):hover .node-dot,
    .realm-node:not(.unlocked):hover .node-dot {
        border-color: rgba(255, 255, 255, 0.8) !important;
        color: white !important;
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.3) !important;
        transform: scale(1.05);
    }

    /* --- Stellar Header Fixes (Visibility) --- */
    .stellar-header-section .section-title {
        background: none !important;
        -webkit-text-fill-color: white !important;
        color: white !important;
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
        opacity: 1 !important;
    }

    .stellar-header-section p {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    /* --- XP Text Fixes --- */
    .xp-text {
        font-family: 'Inter', sans-serif;
        font-weight: 700;
        font-size: 0.9rem;
        color: white !important;
        /* Force Full White for "250 / 700 XP" */
        letter-spacing: 0.05em;
        opacity: 1 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    }

    .xp-text span:first-child {
        color: #60a5fa !important;
        /* Bright Blue for current XP */
        font-size: 1.1rem;
        font-weight: 800;
        text-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
        margin-right: 4px;
    }

    .tier-node.next .node-dot {
        border-color: var(--primary-text);
        color: var(--primary-text);
        border-style: dashed;
    }

    .node-label {
        font-size: 0.75rem;
        font-weight: 700;
        text-align: center;
        position: absolute;
        top: 55px;
        width: 140px;
        color: var(--text-muted);
        transition: all 0.3s ease;
        line-height: 1.2;
        pointer-events: none;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .tier-node.staggered-down .node-label {
        top: auto;
        bottom: 55px;
    }

    .tier-node.unlocked .node-label {
        color: var(--text-main);
    }

    .tier-node.current .node-label {
        color: var(--primary-text);
        font-weight: 800;
        font-size: 0.8rem;
        background: var(--primary-soft);
        padding: 2px 8px;
        border-radius: 6px;
        transform: translateY(4px);
    }

    .tier-node.staggered-down.current .node-label {
        transform: translateY(-4px);
    }

    .node-description {
        position: absolute;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        width: 140px;
        font-size: 0.7rem;
        line-height: 1.2;
        text-align: center;
        opacity: 0;
        pointer-events: none;
        transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        background: var(--card-bg);
        color: var(--text-main);
        padding: 6px 10px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        z-index: 20;
        border: 1px solid var(--card-border);
        bottom: 55px;
        /* Default: Above the node */
    }

    /* Hover State: Slide Up from Bottom */
    .tier-node:hover .node-description {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }

    /* Staggered (Label Top) -> Description Bottom */
    .tier-node.staggered-down .node-description {
        top: 55px;
        bottom: auto;
        transform: translateX(-50%) translateY(-10px);
    }

    /* Hover State Staggered: Slide Down from Top */
    .tier-node.staggered-down:hover .node-description {
        opacity: 1;
        transform: translateX(-50%) translateY(5px);
    }

    .path-footer {
        border-top: 1px solid var(--card-border);
        margin-top: 1rem;
        padding-top: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .next-challenge {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .next-challenge .label {
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.5) !important;
        /* Lighter white */
        font-weight: 600;
    }

    .next-challenge .value {
        font-size: 0.9rem;
        color: #fff !important;
        /* Direct white */
        font-weight: 700;
    }

    .xp-reward {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff !important;
        border-radius: 99px;
        padding: 4px 12px;
        font-size: 0.8rem;
        font-weight: 800;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }

    .realm-track-line-bg {
        position: absolute;
        top: 50%;
        left: 5%;
        right: 5%;
        height: 4px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 2px;
        transform: translateY(-50%);
        z-index: 1;
    }

    .realm-track-line-fill {
        position: absolute;
        top: 50%;
        left: 5%;
        height: 4px;
        background: var(--primary);
        border-radius: 2px;
        transform: translateY(-50%);
        z-index: 2;
        transition: width 1s ease;
        box-shadow: 0 0 10px var(--primary);
    }

    .progression-path-card {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: var(--radius-lg);
        padding: 2rem;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-sm);
        position: relative;
        overflow: hidden;
        margin-bottom: 2rem;
    }

    /* --- Trophy System Styles --- */
    .trophy-section {
        margin-top: 3rem;
    }

    .trophy-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .trophy-header i {
        font-size: 1.5rem;
        color: #eab308;
        /* Yellow */
    }

    .trophy-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .trophy-card {
        background: var(--card-bg);
        border: 2px dashed var(--card-border);
        border-radius: var(--radius-md);
        padding: 1.5rem;
        text-align: center;
        position: relative;
        transition: all 0.3s ease;
        opacity: 0.6;
        filter: grayscale(1);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .trophy-card.unlocked {
        background: var(--card-bg);
        /* Use card-bg but maybe add a gradient or glow */
        border: 2px solid transparent;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
        opacity: 1;
        filter: none;
    }

    .trophy-card.unlocked:hover {

        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

    .trophy-icon-wrapper {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: var(--input-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: var(--text-muted);
        transition: all 0.3s ease;
    }

    .trophy-card.unlocked .trophy-icon-wrapper {
        background: rgba(255, 255, 255, 0.8);
        /* Lighter bg for icon in unlocked state */
        box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    }

    .dark .trophy-card.unlocked .trophy-icon-wrapper {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Utilities for Colors (since Tailwind might be missing) */
    .text-yellow-500 {
        color: #eab308 !important;
    }

    .text-blue-500 {
        color: #3b82f6 !important;
    }

    .text-purple-500 {
        color: #a855f7 !important;
    }

    .text-indigo-500 {
        color: #6366f1 !important;
    }

    .text-red-500 {
        color: #ef4444 !important;
    }

    .text-green-500 {
        color: #22c55e !important;
    }

    .text-teal-500 {
        color: #14b8a6 !important;
    }

    .text-orange-500 {
        color: #f97316 !important;
    }

    .text-blue-400 {
        color: #60a5fa !important;
    }

    .text-green-600 {
        color: #16a34a !important;
    }

    .text-yellow-600 {
        color: #ca8a04 !important;
    }

    .text-gray-400 {
        color: #9ca3af !important;
    }

    .trophy-content {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .trophy-title {
        font-weight: 700;
        font-size: 0.9rem;
        color: var(--text-muted);
    }

    .trophy-card.unlocked .trophy-title {
        color: var(--text-main);
    }

    .trophy-desc {
        font-size: 0.75rem;
        color: var(--text-muted);
        line-height: 1.3;
    }

    .trophy-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        color: #eab308;
        font-size: 1.2rem;
        animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes bounceIn {
        from {
            opacity: 0;
            transform: scale(0.5);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .privacy-toggle-wrapper {
        cursor: pointer;
        display: flex;
        align-items: center;
    }

    .privacy-toggle-track {
        position: relative;
        width: 52px;
        height: 30px;
        border-radius: 99px;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        background-color: var(--card-border);
    }

    .privacy-toggle-track.active {
        background-color: var(--primary);
        box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
    }

    .privacy-toggle-handle {
        position: absolute;
        top: 3px;
        left: 3px;
        width: 24px;
        height: 24px;
        background: white;
        border-radius: 50%;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .privacy-toggle-handle.active {
        transform: translateX(22px);
    }

    .privacy-toggle-handle i {
        font-size: 14px;
        color: var(--primary);
    }

    /* Token Management Fixes */
    .token-preview-box {
        background: var(--input-bg);
        border: 1px solid var(--card-border);
        padding: 10px;
        border-radius: 8px;
        font-size: 11px;
        word-break: break-all;
        font-family: monospace;
        color: var(--text-main);
    }

    .token-new-box {
        background: rgba(var(--primary-rgb), 0.1);
        border: 1px solid rgba(var(--primary-rgb), 0.3);
        border-radius: var(--radius-md);
        padding: 1.5rem;
    }

    /* Fin de la section Constellation */
}

/* ==========================================================================
   PRIVACY CARD
   ========================================================================== */
.privacy-card.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.privacy-card.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.8;
}

.privacy-card.premium-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.privacy-info {
    flex: 1 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.privacy-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.privacy-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

[data-theme="dark"] .privacy-card.premium-card,
[data-theme="neon"] .privacy-card.premium-card {
    background: var(--bg-card);
    border-color: var(--card-border);
}

/* ==========================================================================
   PREMIUM STATS OVERVIEW (Profile Only)
   ========================================================================== */
.stats-grid-premium {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeIn 0.4s ease-out;
}

.stat-card-premium {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

[data-theme="dark"] .stat-card-premium,
[data-theme="neon"] .stat-card-premium {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

/* Gradient Accents & Icons */
.stat-card-premium.glass-blue {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(239, 246, 255, 0.6));
    border-top: 4px solid #3b82f6;
}

.stat-card-premium.glass-emerald {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(236, 253, 245, 0.6));
    border-top: 4px solid #10b981;
}

.stat-card-premium.glass-amber {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 251, 235, 0.6));
    border-top: 4px solid #f59e0b;
}

.stat-card-premium.glass-rose {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 241, 242, 0.6));
    border-top: 4px solid #f43f5e;
}

/* Dark Mode Gradients */
[data-theme="dark"] .stat-card-premium,
[data-theme="neon"] .stat-card-premium {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .stat-card-premium.glass-blue,
[data-theme="neon"] .stat-card-premium.glass-blue {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(59, 130, 246, 0.1));
}
[data-theme="dark"] .stat-card-premium.glass-emerald,
[data-theme="neon"] .stat-card-premium.glass-emerald {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(16, 185, 129, 0.1));
}
[data-theme="dark"] .stat-card-premium.glass-amber,
[data-theme="neon"] .stat-card-premium.glass-amber {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(245, 158, 11, 0.1));
}
[data-theme="dark"] .stat-card-premium.glass-rose,
[data-theme="neon"] .stat-card-premium.glass-rose {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(244, 63, 94, 0.1));
}

/* Neon Mode Gradients */
[data-theme="neon"] .stat-card-premium {
    background: rgba(22, 22, 51, 0.7);
    border-color: rgba(0, 255, 159, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="neon"] .stat-card-premium.glass-blue {
    background: linear-gradient(145deg, rgba(22, 22, 51, 0.8), rgba(0, 210, 255, 0.1));
}
[data-theme="neon"] .stat-card-premium.glass-emerald {
    background: linear-gradient(145deg, rgba(22, 22, 51, 0.8), rgba(0, 255, 159, 0.1));
}
[data-theme="neon"] .stat-card-premium.glass-amber {
    background: linear-gradient(145deg, rgba(22, 22, 51, 0.8), rgba(254, 254, 51, 0.08));
}
[data-theme="neon"] .stat-card-premium.glass-rose {
    background: linear-gradient(145deg, rgba(22, 22, 51, 0.8), rgba(255, 0, 85, 0.1));
}

/* Icons */
.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.glass-blue .stat-icon-wrapper {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.glass-emerald .stat-icon-wrapper {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.glass-amber .stat-icon-wrapper {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.glass-rose .stat-icon-wrapper {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}

/* Stat Content */
.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value-big {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 8px;
}

.stat-value-big .unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 2px;
}

.stat-sub-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Progress Bar Mini */
.stat-progress-mini {
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

[data-theme="dark"] .stat-progress-mini,
[data-theme="neon"] .stat-progress-mini {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
}

/* Stat Pills (Satcli/Delay) */
.stat-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.stat-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pill-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.pill-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

[data-theme="dark"] .pill-success,
[data-theme="neon"] .pill-success {
    color: #34d399;
    background: rgba(5, 150, 105, 0.2);
}

[data-theme="dark"] .pill-warning,
[data-theme="neon"] .pill-warning {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.2);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid-premium {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid-premium {
        grid-template-columns: 1fr;
    }

    .stat-card-premium {
        min-height: auto;
    }
}

/* ==========================================================================
   STELLAR TAB FIXES (Force High Specificity)
   ========================================================================== */
#app .stellar-tab-content .section-title {
    color: #ffffff !important;
    font-size: 2.25rem;
    /* text-4xl */
    font-weight: 900;
    /* font-black */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#app .stellar-tab-content .section-title i {
    color: #60a5fa !important;
    /* text-blue-400 */
}

#app .stellar-tab-content p {
    color: #bfdbfe !important;
    /* text-blue-200 */
    opacity: 0.8;
    font-size: 1.125rem;
    /* text-lg */
}

/* Gamification Header - Celestial Theme */
#app .gamification-header.celestial-theme .xp-text {
    color: #94a3b8 !important;
    /* slate-400 base */
}

#app .gamification-header.celestial-theme .xp-text span {
    color: #ffffff !important;
    /* White numbers */
    font-weight: 700;
}

#app .gamification-header.celestial-theme .level-badge {
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(15, 23, 42, 0.6) !important;
}

#app .gamification-header.celestial-theme .level-number {
    color: #ffffff !important;
}

#app .gamification-header.celestial-theme .level-label {
    color: #94a3b8 !important;
}

#app .celestial-btn-override {
    color: #60a5fa !important;
    border-color: #60a5fa !important;
    background: transparent !important;
}

#app .celestial-btn-override:hover {
    background: rgba(96, 165, 250, 0.1) !important;
}

/* --- New Mes Données Design --- */
.prd-section {
    margin-bottom: 2.5rem;
}

.prd-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.prd-card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--profile-bg);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.prd-card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prd-card-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.prd-card-body {
    padding: 2rem;
}

.prd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.prd-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prd-form-group label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.prd-form-group p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.prd-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.prd-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.prd-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.prd-input:focus {
    outline: none;
    border-color: var(--primary-text);
}

.prd-btn-save {
    background: var(--primary-text);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, background 0.2s;
}

.prd-btn-save:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.prd-hierarchy-list {
    display: flex;
    flex-direction: column;
}

.prd-hierarchy-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s;
}

.prd-hierarchy-item:last-child {
    border-bottom: none;
}

.prd-hierarchy-item:hover {
    background: var(--profile-bg);
}

.prd-hierarchy-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.prd-hierarchy-icon.blue {
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.prd-hierarchy-icon.green {
    color: #10b981;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
}

.prd-hierarchy-icon.purple {
    color: #8b5cf6;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
}

[data-theme="dark"] .prd-hierarchy-icon.blue,
[data-theme="neon"] .prd-hierarchy-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .prd-hierarchy-icon.green,
[data-theme="neon"] .prd-hierarchy-icon.green {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .prd-hierarchy-icon.purple,
[data-theme="neon"] .prd-hierarchy-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

.prd-hierarchy-details h4 {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.prd-hierarchy-details p {
    margin: 0.25rem 0 0 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.prd-banner {
    position: relative;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .prd-banner,
[data-theme="neon"] .prd-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.prd-banner-bg-icon {
    position: absolute;
    right: -2rem;
    top: -2rem;
    font-size: 16rem;
    color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.prd-banner-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .prd-banner-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.prd-banner-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.prd-banner-title h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.prd-banner-title p {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.5;
}

.prd-banner-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.prd-banner-content h4 {
    margin: 0 0 1rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prd-banner-content ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.prd-banner-content li {
    margin-bottom: 0.5rem;
}

.prd-banner-content li:last-child {
    margin-bottom: 0;
}

.prd-btn-download {
    background: white;
    color: #1e3a8a;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.prd-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #1e3a8a;
}

/* =========================================================================
   ASISTENCE ALERT (IMPERSONATION)
   ========================================================================= */
.assistance-alert {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .assistance-alert,
[data-theme="neon"] .assistance-alert {
    background: linear-gradient(145deg, rgba(146, 64, 14, 0.15) 0%, rgba(120, 53, 15, 0.25) 100%);
    border-color: rgba(217, 119, 6, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.assistance-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #d97706, #f59e0b);
    border-radius: 4px 0 0 4px;
}

.assistance-alert-icon {
    background: #fef08a;
    color: #b45309;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.15);
}

[data-theme="dark"] .assistance-alert-icon,
[data-theme="neon"] .assistance-alert-icon {
    background: rgba(180, 83, 9, 0.3);
    color: #fcd34d;
}

.assistance-alert-content h4 {
    color: #92400e;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0 4px 0;
}

[data-theme="dark"] .assistance-alert-content h4,
[data-theme="neon"] .assistance-alert-content h4 {
    color: #fde68a;
}

.assistance-alert-content p {
    color: #b45309;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
}

[data-theme="dark"] .assistance-alert-content p,
[data-theme="neon"] .assistance-alert-content p {
    color: #fef3c7;
}

.assistance-alert-content strong {
    display: block;
    margin-top: 8px;
    font-weight: 600;
}

.btn-danger-outline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

/* ==========================================================================
   THEME PREVIEWS — Neon & Forest
   ========================================================================== */
.theme-prev-neon { background: #0d0d2b; border-color: #1a1a40; }
.theme-prev-neon .preview-sidebar { background: #13132e; border-right-color: rgba(255,255,255,0.05); }
.theme-prev-neon .preview-sidebar::before { background: #00ff9f; opacity: 0.7; }
.theme-prev-neon .preview-header { background: #13132e; border-bottom-color: rgba(255,255,255,0.05); }
.theme-prev-neon .preview-header::after { background: #00ff9f; opacity: 0.5; }
.theme-prev-neon .preview-line { background: rgba(0,255,159,0.15); }

.theme-prev-forest { background: #f0ede5; border-color: #d5d0c6; }
.theme-prev-forest .preview-sidebar { background: #e8e4dc; border-right-color: rgba(0,0,0,0.06); }
.theme-prev-forest .preview-sidebar::before { background: #1b5e3b; opacity: 0.8; }
.theme-prev-forest .preview-header { background: #faf8f4; border-bottom-color: rgba(0,0,0,0.06); }
.theme-prev-forest .preview-header::after { background: #c9d0c4; }
.theme-prev-forest .preview-line { background: rgba(27,94,59,0.12); }

.theme-prev-light { background: #f1f5f9; }
.theme-prev-dark  { background: #0f172a; border-color: #1e293b; }
.theme-prev-dark .preview-sidebar { background: #1e293b; border-right-color: rgba(255,255,255,0.05); }
.theme-prev-dark .preview-sidebar::before { background: #334155; }
.theme-prev-dark .preview-header { background: #1e293b; border-bottom-color: rgba(255,255,255,0.05); }
.theme-prev-dark .preview-header::after { background: #334155; }
.theme-prev-dark .preview-line { background: rgba(255,255,255,0.08); }

.theme-prev-sakura { background: #fff5f9; border-color: #f9c8e0; }
.theme-prev-sakura .preview-sidebar { background: #fce8f3; border-right-color: rgba(233,30,140,0.1); }
.theme-prev-sakura .preview-sidebar::before { background: #e91e8c; opacity: 0.7; }
.theme-prev-sakura .preview-header { background: #fff5f9; border-bottom-color: rgba(233,30,140,0.1); }
.theme-prev-sakura .preview-header::after { background: #f9c8e0; }
.theme-prev-sakura .preview-line { background: rgba(233,30,140,0.1); }

.theme-card.neon.active   { border-color: #00ff9f; box-shadow: 0 0 0 2px #00ff9f, 0 20px 40px -10px rgba(0,255,159,0.2); }
.theme-card.forest.active { border-color: #1b5e3b; box-shadow: 0 0 0 2px #1b5e3b, 0 20px 40px -10px rgba(27,94,59,0.15); }
.theme-card.sakura.active { border-color: #e91e8c; box-shadow: 0 0 0 2px #e91e8c, 0 20px 40px -10px rgba(233,30,140,0.15); }
.theme-card.neon.active::after   { color: #00ff9f; }
.theme-card.forest.active::after { color: #1b5e3b; }
.theme-card.sakura.active::after { color: #e91e8c; }

/* ==========================================================================
   GAINS CARD — Section estimatif de salaire variable
   ========================================================================== */

.gains-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: var(--radius-md, 16px);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.gains-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border, #e2e8f0);
}

.gains-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gains-title i { font-size: 1.1rem; color: #10b981; }

.gains-total {
    font-size: 1.75rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1;
}

.gains-currency {
    font-size: 1rem;
    font-weight: 600;
    margin-left: 2px;
    color: #10b981;
}

.gains-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gains-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    background: var(--primary-soft, rgba(59,130,246,0.05));
    color: var(--text-main, #1e293b);
}

.gains-line strong {
    font-weight: 700;
    color: #10b981;
    white-space: nowrap;
}

.gains-line-unavailable {
    background: transparent;
    border: 1px dashed var(--card-border, #e2e8f0);
    color: var(--text-muted, #94a3b8);
    font-style: italic;
}

[data-theme="dark"] .gains-card,
[data-theme="neon"] .gains-card {
    background: var(--card-bg);
    border-color: var(--card-border);
}

[data-theme="dark"] .gains-line { background: rgba(59,130,246,0.08); color: var(--text-main, #e2e8f0); }
[data-theme="neon"] .gains-line { background: rgba(0,255,159,0.07); color: var(--text-main, #e0e0ff); }
[data-theme="neon"] .gains-line strong { color: #00ff9f; }
[data-theme="neon"] .gains-total, [data-theme="neon"] .gains-currency { color: #00ff9f; }
[data-theme="neon"] .gains-title i { color: #00ff9f; }

[data-theme="forest"] .gains-card { background: var(--card-bg, #faf8f4); border-color: var(--card-border, #c8c1b3); }
[data-theme="forest"] .gains-line { background: rgba(27,94,59,0.07); }

/* ==========================================================================
   PRIVACY (Satcli) — dans Mes Données
   ========================================================================== */
.privacy-text-block {
    flex: 1;
    padding-right: 1rem;
    min-width: 0;
}
.privacy-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main, #0f172a);
    margin-bottom: 3px;
}
[data-theme="dark"] .privacy-title,
[data-theme="neon"] .privacy-title { color: #f1f5f9; }
[data-theme="forest"] .privacy-title { color: #1b3a2a; }

.privacy-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}
[data-theme="dark"] .privacy-status,
[data-theme="neon"] .privacy-status { color: #94a3b8; }
[data-theme="forest"] .privacy-status { color: #5a7a60; }
.privacy-status-on { color: #10b981 !important; }

/* ==========================================================================
   KPI PRIMARY GRID (cartes du haut) + sous-éléments
   ========================================================================== */
.kpi-primary-grid {
    margin-bottom: 0;
}

.kpi-perf-sub {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
    text-align: center;
    margin-top: 0.1rem;
}
[data-theme="dark"] .kpi-perf-sub,
[data-theme="neon"] .kpi-perf-sub  { color: #64748b; }
[data-theme="forest"] .kpi-perf-sub { color: #7a9a7a; }

.kpi-progress-bar-mini {
    width: 100%;
    height: 4px;
    background: var(--border-color, #e2e8f0);
    border-radius: 99px;
    margin-top: 0.35rem;
    overflow: hidden;
}
.kpi-progress-bar-mini > div {
    height: 100%;
    background: var(--primary, #3b82f6);
    border-radius: 99px;
    transition: width 0.4s ease;
    max-width: 100%;
}
[data-theme="neon"] .kpi-progress-bar-mini > div  { background: #00ff9f; }
[data-theme="forest"] .kpi-progress-bar-mini > div { background: #1b5e3b; }

/* Icon color variants */
.kpi-icon-emerald { color: #10b981 !important; }
.kpi-icon-amber   { color: #f59e0b !important; }
.kpi-icon-rose    { color: #f43f5e !important; }

[data-theme="neon"] .kpi-icon-emerald { color: #00ff9f !important; }
[data-theme="neon"] .kpi-icon-amber   { color: #fbbf24 !important; }
[data-theme="neon"] .kpi-icon-rose    { color: #ff6b9d !important; }

/* ==========================================================================
   KPI PERFORMANCES SECTION (Overview Tab)
   ========================================================================== */
.kpi-perf-loader {
    margin-top: 2rem;
    color: var(--text-muted, #94a3b8);
    font-size: 1.25rem;
    text-align: center;
}

.kpi-perf-section {
    margin-top: 2rem;
}

.kpi-perf-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.875rem;
}

[data-theme="dark"] .kpi-perf-header,
[data-theme="neon"] .kpi-perf-header  { color: #94a3b8; }
[data-theme="forest"] .kpi-perf-header { color: #5a7a60; }

.kpi-period-pill {
    margin-left: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-card, #f1f5f9);
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .kpi-period-pill,
[data-theme="neon"] .kpi-period-pill  { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="neon"] .kpi-period-pill  { background: #161633; border-color: #2a2a5a; }
[data-theme="forest"] .kpi-period-pill { background: #edeae3; color: #5a7a60; border-color: #d5d0c6; }

.kpi-perf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .kpi-perf-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .kpi-perf-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi-perf-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 1rem 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-perf-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

[data-theme="dark"] .kpi-perf-card,
[data-theme="neon"] .kpi-perf-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="neon"] .kpi-perf-card {
    background: #161633;
    border-color: #2a2a5a;
}
[data-theme="forest"] .kpi-perf-card {
    background: #faf8f4;
    border-color: #d5d0c6;
}

.kpi-perf-icon {
    font-size: 1.15rem;
    color: var(--primary, #3b82f6);
    margin-bottom: 0.1rem;
}

[data-theme="neon"] .kpi-perf-icon   { color: #00ff9f; }
[data-theme="forest"] .kpi-perf-icon  { color: #1b5e3b; }

.kpi-perf-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color, #0f172a);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .kpi-perf-value,
[data-theme="neon"] .kpi-perf-value  { color: #f1f5f9; }
[data-theme="forest"] .kpi-perf-value { color: #1b3a2a; }

.kpi-perf-unit {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.6;
    margin-left: 1px;
}

.kpi-perf-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.1rem;
}

[data-theme="dark"] .kpi-perf-label,
[data-theme="neon"] .kpi-perf-label  { color: #94a3b8; }
[data-theme="forest"] .kpi-perf-label { color: #5a7a60; }

.mt-10 { margin-top: 2.5rem !important; }
.mt-12 { margin-top: 3rem !important; }

