:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    padding: 24px 12px;
    flex: 1;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.nav-links li.active a {
    background-color: var(--accent-primary);
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.details {
    display: flex;
    flex-direction: column;
}

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

.details .role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Top Header */
.top-header {
    height: 72px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.search-container input {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    width: 320px;
    outline: none;
    transition: border-color 0.2s;
}

.search-container input:focus {
    border-color: var(--accent-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

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

.primary-btn {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: var(--accent-hover);
}

/* Dashboard Content */
.dashboard {
    padding: 32px;
    overflow-y: auto;
}

.welcome-section {
    margin-bottom: 32px;
}

.welcome-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--text-secondary);
}

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

.stat-card {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.purple { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-icon.blue { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }

.stat-details h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-card, .tasks-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 24px;
}

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

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.more-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
}

.view-all {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* Chart */
.chart-container {
    height: 250px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding-top: 20px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--accent-hover), var(--accent-primary));
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all 0.3s ease;
}

.chart-bar:hover {
    opacity: 0.9;
    transform: scaleY(1.02);
}

.chart-bar span {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Tasks */
.task-list {
    list-style: none;
}

.task-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.task-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.task-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status.in-progress { background-color: rgba(99, 102, 241, 0.1); color: var(--accent-primary); }
.status.done { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }

/* Responsive */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 12px;
        gap: 8px;
    }
    
    .nav-links li {
        margin-bottom: 0;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .search-container input {
        width: 200px;
    }
}
