:root {
    --bg: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-hover: #F1F3F5;
    --bg-active: #E7F5FF;
    --bg-input: #F1F3F5;
    --bg-modal: #FFFFFF;
    --text-primary: #212529;
    --text-secondary: #868E96;
    --text-muted: #ADB5BD;
    --border: #E9ECEF;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --brand: #339AF0;
    --brand-light: #E7F5FF;
    --brand-dark: #1C7ED6;
    --priority-high: #FF6B6B;
    --priority-medium: #FFA94D;
    --priority-low: #4DABF7;
    --priority-none: #CED4DA;
    --success: #51CF66;
    --danger: #FF6B6B;
    --sidebar-w: 260px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #1A1B1E;
    --bg-card: #25262B;
    --bg-sidebar: #1A1B1E;
    --bg-hover: #2C2E33;
    --bg-active: #1B3A5C;
    --bg-input: #2C2E33;
    --bg-modal: #2C2E33;
    --text-primary: #E9ECEF;
    --text-secondary: #909296;
    --text-muted: #5C5F66;
    --border: #373A40;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --brand-light: #1B3A5C;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition);
    z-index: 100;
}

.sidebar-header {
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    color: var(--brand);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3);
    }
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), #845EF7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-close {
    display: none;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    transition: all var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--brand);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.nav-label {
    flex: 1;
}

.nav-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 1px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.nav-count:empty {
    display: none;
}

.custom-list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.custom-list-item:hover {
    background: var(--bg-hover);
}

.custom-list-item.active {
    background: var(--bg-active);
    color: var(--brand);
    font-weight: 600;
}

.list-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity var(--transition);
}

.custom-list-item:hover .list-actions {
    opacity: 1;
}

.custom-list-item:hover .nav-count {
    opacity: 0;
}

.btn-list-more {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.list-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Sidebar bottom tabs */
.sidebar-bottom-tabs {
    display: flex;
    border-top: 1px solid var(--border);
    padding: 4px;
}

.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 11px;
}

.bottom-tab:hover {
    background: var(--bg-hover);
}

.bottom-tab.active {
    color: var(--brand);
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-weight: 500;
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 150;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.page {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.page.active {
    display: flex;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 28px 12px;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    flex: 1;
}

.sidebar-toggle {
    display: none;
}

/* ========== Task List ========== */
.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 100px;
}

.task-group-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 16px 8px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item:hover {
    background: var(--bg-hover);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--priority-none);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-top: 1px;
}

.task-checkbox:hover {
    transform: scale(1.1);
}

.task-checkbox.priority-3 {
    border-color: var(--priority-high);
}

.task-checkbox.priority-2 {
    border-color: var(--priority-medium);
}

.task-checkbox.priority-1 {
    border-color: var(--priority-low);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 14px;
    font-weight: 450;
    color: var(--text-primary);
    word-break: break-word;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.task-due.overdue {
    color: var(--danger);
}

.task-due.today {
    color: var(--brand);
}

.task-tag {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--bg-active);
    color: var(--brand);
}

.task-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.task-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.task-empty-text {
    font-size: 14px;
}

/* ========== FAB ========== */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #845EF7);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(51, 154, 240, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 50;
}

.fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 24px rgba(51, 154, 240, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
}

/* ========== QuickAdd ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.quickadd-sheet {
    width: 100%;
    max-width: 600px;
    background: var(--bg-modal);
    border-radius: 20px;
    padding: 20px 24px 28px;
    animation: scaleIn 0.2s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.quickadd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.quickadd-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.quickadd-parsed {
    min-height: 0;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--brand);
    transition: all var(--transition);
}

.quickadd-parsed:empty {
    margin: 0;
}

.quickadd-input-wrap {
    display: flex;
    gap: 8px;
}

.quickadd-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition);
    font-family: inherit;
}

.quickadd-input:focus {
    border-color: var(--brand);
}

/* ========== Task Drawer ========== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    display: none;
    z-index: 150;
}

.drawer-overlay.active {
    display: block;
}

.task-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: slideRight 0.3s ease;
    z-index: 151;
}

@keyframes slideRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.drawer-actions {
    display: flex;
    gap: 4px;
}

.drawer-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-title-input {
    font-size: 20px;
    font-weight: 600;
    border: none;
    outline: none;
    background: none;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}

.task-meta-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
    font-family: inherit;
}

.meta-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.meta-btn.has-value {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.task-tags-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.task-desc-input {
    flex: 1;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', monospace;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color var(--transition);
}

.task-desc-input:focus {
    border-color: var(--brand);
}

/* ========== Pomodoro Button ========== */
.btn-pomodoro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), #845EF7);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-pomodoro:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(51, 154, 240, 0.4);
}

/* ========== Pomodoro Fullscreen ========== */
.pomodoro-fullscreen {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #1A1B2E 0%, #0D0E1A 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    flex-direction: column;
}

.pomodoro-fullscreen.active {
    display: flex;
}

.pomodoro-content {
    text-align: center;
}

.pomodoro-task-name {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.pomodoro-timer {
    font-size: 96px;
    font-weight: 200;
    color: white;
    letter-spacing: 4px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 60px rgba(51, 154, 240, 0.3);
}

.pomodoro-status {
    color: var(--brand);
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    letter-spacing: 2px;
}

.pomodoro-actions {
    display: flex;
    gap: 16px;
    margin-top: 48px;
    justify-content: center;
}

.btn-pomodoro-action {
    padding: 12px 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-pomodoro-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-pomodoro-action.btn-abandon {
    border-color: rgba(255, 107, 107, 0.4);
    color: var(--danger);
}

.btn-pomodoro-action.btn-abandon:hover {
    background: rgba(255, 107, 107, 0.1);
}

.focus-content {
    gap: 20px;
}

.focus-task-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.focus-task-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.focus-task-meta {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.focus-timer {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    text-align: center;
    margin: 20px 0 12px;
}

.focus-status {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.focus-note {
    color: var(--text-secondary);
    line-height: 1.6;
}

.focus-content .pomodoro-actions {
    margin-top: 16px;
}

.focus-content .btn-pomodoro-action {
    min-width: 132px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.focus-content .btn-pomodoro-action:hover:not(:disabled) {
    background: var(--bg-hover);
}

.focus-content #focus-start-btn {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand), #845EF7);
    color: white;
}

.focus-content #focus-start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--brand-dark), #7048E8);
}

.focus-content .btn-pomodoro-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== Popover ========== */
.popover {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 180px;
    display: none;
    z-index: 250;
}

.popover.active {
    display: block;
}

.popover-shortcuts {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.shortcut-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.shortcut-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.popover input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.priority-option,
.list-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    font-family: inherit;
}

.priority-option:hover,
.list-option:hover {
    background: var(--bg-hover);
}

.priority-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.priority-dot.high {
    background: var(--priority-high);
}

.priority-dot.medium {
    background: var(--priority-medium);
}

.priority-dot.low {
    background: var(--priority-low);
}

.priority-dot.none {
    background: var(--priority-none);
}

/* ========== Modals ========== */
.modal-content {
    background: var(--bg-modal);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    margin: auto;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    margin-bottom: 12px;
    font-family: inherit;
}

.modal-input:focus {
    border-color: var(--brand);
}

.modal-input-sm {
    width: 70px;
    text-align: center;
}

.modal-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.habit-freq-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.freq-unit {
    font-size: 14px;
    color: var(--text-secondary);
}

.color-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.color-dot:hover {
    transform: scale(1.1);
}

.color-dot.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-card);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ========== Buttons ========== */
.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-ghost {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-ghost:hover {
    background: var(--bg-hover);
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

/* ========== Toggle Switch ========== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--brand);
    border-color: var(--brand);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ========== Settings ========== */
.settings-content {
    padding: 8px 28px 28px;
    overflow-y: auto;
    flex: 1;
}

.setting-group {
    margin-bottom: 28px;
}

.setting-group h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.setting-label {
    font-size: 14px;
}

.setting-value {
    font-size: 14px;
    color: var(--text-secondary);
}

.setting-input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    outline: none;
    font-family: inherit;
}

/* ========== Habits ========== */
.habit-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 28px;
}

.habit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all var(--transition);
    cursor: pointer;
    animation: slideIn 0.3s ease;
}

.habit-card:hover {
    box-shadow: var(--shadow);
}

.habit-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.habit-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.habit-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.habit-freq {
    font-size: 12px;
    color: var(--text-secondary);
}

.habit-checkin-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--border);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.habit-checkin-btn:hover {
    border-color: var(--success);
}

.habit-checkin-btn.checked {
    border-color: var(--success);
    background: var(--success);
    animation: checkinPop 0.4s ease;
}

@keyframes checkinPop {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.2);
    }

    60% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.habit-checkin-btn.checked::after {
    content: '✓';
    color: white;
    font-weight: 700;
}

/* Heatmap */
.habit-heatmap {
    display: none;
    padding: 16px 0 4px;
    overflow-x: auto;
}

.habit-card.expanded .habit-heatmap {
    display: block;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, 12px);
    grid-template-rows: repeat(7, 12px);
    gap: 2px;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--bg-input);
    transition: background var(--transition);
}

.heatmap-cell[data-level="1"] {
    background: #C6F6D5;
}

.heatmap-cell[data-level="2"] {
    background: #68D391;
}

.heatmap-cell[data-level="3"] {
    background: #38A169;
}

.heatmap-cell[data-level="4"] {
    background: #276749;
}

[data-theme="dark"] .heatmap-cell[data-level="1"] {
    background: #1C4532;
}

[data-theme="dark"] .heatmap-cell[data-level="2"] {
    background: #276749;
}

[data-theme="dark"] .heatmap-cell[data-level="3"] {
    background: #38A169;
}

[data-theme="dark"] .heatmap-cell[data-level="4"] {
    background: #68D391;
}

.heatmap-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.habit-delete-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    margin-top: 12px;
    transition: all var(--transition);
    font-family: inherit;
}

.habit-delete-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.habit-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    color: var(--text-primary);
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== Confetti ========== */
.confetti-piece {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    z-index: 400;
    pointer-events: none;
    animation: confettiFall 1s ease forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(100px) rotate(720deg);
    }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .task-drawer {
        width: 100%;
    }

    .pomodoro-timer {
        font-size: 64px;
    }

    .fab {
        bottom: 20px;
        right: 20px;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
