/* =========================================================================
   Tracker - Global Styles
   =========================================================================
   TABLE OF CONTENTS
   -----------------
   1.  Variables & Reset .................. :root, *, body
   2.  Aurora Background .................. .swift-aurora, .brush-blob
   3.  Layout ............................. .app-container, .main-content
   4.  Sidebar ............................ .sidebar, .nav-item
   5.  Dynamic Island / Top Bar ........... .top-bar, .island-*, .chip
   6.  Dashboard Layout ................... .habits-column, .objectives-column
   7.  Habits ............................. .habit-card, .habit-progress-*
   8.  Tasks / Objectives ................. .objective-card, .subtask-row
   9.  Calendar ........................... .calendar-*, .activity-calendar-*
   10. Calendar Popover ................... .calendar-day-popover, .popover-*
   11. Modals ............................. .modal-overlay, .modal
   12. Scrollbars ......................... ::-webkit-scrollbar
   13. Animations & Keyframes ............. @keyframes
   14. Timeline / Gantt Chart ............. .timeline-container, .gantt-*
   15. Heatmap ............................ .heatmap-*, .streak-*
   ========================================================================= */


:root {
    /* Color Palette - sapphire blue (Deep Dark Revert) */
    --bg-base: #000000;
    /* Absolute Black */
    --bg-sidebar: rgba(0, 0, 0, 0.95);
    --bg-surface: rgba(255, 255, 255, 0.01);
    --bg-surface-hover: rgba(255, 255, 255, 0.03);
    --bg-glass: rgba(0, 0, 0, 0.6);
    /* Darker glass */
    --border-subtle: rgba(255, 255, 255, 0.04);
    /* Subtler card definition */
    --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02);

    --primary: #3b82f6;
    /* Sapphire Blue */
    --primary-hover: #60a5fa;
    /* Sky Blue */
    --primary-dim: rgba(59, 130, 246, 0.15);
    --primary-light: #93c5fd;

    --secondary: #14B8A6;
    /* Soft Teal */
    --accent: #f43f5e;
    /* Swift Rose/Pink */
    --accent-dim: rgba(244, 63, 94, 0.15);

    --success: #10b981;
    /* Saturated Emerald */
    --success-dim: rgba(16, 185, 129, 0.15);

    --warning: #f59e0b;
    /* Vibrant Amber */
    --warning-dim: rgba(245, 158, 11, 0.15);

    --danger: #ef4444;
    /* Tomato Red */
    --danger-dim: rgba(239, 68, 68, 0.15);

    --info: #0ea5e9;
    /* Sky Blue */
    --info-dim: rgba(14, 165, 233, 0.15);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    /* Zinc 400 */
    --text-muted: #71717a;
    /* Zinc 500 */

    /* Design Tokens */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Structure */
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% -20%, #0F172A 0%, #000000 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Fine Art GrainOverlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: soft-light;
}

/* Swift-Style Fluid Aurora */
.swift-aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    filter: blur(180px);
    /* Increased from 100px for silkier blending */
    pointer-events: none;
    background: var(--bg-base);
    /* Ensure fallback under blobs */
}

/* Vignette to blend edges and focus the center */
.swift-aurora::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 5;
}

.brush-blob {
    position: absolute;
    border-radius: 999px;
    opacity: 0.12;
    /* Lowered for better elegance and darkness */
    animation: swift-flow 60s infinite alternate ease-in-out;
    /* Slower 60s animation */
    mix-blend-mode: screen;
}

.blob-1 {
    width: 140vw;
    height: 80vh;
    top: -20vh;
    left: -30vw;
    background: radial-gradient(circle, #6366f1 0%, rgba(168, 85, 247, 0.5) 40%, transparent 70%);
}

.blob-2 {
    width: 120vw;
    height: 70vh;
    bottom: -15vh;
    right: -20vw;
    background: radial-gradient(circle, #3b82f6 0%, rgba(6, 182, 212, 0.5) 40%, transparent 70%);
    animation-delay: -25s;
}

.blob-3 {
    width: 100vw;
    height: 60vh;
    top: 20vh;
    right: -10vw;
    background: radial-gradient(circle, #14b8a6 0%, rgba(16, 185, 129, 0.4) 40%, transparent 70%);
    animation-delay: -45s;
    opacity: 0.12;
}

@keyframes swift-flow {
    0% {
        transform: translate(0, 0) rotate(-15deg) scale(1);
    }

    50% {
        transform: translate(50px, 30px) rotate(-10deg) scale(1.1);
    }

    100% {
        transform: translate(-20px, 60px) rotate(-20deg) scale(1);
    }
}

/* =========================================================================
   Layout
   ========================================================================= */

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
    /* Above aurora */
}

/* =========================================================================
   Sidebar
   ========================================================================= */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    margin-bottom: 28px;
    padding-left: 8px;
}

.brand h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 60%, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
}

.brand h1::after {
    content: '.';
    -webkit-text-fill-color: var(--primary);
}

.sidebar-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 8px;
}

.section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    padding-left: 8px;
    margin-bottom: 8px;
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    /* Compacted */
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--primary-dim);
    color: var(--primary);
}

.btn-modal {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-cancel {
    background: transparent;
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-submit {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

.btn-submit:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(167, 139, 250, 0.4);
}

.nav-item .icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

/* =========================================================================
   Dynamic Island Top Bar
   ========================================================================= */

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: rgba(6, 6, 8, 0.5);
    backdrop-filter: blur(5px);
}

.view-container {
    height: 100%;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 72px;
    background: #000000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 24px;
}

.island-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 1;
    min-width: 0;
}

.island-date-mini {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.island-focus {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #818cf8;
    border: 1px solid rgba(129, 140, 248, 0.3);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.island-center {
    flex: 1;
    min-width: 0;
    max-width: 800px;
    mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.upcoming-stream {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}

.upcoming-stream::-webkit-scrollbar {
    display: none;
}

.island-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.island-quick-add {
    display: flex;
    align-items: center;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 99px;
    padding: 0 16px;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    height: 44px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: text;
}

.island-quick-add .icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.island-quick-add input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    width: 100%;
    opacity: 1;
    white-space: nowrap;
}

.island-quick-add:focus-within,
.island-quick-add:hover {
    max-width: 320px;
    background: var(--bg-surface-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-premium);
}

.island-quick-add:focus-within input,
.island-quick-add:hover input {
    width: 100%;
    opacity: 1;
}

.btn-island-add {
    height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-island-add svg {
    transition: transform 0.2s ease;
}

.btn-island-add:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-island-add:active {
    transform: translateY(1px);
}

.btn-island-add:hover svg {
    transform: rotate(90deg) scale(1.1);
}

/* Adjust Chips for Island height */
/* Adjust Chips for Island height */
.chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-sidebar);
    padding: 4px 16px 4px 10px;
    border-radius: 99px;
    min-width: fit-content;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    height: 44px;
    position: relative;
    box-shadow: var(--shadow-premium);
}

.chip:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.chip-info {
    display: flex;
    flex-direction: column;
}

.chip-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;

    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-sub {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 1px;
}

/* Chip Variants */
.chip.overdue {
    background: radial-gradient(circle at left, rgba(248, 113, 113, 0.15) 0%, rgba(248, 113, 113, 0.05) 100%);
    border-color: rgba(248, 113, 113, 0.3);
}

.chip.overdue .chip-icon {
    color: #f87171;
    background: rgba(248, 113, 113, 0.2);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.4);
}

.chip.overdue:hover {
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chip.today {
    background: radial-gradient(circle at left, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.chip.today .chip-icon {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.chip.today:hover {
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chip.streak {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.2);
}

.chip.streak .chip-icon {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.chip.habit-active {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.2);
}

.chip.habit-active .chip-icon {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

/* Empty state beautiful icon */
.chip-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 44px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-style: italic;
    opacity: 0.7;
}

.chip.overdue .chip-title {
    color: #ff8a75;
}

.chip.overdue .chip-icon {
    color: #f05138;
    opacity: 1;
}

.chip.today {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.chip.today .chip-icon {
    color: #f59e0b;
    opacity: 1;
}

/* Top Quick Add */
.top-quick-add {
    display: flex;
    align-items: center;
    background: rgba(10, 10, 15, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    padding: 2px 12px;
    gap: 8px;
    width: 280px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    height: 40px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.top-quick-add:focus-within {
    background: rgba(15, 15, 20, 0.8);
    border-color: rgba(168, 85, 247, 0.5);
    width: 320px;
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(168, 85, 247, 0.2);
}

.top-quick-add input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    flex: 1;
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.top-quick-add .kbd-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    opacity: 0.6;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-progress-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
}

.header-progress-line .line-fill {
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    width: 0%;
    transition: width 1s ease;
}

@keyframes simplePulse {
    0% {
        opacity: 0.6;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

/* Chip Variants with Vibrant Glows */
.chip.overdue {
    background: rgba(240, 81, 56, 0.06);
    border-color: rgba(240, 81, 56, 0.2);
}

.chip.overdue .chip-icon {
    background: rgba(240, 81, 56, 0.15);
    color: #f05138;
    box-shadow: 0 0 12px rgba(240, 81, 56, 0.2);
}

.chip.overdue .chip-title {
    color: #ff8a75;
}

.chip.today {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
}

.chip.today .chip-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.chip.upcoming {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
}

.chip.upcoming .chip-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.chip.streak {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
}

.chip.streak .chip-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.chip.focus {
    background: rgba(167, 139, 250, 0.06);
    border-color: rgba(167, 139, 250, 0.2);
}

.chip.focus .chip-icon {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.2);
}

.chip-info {
    display: flex;
    flex-direction: column;
}

.chip-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.chip-sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chip:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background-color: var(--bg-surface-hover);
}

.chip-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.bg-danger-dim {
    background-color: var(--danger-dim);
    color: var(--danger);
}

.bg-warning-dim {
    background-color: var(--warning-dim);
    color: var(--warning);
}

.bg-info-dim {
    background-color: var(--info-dim);
    color: var(--info);
}

.bg-success-dim {
    background-color: var(--success-dim);
    color: var(--success);
}

.chip-info {
    display: flex;
    flex-direction: column;
}

.chip-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.chip-sub {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.user-profile .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b2a5a, #2a1a4a);
    color: #a78bfa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    border: 1px solid rgba(167, 139, 250, 0.2);
    cursor: pointer;
}

/* =========================================================================
   Dashboard View
   ========================================================================= */

.view-container {
    flex-grow: 1;
    overflow: hidden;
    /* Prevent page-level scrolling */
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
}

.view-container::-webkit-scrollbar {
    width: 6px;
}

.view-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.view.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text-primary);
    line-height: 1;
}

.header-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

.task-search-container {
    display: flex;
    align-items: center;
    background: var(--bg-sidebar);
    /* Darker background */
    border: 1px solid rgba(255, 255, 255, 0.12);
    /* Brighter border */
    border-radius: var(--radius-full);
    padding: 0 12px;
    height: 32px;
    transition: var(--transition-fast);
}

.task-search-container:focus-within {
    border-color: var(--primary);
    background: var(--bg-surface-hover);
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.task-group.drag-over {
    background: rgba(var(--primary-rgb), 0.08);
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.task-search-container .icon {
    color: var(--text-muted);
    margin-right: 6px;
    display: flex;
}

.task-search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    width: 140px;
    transition: width 0.3s ease;
}

.task-search-input:focus {
    width: 200px;
}

.task-search-input::placeholder {
    color: var(--text-muted);
}

.obj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    color: var(--text-muted);
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 56px;
}

/* Force sync height with main-page-header */


.main-page-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 60px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.obj-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.obj-header-left .icon {
    font-size: 0.85rem;
}

.obj-header-left h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-muted);
}

.obj-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.obj-tabs {
    display: flex;
    background: rgba(15, 15, 20, 0.8);
    /* Darker, more solid base */
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 4px;
}

.obj-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.obj-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.obj-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-new-folder {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(25, 25, 30, 0.8);
    /* Solid background */
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.btn-new-folder:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: var(--primary-dim);
    transform: translateY(-1px);
}


/* Professional Board Layout - More fluid */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(480px, 1fr) 1.4fr;
    /* User request: Reduce right-side width, give left side more space */
    gap: 40px;
    align-items: stretch;
    flex-grow: 1;
    height: 100%;
    min-height: 0;
    transition: grid-template-columns 0.4s ease;
}

@media (max-width: 1400px) {
    .dashboard-layout {
        grid-template-columns: minmax(440px, 1fr) 1.2fr;
        gap: 24px;
    }
}

@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: minmax(420px, 1.2fr) 1fr;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .view-container {
        overflow-y: auto;
    }
}

.habits-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 0 8px;
    /* Compacted */
}

.objectives-column {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 8px 8px 0 8px;
    /* Compacted */
}

/* ── Activity Insights ── */
#focus-hub-container {
    margin-bottom: 24px;
}

.focus-hub-card.insights-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.insights-header {
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.insights-message {
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
}

.insights-message.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.insights-message.warning {
    background: var(--warning-dim);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.insights-message.success {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success);
}

.insights-message strong {
    font-weight: 700;
}

.focus-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.focus-pill {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.focus-pill svg {
    color: var(--primary);
}

/* ── Tasks Grid Constraints ── */
.group-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    grid-auto-rows: min-content;
    gap: 16px;
    padding: 10px;
    border-radius: 12px;
    min-height: 60px;
    transition: all 0.2s;
}

/* User request: Max 2 columns for tasks, but stretch to fill space */
@media (min-width: 1600px) {
    .group-tasks {
        grid-template-columns: repeat(2, 1fr);
        /* Removed max-width to allow full extension as requested */
    }
}

@media (max-width: 800px) {
    .group-tasks {
        grid-template-columns: 1fr;
    }
}

/* Wrapper for the habits list inside the main scrolling column */
.scrollable-habits-wrapper {
    padding-top: 10px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom scrollbars universally across the app */

*::-webkit-scrollbar,
body::-webkit-scrollbar,
.view-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    /* For horizontal scrollbars */
}

*::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.view-container::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.view-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.view-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.column-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--text-muted);
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.column-header .icon {
    font-size: 0.85rem;
}

.column-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Modular Task Grouping */
.task-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-premium);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 48px;
}

.group-header.pill-academic {
    border-left: 4px solid #60a5fa;
}

.group-header.pill-academic .folder-icon {
    color: #60a5fa;
}

.group-header.pill-comp-sci {
    border-left: 4px solid #a78bfa;
}

.group-header.pill-comp-sci .folder-icon {
    color: #a78bfa;
}

.group-header.pill-health {
    border-left: 4px solid #4ade80;
}

.group-header.pill-health .folder-icon {
    color: #4ade80;
}

.group-header.pill-work {
    border-left: 4px solid #facc15;
}

.group-header.pill-work .folder-icon {
    color: #facc15;
}

.group-header.pill-life-goals {
    border-left: 4px solid #fb7185;
}

.group-header.pill-life-goals .folder-icon {
    color: #fb7185;
}

.group-header.pill-pink {
    border-left: 4px solid #f472b6;
}

.group-header.pill-pink .folder-icon {
    color: #f472b6;
}

.group-header.pill-custom {
    border-left: 4px solid #a1a1aa;
}

.group-header.pill-custom .folder-icon {
    color: #a1a1aa;
}

.group-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.collapse-toggle.collapsed {
    transform: rotate(-90deg);
}

.group-tasks.hidden {
    display: none !important;
}

.group-header .folder-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2px;
}

.group-header .tag.bg-surface {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-left: auto;
}

.group-header h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0;
    line-height: 1;
}

.group-header .btn-action {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.group-header:hover .btn-action {
    opacity: 1;
}


/* Universal Card DNA: Crystal Glass - More solid for better contrast */
.task-card {
    --card-accent: rgba(255, 255, 255, 0.1);
    background: var(--bg-sidebar);
    /* Use slightly darker slate for individual cards */
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-premium);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 16px;
    z-index: 1;
    /* allow dragged items to pop */
}

/* ── Native Drag and Drop States ── */
.is-dragging {
    opacity: 0.4 !important;
    transform: scale(0.95) !important;
    box-shadow: none !important;
    z-index: 100 !important;
}

.drag-over {
    background: rgba(168, 85, 247, 0.05) !important;
    outline: 2px dashed rgba(168, 85, 247, 0.6) !important;
    outline-offset: -2px;
}

.drag-over-header {
    background: rgba(168, 85, 247, 0.15) !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4) inset !important;
    border-color: rgba(168, 85, 247, 0.6) !important;
}

/* Folder Reordering Drop Zones */
.drag-over-folder-top {
    position: relative;
}

.drag-over-folder-top::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 4px;
    background: #a855f7;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
    z-index: 10;
}

.drag-over-folder-bottom {
    position: relative;
}

.drag-over-folder-bottom::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 4px;
    background: #a855f7;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
    z-index: 10;
}


/* Pseudo-accent for smooth rounded corners */
.task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--card-accent);
    z-index: 2;
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.task-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.4),
        0 0 12px var(--card-accent-dim, rgba(255, 255, 255, 0.05));
}

.task-card:hover::before {
    transform: scaleX(1.5);
    /* Crisp, hardware-accelerated growth */
    background: var(--card-accent);
    box-shadow: 0 0 15px var(--card-accent);
}

/* Habit Card Specifics */
.habit-card {
    justify-content: space-between;
    margin-bottom: 4px;
    /* Compacted */
}

.habit-card.completed {
    --card-accent: var(--success);
    --card-accent-dim: var(--success-dim);
}

.habit-card:not(.completed) {
    --card-accent: var(--primary);
    --card-accent-dim: var(--primary-dim);
}

.habit-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.checkbox:hover {
    transform: scale(1.15);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-dim);
}

.checkbox.checked {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox.checked::after {
    content: '✓';
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
}

.habit-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.habit-title {
    font-size: 0.88rem;
    font-weight: 500;
}

.habit-time-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.70rem;
    color: var(--text-muted);
}

.habit-stat.today.active {
    color: var(--primary);
    font-weight: 600;
}

.habit-time-stats .separator {
    opacity: 0.5;
}

.habit-right {
    display: flex;
    /* Switched to flex to ensure right alignment */
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    margin-left: auto;
    flex-shrink: 0;
}

.habit-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.habit-history-dots {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: 100%;
}

.habit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    /* Dark/Empty state */
    transition: all 0.3s ease;
}

.habit-dot.completed {
    background: var(--primary-light);
    /* Lit up state */
    box-shadow: 0 0 6px rgba(167, 139, 250, 0.6);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 600;
    width: auto;
    /* Fixed: was pushing other elements */
    white-space: nowrap;
}

.tag {
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 4px 10px;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Habit Chart / Monthly View */
.habit-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.habit-chart-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 16px;
    margin-left: 28px;
    /* Align with title */
    animation: slideDown 0.3s ease-out;
}

.habit-chart-container.hidden {
    display: none;
}

.habit-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.habit-chart-count {
    color: var(--primary-light);
}

.habit-chart-grid {
    display: grid;
    grid-template-columns: repeat(20, 10px);
    /* 60 days approx */
    grid-template-rows: repeat(3, 10px);
    gap: 4px;
    grid-auto-flow: column;
}

.habit-chart-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.2s;
}

.habit-chart-cell.done {
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary-dim);
}

.habit-chart-cell.today {
    border: 1px solid var(--primary-light);
}

.habit-chart-cell:hover {
    transform: scale(1.3);
    z-index: 2;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-chart svg {
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-chart:hover svg {
    color: var(--primary);
}

.streak-badge.empty {
    width: 32px;
    /* Placeholder to maintain alignment */
}

/* Urgency States */
.tag-warning {
    background: #f59e0b !important;
    /* Amber */
    color: #000 !important;
    border: none;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.tag-scary {
    background: #ef4444 !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    animation: tag-blink 3s infinite alternate ease-in-out;
}

@keyframes tag-blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.7;
    }
}

/* Scary Pulse for the whole card */
.scary-red-pulse {
    --card-accent: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
    background: rgba(45, 20, 20, 0.95) !important;
    /* Intense red-tinted dark background */
    box-shadow:
        0 0 25px rgba(239, 68, 68, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.8) !important;
    animation: card-scary-pulse 1.5s infinite ease-in-out;
}

/* Re-adding the intense left accent for red pulse */
.scary-red-pulse::before {
    width: 6px !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8) !important;
}

.warning-yellow-card {
    --card-accent: #f59e0b !important;
}

@keyframes card-scary-pulse {
    0% {
        border-color: rgba(239, 68, 68, 0.3);
    }

    50% {
        border-color: rgba(239, 68, 68, 0.7);
    }

    100% {
        border-color: rgba(239, 68, 68, 0.3);
    }
}

/* Objective Card Specifics */
.objective-card {
    position: relative;
    /* For absolute positioning of progress bar */
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px 20px !important;
    /* Compacted padding */
    --card-accent: var(--primary);
}

.objective-card:not(.scary-red-pulse):not(.warning-yellow-card):not(.completed) {
    --card-accent: var(--primary);
}

.objective-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.objective-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.objective-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.objective-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.objective-progress {
    width: calc(100% - 32px);
    /* Align with new compacted padding */
    position: absolute;
    bottom: 8px;
    left: 16px;
}

.progress-track {
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--card-accent);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px var(--card-accent);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent);
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
    z-index: 1;
}

@keyframes progress-stripes {
    0% {
        background-position: 1rem 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* =========================================================================
   Buttons & Utilities
   ========================================================================= */

.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    /* Base button weight */
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #fff;
    border: none;
    box-shadow:
        0 4px 16px rgba(59, 130, 246, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.2) inset;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    background-position: right center;
    box-shadow:
        0 6px 24px rgba(240, 81, 56, 0.5),
        0 0 0 0.8px rgba(255, 255, 255, 0.3) inset;
    transform: translateY(-1px) scale(1.02);
}

.btn-full {
    width: 100%;
}

.btn-icon-small {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-icon-small:hover {
    color: var(--text-primary);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-16 {
    margin-top: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

/* Hidden state for modals */
.hidden {
    display: none !important;
}

/* ── Modal overlay ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: all var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Modal box ─────────────────────────────────────────────── */
.modal {
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1001;
    animation: modal-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden .modal {
    transform: translateY(20px) scale(0.95);
}

.modal h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 8px;
}

.modal-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    /* Floating glass island */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    appearance: none;
}

.modal-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(240, 81, 56, 0.12),
        0 0 20px rgba(240, 81, 56, 0.15);
}

/* ── Custom Select Dropdown ────────────────────────────── */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    /* Floating glass island */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select.active .custom-select-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(240, 81, 56, 0.1);
}

.custom-select-trigger svg {
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.custom-select.active .custom-select-trigger svg {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(25px) saturate(160%);
    -webkit-backdrop-filter: blur(25px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    max-height: 240px;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #000000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 0 40px;
    height: 72px;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.custom-select.active .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.custom-option.selected {
    background: var(--primary-dim);
    color: var(--primary-light);
    font-weight: 600;
}

.modal-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Modal row for inputs */
.modal-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    align-items: flex-end;
    /* Align inputs to bottom of row */
}

.modal-row>div {
    display: flex;
    flex-direction: column;
}

.modal-input::placeholder {
    color: var(--text-muted);
}

.modal-row .modal-input {
    flex: 1;
}

.modal-subtasks-section {
    margin-top: 16px;
    padding: 0;
    /* De-boxed */
    background: transparent;
    border: none;
}

.subtask-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.modal-subtask-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.modal-subtask-row .modal-input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 0.9rem;
}

.modal-subtask-row .subtask-due {
    max-width: 140px;
}

.modal-subtask-row .btn-delete {
    opacity: 0.4;
    transition: opacity 0.2s;
}

.modal-subtask-row:hover .btn-delete {
    opacity: 1;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Task Action Buttons (Edit, Delete) */
.btn-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.modal-subtask-row .btn-delete {
    background: transparent;
    border: none;
    opacity: 0;
}

.modal-subtask-row:hover .btn-delete {
    opacity: 1;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-action.edit-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-dim);
}

.btn-action.btn-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-dim);
    transform: scale(1.05);
    /* slightly smaller scale for delete */
}

/* Add habit input */
.add-habit-row {
    margin-top: 4px;
}

.add-habit-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-medium);
}

.add-habit-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.1);
}

.add-habit-input::placeholder {
    color: var(--text-muted);
}

/* Subtask items in objective cards */
.subtask-list {
    width: 100%;
    align-self: stretch;
    /* Ensure it spans the full horizontal space */
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scrollbars during animations */
    padding: 6px 0 2px 0;
    /* Removed right padding so actions hit the right edge */
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.subtask-list::-webkit-scrollbar {
    width: 4px;
}

.subtask-list::-webkit-scrollbar-track {
    background: transparent;
}

.subtask-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.subtask-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.subtask-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.subtask-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.subtask-title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subtask-item.done .subtask-title-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checkbox.small {
    width: 14px;
    height: 14px;
    min-width: 14px;
}

/* Date input styling for dark theme */
input[type="date"] {
    color-scheme: dark;
}


/* ── Per-Task Timer Button ───────────────────────────── */
.timer-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.timer-btn:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

.timer-btn.active {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* ── Complete Button ─────────────────────────────── */
.complete-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.complete-btn:hover {
    background: var(--success-dim);
    color: var(--success);
    border-color: var(--success);
    transform: scale(1.1);
}

.complete-btn.is-complete {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

/* ── Completed Task/Habit ──────────────────────────────────── */
.task-card.completed {
    opacity: 0.55;
}

.done-text {
    text-decoration: line-through;
    color: var(--text-muted) !important;
}

/* ── Subtask list (always visible) ─────────────────────────── */
.subtask-list.visible {
    display: block !important;
    width: 100%;
    padding: 4px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 6px;
}

.subtask-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.subtask-item.done .subtask-title-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-time-wrapper {
    font-size: 0.75rem;
    font-weight: 550;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
}

.manual-edit-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.manual-edit-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.manual-edit-trigger:hover .subtask-time,
.manual-edit-trigger:hover .habit-stat.today {
    color: var(--primary-light);
}

.edit-icon-inline {
    opacity: 0.6;
    /* Increased visibility over 0.3 */
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.manual-edit-trigger:hover .edit-icon-inline {
    opacity: 1;
    color: var(--primary-light);
    transform: scale(1.1);
}

.subtask-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.subtask-actions .timer-btn {
    width: 28px;
    height: 28px;
    font-size: 0.6rem;
}

/* ── Urgency tags ──────────────────────────────────────────── */
.tag-overdue {
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.4);
    font-weight: 700;
}

.tag-urgent {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--danger) !important;
    animation: pulse-text 2s ease-in-out infinite;
}

.tag-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}

.tag-notice {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

.tag-normal {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
}

/* ── Active Timer Widget ───────────────────────────────────── */
/* ── Active Timer Widget (Premium Redesign) ──────────────── */
#active-timer-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    border-radius: 32px;
    display: none;
    align-items: center;
    gap: 24px;
    z-index: 2000;
    padding: 10px 12px 10px 20px;
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    min-width: 440px;
    overflow: hidden;
}

#active-timer-banner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.timer-sculpture-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.timer-banner-pulse-container {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timer-banner-pulse {
    width: 6px;
    height: 6px;
    background: #ff3366;
    border-radius: 50%;
    box-shadow: 0 0 15px #ff3366;
    transition: all 0.5s ease;
}

.is-running .timer-banner-pulse {
    animation: premium-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.is-paused .timer-banner-pulse {
    background: #71717a;
    box-shadow: none;
}

@keyframes premium-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.6;
        box-shadow: 0 0 25px #ff3366;
    }
}

.timer-banner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.timer-banner-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.timer-status-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.is-running .timer-status-badge {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.timer-target-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-banner-display {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #fff 40%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.is-paused .timer-banner-display {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--text-muted);
}

.timer-banner-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.timer-control-btn {
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 18px;
}

.timer-control-btn.toggle-pause {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-control-btn.toggle-pause:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.timer-control-btn.toggle-pause.paused {
    background: var(--primary);
    border-color: transparent;
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4);
}

.timer-control-btn.finish {
    width: 56px;
    height: 56px;
    background: #fff;
    color: #000;
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.15);
}

.timer-control-btn.finish:hover {
    transform: scale(1.05);
    background: #f4f4f5;
}

/* Card-level Active/Paused States */
.task-card.timer-active {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1), 0 8px 30px rgba(0, 0, 0, 0.15);
    background: rgba(99, 102, 241, 0.05);
}

.task-card.timer-paused {
    opacity: 0.8;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.02);
}

.timer-btn.active {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.timer-btn.paused {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--warning) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 15px 4px rgba(239, 68, 68, 0.6);
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
}

/* ── Toast Notification ────────────────────────────────────── */
.timer-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(10px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.timer-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px currentColor;
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 12px currentColor;
    }
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ── Modal labels ──────────────────────────────────────────── */
.modal-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

/* ── Habit input ───────────────────────────────────────────── */
.add-habit-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.add-habit-tag {
    width: 80px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-medium);
    text-align: center;
}

.add-habit-tag:focus {
    border-color: var(--primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.1);
}

/* ── Projects list ─────────────────────────────────────────── */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.projects-list .objective-card {
    transition: var(--transition-fast);
}

.projects-list .objective-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   PAST ACTIVITY CALENDAR: NEXT-GEN REFINEMENT
   ========================================================================== */

#activity-calendar-container {
    background: radial-gradient(circle at 50% -20%, rgba(167, 139, 250, 0.05) 0%, transparent 70%);
    padding-bottom: 24px;
    width: 100%;
    min-width: 0;
    position: relative;
    z-index: 100;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.calendar-month-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
    opacity: 0.95;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-nav-btn:hover:not(:disabled) {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.3);
    color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calendar-grid-wrapper {
    background: rgba(15, 15, 20, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 16px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    width: 100%;
    margin: 0 auto;
    /* overflow: hidden removed to allow popovers to extend outside grid */
    position: relative;
}

@media (max-width: 1400px) {
    .calendar-grid-wrapper {
        padding: 12px;
    }
}

@media (max-width: 900px) {
    .calendar-grid-wrapper {
        padding: 8px;
        border-radius: 14px;
    }
}

.calendar-day-headers {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-content: start;
    gap: 6px;
    /* No fixed aspect-ratio: the calendar naturally fills whatever
       vertical space remains after header + habits, controlled by
       the parent grid's row allocation */
}

@media (min-width: 1400px) {
    .calendar-day-headers {
        gap: 8px;
        margin-bottom: 12px;
    }

    .calendar-days-grid {
        gap: 8px;
    }
}

@media (max-width: 900px) {
    .calendar-day-headers {
        gap: 3px;
        margin-bottom: 6px;
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    .calendar-days-grid {
        gap: 3px;
    }
}

.calendar-day {
    aspect-ratio: 1 / 1;
    height: auto;
    /* Removed min-height so it scales purely on aspect-ratio. JavaScript limits the task numbers dynamically to match the available space. */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 4px 4px;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* Mobile aspect-ratio override removed to allow grid-level aspect-ratio to dictate height */
@media (max-width: 1024px) {
    /* Kept for potential future tablet-specific cell overrides */
}

@media (max-width: 900px) {
    .calendar-day {
        min-height: 60px;
        border-radius: 8px;
        padding: 4px 1px 3px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0 16px;
        gap: 12px;
    }

    .island-left {
        gap: 8px;
    }

    .island-date-mini {
        font-size: 0.9rem;
    }

    .island-focus {
        display: none;
        /* Hide focus badge on mobile */
    }

    .island-center {
        display: none;
        /* Hide stream on mobile */
    }

    .island-quick-add {
        max-width: 160px;
    }

    .calendar-day {
        border-radius: 6px;
        padding: 3px 1px 2px;
    }
}

.calendar-day:not(.empty):not(.future):hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px) scale(1.02);
    z-index: 10;
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.calendar-day.other-month {
    background: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.04) !important;
    cursor: pointer;
}

.calendar-day.other-month> :not(.calendar-day-popover) {
    opacity: 0.2;
}

.calendar-day.future {
    border: 1px dashed rgba(255, 255, 255, 0.06);
    cursor: default;
}

.calendar-day.future> :not(.calendar-day-popover) {
    opacity: 0.15;
}

.calendar-day.today {
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: var(--primary-light);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.1);
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light);
}

.day-number {
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 2px;
    opacity: 0.8;
}

@media (max-width: 900px) {
    .day-number {
        font-size: 0.7rem;
        margin-bottom: 1px;
    }
}

@media (max-width: 768px) {
    .day-number {
        font-size: 0.6rem;
    }
}

.calendar-day:hover .day-number,
.calendar-day.today .day-number {
    opacity: 1;
}

/* Micro-Tag Styling: Redesign task pills - Larger and Color-Coded */
.cal-task-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    margin-top: 3px;
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    text-transform: capitalize;
    color: #fff;
}

/* Category Specific Colors */
.cal-task-pill.pill-academic {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.cal-task-pill.pill-comp-sci {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
}

.cal-task-pill.pill-life-goals {
    background: rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.4);
    color: #fda4af;
}

.cal-task-pill.pill-health {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.cal-task-pill.pill-work {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.cal-task-pill.pill-custom {
    background: rgba(236, 72, 153, 0.25);
    border-color: rgba(236, 72, 153, 0.4);
    color: #f9a8d4;
}

.cal-task-pill.pill-default {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e4e4e7;
}

@media (max-width: 900px) {
    .cal-task-pill {
        font-size: 0.55rem;
        padding: 1px 4px;
        margin-top: 2px;
    }
}

.calendar-day:hover .cal-task-pill {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.cal-task-pill.cal-task-more {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    font-size: 0.6rem;
    opacity: 0.8;
}

.cal-task-pill.is-subtask {
    font-style: italic;
    border-style: solid;
    opacity: 0.8;
    border-width: 1px 1px 1px 3px;
    font-size: 0.55rem;
}

.cal-task-pill.is-main-task {
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-width: 1.5px;
    filter: brightness(1.1);
}

/* Days with due tasks - Specialized subtle glow */
.calendar-day.has-tasks {
    border-color: rgba(255, 214, 102, 0.2);
    background: linear-gradient(to bottom, rgba(255, 214, 102, 0.03), transparent);
}

/* Intensity Layers - More abstract and soft */
.calendar-day.active {
    font-weight: 800;
}

.calendar-day.intensity-1::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 8px var(--primary-light);
}

.calendar-day.intensity-2 {
    background: rgba(167, 139, 250, 0.04);
}

.calendar-day.intensity-3 {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.2);
}

.calendar-day.selected {
    background: rgba(167, 139, 250, 0.15) !important;
    border-color: var(--primary-light) !important;
    transform: translateY(-6px) scale(1.05) !important;
    z-index: 30;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(167, 139, 250, 0.3);
}

.calendar-day.selected .day-preview {
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   CALENDAR DAY POPOVER (Replaces external Daily Log)
   ========================================================================== */

/* ==========================================================================
   PROFESSIONAL CALENDAR POPOVER SYSTEM
   ========================================================================== */

.calendar-day-popover {
    position: fixed;
    width: 280px;
    background: rgba(13, 13, 18, 0.98);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 18px 0;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 8px 24px -10px var(--primary);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    /* Permanent horizontal centering at -50% to prevent sliding */
    /* Vertical and scale starts offset */
    transform: translateX(-50%) translateY(15px) scale(0.95);
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: left;
}

.calendar-day-popover.visible {
    opacity: 1;
    pointer-events: auto;
    /* Maintain -50% horizontally, only animate Y and Scale */
    transform: translateX(-50%) translateY(0) scale(1);
}

#calendar-popover-portal.hidden {
    display: none;
}

/* Removed old relative positioning classes as portal uses fixed positioning */

/* Portal-based positioning is handled via JS and position: fixed */

.popover-header {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 18px 12px 18px;
}

.popover-date-pill {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.popover-subtitle {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.5;
}

.popover-stats-dashboard {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(167, 139, 250, 0.05);
    border-radius: 10px;
    margin: 4px 18px 16px 18px;
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--primary-light);
    letter-spacing: 0.5px;
    border: 1px solid rgba(167, 139, 250, 0.1);
}

.popover-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding: 0 18px 12px 18px;
}

.popover-content::-webkit-scrollbar {
    width: 2px;
}

.popover-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.popover-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.popover-section.completed-items {
    border-left: 3px solid var(--success);
}

.popover-section.due-items {
    border-left: 3px solid #fbbf24;
}

.popover-section.habits-items {
    border-left: 3px solid #60a5fa;
}

.popover-section.focus-items {
    border-left: 3px solid var(--primary-light);
}

.popover-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.58rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3) !important;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin-bottom: 2px;
    pointer-events: none;
}

.completed-items .popover-section-label {
    color: rgba(34, 197, 94, 0.5) !important;
}

.due-items .popover-section-label {
    color: rgba(251, 191, 36, 0.5) !important;
}

.habits-items .popover-section-label {
    color: rgba(96, 165, 250, 0.5) !important;
}

.focus-items .popover-section-label {
    color: rgba(167, 139, 250, 0.5) !important;
}

.popover-section-icon {
    color: var(--primary-light);
    display: flex;
    opacity: 0.6;
}

.popover-section-icon.success {
    color: var(--success);
    opacity: 0.8;
}

/* Premium Task Cards */
.popover-task.pill-pink {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.2) 0%, rgba(244, 114, 182, 0.1) 100%);
    border: 1px solid rgba(244, 114, 182, 0.3);
    color: #f472b6;
}

.pill-custom {
    background: linear-gradient(135deg, rgba(161, 161, 170, 0.15) 0%, rgba(161, 161, 170, 0.05) 100%);
    border: 1px solid rgba(161, 161, 170, 0.25);
    color: #a1a1aa;
}

/* Color Picker UI */
.color-picker-grid,
.icon-picker-grid {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    padding: 16px;
    /* Increased padding further to prevent clipping */
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
    position: relative;
}

.color-option:hover {
    transform: scale(1.15) translateY(-2px);
}

.color-option.active {
    border-color: #fff;
    box-shadow: 0 0 20px 4px rgba(255, 255, 255, 0.4);
    transform: scale(1.15);
    z-index: 10;
    /* Ensure active glow is above neighbors */
}

.color-option.active::after {
    content: '';
    position: absolute;
    inset: -4px;
    /* Reduced inset to keep it within padding */
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.color-option.pill-academic {
    background-color: #60a5fa;
}

.color-option.pill-comp-sci {
    background-color: #a78bfa;
}

.color-option.pill-health {
    background-color: #4ade80;
}

.color-option.pill-work {
    background-color: #facc15;
}

.color-option.pill-life-goals {
    background-color: #fb7185;
}

.color-option.pill-pink {
    background-color: #f472b6;
}

.color-option.pill-custom {
    background-color: #a1a1aa;
}

/* Icon Picker UI */

.icon-option {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.icon-option.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary-light);
    box-shadow: 0 4px 12px var(--primary-dim);
    transform: translateY(-2px);
    z-index: 10;
    /* Ensure active state is not clipped by neighbors */
}

.popover-task-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

/* Removed whitening hover for stability */

/* Removed purple/green accent lines for a cleaner look */

.popover-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.popover-task-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.popover-badge {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--primary-dim);
    color: var(--primary-light);
    border: 1px solid rgba(167, 139, 250, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popover-task-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popover-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    overflow: hidden;
}

.popover-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #d8b4fe);
    border-radius: 10px;
}

.popover-progress-text {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* Habit List */
.popover-habit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.2s;
}

/* Removed whitening hover for stability */

.popover-habit-icon {
    display: flex;
    color: var(--success);
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.4));
}

/* Focus Session Details */
.popover-focus-card {
    background: rgba(167, 139, 250, 0.03);
    border: 1px solid rgba(167, 139, 250, 0.08);
    border-radius: 12px;
    padding: 14px;
}

.popover-focus-stats {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.popover-focus-total {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-light);
    letter-spacing: -0.5px;
}

.popover-focus-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.6;
}

.popover-focus-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popover-session-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-primary);
}

.popover-session-time {
    font-weight: 800;
    color: var(--primary-light);
    min-width: 28px;
}

.popover-session-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.68rem;
}

.popover-no-data {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 30px 10px;
    opacity: 0.5;
    font-weight: 500;
}

.popover-item .icon.timer {
    color: var(--primary-light);
}

.popover-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.2);
}

.popover-task-card.completed {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.1);
}

/* Removed accent line variant */

.popover-task-card.completed .popover-task-name {
    opacity: 0.8;
    text-decoration: line-through;
    text-decoration-color: var(--success);
    text-decoration-thickness: 1.5px;
}

.popover-parent-context {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popover-subtask-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 2px;
}

.popover-subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-primary);
    background: var(--bg-glass);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.popover-subtask-item svg {
    color: var(--success);
    opacity: 0.8;
    flex-shrink: 0;
}

.popover-task-card.completed-sub-only {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.04);
}

/* ── Subtasks Section Refinements ──────────────────────────── */
.modal-subtask-section {
    display: flex;
    flex-direction: column;
}

.modal-subtask-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-subtask-row .modal-input {
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    height: auto;
}

.subtask-quick-add-input {
    width: 100%;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 4px;
}

.subtask-quick-add-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(240, 81, 56, 0.08);
}

.subtask-quick-add-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================================
   Timeline / Gantt Chart
   (Moved from js/timeline.js — addGanttStyles)
   ========================================================================= */

.timeline-container {
    background-color: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.date-range {
    font-size: 0.9rem;
    font-weight: 600;
}

.gantt-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.gantt-header-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.gantt-task-col-header {
    width: 250px;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.gantt-days-row {
    flex-grow: 1;
    display: flex;
    position: relative;
}

.gantt-day-header {
    flex: 1;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.gantt-day-header.is-today {
    color: var(--accent);
    font-weight: 700;
}

.gantt-body {
    position: relative;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

.gantt-grid-lines {
    position: absolute;
    top: 0;
    left: 250px;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.02);
}

.gantt-row {
    display: flex;
    align-items: center;
    min-height: 48px;
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
}

.project-row {
    margin-top: 16px;
}

.project-row:first-child {
    margin-top: 0;
}

.subtask-row {
    min-height: 40px;
}

.gantt-task-name {
    width: 250px;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 600;
    padding-right: 16px;
    color: var(--text-primary);
}

.subtask-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    padding-left: 12px;
}

.gantt-bar-area {
    flex-grow: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.gantt-bar {
    position: absolute;
    height: 24px;
    background-color: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.project-row .gantt-bar {
    background-color: rgba(255, 255, 255, 0.03);
}

.gantt-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2dd4bf);
    border-radius: 4px;
}

.project-row .gantt-bar-fill {
    opacity: 0.8;
}

.gantt-bar-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 0 8px;
    position: absolute;
    right: 0;
}

.subtask-bar.faded {
    background-color: rgba(255, 255, 255, 0.02);
}

.subtask-bar {
    height: 16px;
}

.today-line {
    position: absolute;
    top: -10px;
    bottom: 0;
    width: 2px;
    background-color: var(--accent);
    z-index: 10;
    pointer-events: none;
    left: 250px;
    box-shadow: 0 0 10px var(--accent-dim);
}

.today-dot {
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}


/* =========================================================================
   Heatmap
   (Moved from js/heatmap.js — addHeatmapStyles)
   ========================================================================= */

:root {
    --heatmap-0: rgba(255, 255, 255, 0.05);
    --heatmap-1: #0e4429;
    --heatmap-2: #006d32;
    --heatmap-3: #26a641;
    --heatmap-4: #39d353;
}

.heatmap-module {
    padding: 8px 0;
}

.heatmap-grid-container {
    overflow-x: auto;
    padding-bottom: 8px;
}

.heatmap-cell {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.heatmap-cell.future-cell {
    background-color: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    cursor: default;
}

.heatmap-cell.future-cell:hover {
    transform: none;
    box-shadow: none;
}

.heatmap-cell:hover {
    transform: scale(1.8);
    z-index: 10;
}

.heatmap-cell[data-level="0"] {
    background-color: var(--heatmap-0);
}

.heatmap-cell[data-level="1"] {
    background-color: var(--heatmap-1);
}

.heatmap-cell[data-level="2"] {
    background-color: var(--heatmap-2);
}

.heatmap-cell[data-level="3"] {
    background-color: var(--heatmap-3);
}

.heatmap-cell[data-level="4"] {
    background-color: var(--heatmap-4);
}

.heatmap-cell[data-level="1"]:hover {
    box-shadow: 0 0 12px var(--heatmap-1);
}

.heatmap-cell[data-level="2"]:hover {
    box-shadow: 0 0 12px var(--heatmap-2);
}

.heatmap-cell[data-level="3"]:hover {
    box-shadow: 0 0 12px var(--heatmap-3);
}

.heatmap-cell[data-level="4"]:hover {
    box-shadow: 0 0 12px var(--heatmap-4);
}

.stats-row {
    display: none;
}

.streak-stat {
    display: flex;
    flex-direction: column;
}

.streak-stat .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.streak-stat .value {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ── Custom DatePicker (Premium) ────────────────────────── */
.datepicker-container {
    position: absolute;
    width: 290px;
    background: rgba(24, 24, 32, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 18px;
    z-index: 10000;
    user-select: none;
    transform-origin: top left;
}

.datepicker-container.hidden {
    display: none;
}

.datepicker-container.fade-in {
    animation: dpSlideIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes dpSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dp-month-year {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.dp-nav-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dp-nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.dp-day {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    position: relative;
}

.dp-day:hover:not(.empty) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
    z-index: 2;
}

.dp-day.today {
    color: var(--primary);
    font-weight: 800;
}

.dp-day.today::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.dp-day.selected {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: white !important;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.dp-day.empty {
    cursor: default;
}

.datepicker-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dp-today-btn,
.dp-clear-btn {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dp-today-btn:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.dp-clear-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
}

/* ── DatePicker Custom Triggers ─────────────────────────── */
.custom-datepicker-trigger {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-datepicker-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.custom-datepicker-trigger.has-value {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.3);
    color: var(--primary);
    font-weight: 700;
}

.subtask-due-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 95px;
}

.subtask-due-wrapper:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.subtask-due-display {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.subtask-due-wrapper.has-value {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.subtask-due-wrapper.has-value .subtask-due-display {
    color: var(--primary);
    font-weight: 700;
}

/* Habit Edit Button Refinement */
.edit-icon-inline {
    opacity: 0.6;
    margin-left: 6px;
    transition: all 0.2s;
    color: var(--text-muted);
}

.manual-edit-trigger:hover .edit-icon-inline {
    opacity: 1;
    color: var(--primary);
    transform: scale(1.1);
}

.edit-icon-inline svg {
    display: block;
}

/* ── Confetti Animation ─────────────────────────────────── */
.confetti {
    position: fixed;
    width: 6px;
    height: 6px;
    z-index: 10000;
    pointer-events: none;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateY(200px) rotate(720deg) translateX(var(--drift, 100px));
        opacity: 0;
    }
}

/* ── Task Card Styling ──────────────────────────────────── */
.objective-card {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s, border-color 0.2s;
}

.objective-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.objective-card:active {
    transform: translateY(0) scale(0.98);
}

.btn-edit {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.btn-edit:hover {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-light);
    transform: scale(1.1);
}

/* Account settings enhancements */
.user-profile .avatar,
.settings-avatar {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.user-profile .avatar.has-image,
.settings-avatar.has-image {
    color: transparent;
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.settings-modal {
    width: min(760px, 96vw);
    max-width: 760px;
    max-height: 92vh;
}

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

.settings-form {
    gap: 14px;
    max-height: calc(92vh - 90px);
}

.settings-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.settings-card-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
    color: var(--text-primary);
}

.settings-profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.settings-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1rem;
}

.settings-profile-name {
    font-weight: 700;
    color: var(--text-primary);
}

.settings-profile-email {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.settings-stack {
    margin-bottom: 0;
}

.settings-card .modal-row + .modal-row {
    margin-top: 12px;
}

.settings-readonly-input {
    opacity: 0.85;
    cursor: not-allowed;
    user-select: none;
}

.settings-readonly-input:focus {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.settings-help-tight {
    margin-top: 6px;
}

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

.settings-file-input {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.settings-file-input::file-selector-button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 6px 10px;
    margin-right: 10px;
    cursor: pointer;
}

.settings-help-text {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.settings-status {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.86rem;
    border: 1px solid transparent;
}

.settings-status.info {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.2);
}

.settings-status.success {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.24);
}

.settings-status.error {
    background: rgba(239, 68, 68, 0.14);
    color: #fda4af;
    border-color: rgba(253, 164, 175, 0.24);
}

.settings-footer-actions {
    margin-top: 4px;
    justify-content: space-between;
}

@media (max-width: 880px) {
    .settings-avatar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-modal .modal-row {
        flex-direction: column;
        gap: 12px;
    }
}





