:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #f4f6f8;
    --text: #333;
    --sidebar-width: 250px;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.brand {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    display: block;
    padding: 0.8rem 1rem;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: #e3f2fd;
    color: var(--accent);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.page-section {
    display: none; /* Hidden by default */
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.page-section.active {
    display: block; /* Show when active */
}

h1 { margin-bottom: 1.5rem; color: var(--primary); }

/* Utility Classes */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

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

/* --- DASHBOARD STYLES --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white; padding: 1.5rem; border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; justify-content: space-between;
}

.stat-number { font-size: 2.5rem; font-weight: bold; color: var(--primary); }
.stat-label { color: #666; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

.dashboard-list { list-style: none; margin-top: 1rem; }
.dashboard-list li {
    padding: 0.8rem 0; border-bottom: 1px solid #eee;
    font-size: 0.9rem; display: flex; justify-content: space-between;
}
.dashboard-list li:last-child { border-bottom: none; }

.scratchpad-container {
    background: #fff9c4; /* Yellow notepad look */
    padding: 1.5rem; border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    grid-row: span 2; 
    display: flex; flex-direction: column;
}

.scratchpad-area {
    width: 100%; flex: 1;
    background: transparent; border: none;
    resize: none; outline: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem; line-height: 1.5;
    margin-top: 1rem;
}

/* --- Daily Planning Styles --- */
.tab-container { margin-bottom: 1.5rem; border-bottom: 1px solid #ddd; }
.tab-btn {
    background: none; border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem; cursor: pointer;
    color: #666; border-bottom: 3px solid transparent;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: bold; }

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    height: calc(100vh - 200px);
    overflow-x: auto;
}

.kanban-column {
    background: #ebecf0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    font-weight: bold; margin-bottom: 1rem;
    display: flex; justify-content: space-between; color: #172b4d;
}

.task-card {
    background: white; padding: 10px; border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem; cursor: grab;
    border-left: 4px solid var(--accent);
}
.task-card:hover { background: #f4f5f7; }
.task-meta { font-size: 0.8rem; color: #888; margin-top: 5px; }

.personal-list { max-width: 800px; }
.personal-task {
    display: flex; align-items: center; gap: 10px;
    padding: 1rem; background: white; border-bottom: 1px solid #eee;
}

/* --- GOALS & HABITS STYLES --- */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.goal-card {
    background: white; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    position: relative; display: flex; flex-direction: column;
}
.goal-card:hover { transform: translateY(-3px); }

.goal-image {
    height: 140px; background-color: #eee;
    background-size: cover; background-position: center;
}

.goal-content { padding: 1rem; flex: 1; }
.goal-title { font-weight: bold; font-size: 1.1rem; margin-bottom: 0.5rem; }

.progress-container {
    background: #eee; height: 10px; border-radius: 5px;
    overflow: hidden; margin: 10px 0;
}
.progress-fill {
    height: 100%; background: var(--accent); width: 0%; transition: width 0.3s ease;
}

.goal-stats {
    display: flex; justify-content: space-between;
    font-size: 0.85rem; color: #666; margin-bottom: 1rem;
}

.goal-actions {
    border-top: 1px solid #f0f0f0; padding: 0.5rem;
    display: flex; justify-content: space-around;
}

.action-btn {
    background: none; border: none;
    color: var(--accent); font-weight: bold;
    cursor: pointer; padding: 5px 10px; font-size: 1.2rem;
}
.action-btn:hover { background: #f0f8ff; border-radius: 4px; }

.notes-area {
    width: 100%; height: 100px; padding: 10px; border: 1px solid #ddd;
    border-radius: 6px; margin-top: 10px; font-family: inherit; resize: vertical;
}

/* --- BUDGET STYLES --- */
.budget-section { margin-bottom: 2rem; background: white; padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.budget-header { display: flex; justify-content: space-between; margin-bottom: 1rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 0.5rem; }
.budget-total { font-size: 1.2rem; font-weight: bold; color: var(--primary); }

table.budget-table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px; color: #888; font-weight: normal; font-size: 0.9rem; }
td { padding: 10px; border-bottom: 1px solid #eee; }
tr:last-child td { border-bottom: none; }

.money-col { font-family: monospace; font-size: 1rem; color: #333; }
.paid-row { opacity: 0.5; background: #fafafa; text-decoration: line-through; }

/* --- VISION BOARD STYLES (MASONRY) --- */
.vision-header { 
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; 
}

.vision-filter { 
    margin-bottom: 2rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.filter-btn {
    padding: 0.5rem 1.2rem; border-radius: 20px; border: 1px solid #ddd;
    background: white; cursor: pointer; transition: all 0.2s; user-select: none;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary); color: white; border-color: var(--primary);
}
.add-cat-btn {
    padding: 0.5rem 1rem; border: 1px dashed #ccc; background: none; 
    border-radius: 20px; color: #666; cursor: pointer; font-size: 0.8rem;
}

.vision-grid {
column-count: 4; 
    column-gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) { .vision-grid { column-count: 3; } }
@media (max-width: 600px) { .vision-grid { column-count: 2; } }

/* MASONRY LAYOUT FIX */
.vision-grid {
    column-count: 4; 
    column-gap: 1.5rem;
    width: 100%; /* Force full width */
}

@media (max-width: 1100px) { .vision-grid { column-count: 3; } }
@media (max-width: 800px) { .vision-grid { column-count: 2; } }
@media (max-width: 500px) { .vision-grid { column-count: 1; } }

.vision-card {
    /* Prevents the card from being sliced in half by a column break */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    
    /* Ensures the card behaves as a solid block */
    display: inline-block;
    width: 100%;
    
    margin-bottom: 1.5rem;
    background: white; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    position: relative; 
    transition: transform 0.2s;
}

/* Dragging visual adjustments */
.vision-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--accent);
}

.vision-card.drag-over {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
    border-color: var(--accent);
}

.vision-img { width: 100%; height: auto; display: block; }

.vision-overlay { background: white; padding: 10px; border-top: 1px solid #eee; }

.vision-title { 
    font-weight: bold; font-size: 0.95rem; cursor: text; 
    padding: 2px 4px; border-radius: 4px;
}
.vision-title:hover { background: #f0f0f0; }
.vision-title:focus { background: white; outline: 2px solid var(--accent); }

.vision-delete {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.9); border-radius: 50%;
    width: 25px; height: 25px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: red; opacity: 0; transition: opacity 0.2s; z-index: 10;
}
.vision-card:hover .vision-delete { opacity: 1; }

/* Add to bottom of styles.css */
.budget-header-row {
    background-color: #f8f9fa;
    font-weight: bold;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.budget-header-row td {
    padding-top: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ddd;
}
.editable-cell:hover {
    text-decoration: underline;
    cursor: pointer;
    color: var(--accent);
}

/* --- KANBAN UPDATES --- */
.task-card {
    background: white; padding: 12px; border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 0.8rem; cursor: grab;
    border-left: 5px solid #ccc; /* Default Border */
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.task-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.task-card.dragging { opacity: 0.5; border: 2px dashed #666; }

/* Status Colors (Border) */
.status-todo { border-left-color: #95a5a6; }
.status-inprogress { border-left-color: #3498db; }
.status-onhold { border-left-color: #f39c12; }
.status-done { border-left-color: #2ecc71; opacity: 0.7; }

/* Urgency Colors (Background) */
.urgent-soon { background-color: #fffde7; border-left-color: #f1c40f; } /* Yellow - Due < 3 days */
.urgent-today { background-color: #fff3e0; border-left-color: #e67e22; } /* Orange - Due Today */
.urgent-overdue { background-color: #ffebee; border-left-color: #e74c3c; } /* Red - Overdue */

.task-date-badge {
    font-size: 0.75rem; display: inline-block; padding: 2px 6px;
    border-radius: 4px; background: #eee; margin-top: 5px; color: #555;
}

/* FIX: Makes the drop zone fill the entire column height */
.task-container {
    flex: 1; /* Grows to fill the column */
    min-height: 150px; /* Ensures empty columns are still big targets */
    display: flex;
    flex-direction: column;
}

/* --- PERSONAL LIST STYLES --- */
.personal-task {
    display: flex; align-items: center; gap: 10px;
    padding: 1rem; background: white; border-bottom: 1px solid #eee;
    transition: background 0.2s;
    cursor: grab; /* Shows it is draggable */
}
.personal-task:hover { background: #f9f9f9; }
.personal-task.dragging { opacity: 0.5; background: #e3f2fd; }

.personal-header {
    background: #f1f3f5;
    color: #495057;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 1rem;
    margin-top: 5px;
    cursor: grab;
    display: flex; justify-content: space-between; align-items: center;
}

.personal-actions {
    margin-top: 1rem;
    display: flex; gap: 10px;
}
.delete-btn {
    background: #ffebee; color: #c0392b; border: 1px solid #ef9a9a;
    padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer;
}
.delete-btn:hover { background: #ffcdd2; }
