:root {
    --bg-main: #0D1117;
    --bg-surface: #161B22;
    --bg-hover: #21262D;
    --border: #30363D;
    
    --text-primary: #E6EDF3;
    --text-muted: #8B949E;
    
    --primary: #00B4D8;
    --primary-hover: #03045E;
    --accent: #48CAE4;
    
    --positive: #3FB950;
    --negative: #F85149;
    
    --shadow: 0 4px 12px rgba(0,0,0,0.5);
    
    font-family: 'Inter', -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: 600;
}

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

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1px; /* border thickness */
    background: var(--border); /* border color */
    flex: 1;
}

.sidebar {
    background: var(--bg-main);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    height: calc(100vh - 72px);
}

.viz-container {
    background: var(--bg-main);
    position: relative;
    display: flex;
    flex-direction: column;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

.viz-footer {
    padding: 1rem 2rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Sidebar List */
.sidebar-section {
    display: flex;
    flex-direction: column;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.item-row input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.item-row input:focus {
    outline: none;
}

.item-name {
    flex: 1;
    min-width: 0;
}

.item-value {
    width: 80px;
    text-align: right;
}

.currency-symbol {
    color: var(--text-muted);
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0 0.25rem;
}

.remove-btn:hover {
    color: var(--negative);
}

/* Summary Stats */
.info-panel {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    gap: 1rem;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.summary-stat strong { font-size: 1rem; }

.savings-rate {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.savings-rate strong {
    font-size: 1.5rem;
    color: var(--primary);
}

.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-accent { color: var(--accent); }

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 6px;
    box-shadow: var(--shadow);
    pointer-events: none;
    font-size: 0.875rem;
    z-index: 100;
}

.tooltip.hidden {
    display: none;
}
