/* ===== DESIGN TOKENS ===== */
:root {
    --bg: #f0f2f8;
    --surface: #ffffff;
    --surface2: #f7f8fc;
    --border: #e4e8f0;
    --text: #1a1d2e;
    --text-muted: #7b82a0;
    --primary: #5b4fcf;
    --primary-light: #ede9ff;
    --primary-glow: rgba(91,79,207,0.18);
    --success: #22c98e;
    --success-light: #e4fbf2;
    --warning: #f5a623;
    --warning-light: #fff6e5;
    --danger: #f04b6b;
    --danger-light: #ffe9ed;
    --sidebar-w: 230px;
    --topbar-h: 64px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(91,79,207,0.08);
    --shadow-lg: 0 12px 40px rgba(91,79,207,0.14);
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

body.dark {
    --bg: #0f1117;
    --surface: #181c27;
    --surface2: #1e2233;
    --border: #272d3f;
    --text: #e8eaf5;
    --text-muted: #6b7394;
    --primary: #7b6fe8;
    --primary-light: #1e1a3f;
    --primary-glow: rgba(123,111,232,0.2);
    --success: #1eb87e;
    --success-light: #0d2219;
    --warning: #d4901c;
    --warning-light: #221a0d;
    --danger: #d43a58;
    --danger-light: #220d13;
    --shadow: 0 4px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

/* ===== SPLASH ===== */
.splash {
    position: fixed; inset: 0;
    background: #0d0a1f;
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

.splash-bg { position: absolute; inset: 0; overflow: hidden; }
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.4;
    animation: blobFloat 8s ease-in-out infinite alternate;
}
.blob1 { width: 500px; height: 500px; background: #5b4fcf; top: -100px; left: -100px; }
.blob2 { width: 400px; height: 400px; background: #cf4f8f; bottom: -100px; right: -100px; animation-delay: -3s; }
.blob3 { width: 300px; height: 300px; background: #4fcfcf; top: 40%; left: 40%; animation-delay: -6s; }

@keyframes blobFloat {
    from { transform: scale(1) translate(0,0); }
    to { transform: scale(1.2) translate(30px,20px); }
}

.splash-card {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 52px 48px;
    text-align: center;
    max-width: 460px; width: 90%;
    animation: splashIn 0.7s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes splashIn {
    from { opacity:0; transform: translateY(40px) scale(0.92); }
    to { opacity:1; transform: translateY(0) scale(1); }
}

.splash-logo {
    position: relative; width: 80px; height: 80px;
    margin: 0 auto 24px;
    display: flex; align-items: center; justify-content: center;
}
.logo-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    animation: spinRing 6s linear infinite;
    background: conic-gradient(from 0deg, #5b4fcf, #cf4f8f, #4fcfcf, #5b4fcf);
    mask: radial-gradient(circle at center, transparent 60%, black 60%);
    -webkit-mask: radial-gradient(circle at center, transparent 60%, black 60%);
}
@keyframes spinRing { to { transform: rotate(360deg); } }
.splash-logo i { font-size: 32px; color: white; }

.splash-card h1 {
    font-family: var(--font-head);
    font-size: 36px; font-weight: 800;
    color: white; letter-spacing: -1px;
    margin-bottom: 8px;
}
.splash-card h1 span { color: #7b6fe8; }
.splash-card p { color: rgba(255,255,255,0.6); margin-bottom: 28px; font-size: 15px; }

.splash-features {
    display: flex; gap: 16px; justify-content: center;
    margin-bottom: 32px;
}
.sf {
    padding: 8px 16px; border-radius: 50px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.sf i { color: #7b6fe8; }

.splash-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #5b4fcf, #7b3fbf);
    color: white; border: none; border-radius: 50px;
    font-family: var(--font-head); font-size: 16px; font-weight: 700;
    cursor: pointer; transition: var(--transition);
    box-shadow: 0 8px 30px rgba(91,79,207,0.4);
}
.splash-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(91,79,207,0.55); }
.splash-btn i { transition: transform 0.3s; }
.splash-btn:hover i { transform: translateX(4px); }

/* ===== LAYOUT ===== */
#mainApp {
    display: flex; min-height: 100vh;
}
#mainApp.hidden { display: none; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w); min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; z-index: 100;
    transition: transform var(--transition), background var(--transition);
}

.sidebar-logo {
    padding: 22px 24px;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-head); font-size: 20px; font-weight: 800;
    color: var(--primary); border-bottom: 1px solid var(--border);
}
.sidebar-logo i { font-size: 22px; }

.sidebar-nav {
    flex: 1; padding: 16px 12px;
    display: flex; flex-direction: column; gap: 4px;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border: none; background: transparent;
    color: var(--text-muted); font-family: var(--font-body);
    font-size: 14px; font-weight: 500;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: var(--transition); text-align: left; width: 100%;
}
.nav-item i { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active {
    background: var(--primary-light); color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-bottom { padding: 16px 12px; border-top: 1px solid var(--border); }

.theme-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border: none; background: var(--surface2);
    color: var(--text-muted); font-family: var(--font-body);
    font-size: 13px; border-radius: var(--radius-sm);
    cursor: pointer; width: 100%; transition: var(--transition);
}
.theme-btn:hover { color: var(--primary); background: var(--primary-light); }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 28px; gap: 16px;
    position: sticky; top: 0; z-index: 90;
    transition: background var(--transition);
}

.menu-btn {
    display: none; background: none; border: none;
    color: var(--text); cursor: pointer; font-size: 18px;
    padding: 6px;
}

.topbar-title {
    font-family: var(--font-head); font-size: 20px;
    font-weight: 700; flex: 1; color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.streak-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff6b35, #f7c59f);
    color: white; border-radius: 50px;
    font-size: 13px; font-weight: 600;
}
.streak-badge i { color: #fff200; }

.export-btn {
    padding: 8px 16px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text-muted); border-radius: var(--radius-sm);
    font-size: 13px; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; gap: 6px;
}
.export-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ===== PANELS ===== */
.panel { display: none; padding: 28px; animation: panelIn 0.3s ease; }
.panel.active { display: block; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== DASHBOARD ===== */
.greeting-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.greeting-bar h2 {
    font-family: var(--font-head); font-size: 26px;
    font-weight: 800; color: var(--text);
}
.greeting-bar p { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

.quick-add-trigger {
    padding: 10px 20px;
    background: var(--primary); color: white;
    border-radius: 50px; cursor: pointer;
    font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    transition: var(--transition); box-shadow: 0 4px 16px var(--primary-glow);
}
.quick-add-trigger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}

.stat-tile {
    background: var(--surface); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--border);
    transition: var(--transition); position: relative; overflow: hidden;
}
.stat-tile::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 80px; height: 80px; border-radius: 0 var(--radius) 0 80px;
    opacity: 0.07;
}
.stat-tile.primary::before { background: var(--primary); }
.stat-tile.success::before { background: var(--success); }
.stat-tile.warning::before { background: var(--warning); }
.stat-tile.danger::before { background: var(--danger); }

.stat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-tile.primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-tile.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-tile.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-tile.danger .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-num {
    font-family: var(--font-head); font-size: 32px;
    font-weight: 800; color: var(--text); line-height: 1;
}
.stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* Dashboard Row */
.dashboard-row {
    display: grid; grid-template-columns: 320px 1fr;
    gap: 20px; margin-bottom: 24px;
}

.progress-card, .recent-card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 24px;
}

.progress-card h3, .recent-card h3 {
    font-family: var(--font-head); font-size: 16px;
    font-weight: 700; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}

.badge-count {
    background: var(--primary); color: white;
    font-size: 12px; padding: 2px 8px; border-radius: 50px;
    font-family: var(--font-body); font-weight: 600;
}

/* Ring */
.ring-wrap {
    position: relative; width: 140px; height: 140px;
    margin: 0 auto 20px;
}
.ring-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.ring-fill {
    fill: none; stroke: var(--primary); stroke-width: 10;
    stroke-linecap: round; transition: stroke-dashoffset 0.8s ease;
}
.ring-text {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
}
.ring-pct {
    font-family: var(--font-head); font-size: 28px;
    font-weight: 800; display: block; color: var(--text);
}
.ring-sub { font-size: 11px; color: var(--text-muted); }

.progress-breakdown { display: flex; flex-direction: column; gap: 8px; }
.pb-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-muted);
}
.pb-item b { margin-left: auto; color: var(--text); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.high { background: var(--danger); }
.dot.med { background: var(--warning); }
.dot.low { background: var(--success); }

/* Today's tasks */
.today-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 20px; max-height: 140px; overflow-y: auto;
}
.today-task {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: var(--surface2);
    border-radius: var(--radius-sm); font-size: 13px;
}
.today-task .tt-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.today-task.done { opacity: 0.5; text-decoration: line-through; }

.mini-chart-wrap h4 {
    font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
    font-family: var(--font-head);
}

/* Category bars */
.cat-breakdown {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 24px;
}
.cat-breakdown h3 {
    font-family: var(--font-head); font-size: 16px;
    font-weight: 700; margin-bottom: 16px;
}
.cat-bars { display: flex; flex-direction: column; gap: 12px; }
.cat-bar-row { display: flex; align-items: center; gap: 12px; }
.cat-bar-label { width: 90px; font-size: 13px; color: var(--text-muted); }
.cat-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.cat-bar-count { font-size: 13px; font-weight: 700; color: var(--text); width: 24px; text-align: right; }

/* ===== TASKS PANEL ===== */
.add-form-card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 24px;
    margin-bottom: 20px;
}
.form-title {
    font-family: var(--font-head); font-size: 16px;
    font-weight: 700; margin-bottom: 16px; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}

.task-input {
    width: 100%; padding: 14px 16px;
    background: var(--surface2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font-body); font-size: 15px;
    margin-bottom: 12px; transition: var(--transition);
}
.task-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.task-input::placeholder { color: var(--text-muted); }

.form-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
}

select, input[type="date"] {
    padding: 10px 14px;
    background: var(--surface2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font-body); font-size: 14px;
    transition: var(--transition); cursor: pointer; width: 100%;
}
select:focus, input[type="date"]:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.add-btn {
    padding: 10px 22px;
    background: var(--primary); color: white; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--font-head); font-size: 14px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    transition: var(--transition); white-space: nowrap;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.add-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px var(--primary-glow); }

/* Filter Bar */
.filter-bar {
    display: flex; gap: 12px; margin-bottom: 20px;
    align-items: center; flex-wrap: wrap;
}
.search-wrap {
    position: relative; flex: 1; min-width: 200px;
}
.search-wrap i {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); color: var(--text-muted); font-size: 14px;
}
.search-wrap input {
    width: 100%; padding: 10px 14px 10px 40px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font-body); font-size: 14px;
    transition: var(--transition);
}
.search-wrap input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-wrap input::placeholder { color: var(--text-muted); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chips select { font-size: 13px; padding: 8px 12px; }

.clear-btn {
    padding: 8px 16px; background: var(--danger-light);
    color: var(--danger); border: 1px solid var(--danger);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; display: flex; align-items: center; gap: 6px;
    transition: var(--transition); white-space: nowrap; font-weight: 600;
}
.clear-btn:hover { background: var(--danger); color: white; }

/* Task List */
.todo-list { display: flex; flex-direction: column; gap: 10px; }

.task-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    display: flex; align-items: center; gap: 14px;
    transition: var(--transition);
    animation: taskIn 0.28s ease;
    position: relative; overflow: hidden;
}
.task-card::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0; width: 3px;
}
.task-card.priority-high::before { background: var(--danger); }
.task-card.priority-medium::before { background: var(--warning); }
.task-card.priority-low::before { background: var(--success); }

@keyframes taskIn {
    from { opacity:0; transform: translateY(-8px); }
    to { opacity:1; transform: translateY(0); }
}

.task-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card.completed { opacity: 0.55; }
.task-card.completed .task-text { text-decoration: line-through; color: var(--text-muted); }

/* Custom checkbox */
.task-check {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid var(--border); cursor: pointer;
    position: relative; flex-shrink: 0;
    background: var(--surface2); transition: var(--transition);
}
.task-check:checked {
    background: var(--primary); border-color: var(--primary);
}
.task-check:checked::after {
    content: '✓'; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%,-52%);
    color: white; font-size: 12px; font-weight: 700;
}
.task-check:hover { border-color: var(--primary); }

.task-content { flex: 1; min-width: 0; }
.task-text {
    font-size: 15px; font-weight: 500; color: var(--text);
    margin-bottom: 6px; word-break: break-word;
}
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge {
    padding: 2px 10px; border-radius: 50px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
}
.badge-high { background: var(--danger-light); color: var(--danger); }
.badge-medium { background: var(--warning-light); color: var(--warning); }
.badge-low { background: var(--success-light); color: var(--success); }
.badge-cat { background: var(--primary-light); color: var(--primary); }

.task-due {
    font-size: 11px; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
}
.task-due.overdue { color: var(--danger); font-weight: 700; }
.task-due.today { color: var(--warning); font-weight: 700; }

.task-actions { display: flex; gap: 6px; }

.action-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface2);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: var(--transition);
}
.action-btn:hover { transform: scale(1.1); }
.action-btn.edit:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.action-btn.delete:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
.action-btn.pomo-pick:hover { background: var(--success-light); color: var(--success); border-color: var(--success); }

/* Empty State */
.empty-state {
    text-align: center; padding: 80px 20px;
    color: var(--text-muted);
}
.empty-illustration i { font-size: 64px; opacity: 0.2; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.empty-state small { font-size: 13px; }

/* ===== ANALYTICS ===== */
.analytics-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.analytics-header h2 {
    font-family: var(--font-head); font-size: 24px; font-weight: 800;
}

.time-tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 4px; }
.tt {
    padding: 6px 16px; border: none; background: transparent;
    color: var(--text-muted); border-radius: 8px; cursor: pointer;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    transition: var(--transition);
}
.tt.active { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: var(--shadow); }

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    transition: var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h4 {
    font-family: var(--font-head); font-size: 15px;
    font-weight: 700; margin-bottom: 16px; color: var(--text);
}
.chart-card h4 small { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }

.chart-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 16px;
}
.chart-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.chart-legend { display: flex; gap: 12px; }
.chart-legend span {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-muted);
}
.leg-dot { width: 10px; height: 10px; border-radius: 50%; }
.completed-dot { background: var(--primary); }
.added-dot { background: var(--success); }

.donut-wrap { display: flex; align-items: center; justify-content: center; padding: 8px 0; }

/* Score Card */
.score-card { display: flex; flex-direction: column; }
.score-display { text-align: center; padding: 20px 0; }
.score-num {
    font-family: var(--font-head); font-size: 56px;
    font-weight: 800; color: var(--primary); line-height: 1;
}
.score-grade {
    font-size: 16px; font-weight: 700; color: var(--text-muted);
    margin-top: 4px;
}
.score-breakdown { margin-top: auto; }
.sb-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted);
}
.sb-row:last-child { border-bottom: none; }
.sb-row span:last-child { font-weight: 700; color: var(--text); }

/* Heatmap */
.heatmap-card { grid-column: 1 / -1; }
.heatmap {
    display: grid; grid-template-columns: repeat(28, 1fr);
    gap: 4px;
}
.heat-cell {
    aspect-ratio: 1; border-radius: 3px;
    background: var(--border); position: relative;
    transition: transform 0.2s;
    cursor: default;
}
.heat-cell:hover { transform: scale(1.3); z-index: 1; }
.heat-cell[data-level="1"] { background: rgba(91,79,207,0.2); }
.heat-cell[data-level="2"] { background: rgba(91,79,207,0.45); }
.heat-cell[data-level="3"] { background: rgba(91,79,207,0.7); }
.heat-cell[data-level="4"] { background: var(--primary); }

/* ===== POMODORO ===== */
.pomodoro-wrap {
    display: grid; grid-template-columns: 420px 1fr;
    gap: 24px;
}

.pomo-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    text-align: center;
}

.pomo-mode-tabs {
    display: flex; gap: 4px; background: var(--surface2);
    border-radius: 10px; padding: 4px; margin-bottom: 32px;
}
.pomo-tab {
    flex: 1; padding: 8px 4px; border: none; background: transparent;
    color: var(--text-muted); border-radius: 8px; cursor: pointer;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    transition: var(--transition);
}
.pomo-tab.active { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: var(--shadow); }

.pomo-timer-display { margin-bottom: 32px; }

.pomo-ring {
    position: relative; width: 220px; height: 220px;
    margin: 0 auto;
}
.pomo-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.pr-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.pr-fill {
    fill: none; stroke: var(--primary); stroke-width: 8;
    stroke-linecap: round; transition: stroke-dashoffset 0.5s ease;
}

.pomo-time {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    font-family: var(--font-head); font-size: 48px;
    font-weight: 800; color: var(--text);
    letter-spacing: -2px;
}

.pomo-controls { display: flex; gap: 16px; align-items: center; justify-content: center; margin-bottom: 24px; }

.pomo-play {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--primary); color: white; border: none;
    font-size: 20px; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px var(--primary-glow);
}
.pomo-play:hover { transform: scale(1.08); box-shadow: 0 10px 30px var(--primary-glow); }

.pomo-ctrl {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface2); border: 1.5px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; transition: var(--transition);
}
.pomo-ctrl:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.pomo-sessions { margin-bottom: 24px; }
.pomo-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.pomo-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--border); transition: var(--transition);
}
.pomo-dot.filled { background: var(--primary); }
.pomo-sessions p { font-size: 13px; color: var(--text-muted); }

.pomo-settings {
    border-top: 1px solid var(--border); padding-top: 20px;
    display: flex; flex-direction: column; gap: 10px;
}
.ps-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; color: var(--text-muted);
}
.ps-row input[type="number"] {
    width: 60px; padding: 6px 10px; text-align: center;
    font-size: 14px; font-weight: 700;
}

/* Pomodoro Right */
.pomo-right { display: flex; flex-direction: column; gap: 16px; }

.pomo-task-card, .pomo-stats-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.pomo-task-card h3, .pomo-stats-card h3 {
    font-family: var(--font-head); font-size: 15px;
    font-weight: 700; margin-bottom: 14px; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}

.pomo-current-task {
    background: var(--primary-light); border-radius: var(--radius-sm);
    padding: 14px 16px; min-height: 50px;
    display: flex; align-items: center;
}
.no-task-msg { color: var(--text-muted); font-size: 14px; }
.pomo-selected-task { font-size: 14px; font-weight: 600; color: var(--primary); }

.pomo-task-list {
    max-height: 200px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
}
.pomo-task-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--surface2);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: var(--transition); font-size: 13px;
    border: 1.5px solid transparent;
}
.pomo-task-item:hover { border-color: var(--primary); background: var(--primary-light); }
.pomo-task-item.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

.pomo-today-stats { display: flex; justify-content: space-around; }
.pts-item { text-align: center; }
.pts-num {
    font-family: var(--font-head); font-size: 28px;
    font-weight: 800; color: var(--primary);
}
.pts-lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== MODAL ===== */
.modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; z-index: 1000;
    animation: fadeIn 0.2s ease;
}
.modal.show { display: flex; }

@keyframes fadeIn { from {opacity:0} to {opacity:1} }

.modal-content {
    background: var(--surface); border-radius: 20px;
    width: 90%; max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modalIn {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-family: var(--font-head); font-size: 18px; font-weight: 700;
    display: flex; align-items: center; gap: 8px; color: var(--primary);
}
.close-modal {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); font-size: 14px;
}
.close-modal:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.modal-input {
    width: 100%; padding: 12px 16px;
    background: var(--surface2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font-body); font-size: 14px;
    transition: var(--transition);
}
.modal-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.modal-textarea {
    width: 100%; padding: 12px 16px; height: 80px; resize: vertical;
    background: var(--surface2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font-body); font-size: 14px;
    transition: var(--transition);
}
.modal-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-select { font-size: 14px; padding: 12px 14px; }

.modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end;
}
.btn-save {
    padding: 10px 24px; background: var(--primary);
    color: white; border: none; border-radius: var(--radius-sm);
    font-family: var(--font-head); font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: var(--transition); box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 8px 20px var(--primary-glow); }
.btn-cancel {
    padding: 10px 20px; background: var(--surface2);
    border: 1.5px solid var(--border); color: var(--text-muted);
    border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--font-body); font-size: 14px;
    transition: var(--transition);
}
.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

/* ===== UNDO TOAST ===== */
.undo-toast {
    position: fixed; bottom: 28px; left: 50%;
    transform: translateX(-50%);
    background: var(--text); color: var(--surface);
    padding: 14px 20px; border-radius: 12px;
    display: flex; align-items: center; gap: 14px;
    font-size: 14px; z-index: 2000;
    box-shadow: var(--shadow-lg); min-width: 280px;
    animation: toastIn 0.3s cubic-bezier(.34,1.56,.64,1);
}
.undo-toast.hidden { display: none; }

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

#undoBtn {
    padding: 6px 14px; background: var(--primary);
    color: white; border: none; border-radius: 8px;
    cursor: pointer; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; gap: 6px;
    transition: var(--transition); margin-left: auto;
}
#undoBtn:hover { background: #7b6fe8; }

/* ===== SHORTCUTS PANEL ===== */
.shortcuts-panel {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}
.shortcuts-panel.hidden { display: none; }

.shortcuts-card {
    background: var(--surface); border-radius: 20px;
    padding: 32px; max-width: 380px; width: 90%;
    border: 1px solid var(--border);
    position: relative;
}
.shortcuts-card h3 {
    font-family: var(--font-head); font-size: 20px;
    font-weight: 800; margin-bottom: 20px; color: var(--text);
}
.shortcut-list { display: flex; flex-direction: column; gap: 10px; }
.shortcut-item {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; color: var(--text-muted);
}
kbd {
    padding: 4px 10px; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 6px;
    font-family: monospace; font-size: 12px; color: var(--text);
    box-shadow: 0 2px 0 var(--border);
}
#closeShortcuts {
    position: absolute; top: 20px; right: 20px;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: var(--transition);
}
#closeShortcuts:hover { background: var(--danger-light); color: var(--danger); }

/* ===== CONFETTI ===== */
.confetti-container {
    position: fixed; inset: 0; pointer-events: none; z-index: 9998;
}
.confetti-piece {
    position: absolute; width: 10px; height: 10px;
    animation: confettiFall 1.5s ease-in forwards;
    border-radius: 2px;
}
@keyframes confettiFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-row { grid-template-columns: 1fr; }
    .pomodoro-wrap { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .chart-card.wide { grid-column: 1; }
    .heatmap-card { grid-column: 1; }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar {
        transform: translateX(-240px);
        width: 240px;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-btn { display: flex; }
    .form-row { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar { padding: 0 16px; }
    .panel { padding: 16px; }
    .heatmap { grid-template-columns: repeat(14, 1fr); }
    .topbar-actions { gap: 6px; }
    .streak-badge span { display: none; }
}
