:root {
    --bg-color: #0f172a;
    --bg-gradient: linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success-color: #10b981;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(to right, var(--accent-color), #a855f7);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.top-nav {
    display: flex;
    background: rgba(30, 41, 59, 0.5);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
    /* Prevent full height stretching */
    /* Removed flex: 1 and min-height to avoid forcing full page height if not needed */
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: fit-content;
    /* Only take necessary space */
}

/* ... (keep existing css) ... */

/* Chart Panel */
.chart-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* ... (keep existing css) ... */

.canvas-container {
    position: relative;
    width: 100%;
    height: 500px;
    /* Fixed reasonable height to fit screen */
    min-height: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .app-container {
        height: auto;
        padding: 1rem;
    }

    .canvas-container {
        height: 500px;
        /* Fixed height on mobile */
    }
}