:root {
    --font-main: 'Inter', sans-serif;
    --bg-primary: #0f0f23; --bg-secondary: #1a1a2e; --bg-tertiary: #16213e;
    --bg-card: #1e1e3f; --text-primary: #e2e8f0; --text-secondary: #94a3b8;
    --text-muted: #64748b; --border-color: #334155; --accent-primary: #10b981;
    --accent-secondary: #06d6a0; --accent-gradient: linear-gradient(135deg, #10b981, #06d6a0);
    --success-color: #22c55e; --danger-color: #ef4444; --warning-color: #f59e0b;
    --info-color: #3b82f6; --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body.light-mode {
    --bg-primary: #f8fafc; --bg-secondary: #ffffff; --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff; --text-primary: #1e293b; --text-secondary: #475569;
    --text-muted: #64748b; --border-color: #e2e8f0; --accent-primary: #059669;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background: var(--bg-primary); color: var(--text-primary); display: flex; transition: all 0.3s ease; line-height: 1.6; overflow-x: hidden; }
.sidebar { width: 260px; height: 100vh; background: var(--bg-secondary); border-right: 1px solid var(--border-color); position: fixed; top: 0; left: 0; display: flex; flex-direction: column; z-index: 100; transition: all 0.3s ease; }
.profile-header { padding: 24px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; }
.profile-avatar { width: 48px; height: 48px; background: var(--accent-gradient); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5em; font-weight: 600; color: white; }
.profile-info h3 { font-size: 1.1em; font-weight: 600; margin-bottom: 2px; }
.profile-info p { color: var(--text-secondary); font-size: 0.85em; }
.sidebar-nav { flex-grow: 1; padding: 20px 0; }
.nav-btn { width: 100%; padding: 12px 20px; background: none; border: none; color: var(--text-secondary); display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.2s ease; font-size: 0.95em; font-weight: 500; }
.nav-btn:hover { background-color: var(--bg-tertiary); color: var(--text-primary); }
.nav-btn.active { background: var(--accent-gradient); color: white; box-shadow: var(--shadow-md); }
.nav-btn .icon { font-size: 1.2em; width: 20px; text-align: center; }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-color); }
.theme-toggle { width: 100%; padding: 12px 20px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.9em; transition: all 0.2s ease; }
.theme-toggle:hover { background: var(--bg-card); }
.main-content { margin-left: 260px; width: calc(100% - 260px); padding: 30px 40px; transition: all 0.3s ease; min-height: 100vh; }
.page { display: none; animation: fadeIn 0.4s ease-out; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.page-header { margin-bottom: 32px; padding-bottom: 20px; }
.page-header h1 { font-size: 2.5em; font-weight: 700; margin-bottom: 8px; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-header p { color: var(--text-secondary); font-size: 1.1em; font-weight: 400; }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.widget { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-md); transition: all 0.3s ease; position: relative; overflow: hidden; }
.widget::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent-gradient); }
.widget:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.widget h3 { margin-bottom: 16px; font-size: 1.1em; color: var(--text-primary); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat-card { text-align: center; padding: 20px; }
.stat-number { font-size: 2.5em; font-weight: 700; color: var(--accent-primary); margin-bottom: 8px; }
.stat-label { color: var(--text-secondary); font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px; }
.quote-widget blockquote { border-left: 4px solid var(--accent-primary); padding-left: 20px; font-style: italic; font-size: 1.1em; line-height: 1.6; margin-bottom: 16px; }
.quote-widget footer { text-align: right; font-weight: 600; color: var(--text-secondary); }
.task-form { display: flex; gap: 12px; margin-bottom: 24px; }
.task-input { flex-grow: 1; padding: 14px 16px; font-size: 1em; background: var(--bg-tertiary); border: 2px solid var(--border-color); border-radius: 12px; color: var(--text-primary); transition: all 0.2s ease; font-family: var(--font-main); }
.task-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.task-add-btn { padding: 14px 24px; font-size: 1em; background: var(--accent-gradient); color: white; border: none; border-radius: 12px; cursor: pointer; font-weight: 600; transition: all 0.2s ease; box-shadow: var(--shadow-md); }
.task-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--bg-tertiary); border-left: 4px solid var(--accent-secondary); margin-bottom: 12px; border-radius: 12px; transition: all 0.3s ease; position: relative; }
.task-item.done { border-left-color: var(--success-color); opacity: 0.6; }
.task-item.done .task-text { text-decoration: line-through; }
.task-item .task-checkbox { width: 20px; height: 20px; accent-color: var(--accent-secondary); flex-shrink: 0; cursor: pointer; }
.task-text { flex-grow: 1; font-size: 1em; }
.task-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1em; transition: all 0.2s ease; }
.task-delete:hover { color: var(--danger-color); }
.goals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 24px; margin-bottom: 32px; }
.goal-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; transition: all 0.3s ease; box-shadow: var(--shadow-md); }
.goal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.goal-title { font-size: 1.2em; font-weight: 600; margin-bottom: 8px; }
.goal-status { padding: 6px 12px; border-radius: 20px; font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-in-progress { background: rgba(59, 130, 246, 0.1); color: var(--info-color); }
.status-active-focus { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.status-completed { background: rgba(34, 197, 94, 0.1); color: var(--success-color); }
.goal-description { color: var(--text-secondary); margin-bottom: 16px; flex-grow: 1; }
.progress-bar { background: var(--bg-tertiary); border-radius: 10px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { background: var(--accent-gradient); height: 100%; border-radius: 10px; transition: width 0.3s ease; }
.progress-text { font-size: 0.9em; color: var(--text-secondary); text-align: right; }
.goal-actions button { flex: 1; padding: 8px; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
.goal-actions button:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-primary); font-size: 0.95em; }
.input-group input, .input-group textarea { width: 100%; padding: 12px 16px; background: var(--bg-tertiary); border: 2px solid var(--border-color); border-radius: 12px; color: var(--text-primary); font-size: 1em; font-family: var(--font-main); transition: all 0.2s ease; }
.input-group input:focus, .input-group textarea:focus { outline: none; border-color: var(--accent-primary); }
.calc-button { background: var(--accent-gradient); color: white; border: none; padding: 14px 28px; border-radius: 12px; font-size: 1em; font-weight: 600; cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-md); }
.financial-flow li { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border-color); font-size: 1.05em; }
.financial-flow .total { color: var(--accent-primary); font-size: 1.3em; border-top: 2px solid var(--accent-primary); padding-top: 16px; margin-top: 12px; font-weight: 700; }
.income { color: var(--success-color); font-weight: 600; }
.expense { color: var(--danger-color); font-weight: 600; }
.coin-display { margin-top: 20px; padding: 16px; background: var(--accent-gradient); border-radius: 12px; text-align: center; color: white; font-size: 1.2em; font-weight: 600; }
.notification { position: fixed; top: 20px; right: 20px; padding: 16px 24px; border-radius: 12px; color: white; font-weight: 500; z-index: 1000; animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 2.7s forwards; box-shadow: var(--shadow-lg); }
.notification.success { background: var(--success-color); }
.notification.error { background: var(--danger-color); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 768px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: 70px; flex-direction: row; align-items: center; justify-content: space-between; position: fixed; bottom: 0; top: auto; left: 0; border-top: 1px solid var(--border-color); border-right: none; padding: 0 10px; z-index: 1000; background: rgba(26, 26, 46, 0.8); backdrop-filter: blur(10px); }
    body.light-mode .sidebar { background: rgba(255, 255, 255, 0.8); }
    .profile-header, .sidebar-footer { display: none; }
    .sidebar-nav { display: flex; flex-grow: 1; justify-content: space-evenly; align-items: center; height: 100%; padding: 0; }
    .sidebar-nav .nav-btn { flex-direction: column; justify-content: center; font-size: 0.75em; padding: 8px; gap: 4px; height: 60px; border-radius: 12px; min-width: 60px; }
    .sidebar-nav .nav-btn .icon { font-size: 1.6em; }
    .sidebar-nav .nav-btn .text { font-size: 0.8em; }
    .main-content { width: 100%; margin-left: 0; padding: 20px 20px 90px 20px; }
    .task-form { flex-direction: column; }
}
