*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
*:focus { outline: none !important; box-shadow: none !important; }
button { -webkit-tap-highlight-color: transparent; outline: none; }

/* ============================================================
   LUCIO THEME SYSTEM
   CSS custom properties drive all colors. Themes override
   accent vars. Light mode overrides background/text vars.
   ============================================================ */

:root {
    /* Backgrounds */
    --bg-dark:   #0B0E14;
    --bg-panel:  #151921;
    --bg-hover:  #1E2330;
    --bg-mesh-1: rgba(129, 140, 248, 0.08);
    --bg-mesh-2: rgba(45, 212, 191, 0.06);

    /* Text */
    --text-primary:   #ECEFF4;
    --text-secondary: #94A3B8;
    --text-muted:     #64748B;

    /* Accent */
    --accent-primary:   #818CF8;
    --accent-secondary: #2DD4BF;
    --accent-glow:      rgba(129, 140, 248, 0.4);

    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --danger:  #EF4444;

    /* Layout */
    --sidebar-width: 280px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --font-main: 'Outfit', 'Inter', -apple-system, sans-serif;
    --border-subtle: rgba(255,255,255,0.05);
}

/* ──── COLOR THEMES ──── */
[data-theme="ocean"] {
    --accent-primary:   #38BDF8;
    --accent-secondary: #818CF8;
    --accent-glow:      rgba(56,189,248,0.4);
    --bg-mesh-1: rgba(56,189,248,0.07);
    --bg-mesh-2: rgba(129,140,248,0.06);
}
[data-theme="forest"] {
    --accent-primary:   #34D399;
    --accent-secondary: #A3E635;
    --accent-glow:      rgba(52,211,153,0.4);
    --bg-mesh-1: rgba(52,211,153,0.07);
    --bg-mesh-2: rgba(163,230,53,0.05);
}
[data-theme="sunset"] {
    --accent-primary:   #FB923C;
    --accent-secondary: #F472B6;
    --accent-glow:      rgba(251,146,60,0.4);
    --bg-mesh-1: rgba(251,146,60,0.07);
    --bg-mesh-2: rgba(244,114,182,0.06);
}
[data-theme="rose"] {
    --accent-primary:   #FB7185;
    --accent-secondary: #FBBF24;
    --accent-glow:      rgba(251,113,133,0.4);
    --bg-mesh-1: rgba(251,113,133,0.07);
    --bg-mesh-2: rgba(251,191,36,0.05);
}

/* ──── LIGHT MODE ──── */
[data-mode="light"] {
    --bg-dark:   #F0F4F8;
    --bg-panel:  #FFFFFF;
    --bg-hover:  #E2EAF4;
    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;
    --border-subtle: rgba(0,0,0,0.07);
    --bg-mesh-1: rgba(129,140,248,0.06);
    --bg-mesh-2: rgba(45,212,191,0.04);
}
[data-mode="light"] .sidebar {
    border-right-color: rgba(0,0,0,0.08);
    box-shadow: 4px 0 20px rgba(0,0,0,0.06);
}
[data-mode="light"] .nav-btn.active {
    background: rgba(129,140,248,0.1);
    box-shadow: 0 0 0 1px rgba(129,140,248,0.2);
}
[data-mode="light"] .mobile-nav {
    background: rgba(255,255,255,0.94);
    border-top-color: rgba(0,0,0,0.08);
}
[data-mode="light"] .modal { background: #fff; }
[data-mode="light"] .confirm-modal { background: #fff; }
[data-mode="light"] .form-input {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
    color: #0f172a;
}
[data-mode="light"] .glass-panel {
    background: rgba(255,255,255,0.7);
    border-color: rgba(0,0,0,0.07);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
[data-mode="light"] .habit-item { border-bottom-color: rgba(0,0,0,0.06); }
[data-mode="light"] .habit-checklist { background: rgba(0,0,0,0.015); }
[data-mode="light"] .auth-card {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}
[data-mode="light"] .auth-card h1,
[data-mode="light"] .auth-card p { color: var(--text-primary); }
[data-mode="light"] .theme-panel {
    background: #fff;
    border-left-color: rgba(0,0,0,0.08);
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}
[data-mode="light"] .profile-panel {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}
[data-mode="light"] .column .habit-checklist {
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.06);
}
[data-mode="light"] .stat-card {
    background: rgba(255,255,255,0.8);
    border-color: rgba(0,0,0,0.07);
}
[data-mode="light"] .sync-status { background: rgba(0,0,0,0.04); }
[data-mode="light"] .idea-card {
    background: #fff;
    border-color: rgba(0,0,0,0.07);
}

/* ──── THEME PICKER PANEL ──── */
.theme-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100dvh;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-subtle);
    z-index: 2000;
    padding: 1.75rem 1.5rem;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0,0,0,0.4);
    scrollbar-width: none;
}
.theme-panel::-webkit-scrollbar { display: none; }
.theme-panel.open { right: 0; }

.theme-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-panel-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.theme-close-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 30px; height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.theme-close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.theme-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.6rem;
}
.mode-toggle-row { display: flex; gap: 0.5rem; }
.mode-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-main);
}
.mode-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}
.theme-swatches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.theme-swatch {
    padding: 0.75rem;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-hover);
    font-family: var(--font-main);
}
.theme-swatch:hover { background: var(--bg-hover); filter: brightness(1.15); }
.theme-swatch.active {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}
.swatch-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.25rem 0;
}

/* Account section in theme panel */
.theme-account-section { display: flex; flex-direction: column; gap: 0.75rem; }
.theme-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--bg-hover);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}
.theme-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.theme-user-details { flex: 1; min-width: 0; }
.theme-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.theme-user-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.theme-action-btn {
    width: 100%;
    padding: 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-main);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.theme-action-btn:hover { color: var(--text-primary); filter: brightness(1.1); }
.theme-action-btn.danger {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.06);
    color: #ef4444;
}
.theme-action-btn.danger:hover { background: rgba(239,68,68,0.12); }

/* Floating theme trigger */
.theme-trigger {
    position: fixed;
    bottom: 5.5rem;
    right: 1rem;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 1.15rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 900;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.theme-trigger:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: transparent;
    transform: rotate(20deg) scale(1.08);
    box-shadow: 0 6px 24px var(--accent-glow);
}
@media (min-width: 1025px) {
    .theme-trigger { bottom: 1.5rem; right: 1.5rem; }
}

/* Theme panel overlay (click-outside to close) */
.theme-overlay {
    position: fixed; inset: 0;
    z-index: 1999;
    display: none;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: overlayIn 0.2s ease;
}
.theme-overlay.open { display: block; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ──── NOTIFICATION BELL ──── */
.notif-bell {
    position: fixed;
    bottom: 5.5rem;
    right: 4rem;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 900;
    transition: all 0.25s;
}
.notif-bell:hover {
    background: var(--warning);
    color: #fff;
    border-color: transparent;
    transform: scale(1.08);
}
.notif-bell.active {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.4);
    color: var(--warning);
}
@media (min-width: 1025px) {
    .notif-bell { bottom: 1.5rem; right: 5rem; }
}

/* ──── PROFILE MODAL ──── */
.profile-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    width: min(480px, 95vw);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2rem;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.profile-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.profile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.profile-panel-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}
.profile-avatar-large {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 0 20px var(--accent-glow);
}
.profile-form { display: flex; flex-direction: column; gap: 1rem; }
.profile-field { display: flex; flex-direction: column; gap: 0.4rem; }
.profile-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.profile-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: border-color 0.2s;
    outline: none;
}
.profile-input:focus { border-color: var(--accent-primary); }
.profile-input:disabled { opacity: 0.5; cursor: not-allowed; }
.profile-save-btn {
    padding: 0.75rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.profile-save-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.profile-stats-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.profile-stat {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-hover);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}
.profile-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.profile-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ──── TOAST NOTIFICATION ──── */
#xp-toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 0.7rem 1.4rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-main);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 9999;
    white-space: nowrap;
    pointer-events: none;
}
#xp-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ──── MOBILE LOGOUT BUTTON ──── */
.mobile-logout-btn { color: #ef4444 !important; opacity: 0.85; }
.mobile-logout-btn:hover { opacity: 1; }

/* ──── STREAK DOTS ──── */
.habit-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.streak-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(251,146,60,0.15);
    color: #FB923C;
    border: 1px solid rgba(251,146,60,0.3);
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.habit-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.2rem;
}
.streak-dots { display: flex; gap: 3px; align-items: center; }
.streak-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s;
    flex-shrink: 0;
}
[data-mode="light"] .streak-dot { background: rgba(0,0,0,0.1); }
.streak-dot.filled {
    background: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-glow);
}
.habit-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}


html {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    /* Subtle Mesh Gradient Background */
    background-image:
        radial-gradient(circle at 15% 15%, var(--bg-mesh-1) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, var(--bg-mesh-2) 0%, transparent 40%);
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease;
}

/* --- Layout Grid --- */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* Sidebar */
.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.logo-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    width: fit-content;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    transition: all 0.3s ease;
}

.sync-status.syncing {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.1);
}

.sync-status.syncing .sync-dot {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: syncPulse 1.2s infinite ease-in-out;
}

.sync-status.syncing .sync-text {
    color: var(--warning);
}

.sync-status.error {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.sync-status.error .sync-dot {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.sync-status.error .sync-text {
    color: var(--danger);
}

.force-sync-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 4px;
    margin-left: 4px;
    opacity: 0.4;
    transition: all 0.2s ease;
    filter: grayscale(1);
}

.force-sync-btn:hover {
    opacity: 1;
    filter: grayscale(0);
    transform: rotate(180deg);
}

@keyframes syncPulse {
    0% {
        opacity: 0.4;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-align: left;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn .icon,
.nav-btn span,
.mobile-nav-btn .icon,
.mobile-nav-btn .label {
    pointer-events: none;
}

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

.nav-btn.active {
    background: rgba(var(--accent-rgb, 129, 140, 248), 0.1);
    color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 129, 140, 248), 0.2);
    transform: translateX(4px);
}

.nav-btn:active {
    transform: scale(0.98);
}

.nav-btn.active .icon {
    opacity: 1;
}

/* Content Area */
.content-area {
    padding: 2rem 3rem;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 100px;
    scroll-behavior: smooth;
    width: 100%;
}

.content-area.view-fade-in {
    animation: contentFadeIn 0.3s ease forwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

@media (max-width: 768px) {
    .content-area {
        padding: 1.5rem;
        padding-bottom: 100px;
    }
}

/* Welcome Screen Refined */
.welcome-screen {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-screen h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .welcome-screen h2 {
        font-size: 2rem;
    }

    .welcome-screen {
        margin: 2rem auto;
    }
}

.stats-preview {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 640px) {
    .stats-preview {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .stat-card {
        width: 100%;
        max-width: 300px;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 180px;
    backdrop-filter: blur(5px);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Global Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Focus Mode Toggle */
.focus-mode-btn:hover {
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent-secondary);
}

/* --- Habits View --- */
.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.habits-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.habit-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.habit-card:hover {
    transform: translateY(-2px);
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.habit-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.habit-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.habit-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

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

.check-btn {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.check-btn.completed {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}

.check-btn svg {
    width: 18px;
    height: 18px;
    stroke: #0d121c;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.check-btn.completed svg {
    opacity: 1;
    transform: scale(1);
}

/* --- Modals --- */
/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: auto;
    position: relative;
}

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

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.cancel-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}

.cancel-btn:hover {
    color: var(--text-primary);
}

.save-btn,
.add-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
    transition: transform 0.2s;
}

.save-btn:hover,
.add-btn:hover {
    transform: translateY(-1px);
    background: #737df2;
}

.delete-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 0 0.5rem;
    z-index: 10;
}

.delete-icon:hover {
    color: var(--danger);
    opacity: 1;
    transform: scale(1.1);
}

.habit-item:hover .delete-icon {
    opacity: 1;
}

/* --- Planner: Timeline Month Grouping --- */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.month-group {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s;
}

.month-group.past-month {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.1);
    opacity: 0.7;
}

.month-group.past-month:hover {
    opacity: 1;
}

.month-group.current-month {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.15);
}

.month-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.past-month .month-label {
    color: #f87171;
    /* brighter red text */
}

.month-weeks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 cols of weeks */
    gap: 0.5rem;
}

.habit-group {
    margin-bottom: 2rem;
}

.habit-category-header {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.habit-category-header.urgent {
    color: #f87171;
}

.habit-category-header.medium {
    color: var(--accent-primary);
}

.habit-category-header.low {
    color: var(--text-muted);
}

.habit-checklist {
    display: grid;
    gap: 0.75rem;
}

.habit-item {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.habit-item:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.habit-item.done {
    opacity: 0.6;
}

.habit-item.done .habit-name {
    text-decoration: line-through;
}

.week-card-mini {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    transition: background 0.2s;
}

.week-card-mini:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.w-num {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.w-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--accent-secondary);
    border-radius: 50%;
    position: absolute;
    top: 4px;
    right: 4px;
}

/* --- Dashboard Orbit --- */


.timer-center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timer-huge {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -2px;
    color: white;
}

.focus-controls-modern {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
}

.control-btn-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.control-btn-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.control-btn-icon:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

.control-btn-icon.active {
    background: var(--accent-primary);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
    border-color: transparent;
}

.control-btn-icon.active svg {
    fill: white;
}

.control-btn-icon.secondary {
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

.control-btn-icon.secondary:hover {
    opacity: 1;
}



/* Weekly View Refinements */
.day-column {
    background: rgba(0, 0, 0, 0.2) !important;
    border: none !important;
}

.day-column .column-header {
    background: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Planner: Week Grid (Year View) --- */
.year-roadmap-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.roadmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.weeks-grid-container h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

.week-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1rem 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.week-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.week-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.week-task-count {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.empty-msg {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

.add-btn-small {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.add-btn-small:hover {
    background: var(--bg-hover);
    color: white;
}

/* --- Planner: Week Board (Simple Checklist Style) --- */
.week-checklist-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    /* Removed gaps for seamless look */
    padding-bottom: 1rem;
    width: 100%;
    margin: 0 auto;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

/* Simple Day Checklist */
.day-checklist {
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    min-width: 0;
    min-height: 500px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.day-checklist:last-child {
    border-right: none;
}

.day-checklist:hover {
    background: transparent;
    /* No hover effect */
}

.day-checklist.is-today {
    border-color: rgba(255, 255, 255, 0.1);
    background: transparent;
    /* No today background */
}

/* Day Header */
.day-header-simple {
    background: transparent;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.pomo-title {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.pomo-exit-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.4;
    z-index: 10;
}

.pomo-exit-btn:hover {
    opacity: 1;
    color: var(--pomo-accent);
    transform: scale(1.1);
}

.day-header-simple h3 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
}

.is-today .day-header-simple h3 {
    color: var(--accent-primary);
}

.today-dot {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0);
}

/* Checklist Items Container */
.checklist-items {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

/* Individual Checklist Item */
.checklist-item {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
    cursor: pointer;
}

.checklist-item:last-of-type {
    border-bottom: none;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.checklist-item.done {
    opacity: 0.5;
}

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

/* Checkbox Wrapper */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    cursor: pointer;
}

/* Hide default checkbox */
.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom Checkbox */
.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.checkbox-wrapper:hover .checkbox-custom {
    border-color: var(--accent-primary);
}

/* Checked state */
.checkbox-wrapper input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Checkmark */
.checkbox-wrapper input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Task Title */
.task-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

/* Delete Button */
.delete-task-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0 0.25rem;
    line-height: 1;
    transition: all 0.2s;
}

.checklist-item:hover .delete-task-btn {
    opacity: 1;
}

.delete-task-btn:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* Empty State */
.empty-checklist {
    padding: 2rem 1rem;
    text-align: center;
}

.empty-checklist p {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin: 0;
}

/* Add Task Button */
.add-task-simple {
    margin-top: 0;
    padding: 0.8rem 0.5rem;
    /* Aligns with grid */
    height: 2.8rem;
    /* Fix height to match grid */
    background: transparent;
    border: none;
    border-bottom: none;
    /* Removed separator */
    /* Stronger separator */
    color: var(--text-muted);
    /* Brighter text */
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    opacity: 0.8;
    width: 100%;
}

.add-task-simple:hover {
    color: var(--accent-primary);
    opacity: 1;
    background: transparent;
}

.add-task-simple::before {
    content: '+';
    font-size: 1.2em;
    font-weight: 400;
}

.checklist-item {
    padding: 0 0.65rem;
    height: 2.8rem;
    /* Strict height for grid alignment */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
    cursor: pointer;
}

.checklist-item[draggable="true"] {
    cursor: move;
}

.checklist-item.dragging {
    opacity: 0.5;
}

.day-checklist.drag-over {
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.08);
}

/* Old modern styles - keeping for backward compatibility but hidden */
.week-board-modern,
.day-column-modern {
    display: none;
}

/* --- Results / Charts --- */
.results-container {
    display: grid;
    gap: 2rem;
    animation: fadeIn 0.4s;
}

.chart-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.chart-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.trend-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    padding-top: 1rem;
}

.trend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.trend-bar-bg {
    width: 16px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.trend-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent-secondary);
    border-radius: 10px;
    transition: height 1s ease-out;
}

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

.heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.heatmap-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.heatmap-day.l1 {
    background: rgba(52, 211, 153, 0.2);
}

.heatmap-day.l2 {
    background: rgba(52, 211, 153, 0.4);
}

.heatmap-day.l3 {
    background: rgba(52, 211, 153, 0.7);
}

.heatmap-day.l4 {
    background: #34d399;
    box-shadow: 0 0 5px rgba(52, 211, 153, 0.5);
}

/* Sparklines */
.graphic-table {
    width: 100%;
    border-collapse: collapse;
}

.graphic-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.graphic-table td {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-sparkline {
    display: flex;
    gap: 3px;
    align-items: center;
}

.spark-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.spark-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 4px var(--accent-glow);
}

/* --- Planner: Split View (Drill Down) --- */
.planner-layout-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
    overflow: hidden;
}

@media (max-width: 768px) {
    .planner-layout-split {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .planner-sidebar {
        height: auto;
        max-height: 300px;
    }

    .backlog-list {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .backlog-list .task-card {
        min-width: 200px;
        margin-right: 0.5rem;
    }

    .planner-board {
        min-height: 500px;
    }
}

/* --- Planner Board Styles --- */
.planner-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.column {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 1rem;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.column.drag-over {
    background: rgba(129, 140, 248, 0.07);
    border: 2px dashed var(--accent-primary);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.15), inset 0 0 20px rgba(129,140,248,0.04);
    border-radius: 16px;
    transition: all 0.15s ease;
}

.column-header h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Task Card */
.task-card {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.1);
}

.task-card.dragging {
    opacity: 0.35;
    transform: scale(0.97);
    background: var(--bg-hover);
    border: 1px dashed rgba(255,255,255,0.15);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.task-delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.task-card:hover .task-delete-btn {
    opacity: 1;
}

/* Category Tags */
.category-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.tag-green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.tag-red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.tag-purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.tag-gray {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.priority-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.priority-high {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.priority-med {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.priority-low {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}








/* --- ULTRA Habit Card --- */
.habit-card-ultra {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.habit-card-ultra:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Priority Indicator */
.ultra-priority-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: gray;
    /* fallback */
}

/* Icon */
.ultra-icon-wrapper {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.habit-card-ultra:hover .ultra-icon-wrapper {
    transform: rotate(10deg) scale(1.1);
}

/* Info */
.ultra-info {
    flex: 1;
}

.ultra-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.habit-card-ultra h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ultra-badge.urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.05em;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ultra-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Check Button */
.ultra-check-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ultra-check-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.1);
}

.done .ultra-check-btn {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--bg-dark);
    font-weight: bold;
    font-size: 0.7rem;
    width: auto;
    padding: 0 1rem;
    border-radius: 20px;
}

/* Delete */
.ultra-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.habit-card-ultra:hover .ultra-delete {
    opacity: 1;
}

.ultra-delete:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* Done State Styles */
.habit-card-ultra.done {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.02);
}

.habit-card-ultra.done h3 {
    text-decoration: line-through;
    color: var(--text-muted);
}

.habit-card-ultra.done .ultra-icon-wrapper {
    filter: grayscale(1);
    opacity: 0.5;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* --- Custom Confirmation Modal --- */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.open {
    display: flex;
    opacity: 1;
}

.confirm-modal {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-overlay.open .confirm-modal {
    transform: scale(1);
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.confirm-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 2rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    flex: 1;
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.confirm-btn-danger:hover {
    background: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

@media (max-width: 480px) {
    .confirm-modal {
        padding: 2rem 1.5rem;
    }

    .confirm-actions {
        flex-direction: column;
    }
}

/* --- Responsive Navigation & Layout --- */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(21, 25, 33, 0.9);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    justify-content: flex-start;
    align-items: center;
    padding: 0 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
}
.mobile-nav::-webkit-scrollbar { display: none; }

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.mobile-nav-btn .icon {
    font-size: 1.25rem;
}

.mobile-nav-btn .label {
    font-size: 0.7rem;
    font-weight: 500;
}

.mobile-nav-btn.active {
    color: var(--accent-primary);
}

.mobile-nav-btn.active .icon {
    transform: translateY(-4px);
    text-shadow: 0 0 10px var(--accent-glow);
}

.mobile-nav-btn:active {
    transform: scale(0.9);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        /* Allow scrolling on mobile */
        height: auto;
    }

    .app-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        display: none;
        /* Hide sidebar on mobile */
    }

    .mobile-nav {
        display: flex;
        /* Show bottom nav on mobile */
    }

    .content-area {
        padding: 1rem 0.75rem 80px 0.75rem;
        /* Extra bottom padding for nav, tighter sides */
    }

    /* Planner Mobile Polish */
    .week-checklist-board {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        border: none !important;
        background: transparent !important;
    }

    .day-checklist {
        width: 100% !important;
        border-right: none !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        min-height: auto !important;
        background: rgba(255, 255, 255, 0.03) !important;
        margin-bottom: 0.5rem;
    }

    .day-header-simple {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-btn .label {
        display: none;
    }

    .mobile-nav {
        height: 55px;
    }

    .welcome-screen h2 {
        font-size: 2.2rem;
    }

    .stats-preview {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
    }

    .stat-card {
        min-width: 0;
        width: 100%;
    }

    /* Modal responsiveness */
    .modal {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .save-btn,
    .add-btn,
    .cancel-btn {
        width: 100%;
        padding: 0.8rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .sidebar {
        padding: 1rem;
    }

    .logo h1 {
        display: none;
        /* Icon only logo on small tablets */
    }

    .nav-btn .label {
        display: none;
        /* Icon only nav buttons? Maybe not, keep them small instead */
    }
}

/* --- Auth Screen Redesign --- */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(129, 140, 248, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(45, 212, 191, 0.15) 0%, transparent 40%);
    z-index: 10000;
    padding: 1rem;
    box-sizing: border-box;
}

.auth-card {
    background: rgba(21, 25, 33, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: authFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    margin: auto;
    /* Fit within viewport height with scroll fallback */
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    scrollbar-width: none;
}
.auth-card::-webkit-scrollbar { display: none; }

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.auth-card h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 0.75rem;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

.auth-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 10px 15px -3px rgba(129, 140, 248, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(129, 140, 248, 0.4);
    filter: brightness(1.1);
}

.auth-toggle {
    margin-top: 1.5rem !important;
    font-size: 0.9rem !important;
}

.auth-toggle a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.auth-toggle a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.logo-icon.large {
    font-size: 3.25rem;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

/* --- Social Auth Styles --- */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
}

.social-auth-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.social-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn img {
    width: 24px;
    height: 24px;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-btn.google:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.1);
}

.social-btn.facebook:hover {
    border-color: #1877F2;
    background: rgba(24, 119, 242, 0.1);
}

.social-btn.apple:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.social-btn.phone:hover {
    border-color: var(--accent-secondary);
    background: rgba(45, 212, 191, 0.1);
}

.social-btn .icon {
    font-size: 1.5rem;
}

#recaptcha-container {
    margin-top: 1rem;
}

/* --- MODULES RESTORED --- */

.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.add-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Space between groups */
}

/* Category Headers (The "Box" style) */
.habit-category-header {
    padding: 0.6rem 2.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #0c4a6e;
    /* Dark blue text */
    background: #e0f2fe;
    /* High-contrast light blue block */
    margin: 1.5rem 0 0.5rem 0;
    width: fit-content;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Priority based block tints */
.habit-category-header.urgent {
    background: #fee2e2;
    color: #991b1b;
}

.habit-category-header.medium {
    background: #e0f2fe;
    color: #0c4a6e;
}

.habit-category-header.low {
    background: #f1f5f9;
    color: #334155;
}

.habit-checklist {
    border: none;
    background: transparent;
}

/* Checklist Item */
.habit-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.1s;
}

.habit-item:last-child {
    border-bottom: none;
}

.habit-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Square Checkbox */
.checkbox-square {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    background: transparent;
    margin-right: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    /* Checkmark color */
    font-size: 0.85rem;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-square:hover {
    border-color: white;
}

.checkbox-square.checked {
    background: transparent;
    /* Keep transparent or fill? Image had checkmark */
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Content */
.habit-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.habit-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Completed State */
.habit-item.done .habit-name {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Delete Button */
.delete-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    padding: 0 0.5rem;
    transition: opacity 0.2s;
}

.habit-item:hover .delete-icon {
    opacity: 0.6;
}

.delete-icon:hover {
    opacity: 1;
    color: #ef4444;
}

/* Modal Styles Reuse */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #1e293b;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
}

.save-btn {
    background: var(--accent-primary);
    border: none;
    padding: 0.5rem 1.5rem;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

/* --- Responsive Habits --- */
@media (max-width: 768px) {
    .habits-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .habits-header h2 {
        font-size: 1.5rem;
    }

    .habit-item {
        padding: 0.75rem 0.5rem;
    }

    .habit-name {
        font-size: 0.9rem;
    }

    .checkbox-square {
        margin-right: 0.75rem;
    }
}

/* planner.css - Paper Checklist Style */

/* Reusing classes from habits.css for consistency: 
   .habit-category-header, .habit-checklist, .habit-item, .checkbox-square
*/

.planner-container {
    animation: fadeIn 0.4s ease-out;
}

.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.back-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 1.25rem;
    font-family: 'Outfit', sans-serif;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateX(-4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Week Board Grid */
.week-checklist-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Minimal width for papers */
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: start;
}

/* Individual Day Column wrapper */
.column {
    /* No background, purely structural now */
    border: none;
    padding: 0;
    min-width: 250px;
}

/* Ensure checklists take full height/width of column */
.habit-checklist {
    background: rgba(30, 41, 59, 0.2);
    /* Slight tint for day columns */
}

/* Add Task Button Styling overrides for context */
.add-task-simple {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-task-simple:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.02);
}

/* --- Responsive Planner --- */
@media (max-width: 768px) {
    .planner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .planner-header h2 {
        font-size: 1.5rem;
    }

    .week-checklist-board {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding-bottom: 2rem;
        margin: 0;
        overflow-x: visible;
    }

    .column {
        width: 100%;
        min-width: auto;
        scroll-snap-align: none;
        flex-shrink: 1;
    }

    .habit-checklist {
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    /* Small dots or indicator for swiping? Browser provides scrollbar usually */
}
/* Anonymous / Guest Login Button */
.social-btn.anonymous {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    font-size: 1.3rem;
}

.social-btn.anonymous:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Anonymous warning text */
.anon-warning {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.75rem;
    opacity: 0.7;
    line-height: 1.4;
}

/* --- Auth Screen Responsive Fix --- */
@media (max-width: 600px) {
    .auth-screen {
        align-items: center;
        padding: 0.75rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 20px;
        margin: auto;
        max-height: calc(100dvh - 1.5rem);
    }

    .auth-card h1 {
        font-size: 1.75rem;
        margin-top: 0.4rem;
    }

    .logo-icon.large {
        font-size: 2.75rem;
    }

    .auth-card p {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .auth-form {
        gap: 0.75rem;
    }

    .auth-form input {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .auth-btn {
        padding: 0.85rem;
        margin-top: 0.5rem;
    }

    .auth-divider {
        margin: 1rem 0;
    }

    .social-auth-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .social-btn {
        height: 44px;
    }

    .auth-toggle {
        margin-top: 1rem !important;
    }
}

/* ============================================================
   NOTIFICATIONS VIEW
   ============================================================ */
.notif-view {
    max-width: 640px;
    padding-bottom: 3rem;
    animation: fadeIn 0.35s ease-out;
}

.notif-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}
.notif-view-header h2 { margin: 0; font-size: 1.75rem; font-weight: 700; }

.notif-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
}

/* Permission Banners */
.notif-permission-banner,
.notif-permission-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}
.notif-permission-banner {
    background: rgba(129,140,248,0.08);
    border: 1px solid rgba(129,140,248,0.2);
    color: var(--text-secondary);
}
.notif-permission-warning {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    color: var(--text-secondary);
    line-height: 1.5;
}
.notif-grant-btn {
    padding: 0.5rem 1.1rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-main);
    transition: filter 0.2s;
    flex-shrink: 0;
}
.notif-grant-btn:hover { filter: brightness(1.12); }

/* Notification Card */
.notif-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 0.6rem;
    transition: border-color 0.2s;
}
.notif-card:hover { border-color: rgba(255,255,255,0.1); }

.notif-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.notif-card-icon {
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 10px;
    flex-shrink: 0;
}
.notif-card-info { flex: 1; min-width: 0; }
.notif-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Time Row */
.notif-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-subtle);
    transition: opacity 0.2s;
}
.notif-time-row.dimmed {
    opacity: 0.35;
    pointer-events: none;
}
.notif-time-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.notif-time-input {
    padding: 0.4rem 0.7rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-main);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    color-scheme: dark;
}
[data-mode="light"] .notif-time-input { color-scheme: light; }
.notif-time-input:focus { border-color: var(--accent-primary); }
.notif-time-input:disabled { opacity: 0.35; cursor: not-allowed; }

/* Toggle Switch */
.notif-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.notif-toggle-switch input { opacity: 0; width: 0; height: 0; }
.notif-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.12);
    border-radius: 100px;
    transition: background 0.25s;
}
[data-mode="light"] .notif-slider { background: rgba(0,0,0,0.15); }
.notif-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.notif-toggle-switch input:checked + .notif-slider {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}
.notif-toggle-switch input:checked + .notif-slider::before {
    transform: translateX(20px);
}

/* Test button */
.notif-test-row { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-subtle); }
.notif-test-btn {
    padding: 0.7rem 1.5rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
}
.notif-test-btn:hover {
    background: rgba(129,140,248,0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.notif-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* ============================================================
   IN-APP NOTIFICATION BANNER
   ============================================================ */
.inapp-banner {
    position: fixed;
    top: -90px;
    left: 50%;
    transform: translateX(-50%);
    width: min(440px, calc(100vw - 2rem));
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    z-index: 9990;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    transition: top 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.inapp-banner.show { top: 1rem; }
.inapp-banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.inapp-banner-text { flex: 1; min-width: 0; }
.inapp-banner-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.inapp-banner-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.inapp-banner-close {
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 26px; height: 26px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s;
}
.inapp-banner-close:hover { color: var(--text-primary); }

/* Bell button active glow */
.notif-bell.active {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.35);
    color: var(--warning);
    box-shadow: 0 0 14px rgba(245,158,11,0.2);
}

/* ============================================================
   STREAK DOTS (habit cards)
   ============================================================ */
.habit-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.streak-badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(251,146,60,0.15);
    color: #FB923C;
    border: 1px solid rgba(251,146,60,0.3);
    padding: 1px 6px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.habit-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}
.streak-dots { display: flex; gap: 3px; align-items: center; }
.streak-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s;
    flex-shrink: 0;
}
[data-mode="light"] .streak-dot { background: rgba(0,0,0,0.1); }
.streak-dot.filled {
    background: var(--accent-primary);
    box-shadow: 0 0 5px var(--accent-glow);
}
.habit-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

/* Mobile notif nav adjustments */
@media (max-width: 1024px) {
    .inapp-banner { top: -90px; }
    .inapp-banner.show { top: 4.5rem; }
}

/* ============================================================
   I18N — Language Toggle Styles
   ============================================================ */
[data-lang-btn] { transition: all 0.2s; }
[data-lang-btn].active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Lang badge in sidebar (optional) */
.lang-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.04em;
}
.lang-badge:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: transparent;
}

/* AI suggest btn */
.ai-suggest-btn { background:rgba(129,140,248,.12);border:1px solid rgba(129,140,248,.25);border-radius:8px;padding:.3rem .55rem;font-size:.85rem;cursor:pointer;transition:all .2s;outline:none;-webkit-tap-highlight-color:transparent;flex-shrink:0;line-height:1; }
.ai-suggest-btn:hover { background:rgba(129,140,248,.3);transform:scale(1.1); }
.ai-suggest-btn:disabled { opacity:.5;cursor:not-allowed;transform:none; }

.ai-suggest-btn{background:rgba(129,140,248,.12);border:1px solid rgba(129,140,248,.25);border-radius:8px;padding:.3rem .55rem;font-size:.85rem;cursor:pointer;transition:all .2s;outline:none;-webkit-tap-highlight-color:transparent;flex-shrink:0;}
.ai-suggest-btn:hover{background:rgba(129,140,248,.3);transform:scale(1.1);}
.ai-suggest-btn:disabled{opacity:.5;cursor:not-allowed;transform:none;}
