/* ===== TASKFLOW UZ — Premium Design System ===== */

:root {
    /* Light theme */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-input: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --hover-bg: rgba(99, 102, 241, 0.08);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glass: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --priority-high: #ef4444;
    --priority-medium: #f59e0b;
    --priority-low: #22c55e;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --blur: 20px;
}



/* Dark Mode */
body.dark-mode {
    --bg-primary: #0f0f17;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --bg-glass: rgba(26, 26, 46, 0.6);
    --bg-input: rgba(30, 30, 50, 0.9);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #818cf8;
    --accent-light: #a5b4fc;
    --accent-glow: rgba(129, 140, 248, 0.3);
    --accent-gradient: linear-gradient(135deg, #818cf8, #a78bfa);
    --hover-bg: rgba(129, 140, 248, 0.1);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(129, 140, 248, 0.2);
    --danger-bg: rgba(239, 68, 68, 0.15);
    --success-bg: rgba(34, 197, 94, 0.15);
    --sidebar-bg: rgba(15, 15, 23, 0.95);
    --nav-bg: rgba(15, 15, 23, 0.9);
}

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        --bg-primary: #0f0f17;
        --bg-secondary: #1a1a2e;
        --bg-card: rgba(26, 26, 46, 0.8);
        --bg-glass: rgba(26, 26, 46, 0.6);
        --bg-input: rgba(30, 30, 50, 0.9);
        --text-primary: #e2e8f0;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --accent: #818cf8;
        --accent-light: #a5b4fc;
        --accent-glow: rgba(129, 140, 248, 0.3);
        --accent-gradient: linear-gradient(135deg, #818cf8, #a78bfa);
        --hover-bg: rgba(129, 140, 248, 0.1);
        --border-color: rgba(255, 255, 255, 0.06);
        --border-glass: rgba(255, 255, 255, 0.08);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
        --shadow-glow: 0 0 30px rgba(129, 140, 248, 0.2);
        --danger-bg: rgba(239, 68, 68, 0.15);
        --success-bg: rgba(34, 197, 94, 0.15);
        --sidebar-bg: rgba(15, 15, 23, 0.95);
        --nav-bg: rgba(15, 15, 23, 0.9);
    }
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior-y: none;
    transition: background-color var(--transition), color var(--transition);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    width: 100%;
    flex-direction: column;
    position: relative;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 20px 16px;
    padding-bottom: 100px;
    overflow-y: auto;
    order: 1;
}

/* ===== HEADER ===== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.header-info h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header-info .subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    text-align: center;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.total::before { background: var(--accent-gradient); }
.stat-card.done::before { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-card.pending::before { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card.total .stat-number { color: var(--accent); }
.stat-card.done .stat-number { color: var(--success); }
.stat-card.pending .stat-number { color: var(--priority-medium); }

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

/* Progress bar */
.progress-container {
    margin-bottom: 24px;
}

.progress-bar-wrapper {
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-percent {
    font-weight: 700;
    color: var(--accent);
}

/* ===== SEARCH BAR ===== */
.search-container {
    margin-bottom: 16px;
    position: relative;
}

.search-container i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color var(--transition);
}

.search-container input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    font-size: 0.9rem;
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition);
}

.search-container input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-container input:focus + i,
.search-container input:focus ~ i {
    color: var(--accent);
}

/* ===== TASK INPUT ===== */
.task-input-container {
    margin-bottom: 20px;
}

.task-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.input-wrapper > i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
    z-index: 1;
    transition: color var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 42px;
    font-size: 0.95rem;
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrapper input:focus ~ i,
.input-wrapper input:focus + i {
    color: var(--accent);
}

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

/* Priority selector */
.priority-select {
    appearance: none;
    padding: 0 32px 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    min-width: 90px;
}

.priority-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Add button */
.btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 20px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-add::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-add:hover::before {
    opacity: 1;
}

.btn-add:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-add:active {
    transform: scale(0.97);
}

.btn-add i {
    font-size: 1.2rem;
}

/* ===== TASKS LIST ===== */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== TASK ITEM ===== */
.task-item {
    display: flex;
    align-items: center;
    padding: 14px 14px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    animation: taskSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    transition: background var(--transition);
}

.task-item.priority-high::before { background: var(--priority-high); }
.task-item.priority-medium::before { background: var(--priority-medium); }
.task-item.priority-low::before { background: var(--priority-low); }

.task-item:hover {
    border-color: var(--accent-glow);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.task-item:active {
    transform: scale(0.99);
}

.task-item.completed {
    opacity: 0.65;
}

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

.task-item.removing {
    animation: taskSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

@keyframes taskSlideOut {
    to {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
        max-height: 0;
        padding: 0;
        margin: 0;
        border-width: 0;
    }
}

/* Staggered animation */
.task-item:nth-child(1) { animation-delay: 0.02s; }
.task-item:nth-child(2) { animation-delay: 0.04s; }
.task-item:nth-child(3) { animation-delay: 0.06s; }
.task-item:nth-child(4) { animation-delay: 0.08s; }
.task-item:nth-child(5) { animation-delay: 0.10s; }
.task-item:nth-child(6) { animation-delay: 0.12s; }
.task-item:nth-child(7) { animation-delay: 0.14s; }
.task-item:nth-child(8) { animation-delay: 0.16s; }
.task-item:nth-child(9) { animation-delay: 0.18s; }
.task-item:nth-child(10) { animation-delay: 0.20s; }

/* Checkbox */
.checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all var(--transition);
    position: relative;
}

.checkbox:hover {
    border-color: var(--accent);
    background: var(--hover-bg);
}

.checkbox i {
    font-size: 12px;
    color: transparent;
    transition: all var(--transition);
}

.task-item.completed .checkbox {
    background: var(--accent-gradient);
    border-color: transparent;
    animation: checkBounce 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item.completed .checkbox i {
    color: #fff;
}

@keyframes checkBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

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

.task-text {
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    transition: all var(--transition);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.priority-badge.high {
    background: var(--danger-bg);
    color: var(--priority-high);
}
.priority-badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--priority-medium);
}
.priority-badge.low {
    background: var(--success-bg);
    color: var(--priority-low);
}

.task-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Task actions */
.task-actions {
    display: flex;
    gap: 2px;
    opacity: 1;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.action-btn:hover {
    background: var(--hover-bg);
    color: var(--accent);
    transform: scale(1.1);
}

.action-btn.delete:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ===== BOTTOM NAVIGATION ===== */
.sidebar {
    order: 2;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: var(--nav-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-top: 1px solid var(--border-color);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

.desktop-only {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: row;
    height: 100%;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    position: relative;
}

.nav-item i {
    font-size: 22px;
    transition: all var(--transition);
}

.nav-item span {
    transition: all var(--transition);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active i {
    transform: translateY(-2px) scale(1.1);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 3px;
    border-radius: 10px;
    background: var(--accent-gradient);
    transition: transform var(--transition);
}

.nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97);
}

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

.btn-danger:hover {
    opacity: 0.9;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Theme toggle */
.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-btn:hover {
    background: var(--hover-bg);
    color: var(--accent);
    border-color: var(--accent-glow);
}

.theme-btn:active {
    transform: scale(0.9) rotate(20deg);
}

/* Install button */
.install-btn {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.install-btn:hover {
    box-shadow: var(--shadow-glow);
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

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

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

.modal-content {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-content h3 i {
    color: var(--accent);
}

.modal-input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    outline: none;
    transition: all var(--transition);
}

.modal-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* Delete confirmation modal extra */
.delete-modal-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.delete-modal-text strong {
    color: var(--text-primary);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 320px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--accent); }

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(80px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(80px) scale(0.9);
    }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 260px;
    line-height: 1.5;
}

/* ===== LOADING ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 16px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== DESKTOP LAYOUT ===== */
@media (min-width: 769px) {
    .app-container {
        flex-direction: row;
    }

    .sidebar {
        order: 1;
        position: static;
        width: 260px;
        height: 100vh;
        border-top: none;
        border-right: 1px solid var(--border-color);
        padding: 24px 12px;
        background: var(--sidebar-bg);
        backdrop-filter: blur(var(--blur));
        -webkit-backdrop-filter: blur(var(--blur));
    }

    .main-content {
        order: 2;
        padding: 40px 60px;
        padding-bottom: 40px;
        max-width: 860px;
    }

    .desktop-only {
        display: block;
        margin-bottom: 32px;
        padding: 0 10px;
    }

    .logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .logo img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        border-radius: 8px;
    }

    .logo span {
        background: var(--accent-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .sidebar-nav {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
    }

    .nav-item {
        flex-direction: row;
        text-align: left;
        justify-content: flex-start;
        font-size: 0.9rem;
        padding: 12px 14px;
        border-radius: var(--radius-md);
        flex: none;
        margin-bottom: 2px;
        gap: 10px;
    }

    .nav-item i {
        font-size: 20px;
    }

    .nav-item::after {
        display: none;
    }

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

    .nav-item.active {
        background: var(--hover-bg);
        color: var(--accent);
        font-weight: 700;
    }

    .nav-item.active i {
        transform: none;
        color: var(--accent);
    }

    .task-actions {
        opacity: 0;
        transition: opacity var(--transition);
    }

    .task-item:hover .task-actions {
        opacity: 1;
    }

    .stats-bar {
        gap: 14px;
    }

    .stat-card {
        padding: 18px 20px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .header-info h1 {
        font-size: 2rem;
    }

    .toast-container {
        top: 24px;
        right: 24px;
    }
}

/* ===== MOBILE FIXES (all mobile) ===== */
@media (max-width: 768px) {
    /* Header — compact buttons */
    .header-actions {
        gap: 6px;
    }

    .install-btn span {
        display: none;
    }

    .install-btn {
        padding: 10px;
        border-radius: var(--radius-md);
    }

    /* Task input — stack on mobile */
    .task-input-row {
        flex-direction: column;
        gap: 8px;
    }

    .input-wrapper {
        width: 100%;
    }

    .task-input-bottom {
        display: flex;
        gap: 8px;
    }

    .priority-select {
        flex: 1;
        min-width: 0;
        height: 44px;
    }

    .btn-add {
        flex: 0 0 auto;
        padding: 0 20px;
        height: 44px;
    }

    /* Stats cards — tighter on mobile */
    .stats-bar {
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    /* Task items */
    .task-item {
        padding: 12px 10px;
    }

    .task-meta {
        gap: 6px;
    }

    .priority-badge {
        font-size: 0.6rem;
        padding: 1px 6px;
    }

    .task-date {
        font-size: 0.65rem;
    }

    /* Search */
    .search-container input {
        padding: 11px 14px 11px 38px;
        font-size: 0.85rem;
    }

    /* Subtitle — smaller on mobile */
    .header-info .subtitle {
        font-size: 0.8rem;
    }

    .header-info h1 {
        font-size: 1.5rem;
    }
}

/* ===== SMALL MOBILE ===== */
@media (max-width: 360px) {
    .stats-bar {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .stat-card {
        padding: 10px 6px;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .btn-add span {
        display: none;
    }

    .btn-add {
        padding: 0 14px;
    }

    .priority-select {
        min-width: 60px;
        font-size: 0.75rem;
        padding: 0 24px 0 8px;
    }

    .header-info h1 {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 14px 10px;
        padding-bottom: 90px;
    }
}
