:root {
    --bg-dark: #0a0c10;
    --bg-card: #161b22;
    --bg-sidebar: #0d1117;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.3);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border: #30363d;
    --success: #238636;
    --danger: #da3633;
    --warning: #d29922;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    overflow-x: hidden;
}

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

/* Sidebar Styling */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.logo i {
    width: 32px;
    height: 32px;
}

.controls h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-group input[type="number"],
.input-group input[type="range"] {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.range-value {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

.primary-btn {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s, background 0.2s;
    margin-top: 1rem;
}

.primary-btn:hover {
    background: #4a95e6;
    transform: translateY(-2px);
}

.info-card {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.info-card i {
    flex-shrink: 0;
    color: var(--accent);
    width: 20px;
    height: 20px;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    padding: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 2.5rem;
}

.dashboard-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff 0%, #8b949e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-item:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.stat-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-item .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-item .value.highlight {
    color: var(--success);
}

.stat-item .value.danger {
    color: var(--danger);
}

/* Charts Styling */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.legend {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.dot.price { background: var(--accent); }
.dot.value { background: var(--success); }

.secondary-charts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.secondary-charts .chart-container {
    flex: 1;
}

/* Table Styling */
.stage-analysis {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
}

.stage-analysis h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    color: var(--text-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

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

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}
