/* Design Tokens & CSS Variables */
:root {
    --bg-gradient: linear-gradient(135deg, #e8e0f0 0%, #f5e6e0 50%, #dde8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.45);
    --card-border: 1px solid rgba(255, 255, 255, 0.6);
    --card-radius: 20px;
    --card-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
    --backdrop-blur: blur(20px) saturate(180%);
    
    /* Elegant Color Palette */
    --text-primary: #1e1e2f;
    --text-secondary: #5a5a75;
    --accent-color: #635b8f;
    --accent-hover: #4e4675;
    
    /* Priority Colors (Muted, Elegant) */
    --urgent-important-bg: rgba(239, 68, 68, 0.06);
    --urgent-important-border: rgba(239, 68, 68, 0.3);
    --urgent-important-text: #b91c1c;

    --important-not-urgent-bg: rgba(245, 158, 11, 0.06);
    --important-not-urgent-border: rgba(245, 158, 11, 0.3);
    --important-not-urgent-text: #b45309;

    --urgent-not-important-bg: rgba(59, 130, 246, 0.06);
    --urgent-not-important-border: rgba(59, 130, 246, 0.3);
    --urgent-not-important-text: #1d4ed8;

    --neither-bg: rgba(16, 185, 129, 0.06);
    --neither-border: rgba(16, 185, 129, 0.3);
    --neither-text: #047857;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background: #e8e0f0;
}

/* Ambient Animating Background */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: var(--bg-gradient);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.08);
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 24px;
    border-radius: var(--card-radius);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: var(--backdrop-blur);
    border: var(--card-border);
}

.app-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

/* Date Navigator */
.date-navigator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

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

.current-date-display {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}

.today-badge {
    background: var(--accent-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.today-badge:hover {
    background: var(--accent-hover);
}

.app-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    color: #fff;
    background: var(--accent-color);
}

/* 4-Column Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    flex-grow: 1;
    align-items: stretch;
}

.grid-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0; /* Important for inner scrolls */
}

/* Panel Titles */
.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* COLUMN 1: Brain Dump & Auto-Generated Todos */
.braindump-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 250px;
}

.braindump-textarea {
    width: 100%;
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.braindump-textarea:focus {
    border-color: rgba(99, 91, 143, 0.5);
    background: rgba(255, 255, 255, 0.35);
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn {
    background: var(--accent-color);
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    outline: none;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.55);
}

.autotodos-card {
    display: flex;
    flex-direction: column;
    height: calc(100% - 270px);
    min-height: 250px;
}

.todo-list-container {
    flex-grow: 1;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for scrollable boxes */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Todo Items */
.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: grab;
    user-select: none;
    transition: background 0.2s, transform 0.2s;
}

.todo-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.todo-content-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

/* iOS style Checkbox */
.todo-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.todo-checkbox:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.todo-checkbox:checked::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(0.5px, -0.5px);
}

.todo-text {
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: color 0.2s, text-decoration 0.2s;
}

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

.todo-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.action-btn.delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Add Todo Mini Form */
.add-todo-inline {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.inline-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.85rem;
    outline: none;
}

.inline-input:focus {
    border-color: rgba(99, 91, 143, 0.4);
    background: rgba(255, 255, 255, 0.4);
}


/* COLUMN 2: Eisenhower Matrix (Scrollable Priority Stack) */
.eisenhower-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.priority-block {
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 14px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed capsule/badge state */
.priority-block.collapsed {
    flex: 0 0 auto !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 8px 16px !important;
    margin-bottom: 8px !important;
    border-radius: 20px !important;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.priority-block.collapsed:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    filter: brightness(1.02);
}

.priority-block.collapsed .priority-header {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    height: 100%;
    align-items: center;
}

.priority-block.collapsed .priority-list {
    display: none !important;
}

/* Expanded state */
.priority-block.expanded {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    margin-bottom: 12px !important;
}

.priority-block.expanded .priority-header {
    cursor: pointer;
}

.priority-block.expanded .priority-header:hover {
    opacity: 0.85;
}

.priority-block.expanded .priority-list {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    display: block !important;
}

.priority-header {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.priority-count {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Custom styles per Priority Block */
.priority-block.urgent_important {
    background: var(--urgent-important-bg);
    border-color: var(--urgent-important-border);
}
.priority-block.urgent_important .priority-header {
    color: var(--urgent-important-text);
}

.priority-block.important_not_urgent {
    background: var(--important-not-urgent-bg);
    border-color: var(--important-not-urgent-border);
}
.priority-block.important_not_urgent .priority-header {
    color: var(--important-not-urgent-text);
}

.priority-block.urgent_not_important {
    background: var(--urgent-not-important-bg);
    border-color: var(--urgent-not-important-border);
}
.priority-block.urgent_not_important .priority-header {
    color: var(--urgent-not-important-text);
}

.priority-block.neither {
    background: var(--neither-bg);
    border-color: var(--neither-border);
}
.priority-block.neither .priority-header {
    color: var(--neither-text);
}

.priority-list {
    flex-grow: 1;
    max-height: 130px;
    overflow-y: auto;
    min-height: 60px;
}

.priority-list.drag-over {
    border: 2px dashed rgba(99, 91, 143, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
}


/* COLUMN 3: Daily Reflection Notes & AI Suggestions */
.reflection-card {
    display: flex;
    flex-direction: column;
    flex-grow: 2;
    min-height: 250px;
}

.reflection-textarea {
    width: 100%;
    flex-grow: 1;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.reflection-textarea:focus {
    border-color: rgba(99, 91, 143, 0.5);
    background: rgba(255, 255, 255, 0.35);
}

/* AI suggestions panels */
.reflection-results-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.reflection-result-box {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.reflection-result-box.empty {
    opacity: 0.6;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.result-box-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reflection-result-content {
    font-size: 0.88rem;
    line-height: 1.5;
}

.reflection-result-content ul {
    list-style-type: none;
}

.reflection-result-content li {
    margin-bottom: 6px;
    position: relative;
    padding-left: 14px;
}

.reflection-result-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}


/* COLUMN 4: Flashcards & Pomodoro Timer */
.flashcards-card {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    perspective: 1000px; /* Crucial for 3D card flip */
}

/* Card Container with Flip Animation */
.flashcard-wrapper {
    position: relative;
    flex-grow: 1;
    width: 100%;
    height: 140px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    cursor: pointer;
}

.flashcards-card.flipped .flashcard-wrapper {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.flashcard-front {
    background: rgba(255, 255, 255, 0.35);
}

.flashcard-back {
    background: rgba(255, 255, 255, 0.5);
    transform: rotateY(180deg);
}

.word-display {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.5px;
}

.word-definition {
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.word-example {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    text-align: center;
}

.flashcard-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.flashcard-action-bar-back {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

/* Card Create Panel */
.flashcard-creator {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    padding: 12px;
    margin-top: 12px;
    display: none; /* Toggleable in JS */
}

.flashcard-creator.active {
    display: block;
}

.form-group {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    outline: none;
}

.form-control:focus {
    border-color: rgba(99, 91, 143, 0.4);
}

.creator-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}


/* POMODORO TIMER CARD */
.pomodoro-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.timer-visual {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.timer-ring {
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.04);
    stroke-width: 6;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 377; /* 2 * PI * r (r=60) */
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 1s linear;
}

.timer-digits {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timer-controls {
    display: flex;
    gap: 8px;
}

.pomodoro-stats {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 12px;
}


/* REFLECTION INSIGHTS CARD */
.reflection-insights-card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
}


/* ANALYTICS SECTION */
.analytics-section {
    margin-top: 24px;
    margin-bottom: 12px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.analytics-chart-panel {
    display: flex;
    flex-direction: column;
    height: 280px;
}

.chart-wrapper {
    flex-grow: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streak-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.streak-number {
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--accent-color);
    line-height: 1;
    margin: 12px 0 4px 0;
}

.streak-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.totals-card {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 24px;
}

.total-stat-item {
    display: flex;
    flex-direction: column;
}

.total-stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.total-stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}


/* RESPONSIVE LAYOUT (MOBILE COMPATIBILITY) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 12px;
        overflow-x: hidden;
    }
    body {
        overflow-x: hidden;
    }
    .app-header {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
        text-align: center;
        padding: 16px;
    }
    .date-navigator {
        justify-content: center;
    }
    .app-nav {
        justify-content: center;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .priority-block {
        min-height: 100px;
    }
    .app-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .user-profile-badge {
        padding: 4px 10px !important;
        font-size: 0.8rem !important;
        gap: 6px !important;
    }
    .avatar-img {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.7rem !important;
    }
    /* Fix #5: Force analytics grids to single column on mobile */
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }
    .analytics-section {
        overflow-x: hidden;
    }
    /* Fix #2: Make todo actions always visible on touch (no hover on mobile) */
    .todo-actions {
        opacity: 1;
    }
}


/* ===== Anki Link Card Styles ===== */
.anki-link-card {
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.anki-link-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 14px;
    text-align: center;
    padding: 12px 0;
}

.anki-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.anki-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 260px;
}

.anki-btn {
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.anki-btn:hover {
    box-shadow: 0 6px 20px rgba(99, 91, 143, 0.25);
}


/* ===== Touch Drag Clone Styles ===== */
.touch-drag-clone {
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    border: var(--card-border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: none;
}


/* ===== Projects Page Styles ===== */
.projects-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 60px;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.projects-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.projects-header h2 span {
    color: var(--accent-color);
}

.project-add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.project-add-form .form-control {
    flex: 1;
    min-width: 150px;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(31, 38, 135, 0.08);
}

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

.project-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.project-name a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.project-name a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.project-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.project-url-display {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    word-break: break-all;
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.project-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.project-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .project-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .project-actions {
        justify-content: flex-end;
    }
    .project-add-form {
        flex-direction: column;
    }
}


/* ===== LOCK HEIGHTS & ENABLE SCROLLING ON DESKTOP (Dashboard Only) ===== */
@media (min-width: 1025px) {
    /* Fix #6: Only lock overflow on dashboard pages, not landing/analytics/ops/projects */
    .dashboard-page,
    .dashboard-page body {
        height: 100vh;
        overflow: hidden;
    }

    .dashboard-page .app-container {
        height: 100vh;
        overflow: hidden;
        padding: 20px 24px;
        display: flex;
        flex-direction: column;
    }

    .dashboard-page .main-content {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .dashboard-page .dashboard-grid {
        height: 100%;
        overflow: hidden;
        align-items: stretch;
    }

    .dashboard-page .grid-column {
        height: 100%;
        overflow: hidden;
    }

    /* Column 1 Sizing */
    .dashboard-page .braindump-card {
        flex: 0 0 240px;
    }

    .dashboard-page .autotodos-card {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .dashboard-page .todo-list-container {
        flex: 1;
        max-height: none;
        overflow-y: auto;
        min-height: 0;
    }

    /* Column 2 (Eisenhower) Sizing */
    .dashboard-page .eisenhower-column {
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .dashboard-page .priority-block {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        margin-bottom: 12px;
    }

    .dashboard-page .priority-list {
        flex: 1;
        max-height: none;
        overflow-y: auto;
        min-height: 0;
    }

    /* Column 3 (Reflection) Sizing */
    .dashboard-page .reflection-card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .dashboard-page .reflection-textarea {
        flex: 1;
        min-height: 0;
    }

    /* Column 4 (Anki & Reflection Insights) Sizing */
    .dashboard-page .anki-link-card {
        flex: 0 0 auto;
        min-height: 180px;
    }

    .dashboard-page .reflection-insights-card {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .dashboard-page .reflection-insights-card .reflection-results-stack {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        margin-top: 12px;
        padding-right: 4px;
    }
}


