:root {
    /* Color Palette - Deep Dark with Neon accents */
    --bg-base: #0f1015;
    --bg-surface: rgba(25, 27, 35, 0.6);
    --bg-surface-hover: rgba(35, 38, 50, 0.8);
    --border-color: rgba(255, 255, 255, 0.05);
    --text-primary: #f8f9fa;
    --text-secondary: #9ba1a6;
    
    --accent-1: #6366f1; /* Indigo */
    --accent-2: #ec4899; /* Pink */
    --accent-3: #10b981; /* Emerald */
    --accent-4: #f59e0b; /* Amber */
    
    /* Effects */
    --glass-blur: blur(16px);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.2);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Layout */
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Blobs for Ambient Light */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-1);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-2);
    bottom: -150px;
    right: -100px;
    opacity: 0.3;
}

/* Utilities */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    border-radius: 20px;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    margin: 20px 0 20px 20px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 24px; /* overrides glass-panel radius slightly */
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.brand i {
    color: var(--accent-1);
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.1));
    color: var(--accent-1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-status {
    font-size: 0.8rem;
    color: var(--accent-3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    margin-top: 20px;
}

.header-greeting h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(to right, #fff, #9ba1a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.header-widgets {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.weather-widget {
    padding: 12px 24px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.weather-widget i {
    font-size: 1.5rem;
    color: var(--accent-3);
}

.time-widget {
    padding: 12px 24px;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--accent-1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Widget Card */
.widget-card {
    text-decoration: none;
    color: inherit;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
}

.widget-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

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

.widget-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.widget-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.widget-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    flex: 1;
}

.widget-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.widget-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.widget-card:hover .widget-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Widget Specific Colors */
.widget-website .widget-icon-wrapper {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-1);
}
.widget-momentum .widget-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-3);
}
.widget-trading .widget-icon-wrapper {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 12px;
    width: 300px;
    margin-right: auto;
    margin-left: 40px;
}
.search-bar i {
    color: var(--text-secondary);
    font-size: 1.2rem;
}
.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
}
.search-bar input::placeholder {
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    width: 400px;
    padding: 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-group input {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    color: var(--text-primary);
    outline: none;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}
.modal-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}
.btn-primary {
    background: var(--accent-1);
    color: #fff;
}

/* Categories */
.category-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.category-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* PIN Modal Specifics */
.pin-modal-content {
    align-items: center;
    text-align: center;
    width: 350px;
}
#pin-modal-title {
    margin-bottom: 5px;
}
#pin-modal-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.pin-display {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}
.pin-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}
.pin-dot.filled {
    background: var(--accent-1);
    box-shadow: 0 0 10px var(--accent-1);
    transform: scale(1.2);
}
.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 250px;
    margin: 0 auto 20px auto;
}
.pin-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    margin: auto;
}
.pin-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.1);
}
.pin-btn:active {
    transform: scale(0.95);
    background: var(--accent-1);
    color: #fff;
}
.pin-btn-action {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
}
.pin-btn-action:hover {
    background: transparent;
    color: var(--text-primary);
}
.pin-error-text {
    color: var(--accent-2);
    font-weight: 500;
    margin-bottom: 10px;
}

/* Responsiveness */
@media screen and (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: auto;
        margin: 20px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        height: auto;
    }
    
    .brand {
        margin-bottom: 0;
    }
    
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 0;
    }
    
    .nav-item {
        padding: 10px 15px;
    }
    .nav-item span {
        display: none; /* Cache le texte sur petits écrans */
    }
    
    .main-content {
        padding: 0 20px 20px 20px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
        margin-left: 0;
    }
    
    .header-widgets {
        width: 100%;
        justify-content: space-between;
    }
}

@media screen and (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        width: 90%;
    }
}
