/* ============== VARIABLES ============== */
:root {
    --bg-primary: #0B0E14;
    --bg-secondary: #141922;
    --bg-tertiary: #1A202C;
    --bg-card: #1E2530;
    --accent-green: #10B981;
    --accent-green-dark: #059669;
    --accent-red: #EF4444;
    --accent-red-dark: #DC2626;
    --accent-blue: #3B82F6;
    --accent-yellow: #F59E0B;
    --accent-purple: #8B5CF6;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;
    --border: #2D3748;
    --border-light: #374151;
}

/* ============== COMPANY EMPLOYEE CARDS ============== */
.company-employee-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.company-employee-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

/* ============== RESET & BASE ============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1420 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============== MAIN LAYOUT ============== */
.app-container {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    grid-template-rows: 65px auto 1fr;
    height: 100vh;
    width: 100vw;
    max-width: 100%;
    gap: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

@media (min-width: 2200px) {
    .app-container {
        grid-template-columns: 320px minmax(0, 1fr) 400px;
        grid-template-rows: 75px auto 1fr;
    }
}

@media (min-width: 1920px) and (max-width: 2199px) {
    .app-container {
        grid-template-columns: 280px minmax(0, 1fr) 340px;
        grid-template-rows: 70px auto 1fr;
    }
}

@media (max-width: 1440px) {
    .app-container {
        grid-template-columns: 240px minmax(0, 1fr) 300px;
    }
}

/* ============== TOP BAR ============== */
.top-bar {
    grid-column: 1 / -1;
    background: rgba(20, 25, 34, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    height: 65px;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.2);
    min-width: 140px;
}

@media (min-width: 2200px) {
    .top-bar {
        padding: 0 40px;
        height: 75px;
    }
    
    .logo {
        font-size: 32px;
        min-width: 200px;
    }
}

@media (min-width: 1920px) and (max-width: 2199px) {
    .top-bar {
        padding: 0 32px;
        height: 70px;
    }
    
    .logo {
        font-size: 28px;
        min-width: 180px;
    }
}

.top-bar-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.user-badge:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-display {
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.balance-display:hover {
    border-color: var(--accent-green);
}

.balance-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.balance-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-green);
}

.company-balance {
    font-size: 11px;
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    margin-top: 4px;
}

.btn-top {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-top:hover {
    transform: translateY(-2px);
}

.btn-company {
    background: var(--accent-purple);
    color: white;
}

.btn-settings {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-settings:hover {
    background: var(--bg-tertiary);
}

/* ============== STATS DASHBOARD ============== */
.stats-dashboard {
    grid-column: 1 / -1;
    padding: 0 20px 4px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.5fr) repeat(5, minmax(120px, 1fr));
    gap: 6px;
    max-width: 100%;
}

@media (min-width: 2200px) {
    .stats-dashboard {
        padding: 0 40px 12px;
    }
    
    .stats-grid {
        grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-card.large .stat-value {
        font-size: 30px;
    }
}

@media (min-width: 1920px) and (max-width: 2199px) {
    .stats-dashboard {
        padding: 0 32px 10px;
    }
    
    .stats-grid {
        grid-template-columns: minmax(250px, 2fr) repeat(5, minmax(140px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 1440px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-card.large {
        grid-column: span 3;
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card.large {
    grid-column: span 2;
}

.stat-card.medium {
    grid-column: span 1;
}

.stat-card.small {
    grid-column: span 1;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.stat-card.success {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
}

.stat-card.error {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-yellow));
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.2s;
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

.stat-card.large .stat-value {
    font-size: 20px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-icon.green { background: rgba(16, 185, 129, 0.1); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.1); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.1); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.1); }

.stat-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }

/* ============== LEFT SIDEBAR ============== */
.left-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.search-box {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.asset-list {
    flex: 1;
}

.asset-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.asset-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.2s;
}

.asset-item:hover {
    background: var(--bg-tertiary);
}

.asset-item:hover::before {
    opacity: 1;
}

.asset-item.active {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-blue);
}

.asset-item.active::before {
    opacity: 0;
}

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

.asset-symbol {
    font-size: 13px;
    font-weight: 700;
}

.asset-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
}

.asset-name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.asset-change {
    font-size: 12px;
    font-weight: 600;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }

/* ============== MAIN CONTENT (CHART) ============== */
.main-content {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    padding-bottom: 80px;
}

.chart-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.chart-info h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.chart-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
}

.chart-change-info {
    font-size: 15px;
    font-weight: 700;
}

.chart-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-buy {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-buy:hover {
    background: var(--accent-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-sell {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sell:hover {
    background: var(--accent-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.chart-container {
    flex: 1;
    padding: 16px 24px 24px;
    position: relative;
    max-height: calc(100vh - 280px);  /* AJOUTÉ : Hauteur fixe */
    min-height: 400px;  /* AJOUTÉ : Hauteur minimum */
    overflow: hidden;  /* AJOUTÉ : Empêcher débordement */
}

#priceChart {
    width: 100% !important;
    height: 100% !important;
    max-height: 100%;  /* AJOUTÉ */
    position: relative;  /* AJOUTÉ */
}

/* ============== RIGHT SIDEBAR ============== */
.right-sidebar {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.sidebar-tab {
    flex: 1;
    padding: 14px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sidebar-tab:hover {
    color: var(--text-primary);
}

.sidebar-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Activity Feed */
.activity-feed, .portfolio-list, .leaderboard-list, .companies-list {
    padding: 16px;
}

.activity-item {
    padding: 14px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-blue);
    transition: all 0.2s;
    cursor: pointer;
}

.activity-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.activity-item.buy { border-left-color: var(--accent-green); }
.activity-item.sell { border-left-color: var(--accent-red); }

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.activity-user {
    font-size: 12px;
    font-weight: 600;
}

.activity-time {
    font-size: 10px;
    color: var(--text-tertiary);
}

.activity-details {
    font-size: 11px;
    color: var(--text-secondary);
}

.activity-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    margin-top: 4px;
}

/* Company/Leaderboard Items */
.company-item, .leaderboard-item {
    padding: 16px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.company-item:hover, .leaderboard-item:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

/* ============== MODALS ============== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease-out;
}

.modal-small { max-width: 500px; }
.modal-medium { max-width: 700px; }
.modal-large { max-width: 900px; }

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

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

/* ============== PANELS ============== */
.panel-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.panel-nav-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.panel-nav-item:hover {
    color: var(--text-primary);
}

.panel-nav-item.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.panel-section {
    display: none;
}

.panel-section.active {
    display: block;
}

/* ============== FORMS ============== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============== BUTTONS ============== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* ============== SPECIAL COMPONENTS ============== */

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.role-option {
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.role-option:hover {
    border-color: var(--accent-blue);
}

.role-option.active {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.role-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.role-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.role-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Profile Avatar */
.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 48px;
    object-fit: cover;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.avatar-upload-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* XP Bar */
.xp-bar-container {
    width: 100%;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: white;
    font-weight: 700;
    font-size: 11px;
}

/* Badge Grid */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.badge-item {
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s;
}

.badge-item.unlocked {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.05);
}

.badge-item.locked {
    opacity: 0.5;
}

.badge-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.badge-name {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.badge-desc {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Employee Grid */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.employee-card {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.employee-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

/* Info Box */
.info-box {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

/* Toast */
.toast {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-green);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInToast 0.3s ease-out;
    min-width: 300px;
}

@keyframes slideInToast {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.error {
    border-left-color: var(--accent-red);
}

/* ============== SCROLLBAR ============== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: 250px 1fr 300px;
    }
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 60px auto auto;
    }
    
    .left-sidebar, .right-sidebar {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .stat-card.large {
        grid-column: span 3;
    }
    
    .stat-card.medium {
        grid-column: span 1;
    }
    
    .stat-card.small {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card.large,
    .stat-card.medium,
    .stat-card.small {
        grid-column: span 1;
    }
    
    .top-bar {
        flex-wrap: wrap;
        padding: 12px;
        height: auto;
    }
    
    .top-bar-center {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .modal-content {
        margin: 12px;
    }
}

/* ============== TIMEFRAME BUTTONS ============== */
.timeframe-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.timeframe-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.timeframe-btn.active {
    background: var(--accent-blue);
    color: white;
}

@media (max-width: 1600px) {
    .timeframe-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 0;
}

.achievement-card {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    /* max-width: 220px;  ← SUPPRIMER CETTE LIGNE */
}

.achievement-card:hover {
    transform: translateY(-4px);
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border: 2px solid var(--accent-blue);
    opacity: 1;
}

.achievement-card.locked {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    opacity: 0.5;
}

.achievement-icon {
    font-size: 40px;  /* Réduit de 48px à 40px */
    margin-bottom: 8px;  /* Réduit de 12px à 8px */
}

.achievement-name {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 13px;  /* Réduit de 14px à 13px */
    line-height: 1.2;
}

.achievement-description {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* Limite à 2 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.achievement-status {
    font-size: 12px;
    font-weight: 600;
}

.achievement-status.unlocked {
    color: var(--accent-green);
}

.achievement-status.locked {
    color: var(--text-secondary);
    font-size: 11px;
}