:root {
    --bg-primary: #f0f4ff;
    --bg-secondary: #e8eeff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-sidebar: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #999;
    --border-color: rgba(200, 210, 240, 0.5);
    --accent: #4fc3f7;
    --accent2: #7c4dff;
    --accent-gradient: linear-gradient(135deg, #4fc3f7 0%, #7c4dff 100%);
    --danger: #ef5350;
    --warning: #ff9800;
    --success: #66bb6a;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 0 20px rgba(79, 195, 247, 0.25);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Poppins', 'Kanit', sans-serif;
    --font-secondary: 'Inter', 'Kanit', sans-serif;
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --bg-primary: #0d0d1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(25, 25, 50, 0.78);
    --bg-sidebar: rgba(15, 15, 35, 0.92);
    --text-primary: #e8e8f0;
    --text-secondary: #aab;
    --text-muted: #667;
    --border-color: rgba(100, 100, 160, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(79, 195, 247, 0.18);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: -40%;
    left: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(79, 195, 247, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(124, 77, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

.app-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
}

/* ============ SIDEBAR ============ */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.menu-toggle:hover { box-shadow: var(--shadow-glow); }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition), margin-left var(--transition);
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 28px 24px 16px;
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    overflow: hidden;
    transition: all var(--transition);
}

.nav-item i { font-size: 1.1rem; width: 22px; text-align: center; }

.nav-glow {
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition);
    z-index: -1;
    border-radius: 12px;
}

.nav-item:hover { color: var(--accent); transform: translateX(4px); }
.nav-item.active {
    color: #fff;
    transform: translateX(0);
}
.nav-item.active .nav-glow {
    opacity: 1;
    box-shadow: 0 4px 20px rgba(79, 195, 247, 0.35);
}
.nav-item.active i { filter: drop-shadow(0 0 6px rgba(255,255,255,0.5)); }

.badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.theme-toggle {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.theme-toggle:hover { box-shadow: var(--shadow-glow); }

[data-theme="light"] .dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: none; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 0;
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
}

/* ============ TOP NAVIGATION BAR ============ */
.top-nav-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 4px 12px 0;
    background: var(--bg-primary);
    margin-bottom: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top-nav-scroll {
    flex: 1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}
.top-nav-scroll::-webkit-scrollbar { display: none; }

.top-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.top-nav-pill i { font-size: 0.85rem; }
.top-nav-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.top-nav-pill.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(79, 195, 247, 0.3);
}

.top-nav-back {
    width: 38px; height: 38px;
    border-radius: 11px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.top-nav-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* ============ SECTION ============ */
.section { padding: 8px 0 48px; scroll-margin-top: 80px; }
.section-container { max-width: 1200px; padding: 0 24px; margin: 0 auto; }

/* ============ GLASS CARD ============ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

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

/* ============ DASHBOARD ============ */
.dashboard-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.greeting-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.greeting-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.greeting-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.greeting-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.datetime-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.time-display {
    font-size: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-secondary);
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.date-display {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--stat-color) 15%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--stat-color);
    flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

.quick-add-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.btn-quick-add {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-quick-add:hover {
    box-shadow: var(--shadow-glow);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

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

/* ============ CHARTS ============ */
.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    padding: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i { color: var(--accent); }

.chart-wrap {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(79, 195, 247, 0.45);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i { color: var(--accent); }

/* ============ TASK LIST ============ */
.task-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(79, 195, 247, 0.3);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.75rem;
    color: transparent;
}

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

.task-content { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 0.95rem; }
.task-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-autodel { font-size: 0.72rem; color: var(--success); display: inline-block; margin-top: 3px; opacity: 0.85; }

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.task-deadline {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.task-deadline.overdue { color: var(--danger); font-weight: 600; }

.priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

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

.task-actions button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    background: transparent;
    color: var(--text-secondary);
}

.task-actions button:hover { background: rgba(79, 195, 247, 0.12); color: var(--accent); }
.task-actions button.delete:hover { background: rgba(239, 83, 80, 0.12); color: var(--danger); }

.task-item.completed { opacity: 0.55; }
.task-item.completed .task-title { text-decoration: line-through; }

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

.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 0.95rem; }

/* ============ PRIORITY SELECTOR ANIMATIONS ============ */
.priority-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.priority-btn {
    padding: 12px 8px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0.55;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.priority-btn:hover { opacity: 0.8; }
.priority-btn.active { opacity: 1; transform: scale(1.05); box-shadow: var(--shadow-md); }

/* Low Priority */
.priority-btn[data-priority="low"] { --pri-color: #9e9e9e; border-color: rgba(158,158,158,0.3); }
.priority-btn[data-priority="low"].active {
    background: #f5f5f5;
    border-color: #9e9e9e;
    color: #757575;
    box-shadow: 0 4px 12px rgba(158,158,158,0.2);
}

/* Normal Priority - Smooth Glide */
.priority-btn[data-priority="normal"] { --pri-color: #4fc3f7; border-color: rgba(79,195,247,0.3); }
.priority-btn[data-priority="normal"].active {
    background: linear-gradient(135deg, rgba(79,195,247,0.15), rgba(79,195,247,0.05));
    border-color: #4fc3f7;
    color: #0288d1;
    box-shadow: 0 0 20px rgba(79,195,247,0.2), 0 4px 12px rgba(79,195,247,0.15);
    animation: glowSlide 2s ease-in-out infinite;
}

@keyframes glowSlide {
    0%, 100% { box-shadow: 0 0 20px rgba(79,195,247,0.2); }
    50% { box-shadow: 0 0 30px rgba(79,195,247,0.4); }
}

/* Important Priority - Bounce */
.priority-btn[data-priority="important"] { --pri-color: #ff9800; border-color: rgba(255,152,0,0.3); }
.priority-btn[data-priority="important"].active {
    background: linear-gradient(135deg, rgba(255,152,0,0.15), rgba(255,152,0,0.05));
    border-color: #ff9800;
    color: #e65100;
    box-shadow: 0 0 20px rgba(255,152,0,0.25), 0 4px 12px rgba(255,152,0,0.15);
    animation: priorityBounce 0.6s ease;
}

@keyframes priorityBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.08); }
    50% { transform: scale(0.97); }
    70% { transform: scale(1.04); }
    100% { transform: scale(1.05); }
}

/* Urgent Priority - Pulse + Flash */
.priority-btn[data-priority="urgent"] { --pri-color: #ef5350; border-color: rgba(239,83,80,0.3); }
.priority-btn[data-priority="urgent"].active {
    background: linear-gradient(135deg, rgba(239,83,80,0.15), rgba(239,83,80,0.05));
    border-color: #ef5350;
    color: #c62828;
    box-shadow: 0 0 25px rgba(239,83,80,0.3), 0 4px 12px rgba(239,83,80,0.15);
    animation: urgentPulse 1.5s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 25px rgba(239,83,80,0.25); transform: scale(1.05); }
    50% { box-shadow: 0 0 40px rgba(239,83,80,0.45); transform: scale(1.06); }
}

/* Ripple Effect */
.priority-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: radial-gradient(circle at center, var(--pri-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.priority-btn.active::after {
    opacity: 0.08;
}

/* ============ CALENDAR ============ */
.calendar-wrapper {
    padding: 20px;
    min-height: 600px;
}

#calendarEl {
    font-family: var(--font-secondary);
}

.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border-color); }
.fc-theme-standard .fc-scrollgrid { border-color: var(--border-color); }

.fc .fc-toolbar-title {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: var(--text-primary);
}

.fc .fc-button {
    border-radius: 10px !important;
    font-family: var(--font-primary) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 8px 16px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    transition: var(--transition) !important;
    text-transform: capitalize !important;
}

.fc .fc-button:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--accent-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.fc .fc-day-today {
    background: rgba(79, 195, 247, 0.06) !important;
}

.fc .fc-daygrid-day-number {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 6px !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    background: var(--accent-gradient);
    color: #fff;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(79, 195, 247, 0.04) !important;
}

.fc-h-event {
    border: none !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
    font-size: 0.75rem !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fc-h-event:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.fc .fc-timegrid-slot { height: 30px !important; }
.fc .fc-col-header-cell-cushion {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase;
}

/* ============ ACHIEVEMENT ============ */
.achievement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.achievement-card { padding: 28px; text-align: center; }

.streak-display { padding: 10px 0; }

.streak-fire {
    font-size: 3rem;
    margin-bottom: 8px;
    animation: firePulse 1.5s ease-in-out infinite;
}

@keyframes firePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255,152,0,0.4)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255,152,0,0.7)); }
}

.streak-count {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff9800, #f44336);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.streak-label { font-size: 0.85rem; color: var(--text-secondary); }

.progress-ring-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }

.progress-ring-bg {
    stroke: var(--border-color);
}

.progress-ring-fill {
    stroke: url(#progressGradient);
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.5s ease;
}

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring-text span {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.badge-card {
    padding: 20px 14px;
    text-align: center;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.badge-card.locked { opacity: 0.4; filter: grayscale(1); }

.badge-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.badge-name { font-weight: 600; font-size: 0.85rem; }
.badge-desc { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

.badge-card.unlocked .badge-icon {
    animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(79,195,247,0.3)); }
    50% { filter: drop-shadow(0 0 12px rgba(79,195,247,0.6)); }
}

/* ============ SAVINGS ============ */
.savings-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
}

.savings-visual { padding: 40px 20px; display: flex; justify-content: center; }

.circular-progress {
    position: relative;
    width: 220px;
    height: 220px;
}

.circular-progress svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.savings-bg {
    stroke: var(--border-color);
}

.savings-fill {
    stroke-dasharray: 534.07;
    stroke-dashoffset: 534.07;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.savings-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.savings-percent {
    font-size: 2.4rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.savings-label { font-size: 0.85rem; color: var(--text-secondary); }

.savings-form { padding: 28px; }

.savings-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.add-money-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-top: 16px;
}
.add-money-input { flex: 1; }
.add-money-input label { margin-bottom: 6px; }

.btn-add-money {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 14px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 187, 106, 0.35);
    white-space: nowrap;
}

.btn-add-money:hover {
    box-shadow: 0 6px 25px rgba(102, 187, 106, 0.5);
    transform: translateY(-2px);
}

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

.btn-add-money::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-add-money:active::after { opacity: 1; }

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

.savings-amounts { margin-top: 16px; }

.amount-display {
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ INPUTS ============ */
.input-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.required { color: var(--danger); }

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    resize: vertical;
}

input:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

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

.modal {
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 { font-size: 1.15rem; font-weight: 700; }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: rgba(239, 83, 80, 0.1); color: var(--danger); }

.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============ NOTIFICATIONS ============ */
.notifications-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.notification-item {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(79, 195, 247, 0.05);
    transition: var(--transition);
    animation: slideInNotif 0.3s ease;
}

@keyframes slideInNotif {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.notification-item.warning { border-left-color: var(--warning); background: rgba(255,152,0,0.05); }
.notification-item.danger { border-left-color: var(--danger); background: rgba(239,83,80,0.05); }

.notif-icon { font-size: 1.3rem; flex-shrink: 0; }
.notif-icon.blue { color: var(--accent); }
.notif-icon.orange { color: var(--warning); }
.notif-icon.red { color: var(--danger); }

.notif-content { flex: 1; }
.notif-title { font-weight: 600; font-size: 0.9rem; }
.notif-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

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

.toast {
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 400px;
    animation: toastIn 0.4s ease, toastOut 0.3s ease 3.5s forwards;
}

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

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

.toast i { font-size: 1.2rem; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.info i { color: var(--accent); }
.toast.warning i { color: var(--warning); }
.toast.error i { color: var(--danger); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    .dashboard-header { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-row { grid-template-columns: 1fr; }
    .savings-content { grid-template-columns: 1fr; }
    .achievement-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.4rem; }
    .time-display { font-size: 1.8rem; }
    .section-title { font-size: 1.2rem; }
    .task-meta { flex-direction: column; align-items: flex-end; gap: 6px; }
    .modal { width: 95%; max-width: 95%; }
    .priority-selector { grid-template-columns: 1fr 1fr; }
    .task-filters { gap: 4px; }
    .filter-btn { padding: 6px 12px; font-size: 0.78rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .modal-body { padding: 14px 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; }
    .toast { min-width: auto; max-width: calc(100vw - 40px); }
    .datetime-card { align-items: flex-start; }
    .add-money-row { flex-direction: column; }
    .btn-add-money { width: 100%; justify-content: center; }
}

/* ============ CONFETTI CANVAS ============ */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4000;
}

/* ============ AOS Override ============ */
[data-aos] { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* ============ GLASS CARD BORDER ANIMATION ============ */
@keyframes borderGlow {
    0%, 100% { border-color: var(--border-color); }
    50% { border-color: rgba(79, 195, 247, 0.4); }
}

.glass-card.animated-border { animation: borderGlow 3s ease-in-out infinite; }

/* ============ LOGIN / LOGOUT ============ */
/* (sidebar-footer layout defined in sidebar section above) */

.login-btn, .logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}

.login-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.logout-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.sidebar-user {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: auto;
}

.login-modal { max-width: 420px; }
.login-body { text-align: center; padding: 28px 28px 32px; }

.login-avatar-ring {
    width: 88px; height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--accent-gradient);
    padding: 4px;
    box-shadow: 0 4px 24px rgba(79, 195, 247, 0.35);
}

.register-ring { background: linear-gradient(135deg, #66bb6a 0%, #7c4dff 100%); box-shadow: 0 4px 24px rgba(102, 187, 106, 0.35); }

.login-avatar-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: var(--accent);
}

.register-ring .login-avatar-inner { color: #66bb6a; }

.login-welcome { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.login-subtitle { color: var(--text-muted); font-size: 13px; margin: 0 0 24px; }

/* ---- Input with icon ---- */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-icon-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: 0.25s;
    outline: none;
}

.input-icon-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.1);
}

.input-icon-wrap input:focus ~ .input-icon,
.input-icon-wrap input:focus + .password-eye + .input-icon { color: var(--accent); }

.input-icon-wrap:focus-within .input-icon { color: var(--accent); }

/* ---- Password eye toggle ---- */
.password-wrap input { padding-right: 44px; }

.password-eye {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 6px 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.password-eye:hover { color: var(--accent); }

/* ---- Password strength ---- */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin: -4px 0 12px;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: 0.3s;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: 0.3s;
    width: 0;
}

.strength-weak::after { width: 33%; background: #ef5350; }
.strength-medium::after { width: 66%; background: #ff9800; }
.strength-strong::after { width: 100%; background: #66bb6a; }

/* ============ LOGIN TABS ============ */
.login-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.login-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.login-tab:hover { color: var(--text-primary); }

.login-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.login-panel { display: none; }
.login-panel.active { display: block; }

/* ============ SIDEBAR QUICK LINKS ============ */
.sidebar-quicklinks {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.quicklinks-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 8px 6px;
    font-weight: 600;
}

.quicklink-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
    margin-bottom: 2px;
}

.quicklink-item:hover {
    background: var(--bg-secondary);
    color: var(--accent);
}

.quicklink-item i {
    width: 22px;
    text-align: center;
    font-size: 14px;
}

.quicklink-item .fa-chalkboard-user:hover { color: #25a75c; }
.quicklink-item .fa-facebook:hover { color: #1877f2; }
.quicklink-item .fa-brain:hover { color: #10a37f; }
.quicklink-item .fa-gem:hover { color: #8e7cc3; }

/* ============ CHAT WIDGET ============ */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 5000; }

.chat-toggle {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    transition: 0.3s;
    animation: pulseChat 2s infinite;
}

@keyframes pulseChat {
    0%, 100% { box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(79, 195, 247, 0.7); transform: scale(1.05); }
}

.chat-toggle:hover { transform: scale(1.1); animation: none; }

.chat-popup {
    position: fixed; bottom: 96px; right: 24px;
    width: 360px; height: 480px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 5000;
}

.chat-popup.active { display: flex; }

.chat-header {
    padding: 14px 18px;
    background: var(--accent-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 600; font-size: 15px;
}

.chat-header i { margin-right: 8px; }

.chat-close {
    background: rgba(255,255,255,0.2);
    border: none; color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: 0.2s;
}

.chat-close:hover { background: rgba(255,255,255,0.4); }

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex; flex-direction: column;
    gap: 10px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.chat-bubble { display: flex; max-width: 85%; }

.chat-bubble.bot { align-self: flex-start; }
.chat-bubble.user { align-self: flex-end; }

.chat-bubble-inner {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
}

.chat-bubble.bot .chat-bubble-inner {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-bubble.user .chat-bubble-inner {
    background: var(--accent-gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-input-wrap {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.chat-input-wrap input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: var(--font-primary);
}

.chat-input-wrap input:focus { border-color: var(--accent); }

.chat-input-wrap button {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: 0.2s;
}

.chat-input-wrap button:hover { opacity: 0.9; transform: scale(1.05); }

@media (max-width: 480px) {
    .chat-popup { width: calc(100vw - 32px); right: 16px; bottom: 88px; height: 420px; }
}

/* ================================================================
   GLOBAL ANIMATIONS — smooth transitions & micro-interactions
   ================================================================ */

/* ---- Page Entry ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.section.active, .section-container[data-aos] {
    animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---- Glass Card Lift ---- */
.glass-card {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
}

/* ---- Buttons ---- */
.btn-primary, .btn-secondary, .btn-quick-add, .btn-add-money {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover, .btn-quick-add:hover, .btn-add-money:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.35);
}

.btn-primary:active, .btn-quick-add:active, .btn-add-money:active {
    transform: translateY(0) scale(0.97);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ---- Button ripple ---- */
.btn-primary::after, .btn-quick-add::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: 0.4s ease-out;
    pointer-events: none;
}

.btn-primary:active::after, .btn-quick-add:active::after {
    opacity: 1;
    transform: scale(2);
    transition: 0s;
}

/* ---- Stat Cards ---- */
.stat-card {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(-5deg);
}

.stat-icon {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-value {
    transition: color 0.3s;
}

.stat-card:hover .stat-value {
    color: var(--accent);
}

/* ---- Task Items ---- */
@keyframes taskSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.task-item {
    animation: taskSlideIn 0.35s ease-out both;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.task-item:nth-child(1)  { animation-delay: 0.02s; }
.task-item:nth-child(2)  { animation-delay: 0.05s; }
.task-item:nth-child(3)  { animation-delay: 0.08s; }
.task-item:nth-child(4)  { animation-delay: 0.11s; }
.task-item:nth-child(5)  { animation-delay: 0.14s; }
.task-item:nth-child(6)  { animation-delay: 0.17s; }
.task-item:nth-child(7)  { animation-delay: 0.20s; }
.task-item:nth-child(8)  { animation-delay: 0.23s; }
.task-item:nth-child(9)  { animation-delay: 0.26s; }
.task-item:nth-child(10) { animation-delay: 0.29s; }

.task-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(79, 195, 247, 0.3);
}

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

.task-checkbox {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
}

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

.task-checkbox.checked {
    animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popIn {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

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

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

.modal-overlay {
    animation: fadeIn 0.25s ease-out;
}

.modal-overlay.active .modal, .modal-overlay.active > .glass-card {
    animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---- Sidebar Nav ---- */
.nav-item {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item.active::before, .nav-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-item:hover { transform: translateX(4px); }
.nav-item.active { transform: translateX(2px); }

/* ---- Quick Links Hover ---- */
.quicklink-item {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.quicklink-item:hover {
    transform: translateX(4px);
}

/* ---- Theme Toggle Spin ---- */
.theme-toggle i {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-toggle:active i {
    transform: rotate(180deg);
}

/* ---- Toast Slide ---- */
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(80px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

.toast {
    animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in both;
}

/* ---- Badge Pulse ---- */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

.badge:not(:empty) {
    animation: badgePulse 2s ease-in-out infinite;
}

.priority-badge {
    transition: all 0.25s ease;
}

.task-item:hover .priority-badge {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ---- Chart Cards ---- */
.chart-card {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ---- Achievement Cards ---- */
.achievement-card {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.achievement-card:hover {
    transform: translateY(-4px) scale(1.02);
}

.badge-card {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: default;
}

.badge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.badge-card.unlocked {
    animation: fadeInUp 0.5s ease-out both;
}

.badge-card.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}

/* ---- Progress Ring Spin ---- */
.progress-ring-fill {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.savings-fill {
    transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Input Focus Glow ---- */
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], textarea, select {
    transition: all 0.25s ease;
}

input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.12);
}

/* ---- Filter Buttons ---- */
.filter-btn {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.filter-btn:active {
    transform: translateY(0) scale(0.95);
}

/* ---- Greeting Card ---- */
.greeting-card {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.greeting-card:hover { transform: translateY(-3px) scale(1.01); }

.greeting-avatar {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.greeting-card:hover .greeting-avatar {
    transform: scale(1.1) rotate(-5deg);
}

/* ---- Calendar Events ---- */
.calendar-wrapper {
    transition: all 0.3s ease;
}

.calendar-wrapper:hover {
    box-shadow: var(--shadow-md);
}

/* ---- Notification Items ---- */
.notification-item {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.notification-item:hover {
    transform: translateX(4px);
    background: var(--bg-secondary);
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Page Background Gradient ---- */
body {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 30%, #f5f0ff 60%, #f0f8ff 100%);
    background-size: 400% 400%;
    animation: bgShift 20s ease-in-out infinite;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0d0d1a 0%, #12122a 30%, #0f0f20 60%, #0d0d1a 100%);
    background-size: 400% 400%;
    animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {
    0%, 100% { background-position: 0% 50%; }
    25%      { background-position: 100% 0%; }
    50%      { background-position: 100% 100%; }
    75%      { background-position: 0% 100%; }
}

/* ---- Sidebar Glass ---- */
/* Sidebar glass effect is handled in the main sidebar rule above */

/* ---- Smooth Page Load ---- */
* {
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

/* ---- Empty State Pulse ---- */
.empty-state i {
    animation: emptyPulse 3s ease-in-out infinite;
}

@keyframes emptyPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.05); }
}

/* ============ SEARCH BAR ============ */
.section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-wrap { position: relative; flex: 1; min-width: 160px; max-width: 280px; }

.search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 13px; pointer-events: none;
}

.search-input {
    width: 100%; padding: 10px 12px 10px 34px;
    border-radius: 10px; border: 2px solid var(--border-color);
    background: var(--bg-secondary); color: var(--text-primary);
    font-size: 13px; font-family: var(--font-primary); outline: none;
    transition: all 0.25s ease;
}

.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15); }

.btn-icon {
    width: 38px; height: 38px; border-radius: 10px;
    border: 2px solid var(--border-color); background: var(--bg-card);
    color: var(--text-primary); cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}

.btn-icon:hover { border-color: #66bb6a; color: #66bb6a; background: rgba(102, 187, 106, 0.08); }

/* ============ POMODORO ============ */
.pomodoro-btn {
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--border-color); background: var(--bg-card);
    color: var(--text-primary); cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.pomodoro-btn:hover { background: #ef5350; color: #fff; border-color: #ef5350; }

.pomodoro-popup {
    position: fixed; bottom: 96px; right: 100px;
    width: 300px; background: var(--bg-card); backdrop-filter: blur(20px);
    border-radius: 20px; border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg); display: none; flex-direction: column;
    overflow: hidden; z-index: 5000;
}

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

.pomodoro-header {
    padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
    font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--border-color);
}

.pomodoro-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.pomodoro-header button:hover { color: var(--danger); }

.pomodoro-body { padding: 20px; text-align: center; }

.pomodoro-circle { position: relative; width: 140px; height: 140px; margin: 0 auto 20px; }
.pomodoro-circle svg { width: 100%; height: 100%; }

#pomodoroProgress {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.pomodoro-time {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.pomodoro-actions { display: flex; gap: 8px; justify-content: center; }

.btn-pomo {
    padding: 10px 16px; border-radius: 10px; border: 2px solid var(--border-color);
    background: var(--bg-secondary); color: var(--text-primary);
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: var(--font-primary); transition: all 0.25s ease;
    display: flex; align-items: center; gap: 6px;
}

.btn-pomo:hover { border-color: var(--accent); background: rgba(79, 195, 247, 0.1); }
.btn-pomo.danger:hover { border-color: var(--danger); background: rgba(239, 83, 80, 0.1); color: var(--danger); }

@media (max-width: 600px) {
    .section-actions { flex-wrap: wrap; }
    .search-wrap { max-width: 100%; order: 3; flex-basis: 100%; }
    .pomodoro-popup { right: 16px; bottom: 88px; width: calc(100vw - 32px); }
}

/* ============ YOUTUBE ============ */
.yt-search-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 8px 0 16px;
}

.yt-logo {
    display: flex; align-items: center; gap: 6px;
    font-size: 20px; font-weight: 800; color: #ff0000;
    flex-shrink: 0;
}

.yt-logo i { font-size: 28px; }
.yt-logo span { color: var(--text-primary); font-size: 18px; letter-spacing: -0.5px; }

.yt-search-full { display: flex; flex: 1; max-width: 640px; }

.yt-search-wrapper {
    position: relative; flex: 1; z-index: 10;
}

#youtubeSearch {
    width: 100%; padding: 10px 16px; border-radius: 24px 0 0 24px;
    border: 1px solid #ccc; border-right: none;
    background: var(--bg-card); color: var(--text-primary);
    font-size: 16px; outline: none; font-family: var(--font-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: 0.2s;
}

#youtubeSearch:focus {
    border-color: #1c62b9; box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

[data-theme="dark"] #youtubeSearch {
    background: #121212; border-color: #303030; color: #fff;
}
[data-theme="dark"] #youtubeSearch:focus { border-color: #1c62b9; }

.yt-search-btn {
    width: 64px; border-radius: 0 24px 24px 0;
    border: 1px solid #ccc; border-left: none;
    background: #f8f8f8; cursor: pointer; font-size: 16px; color: #333;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}

.yt-search-btn:hover { background: #f0f0f0; }

[data-theme="dark"] .yt-search-btn { background: #222; border-color: #303030; color: #fff; }
[data-theme="dark"] .yt-search-btn:hover { background: #2a2a2a; }

/* ---- Autocomplete Dropdown (YouTube style) ---- */
.yt-autocomplete {
    display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    background: #fff; border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-height: 340px; overflow-y: auto; overflow-x: hidden;
    z-index: 6000; padding: 8px 0;
}

.yt-autocomplete.active { display: block; }

[data-theme="dark"] .yt-autocomplete { background: #212121; box-shadow: 0 4px 20px rgba(0,0,0,0.6); }

.yt-suggestion {
    display: flex; align-items: center; gap: 14px;
    padding: 6px 20px; cursor: pointer; transition: 0.1s;
}

.yt-suggestion:hover, .yt-suggestion.active { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .yt-suggestion:hover, [data-theme="dark"] .yt-suggestion.active { background: rgba(255,255,255,0.08); }

.yt-sug-icon { width: 20px; color: #999; font-size: 14px; text-align: center; flex-shrink: 0; }

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

.yt-sug-title { font-size: 14px; color: #0f0f0f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="dark"] .yt-sug-title { color: #fff; }

.yt-sug-channel { font-size: 12px; color: #606060; margin-top: 1px; }
[data-theme="dark"] .yt-sug-channel { color: #aaa; }

.yt-sug-thumb { display: none; }

/* ---- Layout ---- */
.youtube-layout {
    display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start;
}

.youtube-player { padding: 0; overflow: hidden; border-radius: 12px; }

.youtube-embed-wrap { position: relative; width: 100%; min-height: 300px; background: #000; }

.youtube-embed-wrap iframe { display: block; width: 100%; border: none; }

.youtube-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 300px; color: #606060; font-size: 14px;
}

.youtube-placeholder i { font-size: 48px; color: #ff0000; margin-bottom: 12px; }
.youtube-placeholder p { margin: 0; }

.youtube-sidebar { display: flex; flex-direction: column; gap: 12px; }

.youtube-url { padding: 0; border: none; background: none; }
.youtube-url:hover { transform: none; box-shadow: none; border-color: transparent; }

.youtube-url-row { display: flex; gap: 8px; }

.youtube-url-row input {
    flex: 1; padding: 10px 14px; border-radius: 10px;
    border: 1px solid var(--border-color); background: var(--bg-secondary);
    color: var(--text-primary); font-size: 13px; outline: none;
    font-family: var(--font-primary);
}

.youtube-url-row input:focus { border-color: var(--accent); }

.youtube-playlist { padding: 14px; }
.playlist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.playlist-header h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.playlist-list { max-height: 300px; overflow-y: auto; }

.playlist-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px; border-radius: 8px; cursor: pointer; transition: 0.15s;
}
.playlist-item:hover { background: var(--bg-secondary); }

.playlist-thumb { width: 90px; height: 50px; border-radius: 6px; object-fit: cover; background: #000; flex-shrink: 0; }
.playlist-info { flex: 1; min-width: 0; }
.playlist-title { font-size: 12px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-meta { font-size: 11px; color: var(--text-muted); }
.playlist-remove { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.playlist-remove:hover { background: var(--danger); color: #fff; }

/* ---- Filters ---- */
.yt-filters {
    display: flex; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border-color); margin-bottom: 16px;
}

.yt-filter {
    padding: 6px 14px; border-radius: 8px; border: none;
    background: var(--bg-secondary); color: var(--text-primary);
    font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font-primary);
    transition: 0.2s;
}

.yt-filter.active, .yt-filter:hover { background: var(--text-primary); color: var(--bg-primary); }

/* ---- Results ---- */
.youtube-results { padding-top: 4px; }
.result-count { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 12px; }

.results-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 1100px) { .results-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .results-grid { grid-template-columns: 1fr; } }

.video-card { cursor: pointer; transition: 0.2s; }
.video-card:hover { transform: translateY(-2px); }

.video-thumb-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.video-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-duration { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.8); color: #fff; padding: 1px 5px; border-radius: 4px; font-size: 11px; font-weight: 600; }

.video-info { padding: 8px 0 0; }

.video-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.4; margin-bottom: 4px;
}

.video-channel, .video-meta-line { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.load-more-wrap { display: flex; justify-content: center; padding: 20px 0 8px; }

.btn-load-more {
    padding: 12px 28px; border-radius: 24px;
    border: 1px solid var(--border-color); background: var(--bg-card);
    color: var(--text-primary); font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: var(--font-primary); transition: 0.2s;
    display: flex; align-items: center; gap: 8px;
}

.btn-load-more:hover { background: var(--bg-secondary); border-color: var(--accent); }
.btn-load-more:disabled { opacity: 0.6; cursor: default; }

.video-card-new {
    animation: cardSlideUp 0.5s ease-out both;
    opacity: 0;
}

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

/* ---- Page Transition Animation ---- */
.results-grid.page-exit { animation: pageSlideOut 0.25s ease-in forwards; }
.results-grid.page-enter { animation: pageSlideIn 0.35s ease-out; }

@keyframes pageSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-40px); }
}

@keyframes pageSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---- Playlist Drag & Drop ---- */
.playlist-drag-handle {
    width: 20px; color: var(--text-muted); cursor: grab;
    font-size: 12px; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
}

.playlist-item:hover .playlist-drag-handle { opacity: 1; }

.playlist-item.dragging { opacity: 0.4; background: var(--accent); }

.playlist-item[draggable="true"] { user-select: none; }

/* ---- Daily Quote Card ---- */
.quote-card {
    padding: 20px 28px; text-align: center;
    border-left: 4px solid var(--accent);
    margin: 0 0 16px;
}

.quote-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 17px; font-style: italic; color: var(--text-primary);
    line-height: 1.6; margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.quote-author {
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .quote-card { border-left-color: var(--accent2); }

/* ---- Task Pomodoro ---- */
.task-pomodoro {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 20px; margin-bottom: 16px;
    flex-wrap: wrap;
}

.pomo-mode {
    display: flex; align-items: center; gap: 8px;
    min-width: 70px;
}

.pomo-icon {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
}

.pomo-mode span { font-size: 14px; font-weight: 700; color: var(--text-primary); }

.pomo-main { flex: 1; min-width: 120px; }

.pomo-timer-display {
    font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--text-primary); line-height: 1;
}

.pomo-progress-bar {
    width: 100%; height: 5px; background: var(--bg-secondary);
    border-radius: 3px; margin-top: 6px; overflow: hidden;
}

.pomo-progress-fill {
    height: 100%; width: 0%;
    background: var(--accent-gradient); border-radius: 3px;
    transition: width 0.8s linear;
}

.pomo-controls { display: flex; gap: 6px; align-items: center; }

.pomo-btn-small {
    padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-color);
    background: var(--bg-secondary); color: var(--text-primary);
    font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: var(--font-primary); transition: 0.2s;
}

.pomo-btn-small:hover { border-color: var(--accent); }

.pomo-custom {
    width: 50px; padding: 6px 4px; border-radius: 8px;
    border: 1px solid var(--border-color); background: var(--bg-secondary);
    color: var(--text-primary); font-size: 12px; font-weight: 600;
    text-align: center; font-family: var(--font-primary); outline: none;
}
.pomo-custom:focus { border-color: var(--accent); }

.pomo-btn-play {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent-gradient); border: none; color: #fff;
    font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}

.pomo-btn-play:hover { transform: scale(1.1); }

.pomo-sessions { font-size: 14px; color: var(--text-muted); margin-left: 4px; white-space: nowrap; }

@media (max-width: 600px) { .task-pomodoro { flex-direction: column; align-items: stretch; } }

@media (max-width: 900px) {
    .youtube-layout { grid-template-columns: 1fr; }
    .playlist-list { max-height: 200px; }
    .yt-search-hero { flex-direction: column; align-items: stretch; gap: 8px; }
    .yt-search-full { max-width: 100%; }
    .results-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   EISENHOWER MATRIX
   ================================================================ */
.eisenhower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.eisenhower-quadrant {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px;
    min-height: 180px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.eq-q1 { border-top: 3px solid #f87171; }
.eq-q2 { border-top: 3px solid #3b82f6; }
.eq-q3 { border-top: 3px solid #f59e0b; }
.eq-q4 { border-top: 3px solid #94a3b8; }

.eisenhower-quadrant.drag-over {
    box-shadow: 0 0 0 2px var(--accent);
    transform: scale(1.01);
}

.eq-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2px;
}
.eq-header-left { display: flex; align-items: center; gap: 8px; }
.eq-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.eq-dot-q1 { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.4); }
.eq-dot-q2 { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.4); }
.eq-dot-q3 { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.eq-dot-q4 { background: #94a3b8; box-shadow: 0 0 6px rgba(148,163,184,0.4); }
.eq-title { font-weight: 700; font-size: 0.9rem; }
.eq-count { background: var(--bg-secondary); border-radius: 20px; padding: 1px 10px; font-size: 0.75rem; font-weight: 700; }
.eq-subtitle { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 10px; }

.eq-dropzone { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.eq-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.8rem; gap: 6px; opacity: 0.5; }
.eq-empty i { font-size: 1.5rem; }

.eq-task {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    cursor: grab;
    transition: all 0.25s ease;
    animation: eqSlideIn 0.3s ease;
}
@keyframes eqSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.eq-task:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.eq-task.dragging { opacity: 0.5; transform: scale(1.03); }
.eq-task.completed { opacity: 0.5; text-decoration: line-through; }
.eq-task-content { flex: 1; min-width: 0; }
.eq-task-title { font-size: 0.85rem; font-weight: 600; display: block; }
.eq-task-desc { font-size: 0.72rem; color: var(--text-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-task-actions { display: flex; gap: 4px; flex-shrink: 0; opacity: 0; transition: opacity 0.2s; }
.eq-task:hover .eq-task-actions { opacity: 1; }
.eq-task-complete, .eq-task-delete {
    width: 26px; height: 26px; border-radius: 6px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 11px; transition: 0.2s;
    background: transparent; color: var(--text-muted);
}
.eq-task-complete:hover { background: rgba(102,187,106,0.15); color: var(--success); }
.eq-task-delete:hover { background: rgba(239,83,80,0.15); color: var(--danger); }

.swal-q-btn { transition: all 0.2s; }
.swal-q-btn.active { box-shadow: 0 0 0 2px #6366f1; }
@media (max-width: 600px) { .eisenhower-grid { grid-template-columns: 1fr; } }

/* ================================================================
   STICKY NOTES / BRAIN DUMP
   ================================================================ */
.sticky-notes-widget {
    padding: 20px; margin-bottom: 20px;
}
.sticky-header { margin-bottom: 12px; }
.sticky-input {
    width: 100%; padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--border-color); background: var(--bg-primary);
    color: var(--text-primary); font-family: var(--font-primary); font-size: 0.85rem;
    resize: vertical; outline: none; transition: var(--transition);
}
.sticky-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,195,247,0.12); }
.sticky-add-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.sticky-color-picker { display: flex; gap: 6px; }
.sticky-color {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
    cursor: pointer; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.sticky-color:hover { transform: scale(1.2); }
.sticky-color.active { border-color: var(--accent); transform: scale(1.15); }
.sticky-add-btn { font-size: 0.8rem; padding: 8px 16px; }
.sticky-board {
    position: relative; min-height: 150px; margin-top: 12px;
    background: var(--bg-secondary); border-radius: 16px;
    border: 1px dashed var(--border-color);
    padding: 16px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 12px;
}
.sticky-note {
    position: relative; border-radius: 10px; padding: 12px;
    box-shadow: 1px 3px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: grab; user-select: none;
}
.sticky-note:hover { transform: scale(1.02) !important; box-shadow: 2px 6px 20px rgba(0,0,0,0.1); z-index: 10; }
.sticky-delete {
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.5); color: #fff; font-size: 10px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s; z-index: 5;
}
.sticky-note:hover .sticky-delete { opacity: 1; }
.sticky-textarea {
    width: 100%; border: none; background: transparent;
    font-family: var(--font-primary); font-size: 0.8rem; color: #334155;
    resize: vertical; outline: none; min-height: 50px;
}
.sticky-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.sticky-date { font-size: 0.65rem; color: rgba(0,0,0,0.3); }
.sticky-color-picker.small { gap: 4px; }
.sticky-color-dot {
    width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.1);
    cursor: pointer; transition: 0.2s;
}
.sticky-color-dot:hover { transform: scale(1.3); }
.sticky-color-dot.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* ================================================================
   PRODUCTIVITY PROFILE
   ================================================================ */
.profile-exp-card {
    padding: 24px; display: flex; align-items: center; gap: 16px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.profile-level-badge {
    width: 60px; height: 60px; border-radius: 16px;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.6rem; font-weight: 800; flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(79,195,247,0.35);
}
.profile-exp-info { flex: 1; min-width: 0; }
.profile-exp-header { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 6px; }
.profile-exp-label { color: var(--text-secondary); }
.profile-exp-label b { color: var(--text-primary); }
.profile-exp-value { color: var(--text-muted); font-size: 0.75rem; }
.profile-exp-bar-wrap {
    height: 10px; background: var(--bg-secondary); border-radius: 10px; overflow: hidden;
}
.profile-exp-bar {
    height: 100%; border-radius: 10px;
    background: var(--accent-gradient);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}
.profile-exp-bar::after {
    content: ''; position: absolute; right: 0; top: 0; width: 30px; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    animation: expShine 2s infinite;
}
@keyframes expShine {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
.profile-exp-btn {
    padding: 10px 20px; border-radius: 12px; border: none;
    background: var(--accent-gradient); color: #fff; font-weight: 700;
    cursor: pointer; font-size: 0.85rem; transition: 0.2s;
    box-shadow: 0 4px 15px rgba(79,195,247,0.3);
    flex-shrink: 0;
}
.profile-exp-btn:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(79,195,247,0.45); }
.profile-exp-btn:active { transform: scale(0.95); }

.profile-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.profile-stat-card {
    padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.profile-stat-icon { font-size: 1.6rem; }
.profile-stat-value { font-size: 1.6rem; font-weight: 800; }
.profile-stat-label { font-size: 0.72rem; color: var(--text-muted); }

.badges-full-grid { padding: 20px; margin-top: 0; }
.badges-grid-scroll {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px; margin-top: 12px;
}
.profile-badge {
    padding: 14px 10px; text-align: center; border-radius: 12px;
    border: 1px solid var(--border-color); background: var(--bg-primary);
    transition: all 0.25s ease;
}
.profile-badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.profile-badge.locked { opacity: 0.35; filter: grayscale(0.6); }
.profile-badge.unlocked { animation: badgePopIn 0.4s ease; }
@keyframes badgePopIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.profile-badge-icon { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.profile-badge.name { font-size: 0.78rem; font-weight: 700; display: block; }
.profile-badge-desc { font-size: 0.65rem; color: var(--text-muted); display: block; margin-top: 2px; }

/* EXP Floating Particle */
.exp-particle {
    position: fixed; z-index: 5000; pointer-events: none;
    font-weight: 800; font-size: 1rem; color: #f59e0b;
    text-shadow: 0 0 8px rgba(245,158,11,0.4);
    animation: expFloat 1.2s ease-out forwards;
}
@keyframes expFloat {
    0% { opacity: 1; transform: translateY(0px) scale(1); }
    100% { opacity: 0; transform: translateY(-70px) translateX(20px) scale(1.4); }
}

/* Level-Up Overlay */
.levelup-overlay {
    position: fixed; inset: 0; z-index: 6000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}
.levelup-modal {
    background: var(--bg-card); border-radius: 28px;
    padding: 40px 48px; text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
    max-width: 380px; width: 90%;
    animation: levelUpBounce 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes levelUpBounce {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.levelup-icon {
    width: 70px; height: 70px; border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 2rem; color: #fff;
    box-shadow: 0 8px 30px rgba(245,158,11,0.4);
    animation: badgeSpin 0.8s ease;
}
@keyframes badgeSpin {
    0% { transform: rotate(0deg) scale(0); }
    60% { transform: rotate(360deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}
.levelup-title { font-size: 1.8rem; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.levelup-lvl {
    display: inline-block; margin: 8px 0; padding: 6px 24px;
    border-radius: 20px; background: var(--accent-gradient); color: #fff;
    font-size: 2.5rem; font-weight: 900; line-height: 1.2;
}
.levelup-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.levelup-close {
    padding: 12px 36px; border-radius: 14px; border: none;
    background: var(--accent-gradient); color: #fff; font-weight: 700;
    cursor: pointer; font-size: 0.95rem; transition: 0.2s;
    box-shadow: 0 4px 15px rgba(79,195,247,0.3);
}
.levelup-close:hover { transform: scale(1.05); }

.levelup-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.levelup-confetti-piece {
    position: absolute; top: 50%; left: 50%; width: 10px; height: 6px;
    border-radius: 2px;
    animation: confettiBurst var(--d) ease-out forwards;
    animation-delay: 0.2s;
}
@keyframes confettiBurst {
    0% { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(calc(var(--x) * 250px), calc(var(--y) * 250px)) rotate(var(--r)) scale(0.3); opacity: 0; }
}

@media (max-width: 600px) {
    .profile-stats-row { grid-template-columns: repeat(3, 1fr); }
    .badges-grid-scroll { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   SAVINGS UPGRADE
   ================================================================ */
.savings-target-preview {
    display: flex; align-items: center; gap: 10px; margin-top: 12px;
    padding: 10px 14px; border-radius: 14px; background: var(--bg-secondary);
    transition: transform 0.3s;
}
.savings-target-preview.target-pulse {
    animation: targetPulse 0.6s ease;
}
@keyframes targetPulse {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.08); }
}
.target-img-placeholder {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--bg-card); display: flex; align-items: center;
    justify-content: center; font-size: 1.4rem; flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.target-img {
    width: 100%; height: 100%; object-fit: cover;
}
.target-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }

.savings-quick-amounts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick-amt-btn {
    padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-color);
    background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
    font-size: 0.75rem; font-weight: 600; transition: all 0.2s;
}
.quick-amt-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.savings-quota-info { margin-top: 8px; }
.quota-row { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; padding: 4px 0; color: var(--text-secondary); }
.quota-value { font-weight: 700; color: var(--accent); }

.savings-chart-card { padding: 20px; margin-top: 20px; }
.runway-chart { position: relative; height: 150px; margin-top: 12px; }
.runway-bars {
    display: flex; align-items: flex-end; gap: 6px; height: 100%;
    padding-left: 0;
}
.runway-bar-col {
    flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%;
    justify-content: flex-end; gap: 4px;
}
.runway-bar-fill {
    width: 100%; border-radius: 8px 8px 0 0;
    background: var(--accent-gradient); max-height: 100%;
    min-height: 4px;
    transition: height 0.8s ease-out;
}
.runway-bar-fill.future {
    background: transparent;
    border: 2px dashed rgba(79,195,247,0.4);
    border-bottom: none;
}
.runway-bar-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 500; }
.runway-bar-label.goal { color: var(--danger); font-weight: 700; }
.runway-goal-line {
    position: relative; width: 100%;
}
.runway-goal-dash {
    position: absolute; top: 0; left: 0; right: 0;
    border-top: 2px dashed var(--danger);
}

@media (max-width: 768px) {
    .savings-content { grid-template-columns: 1fr; }
}
