:root {
    /* Colors */
    --bg-primary: #071a12;
    --bg-secondary: #0a2b1e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-sidebar: rgba(255, 255, 255, 0.03);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-primary: #55d187;
    --accent-primary-light: #7fe0a8;
    --accent-primary-dark: #3fb26f;
    --danger: #ff4d4d;
    --danger-light: #ff6b6b;
    --warning: #ffaa44;
    --warning-light: #ffbb55;
    --info: #4da6ff;
    --info-light: #66b2ff;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    
    --font-size-xxs: 0.625rem;    /* 10px */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    
    /* Border Radius */
    --radius-none: 0;
    --radius-xs: 0.125rem;   /* 2px */
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    
    /* Blur */
    --blur-xs: blur(2px);
    --blur-sm: blur(4px);
    --blur-md: blur(8px);
    --blur-lg: blur(16px);
    --blur-xl: blur(32px);
    
    /* Z-index */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-auto: auto;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* Layout */
    --header-height: 70px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;

    /* Glass (shared) */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 12px;

    /* Primary alias (used throughout) */
    --primary: #55d187;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Utilities */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

/* Spacing Utilities */
.m-0 { margin: var(--space-0); }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }
.m-10 { margin: var(--space-10); }
.m-12 { margin: var(--space-12); }
.m-16 { margin: var(--space-16); }
.m-20 { margin: var(--space-20); }

.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }
.p-12 { padding: var(--space-12); }
.p-16 { padding: var(--space-16); }
.p-20 { padding: var(--space-20); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

/* Flex Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
/* Border Radius Utilities */
.rounded-none { border-radius: var(--radius-none); }
.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-inner { box-shadow: var(--shadow-inner); }

/* Glass Effect Utilities */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

/* Blur Utilities */
.blur-xs { filter: var(--blur-xs); }
.blur-sm { filter: var(--blur-sm); }
.blur-md { filter: var(--blur-md); }
.blur-lg { filter: var(--blur-lg); }
.blur-xl { filter: var(--blur-xl); }

/* Colors */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-card { background-color: var(--bg-card); }
.bg-sidebar { background-color: var(--bg-sidebar); }
.bg-accent { background-color: var(--accent-primary); }
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); }
.bg-info { background-color: var(--info); }

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(85, 209, 135, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    opacity: 1;
}

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

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.card-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--accent-primary);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.card-content {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* Stats Card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--accent-primary);
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    background: var(--bg-card);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%);
    color: var(--bg-primary);
    border-color: var(--accent-primary-dark);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(85, 209, 135, 0.4);
}

/* Buttons - Danger */
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #cc0000 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 20px rgba(255, 77, 77, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #dd8800 100%);
    color: white;
}
.btn-warning:hover {
    box-shadow: 0 4px 20px rgba(255, 170, 68, 0.4);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
}

/* Inputs */
.input {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

.input::placeholder {
    color: var(--text-muted);
}

.input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(85, 209, 135, 0.1);
}

.input:hover {
    border-color: var(--accent-primary-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-0) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, rgba(85, 209, 135, 0.1) 0%, rgba(85, 209, 135, 0.2) 100%);
    color: var(--accent-primary);
    border: 1px solid rgba(85, 209, 135, 0.3);
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.1) 0%, rgba(255, 77, 77, 0.2) 100%);
    color: var(--danger);
    border: 1px solid rgba(255, 77, 77, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(255, 170, 68, 0.1) 0%, rgba(255, 170, 68, 0.2) 100%);
    color: var(--warning);
    border: 1px solid rgba(255, 170, 68, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, rgba(77, 166, 255, 0.1) 0%, rgba(77, 166, 255, 0.2) 100%);
    color: var(--info);
    border: 1px solid rgba(77, 166, 255, 0.3);
}

/* Chip */
/* Tag */
.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-0) var(--space-2);
    background: rgba(85, 209, 135, 0.1);
    border: 1px solid rgba(85, 209, 135, 0.3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--accent-primary);
    font-weight: var(--font-weight-medium);
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    border: none;
    margin: var(--space-4) 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: rgba(85, 209, 135, 0.3);
    border-radius: var(--radius-full);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(85, 209, 135, 0.5);
}

/* Selection */
::selection {
    background: rgba(85, 209, 135, 0.3);
    color: var(--text-primary);
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--accent-primary);
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-right: 1px solid var(--border-color);
    z-index: var(--z-sticky);
    padding: var(--space-4) 0;
    overflow-y: auto;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: 0 var(--space-3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: rgba(85, 209, 135, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(85, 209, 135, 0.15);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: var(--space-6);
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding: 0 var(--space-1);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: var(--z-fixed);
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .dashboard-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 var(--space-4);
    }

    .main-content {
        padding: var(--space-4);
    }

    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== POMODORO TIMER ==================== */

.pomodoro-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pomodoro-card {
    width: 100%;
    text-align: center;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
}

.pomodoro-modes {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-bottom: var(--space-6);
}

.pomodoro-mode {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.pomodoro-mode:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.pomodoro-mode.active {
    background: rgba(85,209,135,0.12);
    color: var(--primary);
    border-color: rgba(85,209,135,0.3);
}
.pomodoro-mode:disabled { opacity: 0.5; cursor: not-allowed; }

.pomodoro-timer {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomodoro-progress {
    position: absolute;
    top: 0; left: 0;
}

.pomodoro-time {
    font-size: 56px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    letter-spacing: 3px;
    line-height: 1;
}

.pomodoro-label {
    position: absolute;
    bottom: 44px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pomodoro-controls {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-bottom: var(--space-6);
}

.pomodoro-btn {
    min-width: 120px;
    font-size: var(--font-size-base);
}

.pomodoro-stats {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
}

.pomodoro-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pomodoro-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}
.pomodoro-stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Focus Mode Overlay */
.focus-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 1000);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1), visibility 0.4s;
}
.focus-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.focus-overlay.active { opacity: 1; visibility: visible; }

.focus-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 26, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.focus-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-8);
    max-width: 600px;
    width: 100%;
    animation: focusEnter 0.5s cubic-bezier(0.4,0,0.2,1);
}
.focus-overlay.exiting .focus-content {
    animation: focusExit 0.35s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes focusEnter {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes focusExit {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(1.05) translateY(-10px); }
}

.focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.focus-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}
.focus-exit {
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.focus-exit:hover {
    background: rgba(255,80,80,0.15);
    color: #ff6b6b;
    border-color: rgba(255,80,80,0.3);
}

.focus-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-8);
    width: 100%;
}

/* Focus Task Card */
.focus-task {
    width: 100%;
}
.focus-task-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.focus-task-card .focus-task-priority {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.focus-task-card .focus-task-priority.priority-critical { background: #ff4757; }
.focus-task-card .focus-task-priority.priority-high { background: #ff6b6b; }
.focus-task-card .focus-task-priority.priority-medium { background: var(--warning); }
.focus-task-card .focus-task-priority.priority-low { background: var(--primary); }

.focus-task-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-3) 0 var(--space-2);
    line-height: 1.3;
}
.focus-task-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto var(--space-3);
}
.focus-task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
}
.focus-task-tags .tag {
    background: rgba(85,209,135,0.12);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
}

/* Focus Timer */
.focus-timer {
    text-align: center;
}
.focus-timer-ring {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}
.focus-timer-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    letter-spacing: 2px;
}
.focus-timer-label {
    margin-top: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.focus-footer {
    text-align: center;
}
.focus-footer kbd {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-family: inherit;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-4));
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
    max-width: 400px;
    word-wrap: break-word;
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
    }
}

.toast.hide {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
    }
}

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

/* Modal Container */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-container.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-container.active .modal {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    margin-bottom: var(--space-5);
}

.modal-footer {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%);
    border: none;
    border-radius: 50%;
    color: var(--bg-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(85, 209, 135, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-fixed);
    position: relative;
    overflow: hidden;
}

.fab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.fab:hover::before {
    left: 100%;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(85, 209, 135, 0.6);
}

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

.fab-tooltip {
    position: absolute;
    right: 70px;
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 1px solid var(--border-color);
}

.fab:hover .fab-tooltip {
    opacity: 1;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Drag and Drop */
.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

/* Responsive design improvements */
@media (max-width: 640px) {
    .header-brand span {
        display: none;
    }

    .modal {
        padding: var(--space-4);
    }

    .fab {
        width: 48px;
        height: 48px;
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .main-content { padding: var(--space-3); }
    .section-header { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .section-actions { width: 100%; }
    .search-wrapper { width: 100%; }
    .input-search { width: 100%; }
    .filter-bar { flex-wrap: wrap; }
    .filter-group { flex: 1 1 45%; min-width: 0; }
    .modal { margin: var(--space-2); padding: var(--space-4); }
    .form-row { grid-template-columns: 1fr; }
    .fab { width: 44px; height: 44px; font-size: var(--font-size-base); bottom: var(--space-4); right: var(--space-4); }
    .dash-summary { grid-template-columns: 1fr; }
}

/* ===== Phase 8: Task UI ===== */

/* View System */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.2s ease; }

/* Header Logo */
.header-logo {
    width: 36px; height: 36px;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    color: var(--bg-primary);
    font-size: var(--font-size-lg);
}

.header-clock {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-variant-numeric: tabular-nums;
}

/* Sidebar toggle (mobile) */
.sidebar-toggle {
    display: none;
    background: none; border: none; color: var(--text-primary);
    font-size: 20px; cursor: pointer; padding: 8px;
    margin-right: 8px;
}

/* Section Actions */
.section-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.input-search {
    max-width: 260px;
    padding-left: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}

/* Filter Bar */
.filter-bar { display: flex; gap: var(--space-4); align-items: end; padding: var(--space-4) 0; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: var(--space-1); }
.filter-label { font-size: var(--font-size-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-bar .input-sm { min-width: 130px; }

/* Bulk Bar */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(85,209,135,0.08);
    border: 1px solid rgba(85,209,135,0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    animation: fadeIn 0.2s ease;
}
.bulk-count { font-size: var(--font-size-sm); color: var(--text-secondary); margin-right: auto; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    animation: fadeIn 0.3s ease;
}
.empty-icon { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.6; }
.empty-state h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-2); }
.empty-state p { color: var(--text-secondary); margin-bottom: var(--space-6); }

/* Task Card */
.task-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    overflow: hidden;
}
.task-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
    transition: opacity 0.2s;
    opacity: 0;
}
.task-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.task-card:hover::before { opacity: 1; }

.task-card.priority-critical::before { background: var(--danger); opacity: 1; }
.task-card.priority-high::before { background: var(--warning); opacity: 1; }
.task-card.priority-medium::before { background: var(--info); opacity: 1; }
.task-card.priority-low::before { background: var(--text-muted); opacity: 1; }

.task-card.status-done { opacity: 0.65; }
.task-card.status-done .task-title { text-decoration: line-through; text-decoration-color: var(--accent-primary); }

.task-card.selected { border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(85,209,135,0.2); }

.task-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    cursor: pointer;
}

.task-check {
    width: 20px; height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    background: transparent;
    color: transparent;
    font-size: 12px;
}
.task-check:hover { border-color: var(--accent-primary); }
.task-check.checked { background: var(--accent-primary); border-color: var(--accent-primary); color: var(--bg-primary); }

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

.task-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    word-break: break-word;
}

.task-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-1);
}

.task-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 10px;
    background: rgba(85,209,135,0.12);
    border: 1px solid rgba(85,209,135,0.2);
    border-radius: 4px;
    color: var(--accent-primary);
    text-transform: lowercase;
}

.task-tag.tag-work { background: rgba(77,166,255,0.12); border-color: rgba(77,166,255,0.25); color: var(--info); }
.task-tag.tag-personal { background: rgba(85,209,135,0.12); border-color: rgba(85,209,135,0.25); color: var(--accent-primary); }
.task-tag.tag-health { background: rgba(255,77,77,0.1); border-color: rgba(255,77,77,0.2); color: var(--danger); }
.task-tag.tag-urgent { background: rgba(255,170,68,0.12); border-color: rgba(255,170,68,0.25); color: var(--warning); }
.task-tag.tag-dev { background: rgba(170,85,255,0.12); border-color: rgba(170,85,255,0.2); color: #aa55ff; }
.task-tag.tag-meeting { background: rgba(85,209,135,0.1); border-color: rgba(85,209,135,0.2); color: var(--accent-primary); }

.task-date {
    font-size: 10px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.task-date.overdue { color: var(--danger); }
.task-date.due-soon { color: var(--warning); }

.task-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    opacity: 0;
    transition: opacity 0.2s;
}
.task-card:hover .task-actions { opacity: 1; }

.task-action-btn {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}
.task-action-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.task-action-btn.fav-active { color: var(--warning); }
.task-action-btn.fav-active:hover { color: var(--warning); }
.task-action-btn.danger:hover { color: var(--danger); background: rgba(255,77,77,0.1); }

.task-fav {
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    opacity: 0;
    flex-shrink: 0;
    padding: 4px;
}
.task-card:hover .task-fav { opacity: 0.5; }
.task-fav.active { opacity: 1 !important; color: var(--warning); }
.task-fav:hover { opacity: 1 !important; transform: scale(1.2); }

.task-card-footer {
    display: none;
    padding: 0 var(--space-4) var(--space-3) calc(var(--space-4) + 32px);
}
.task-card.expanded .task-card-footer { display: block; animation: fadeIn 0.2s ease; }
.task-expand-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
}

/* Sub-task list */
.subtask-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 0;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}
.subtask-item .task-check { width: 16px; height: 16px; font-size: 10px; margin-top: 0; }
.subtask-item.done { text-decoration: line-through; color: var(--text-muted); }

.subtask-list { margin-bottom: var(--space-3); }
.subtask-add { display: flex; gap: var(--space-2); align-items: center; }

/* Form helpers */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: var(--font-size-xs); color: var(--text-secondary); margin-bottom: var(--space-1); text-transform: uppercase; letter-spacing: 0.05em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-hint { font-size: 10px; color: var(--text-muted); margin-top: 2px; display: block; }

.input-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: var(--space-4);
}
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-value { font-size: var(--font-size-3xl); font-weight: var(--font-weight-bold); color: var(--accent-primary); }
.stat-label { font-size: var(--font-size-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: var(--space-1); }

/* Progress bar */
.progress-bar {
    width: 100%; height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin: var(--space-2) 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-light));
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* Focus mode */
.focus-active .sidebar { display: none; }
.focus-active .header { display: none; }
.focus-active .main-content { margin-left: 0; margin-top: 0; padding-top: var(--space-6); }
.focus-active .fab { display: none; }

/* Responsive for task UI */
@media (max-width: 768px) {
    .task-meta { flex-wrap: wrap; }
    .task-actions { opacity: 1; }
    .task-fav { opacity: 0.5; }
    .task-card-header { padding: var(--space-3); }
    .form-row { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .input-sm { min-width: auto; }
    .section-actions { flex-wrap: wrap; }
    .input-search { max-width: 100%; }
}

/* ===== Phase 9: Search & Filter Enhancements ===== */

/* Search Wrapper */
.search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.search-clear {
    position: absolute;
    right: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.15s;
}
.search-clear:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

#result-count {
    display: block;
    margin-top: 2px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Highlight search matches */
.search-highlight {
    background: rgba(85, 209, 135, 0.25);
    color: var(--accent-primary-light);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: var(--font-weight-semibold);
}

/* Active filters bar */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    min-height: 0;
}
.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(85,209,135,0.1);
    border: 1px solid rgba(85,209,135,0.2);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--accent-primary);
    animation: fadeIn 0.2s ease;
}
.active-filter-tag .remove-filter {
    cursor: pointer;
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.active-filter-tag .remove-filter:hover { opacity: 1; color: var(--danger); }

/* Result count animation */
@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.count-pulse { animation: countPulse 0.3s ease; }

/* ===== Phase 10: Drag & Drop ===== */

/* Drag states */
.task-card.dragging {
    opacity: 0;
    height: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
    transition: opacity 0.15s ease, height 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}
.task-card.dragging * { pointer-events: none; }
.task-card.drag-over { border-bottom: 2px solid var(--accent-primary); }
.task-card.drag-over {
    border-bottom: 2px solid var(--accent-primary);
    margin-bottom: -2px;
}
.task-card.drag-ghost {
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border-color: var(--accent-primary);
    transition: none;
}

/* Drag placeholder */
.drag-placeholder {
    border: 2px dashed var(--accent-primary);
    border-radius: var(--radius-md);
    background: rgba(85, 209, 135, 0.06);
    margin: var(--space-2) 0;
    min-height: 60px;
    animation: placeholderPulse 0.8s ease-in-out infinite alternate;
    transition: height 0.2s ease;
}

@keyframes placeholderPulse {
    0% { background: rgba(85, 209, 135, 0.04); border-color: rgba(85, 209, 135, 0.3); }
    100% { background: rgba(85, 209, 135, 0.1); border-color: rgba(85, 209, 135, 0.6); }
}

/* Smooth card transitions on reorder */
.task-list .task-card {
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.task-list .task-card.dragging ~ .task-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Card focus for keyboard */
.task-card:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Touch drag ghost shadow */
.drag-ghost {
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ===== Phase 11: Dashboard ===== */

.dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Summary stat cards row */
.dash-stat {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all 0.25s ease;
}
.dash-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(85, 209, 135, 0.2);
}
.dash-stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.dash-stat-icon.primary { background: rgba(85, 209, 135, 0.15); color: var(--accent-primary); }
.dash-stat-icon.success { background: rgba(85, 209, 135, 0.15); color: #55D187; }
.dash-stat-icon.warning { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.dash-stat-icon.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.dash-stat-icon.info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.dash-stat-body { flex: 1; min-width: 0; }
.dash-stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.dash-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* Charts row */
.dash-charts {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-2);
}
@media (max-width: 900px) { .dash-charts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .dash-charts { grid-template-columns: 1fr; } }

.dash-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}
.dash-card-title {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-4);
}

/* Progress Ring */
.progress-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4) 0;
}
.progress-ring {
    position: relative;
    width: 140px; height: 140px;
}
.progress-ring svg {
    transform: rotate(-90deg);
}
.progress-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 8;
}
.progress-ring-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-ring-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.progress-ring-percent {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.progress-ring-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Summary sections */
.dash-summary {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}
@media (max-width: 600px) { .dash-summary { grid-template-columns: 1fr; } }

/* SVG Chart base */
.chart-svg {
    width: 100%;
    height: auto;
}
.chart-bar {
    fill: var(--accent-primary);
    transition: height 0.5s ease, y 0.5s ease;
    border-radius: 2px 2px 0 0;
}
.chart-bar:hover { fill: var(--accent-primary-light); opacity: 0.8; }
.chart-bar-monthly { fill: var(--accent-primary-light); }
.chart-bar-monthly:hover { fill: var(--accent-primary); }
.chart-bar-label { fill: var(--text-muted); font-size: 10px; text-anchor: middle; }
.chart-bar-value { fill: var(--text-primary); font-size: 10px; font-weight: 600; text-anchor: middle; }
.chart-gridline { stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.chart-title { fill: var(--text-muted); font-size: 11px; text-anchor: middle; font-weight: 600; letter-spacing: 0.3px; }

/* Progress ring animation on load */
.dash-card .progress-ring-fill {
    stroke-dashoffset: var(--offset, 282.74);
}

/* ===== Phase 12: Calendar ===== */

/* Toggle switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}
.toggle-switch input { opacity: 0; position: absolute; width: 0; height: 0; }
.toggle-switch .toggle-label {
    display: inline-block;
    width: 36px; height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    font-size: 0;
    line-height: 0;
}
.toggle-switch .toggle-label::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-label { background: var(--accent-primary); }
.toggle-switch input:checked + .toggle-label::after {
    transform: translateX(16px);
    background: #fff;
}

/* Calendar container */
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Navigation */
.cal-nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.cal-nav-label {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

/* Grid */
.cal-grid {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
}
.cal-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cal-row + .cal-row { border-top: 1px solid var(--glass-border); }

.cal-cell {
    min-height: 90px;
    padding: var(--space-2);
    border-right: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.cal-cell:hover { background: rgba(85, 209, 135, 0.04); }
.cal-cell:nth-child(7n) { border-right: none; }

.cal-header-cell {
    min-height: auto;
    padding: var(--space-2);
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--glass-border);
}
.cal-header-cell:hover { background: rgba(255,255,255,0.02); }

.cal-empty { opacity: 0.15; cursor: default; }
.cal-empty:hover { background: transparent; }

.cal-today {
    background: rgba(85, 209, 135, 0.06);
    border: 1px solid rgba(85, 209, 135, 0.2);
}
.cal-today .cal-day-num {
    background: var(--accent-primary);
    color: #fff;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.cal-day-num {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 2px;
}

/* Task dots */
.cal-dots {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.cal-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.cal-dot-critical { background: #ef4444; }
.cal-dot-high { background: #f59e0b; }
.cal-dot-medium { background: #3b82f6; }
.cal-dot-low { background: rgba(255,255,255,0.3); }
.cal-dot-more {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1;
}

/* Task titles in cells */
.cal-task-titles {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: auto;
}
.cal-task-title {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    padding: 0 2px;
}
.cal-task-more {
    font-size: 9px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Legend */
.cal-legend {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 11px;
    color: var(--text-muted);
    padding: var(--space-2) 0;
}
.cal-legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .cal-cell { min-height: 60px; padding: var(--space-1); }
    .cal-task-title { display: none; }
    .cal-dots { display: flex; }
    .cal-nav { flex-wrap: wrap; justify-content: center; }
    .cal-nav-label { min-width: auto; font-size: 15px; }
}

/* ==================== HABIT TRACKER ==================== */

.habits-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 700px;
    margin: 0 auto;
}

.habit-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: border-color 0.2s;
}
.habit-card:hover { border-color: rgba(255,255,255,0.12); }

.habit-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.habit-icon {
    font-size: 24px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
}

.habit-info { flex: 1; min-width: 0; }
.habit-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
}
.habit-meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    display: flex; gap: var(--space-2); align-items: center;
}

.habit-badge {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    background: rgba(85,209,135,0.12);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.habit-check {
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.habit-check:hover { border-color: var(--primary); }
.habit-check.done {
    background: var(--primary);
    border-color: var(--primary);
    color: #071A12;
}

/* Stats Row */
.habit-stats {
    display: flex;
    gap: var(--space-5);
    margin-bottom: var(--space-3);
}
.habit-stat {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}
.habit-stat-value {
    font-weight: 700;
    color: var(--warning);
    font-variant-numeric: tabular-nums;
}
.habit-stat-value.good { color: var(--primary); }

/* Weekly mini grid */
.habit-week {
    display: flex;
    gap: 3px;
}
.habit-week-day {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px;
    color: var(--text-muted);
    position: relative;
}
.habit-week-day.done {
    background: rgba(85,209,135,0.2);
    color: var(--primary);
}
.habit-week-day.today {
    border: 1px solid rgba(85,209,135,0.3);
}
.habit-week-day-label {
    position: absolute;
    top: -14px;
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Expanded heatmap */
.habit-expand {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-color);
}
.habit-expand-toggle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.habit-expand-toggle:hover { color: var(--text-primary); }

.habit-heatmap {
    margin-top: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.habit-heatmap-row {
    display: flex;
    gap: 2px;
}
.habit-heatmap-cell {
    width: 12px; height: 12px;
    border-radius: 2px;
    background: rgba(255,255,255,0.04);
}
.habit-heatmap-cell.l1 { background: rgba(85,209,135,0.15); }
.habit-heatmap-cell.l2 { background: rgba(85,209,135,0.35); }
.habit-heatmap-cell.l3 { background: rgba(85,209,135,0.55); }
.habit-heatmap-cell.l4 { background: rgba(85,209,135,0.8); }

/* Habit actions */
.habit-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-color);
}
.habit-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.habit-action-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.habit-action-btn.danger:hover { background: rgba(255,77,77,0.12); color: var(--danger); }

/* Empty state */
.habits-empty {
    text-align: center;
    padding: var(--space-10);
    color: var(--text-muted);
}
.habits-empty-icon { font-size: 48px; margin-bottom: var(--space-3); }
.habits-empty h3 { color: var(--text-primary); margin-bottom: var(--space-2); }

/* Completion rate bar */
.habit-rate-bar {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: var(--space-1);
}
.habit-rate-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ==================== GOALS ==================== */
.goals-list { display: flex; flex-direction: column; gap: 16px; }

.goal-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.goal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.goal-card.achieved {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(85,209,135,0.15);
}

.goal-header {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}
.goal-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.goal-icon.daily { background: rgba(85,209,135,0.15); }
.goal-icon.weekly { background: rgba(100,149,237,0.15); }
.goal-icon.monthly { background: rgba(255,165,0,0.15); }
.goal-icon.yearly { background: rgba(147,112,219,0.15); }
.goal-info { flex: 1; min-width: 0; }
.goal-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.goal-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.goal-badge {
    display: inline-block; padding: 2px 8px; border-radius: 6px;
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.goal-badge.daily { background: rgba(85,209,135,0.2); color: #55D187; }
.goal-badge.weekly { background: rgba(100,149,237,0.2); color: #6495ED; }
.goal-badge.monthly { background: rgba(255,165,0,0.2); color: #FFA500; }
.goal-badge.yearly { background: rgba(147,112,219,0.2); color: #9370DB; }

.goal-achieved-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
    background: linear-gradient(135deg, var(--primary), #45b875);
    border-radius: 10px; font-size: 11px; font-weight: 700; color: #fff;
}

.goal-description {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 14px;
    line-height: 1.5;
}

.goal-progress-section { margin-bottom: 12px; }
.goal-target-text {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 6px;
    display: flex; justify-content: space-between;
}
.goal-target-text strong { color: var(--text-primary); }
.goal-percent { color: var(--primary); font-weight: 700; }

.goal-bar-container {
    width: 100%; height: 8px; background: rgba(255,255,255,0.06);
    border-radius: 4px; overflow: hidden; position: relative;
}
.goal-bar-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), #45b875);
    transition: width 0.5s ease;
}
.goal-bar-fill.complete {
    background: linear-gradient(90deg, #55D187, #FFD700);
    box-shadow: 0 0 10px rgba(85,209,135,0.4);
}

.goal-increment {
    display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.goal-inc-btn {
    padding: 6px 14px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: var(--glass-bg); color: var(--text-primary); cursor: pointer;
    font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.goal-inc-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.goal-inc-btn:active { transform: scale(0.95); }

.goal-actions {
    display: flex; gap: 8px; margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--glass-border); flex-wrap: wrap;
}
.goal-action-btn {
    padding: 4px 12px; border-radius: 6px; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; transition: all 0.2s;
    background: rgba(255,255,255,0.05); color: var(--text-secondary);
}
.goal-action-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.goal-action-btn.danger:hover { background: rgba(255,77,77,0.2); color: #ff4d4d; }
.goal-action-btn.success:hover { background: rgba(85,209,135,0.2); color: var(--primary); }
.goal-action-btn.achieved {
    background: rgba(85,209,135,0.15); color: var(--primary);
}
.goal-action-btn.achieved:hover { background: rgba(255,165,0,0.2); color: #FFA500; }

.goals-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px 20px; text-align: center;
}
.goals-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.goals-empty h3 { font-size: 18px; color: var(--text-primary); margin-bottom: 6px; }
.goals-empty p { font-size: 14px; color: var(--text-secondary); }

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* ==================== ANALYTICS (Stats View) ==================== */
.stats-view { display: flex; flex-direction: column; gap: 16px; }

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.stats-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.stats-card-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.stats-card-icon.primary { background: rgba(85,209,135,0.15); }
.stats-card-icon.success { background: rgba(85,209,135,0.15); }
.stats-card-icon.accent { background: rgba(100,149,237,0.15); }
.stats-card-icon.warning { background: rgba(255,193,7,0.15); }
.stats-card-icon.info { background: rgba(100,149,237,0.15); }
.stats-card-icon.danger { background: rgba(255,77,77,0.15); }

.stats-card-body { min-width: 0; }
.stats-card-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stats-card-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px; }

.stats-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 800px) {
    .stats-charts-row { grid-template-columns: 1fr; }
}

.stats-chart-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 18px;
}

.stats-chart-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 14px;
}
.stats-chart-subtitle {
    font-size: 11px; color: var(--text-muted); font-weight: 400;
}

.stats-empty {
    text-align: center; padding: 30px 10px;
    color: var(--text-muted); font-size: 13px;
}

/* Category Chart (horizontal bars) */
.stats-category-chart { display: flex; flex-direction: column; gap: 8px; }
.stats-cat-row { display: flex; align-items: center; gap: 8px; }
.stats-cat-label { font-size: 12px; color: var(--text-secondary); width: 90px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-cat-bar-bg { flex: 1; height: 18px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
.stats-cat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.stats-cat-count { font-size: 12px; font-weight: 600; color: var(--text-primary); width: 24px; text-align: right; }

/* Priority Chart (horizontal bars with % labels) */
.stats-priority-chart { display: flex; flex-direction: column; gap: 8px; }
.stats-prio-row { display: flex; align-items: center; gap: 8px; }
.stats-prio-label { font-size: 12px; color: var(--text-secondary); width: 80px; flex-shrink: 0; }
.stats-prio-bar-bg { flex: 1; height: 18px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
.stats-prio-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.stats-prio-count { font-size: 12px; font-weight: 600; color: var(--text-primary); width: 60px; text-align: right; }

/* SVG Chart overrides for stats view */
.stats-chart-card .chart-svg {
    width: 100%; height: auto;
}

/* Trend line on SVG bar charts */
.stats-trend-line {
    animation: statsTrendFadeIn 0.6s ease forwards;
}
@keyframes statsTrendFadeIn {
    from { opacity: 0; }
    to { opacity: 0.7; }
}

/* Productivity Metrics */
.stats-productivity { grid-column: 1 / -1; }
.stats-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.stats-metric {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--glass-border);
}
.stats-metric-icon {
    font-size: 20px; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stats-metric-body { min-width: 0; }
.stats-metric-value { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.stats-metric-value.up { color: #55D187; }
.stats-metric-value.down { color: #ff4d4d; }
.stats-metric-label { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Export button */
.stats-export-row { display: flex; justify-content: center; padding: 8px 0; }
.stats-export-btn {
    padding: 10px 24px; border-radius: 10px; border: 1px solid var(--glass-border);
    background: linear-gradient(135deg, var(--glass-bg), rgba(85,209,135,0.08));
    color: var(--text-primary); cursor: pointer; font-size: 13px; font-weight: 600;
    transition: all 0.2s;
}
.stats-export-btn:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(85,209,135,0.3);
}

/* ==================== PROFILE & ACHIEVEMENTS ==================== */
.profile-container { max-width: 720px; margin: 0 auto; }

.profile-view { display: flex; flex-direction: column; gap: 16px; }

/* Header */
.profile-header {
    display: flex; align-items: center; gap: 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px;
}
.profile-avatar-frame {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #45b875);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(85,209,135,0.3);
}
.profile-avatar { font-size: 36px; line-height: 1; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.profile-bio { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.5; }
.profile-joined { font-size: 12px; color: var(--text-muted); }

/* Productivity Score ring */
.profile-productivity { flex-shrink: 0; }
.profile-score-ring { position: relative; width: 80px; height: 80px; }
.profile-score-ring svg { width: 100%; height: 100%; }
.profile-score-center {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.profile-score-value { font-size: 22px; font-weight: 800; line-height: 1; }
.profile-score-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-top: 1px; }

/* Level & XP */
.profile-level-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 18px 20px;
}
.profile-level-info { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.profile-level-badge {
    width: 52px; height: 52px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #45b875);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.profile-xp-info { flex: 1; }
.profile-xp-total { display: block; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.profile-xp-next { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.profile-xp-bar-bg {
    width: 100%; height: 6px; background: rgba(255,255,255,0.06);
    border-radius: 3px; overflow: hidden;
}
.profile-xp-bar-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), #45b875, #FFD700);
    transition: width 0.5s ease;
}

/* Stats row */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.profile-stat-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
}
.profile-stat-icon { font-size: 18px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-stat-body { min-width: 0; }
.profile-stat-val { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.profile-stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* Section */
.profile-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
}
.profile-section-title {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 16px;
}
.profile-section-subtitle {
    font-size: 12px; color: var(--text-muted); font-weight: 400;
}

/* Achievement Grid */
.profile-achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.profile-achievement {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 14px 10px; border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}
.profile-achievement:hover { transform: translateY(-2px); }
.profile-achievement.locked { opacity: 0.45; }
.profile-achievement.locked:hover { opacity: 0.6; }
.profile-ach-icon { font-size: 28px; margin-bottom: 6px; }
.profile-ach-title { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.profile-ach-desc { font-size: 10px; color: var(--text-secondary); line-height: 1.3; }
.profile-ach-date { font-size: 9px; color: var(--primary); margin-top: 4px; font-weight: 600; }
.profile-ach-lock { font-size: 14px; margin-top: 4px; opacity: 0.5; }

/* Activity Feed */
.profile-activity { display: flex; flex-direction: column; gap: 2px; }
.profile-activity-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    transition: background 0.2s;
}
.profile-activity-item:hover { background: rgba(255,255,255,0.03); }
.profile-act-icon { font-size: 14px; width: 24px; text-align: center; flex-shrink: 0; }
.profile-act-msg { flex: 1; font-size: 13px; color: var(--text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-act-xp { font-size: 11px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.profile-act-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.profile-empty { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }

/* ==================== SETTINGS ==================== */
.settings-container { max-width: 640px; margin: 0 auto; }
.settings-view { display: flex; flex-direction: column; gap: 14px; }

.settings-group {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
}
.settings-group-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}
.settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; gap: 16px;
}
.settings-row + .settings-row { border-top: 1px solid rgba(255,255,255,0.03); }
.settings-label { display: flex; flex-direction: column; gap: 2px; }
.settings-label-text { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.settings-label-desc { font-size: 11px; color: var(--text-muted); }
.settings-control { flex-shrink: 0; }

/* Toggle switch for settings */
.settings-toggle {
    position: relative; width: 44px; height: 24px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.1); border-radius: 12px;
    outline: none; transition: background 0.2s;
}
.settings-toggle:checked { background: var(--primary); }
.settings-toggle::before {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; transition: transform 0.2s;
}
.settings-toggle:checked::before { transform: translateX(20px); }

/* Select/input for settings */
.settings-select {
    padding: 6px 28px 6px 10px; border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05); color: var(--text-primary);
    font-size: 13px; cursor: pointer; outline: none;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%23ffffff' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
}
.settings-select option { background: #1a2a20; color: #fff; }

/* Color picker */
.settings-color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-color-swatch {
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: all 0.2s;
}
.settings-color-swatch:hover { transform: scale(1.15); }
.settings-color-swatch.active { border-color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.3); }

/* Reset button */
.settings-reset-btn {
    padding: 8px 20px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.03); color: var(--text-secondary); cursor: pointer;
    font-size: 13px; transition: all 0.2s; margin-top: 4px;
}
.settings-reset-btn:hover { background: rgba(255,77,77,0.15); color: #ff4d4d; border-color: rgba(255,77,77,0.3); }

/* ==================== THEME OVERRIDES ==================== */

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-sidebar: rgba(255, 255, 255, 0.5);
    --text-primary: #1d1d1f;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-muted: rgba(0, 0, 0, 0.4);
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
}

/* No animations */
[data-animations="off"] *,
[data-animations="off"] *::before,
[data-animations="off"] *::after {
    transition: none !important;
    animation: none !important;
    animation-duration: 0s !important;
}

/* Compact mode */
[data-compact="true"] .glass,
[data-compact="true"] .dash-card,
[data-compact="true"] .stat-card,
[data-compact="true"] .stats-card,
[data-compact="true"] .goal-card,
[data-compact="true"] .habit-card,
[data-compact="true"] .task-card,
[data-compact="true"] .profile-header,
[data-compact="true"] .profile-level-card,
[data-compact="true"] .profile-stat-item,
[data-compact="true"] .profile-section,
[data-compact="true"] .settings-group,
[data-compact="true"] .stats-chart-card,
[data-compact="true"] .analytics-card {
    padding: 10px !important;
}
[data-compact="true"] .nav-item { padding: 8px 14px !important; }
[data-compact="true"] .section-header { margin-bottom: 8px !important; }
[data-compact="true"] :root { --space-4: 8px; --space-5: 12px; }

/* Font size overrides */
[data-font-size="small"] { --font-size-base: 0.875rem; --font-size-sm: 0.75rem; --font-size-lg: 1rem; }
[data-font-size="large"] { --font-size-base: 1.125rem; --font-size-sm: 1rem; --font-size-lg: 1.25rem; }

/* RTL overrides */
[dir="rtl"] .sidebar { right: 0; left: auto; }
[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-width); }
[dir="rtl"] .nav-item { flex-direction: row-reverse; }
[dir="rtl"] .nav-icon { margin-left: 12px; margin-right: 0; }
[dir="rtl"] .section-header { flex-direction: row-reverse; }
[dir="rtl"] .task-card { text-align: right; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }
[dir="rtl"] .modal-footer { flex-direction: row-reverse; }
[dir="rtl"] .goal-header { flex-direction: row-reverse; }
[dir="rtl"] .goal-target-text { flex-direction: row-reverse; }
[dir="rtl"] .profile-header { flex-direction: row-reverse; }
[dir="rtl"] .profile-level-info { flex-direction: row-reverse; }
[dir="rtl"] .stats-cat-row { flex-direction: row-reverse; }
[dir="rtl"] .stats-prio-row { flex-direction: row-reverse; }
[dir="rtl"] .settings-row { flex-direction: row-reverse; }
[dir="rtl"] .settings-label { text-align: right; }
[dir="rtl"] .dash-stat { flex-direction: row-reverse; }
[dir="rtl"] .stats-charts-row { direction: ltr; }

/* Responsive */
@media (max-width: 768px) {
    .habit-week-day { width: 24px; height: 24px; font-size: 8px; }
    .habit-heatmap-cell { width: 10px; height: 10px; }
    .form-row { flex-direction: column; gap: 0; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .stats-metrics { grid-template-columns: repeat(2, 1fr); }
    .profile-header { flex-wrap: wrap; }
    .profile-stats-row { grid-template-columns: repeat(2, 1fr); }
    .profile-achievements { grid-template-columns: repeat(3, 1fr); }
    [dir="rtl"] .main-content { margin-right: 0; }
}

/* Skeleton Loading */
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}
.skeleton {
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}
.skeleton-card {
    height: 80px; margin-bottom: 12px;
    background: var(--glass-bg);
    border-radius: 14px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}
.skeleton-line { height: 12px; margin-bottom: 8px; width: 60%; }
.skeleton-line.short { width: 40%; }
.skeleton-line.long { width: 80%; }
.skeleton-block { height: 160px; border-radius: 14px; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }

/* Dashboard empty state */
.dashboard-empty {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 20px; text-align: center;
}
.dashboard-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.dashboard-empty h3 { font-size: 20px; color: var(--text-primary); margin-bottom: 6px; }
.dashboard-empty p { font-size: 14px; color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --text-muted: rgba(255, 255, 255, 0.65);
    }
    .glass, .dash-stat, .dash-card, .card {
        border-color: rgba(255, 255, 255, 0.3);
    }
    [data-theme="light"] {
        --text-muted: rgba(0, 0, 0, 0.55);
    }
}