:root {
    /* Color Palette - Premium Dark Theme */
    --bg-color: #0f111a;
    --surface-color: #171a25;
    --surface-hover: #1e2230;
    --glass-bg: rgba(23, 26, 37, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent Colors */
    --accent-primary: #6366f1;
    /* Indigo */
    --accent-secondary: #8b5cf6;
    /* Violet */
    --color-purple: #c084fc;
    --color-blue: #38bdf8;
    --color-green: #34d399;
    --color-orange: #fb923c;
    --color-danger: #f87171;

    /* Glows */
    --glow-primary: 0 0 20px rgba(99, 102, 241, 0.2);
    --glow-purple: 0 0 15px rgba(192, 132, 252, 0.2);
    --glow-green: 0 0 15px rgba(52, 211, 153, 0.2);

    /* Dimensions */
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(15, 17, 26, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(15, 17, 26, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--glass-bg);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    color: var(--accent-primary);
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.nav-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 500;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-links a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
    background-color: var(--surface-hover);
}

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

.nav-links a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: var(--glow-primary);
}

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

/* User Profile Sidebar Bottom */
.sidebar-bottom {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    cursor: pointer;
}

.user-profile:hover {
    background-color: var(--surface-hover);
}

.user-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    padding: 2px;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0 40px 40px;
}

/* Header */
.top-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background-color: rgba(15, 17, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5;
    padding: 10px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    position: relative;
    width: 350px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px 12px 48px;
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    transition: var(--transition-base);
}

.search-bar input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

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

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-base);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.badge {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    background-color: var(--color-danger);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-base);
    box-shadow: var(--glow-primary);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(139, 92, 246, 0.4);
}

/* Dashboard Content */
.dashboard-content {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.welcome-section p {
    color: var(--text-secondary);
    font-size: 16px;
}

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

.stat-card {
    background-color: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    background-color: var(--surface-color);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

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

.stat-icon.purple {
    background-color: rgba(192, 132, 252, 0.15);
    color: var(--color-purple);
    box-shadow: var(--glow-purple);
}

.stat-icon.blue {
    background-color: rgba(56, 189, 248, 0.15);
    color: var(--color-blue);
}

.stat-icon.orange {
    background-color: rgba(251, 146, 60, 0.15);
    color: var(--color-orange);
}

.stat-icon.green {
    background-color: rgba(52, 211, 153, 0.15);
    color: var(--color-green);
    box-shadow: var(--glow-green);
}

.stat-details h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trend {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.up {
    color: var(--color-green);
}

.trend.down {
    color: var(--color-danger);
}

.status-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--color-green);
    border-radius: 50%;
    margin-top: 4px;
    box-shadow: 0 0 10px var(--color-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

.bento-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.chart-section {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    min-height: 480px;
}

.commits-section {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    height: 400px;
}

.server-health {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

/* Chart Container */
.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
}

select option {
    background-color: var(--bg-color);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 8px;
}

.activity-feed::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
    background: transparent;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.activity-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 20px;
    position: relative;
}

.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    z-index: 2;
}

.activity-content h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

.commit-hash {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--color-blue);
}

/* System Health */
.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.metric-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--color-purple));
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress.danger {
    background: linear-gradient(90deg, var(--color-orange), var(--color-danger));
}

.environment-status {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.env-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.prod {
    background-color: var(--color-green);
    box-shadow: 0 0 6px var(--color-green);
}

.dot.staging {
    background-color: var(--color-blue);
    box-shadow: 0 0 6px var(--color-blue);
}

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

    .chart-section,
    .commits-section,
    .server-health {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 0 20px 20px;
    }
}