:root {
    /* Deep Space & Neon Palette */
    --bg-dark: #0B0E14;
    /* Almost Black */
    --bg-panel: #151921;
    /* Dark Panel */
    --bg-hover: #1E2330;
    /* Lighter Panel */

    --text-primary: #ECEFF4;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --accent-primary: #818CF8;
    /* Indigo-ish */
    --accent-secondary: #2DD4BF;
    /* Teal */
    --accent-glow: rgba(129, 140, 248, 0.25);

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Metrics */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --font-main: 'Outfit', sans-serif;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --glass: rgba(21, 25, 33, 0.7);
    --blur: blur(12px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    /* Subtle Mesh Gradient Background */
    background-image:
        radial-gradient(circle at 15% 15%, rgba(129, 140, 248, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(45, 212, 191, 0.08) 0%, transparent 40%);
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* --- Layout Grid --- */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-btn .icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-btn.active {
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.2);
}

.nav-btn.active .icon {
    opacity: 1;
}

/* Content Area */
.content-area {
    padding: 2rem 3rem;
    overflow-y: auto;
    position: relative;
}

/* Welcome Screen Refined */
.welcome-screen {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-screen h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-preview {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 180px;
    backdrop-filter: blur(5px);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Global Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Polish */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Focus Mode Toggle */
.focus-mode-btn:hover {
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent-secondary);
}

/* --- Habits View --- */
.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.habits-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.habit-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.habit-card:hover {
    transform: translateY(-2px);
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.habit-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.habit-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.habit-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.habit-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.check-btn {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.check-btn:hover {
    border-color: var(--accent-secondary);
}

.check-btn.completed {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}

.check-btn svg {
    width: 18px;
    height: 18px;
    stroke: #0d121c;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.check-btn.completed svg {
    opacity: 1;
    transform: scale(1);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.cancel-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}

.cancel-btn:hover {
    color: var(--text-primary);
}

.save-btn,
.add-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
    transition: transform 0.2s;
}

.save-btn:hover,
.add-btn:hover {
    transform: translateY(-1px);
    background: #737df2;
}

.delete-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 0 0.5rem;
    z-index: 10;
}

.delete-icon:hover {
    color: var(--danger);
    opacity: 1;
    transform: scale(1.1);
}

.habit-item:hover .delete-icon {
    opacity: 1;
}

/* --- Planner: Timeline Month Grouping --- */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.month-group {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s;
}

.month-group.past-month {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.1);
    opacity: 0.7;
}

.month-group.past-month:hover {
    opacity: 1;
}

.month-group.current-month {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.15);
}

.month-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.past-month .month-label {
    color: #f87171;
    /* brighter red text */
}

.month-weeks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 cols of weeks */
    gap: 0.5rem;
}

.habit-group {
    margin-bottom: 2rem;
}

.habit-category-header {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.habit-category-header.urgent {
    color: #f87171;
}

.habit-category-header.medium {
    color: var(--accent-primary);
}

.habit-category-header.low {
    color: var(--text-muted);
}

.habit-checklist {
    display: grid;
    gap: 0.75rem;
}

.habit-item {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.habit-item:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.habit-item.done {
    opacity: 0.6;
}

.habit-item.done .habit-name {
    text-decoration: line-through;
}

.week-card-mini {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    transition: background 0.2s;
}

.week-card-mini:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.w-num {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.w-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--accent-secondary);
    border-radius: 50%;
    position: absolute;
    top: 4px;
    right: 4px;
}

/* --- Dashboard Orbit --- */
.orbit-visualizer-container {
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.timer-center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timer-huge {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -2px;
    color: white;
}

.focus-controls-modern {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
}

.control-btn-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.control-btn-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.control-btn-icon:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

.control-btn-icon.active {
    background: var(--accent-primary);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
    border-color: transparent;
}

.control-btn-icon.active svg {
    fill: white;
}

.control-btn-icon.secondary {
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

.control-btn-icon.secondary:hover {
    opacity: 1;
}

/* --- Astro Cat --- */
.astro-cat-container {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    animation: floatCat 6s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes floatCat {

    0%,
    100% {
        transform: translateY(0) rotate(5deg);
    }

    50% {
        transform: translateY(-20px) rotate(-5deg);
    }
}

.cat-bubble {
    position: absolute;
    top: -40px;
    right: 60px;
    background: white;
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px 20px 0 20px;
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0;
    animation: showBubble 10s infinite;
    white-space: nowrap;
}

@keyframes showBubble {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    10% {
        opacity: 1;
        transform: scale(1);
    }

    80% {
        opacity: 1;
        transform: scale(1);
    }

    /* Stay visible longer */
    90% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Weekly View Refinements */
.day-column {
    background: rgba(0, 0, 0, 0.2) !important;
    border: none !important;
}

.day-column .column-header {
    background: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Planner: Week Grid (Year View) --- */
.year-roadmap-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.roadmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.weeks-grid-container h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

.week-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1rem 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.week-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.week-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.week-task-count {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.empty-msg {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

.add-btn-small {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.add-btn-small:hover {
    background: var(--bg-hover);
    color: white;
}

/* --- Planner: Week Board (Simple Checklist Style) --- */
.week-checklist-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    /* Removed gaps for seamless look */
    padding-bottom: 1rem;
    width: 100%;
    margin: 0 auto;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

/* Simple Day Checklist */
.day-checklist {
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    min-width: 0;
    min-height: 500px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.day-checklist:last-child {
    border-right: none;
}

.day-checklist:hover {
    background: transparent;
    /* No hover effect */
}

.day-checklist.is-today {
    border-color: rgba(255, 255, 255, 0.1);
    background: transparent;
    /* No today background */
}

/* Day Header */
.day-header-simple {
    background: transparent;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.pomo-title {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.pomo-exit-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.4;
    z-index: 10;
}

.pomo-exit-btn:hover {
    opacity: 1;
    color: var(--pomo-accent);
    transform: scale(1.1);
}

.day-header-simple h3 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
}

.is-today .day-header-simple h3 {
    color: var(--accent-primary);
}

.today-dot {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.7);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(129, 140, 248, 0);
    }
}

/* Checklist Items Container */
.checklist-items {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

/* Individual Checklist Item */
.checklist-item {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
    cursor: pointer;
}

.checklist-item:last-of-type {
    border-bottom: none;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.checklist-item.done {
    opacity: 0.5;
}

.checklist-item.done .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Checkbox Wrapper */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    cursor: pointer;
}

/* Hide default checkbox */
.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom Checkbox */
.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.checkbox-wrapper:hover .checkbox-custom {
    border-color: var(--accent-primary);
}

/* Checked state */
.checkbox-wrapper input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Checkmark */
.checkbox-wrapper input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Task Title */
.task-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

/* Delete Button */
.delete-task-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0 0.25rem;
    line-height: 1;
    transition: all 0.2s;
}

.checklist-item:hover .delete-task-btn {
    opacity: 1;
}

.delete-task-btn:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* Empty State */
.empty-checklist {
    padding: 2rem 1rem;
    text-align: center;
}

.empty-checklist p {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin: 0;
}

/* Add Task Button */
.add-task-simple {
    margin-top: 0;
    padding: 0.8rem 0.5rem;
    /* Aligns with grid */
    height: 2.8rem;
    /* Fix height to match grid */
    background: transparent;
    border: none;
    border-bottom: none;
    /* Removed separator */
    /* Stronger separator */
    color: var(--text-muted);
    /* Brighter text */
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    opacity: 0.8;
    width: 100%;
}

.add-task-simple:hover {
    color: var(--accent-primary);
    opacity: 1;
    background: transparent;
}

.add-task-simple::before {
    content: '+';
    font-size: 1.2em;
    font-weight: 400;
}

.checklist-item {
    padding: 0 0.65rem;
    height: 2.8rem;
    /* Strict height for grid alignment */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
    cursor: pointer;
}

.checklist-item[draggable="true"] {
    cursor: move;
}

.checklist-item.dragging {
    opacity: 0.5;
}

.day-checklist.drag-over {
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.08);
}

/* Old modern styles - keeping for backward compatibility but hidden */
.week-board-modern,
.day-column-modern {
    display: none;
}

/* --- Results / Charts --- */
.results-container {
    display: grid;
    gap: 2rem;
    animation: fadeIn 0.4s;
}

.chart-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.chart-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.trend-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    padding-top: 1rem;
}

.trend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.trend-bar-bg {
    width: 16px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.trend-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent-secondary);
    border-radius: 10px;
    transition: height 1s ease-out;
}

.trend-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.heatmap-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.heatmap-day.l1 {
    background: rgba(52, 211, 153, 0.2);
}

.heatmap-day.l2 {
    background: rgba(52, 211, 153, 0.4);
}

.heatmap-day.l3 {
    background: rgba(52, 211, 153, 0.7);
}

.heatmap-day.l4 {
    background: #34d399;
    box-shadow: 0 0 5px rgba(52, 211, 153, 0.5);
}

/* Sparklines */
.graphic-table {
    width: 100%;
    border-collapse: collapse;
}

.graphic-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.graphic-table td {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-sparkline {
    display: flex;
    gap: 3px;
    align-items: center;
}

.spark-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.spark-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 4px var(--accent-glow);
}

/* --- Planner: Split View (Drill Down) --- */
.planner-layout-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
    overflow: hidden;
}

@media (max-width: 768px) {
    .planner-layout-split {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .planner-sidebar {
        height: auto;
        max-height: 300px;
    }

    .backlog-list {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .backlog-list .task-card {
        min-width: 200px;
        margin-right: 0.5rem;
    }

    .planner-board {
        min-height: 500px;
    }
}

/* --- Planner Board Styles --- */
.planner-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.column {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 1rem;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.column.drag-over {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.1);
}

.column-header h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Task Card */
.task-card {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.1);
}

.task-card.dragging {
    opacity: 0.5;
    background: var(--bg-hover);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.task-delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.task-card:hover .task-delete-btn {
    opacity: 1;
}

/* Category Tags */
.category-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.tag-green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.tag-red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.tag-purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.tag-gray {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.priority-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.priority-high {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.priority-med {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.priority-low {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}








/* --- ULTRA Habit Card --- */
.habit-card-ultra {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.habit-card-ultra:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Priority Indicator */
.ultra-priority-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: gray;
    /* fallback */
}

/* Icon */
.ultra-icon-wrapper {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.habit-card-ultra:hover .ultra-icon-wrapper {
    transform: rotate(10deg) scale(1.1);
}

/* Info */
.ultra-info {
    flex: 1;
}

.ultra-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.habit-card-ultra h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ultra-badge.urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.05em;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ultra-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Check Button */
.ultra-check-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ultra-check-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.1);
}

.done .ultra-check-btn {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--bg-dark);
    font-weight: bold;
    font-size: 0.7rem;
    width: auto;
    padding: 0 1rem;
    border-radius: 20px;
}

/* Delete */
.ultra-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.habit-card-ultra:hover .ultra-delete {
    opacity: 1;
}

.ultra-delete:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* Done State Styles */
.habit-card-ultra.done {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.02);
}

.habit-card-ultra.done h3 {
    text-decoration: line-through;
    color: var(--text-muted);
}

.habit-card-ultra.done .ultra-icon-wrapper {
    filter: grayscale(1);
    opacity: 0.5;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* --- Responsive Navigation & Layout --- */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(21, 25, 33, 0.9);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.mobile-nav-btn .icon {
    font-size: 1.25rem;
}

.mobile-nav-btn .label {
    font-size: 0.7rem;
    font-weight: 500;
}

.mobile-nav-btn.active {
    color: var(--accent-primary);
}

.mobile-nav-btn.active .icon {
    transform: translateY(-2px);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        /* Allow scrolling on mobile */
        height: auto;
    }

    .app-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        display: none;
        /* Hide sidebar on mobile */
    }

    .mobile-nav {
        display: flex;
        /* Show bottom nav on mobile */
    }

    .content-area {
        padding: 1.5rem 1rem 80px 1rem;
        /* Extra bottom padding for nav */
    }

    .welcome-screen h2 {
        font-size: 2.2rem;
    }

    .stats-preview {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
    }

    .stat-card {
        min-width: 0;
        width: 100%;
    }

    /* Modal responsiveness */
    .modal {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .save-btn,
    .add-btn,
    .cancel-btn {
        width: 100%;
        padding: 0.8rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .sidebar {
        padding: 1rem;
    }

    .logo h1 {
        display: none;
        /* Icon only logo on small tablets */
    }

    .nav-btn .label {
        display: none;
        /* Icon only nav buttons? Maybe not, keep them small instead */
    }
}

/* --- Focus Cat Styling --- */
.focus-cat-container {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cat-gif-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-cat-gif {
    width: 100%;
    height: auto;
    display: block;
}

.cat-status-text {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-primary);
    letter-spacing: 0.05em;
    opacity: 0.9;
}