:root {
    --bg-color: #f4f7f6;
    --text-color: #333;
    --text-secondary: #666;
    --primary-color: #3a7ebf;
    --secondary-color: #2b9e63;
    --card-bg: #fff;
    --border-color: #e0e0e0;
    --hover-bg: #f9f9f9;
    --column-bg: #e9ecef;
    --input-bg: #fff;
    --input-border: #ccc;
    --modal-bg: #fefefe;
    --shadow-color: rgba(0,0,0,0.1);
    --shadow-strong: rgba(0,0,0,0.2);
    --login-gradient-1: #71b7e6;
    --login-gradient-2: #9b59b6;
    --feedback-bg: #f1f2f6;
}

/* --- Dark Mode Variables --- */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0b8;
    --primary-color: #5dade2;
    --secondary-color: #2ecc71;
    --card-bg: #16213e;
    --border-color: #2a2a4a;
    --hover-bg: #1e2a4a;
    --column-bg: #0f3460;
    --input-bg: #1e2a4a;
    --input-border: #3a3a5a;
    --modal-bg: #16213e;
    --shadow-color: rgba(0,0,0,0.3);
    --shadow-strong: rgba(0,0,0,0.5);
    --login-gradient-1: #0f3460;
    --login-gradient-2: #533483;
    --feedback-bg: #1e2a4a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Smooth transition for theme switching */
body, .navbar, .task-column, .task-card, .modal-content,
.login-container, .stat-card, .chart-container,
.input-group input, .input-group textarea, .input-group select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
}

.view {
    display: none;
    width: 100%;
    height: 100%;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* --- Login View --- */
#login-view {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--login-gradient-1), var(--login-gradient-2));
}

.login-container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px var(--shadow-strong);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    z-index: 1;
}

.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    background-color: var(--input-bg);
    color: var(--text-color);
}

.input-group select {
    padding-left: 40px;
    cursor: pointer;
    appearance: auto;
}

.input-group textarea {
    padding-left: 15px;
    resize: none;
}

.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
    border-color: var(--primary-color);
}

.primary-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.primary-btn:hover {
    background-color: #1e7348;
}

.primary-btn:active {
    transform: scale(0.98);
}

.status-msg {
    margin-top: 15px;
    font-size: 14px;
    height: 20px;
}
.status-error { color: #e74c3c; }
.status-info { color: #7f8c8d; }

/* --- Dashboard View --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px 30px;
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 10;
}

.nav-left h2 {
    color: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-email {
    font-weight: 500;
    color: var(--text-secondary);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

.icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* --- Dark Mode Toggle --- */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.theme-toggle .theme-icon {
    transition: transform 0.4s ease;
}

[data-theme="dark"] .theme-toggle .theme-icon {
    transform: rotate(360deg);
}

/* --- Stats Dashboard --- */
.stats-section {
    display: flex;
    gap: 16px;
    padding: 16px 30px 0 30px;
    flex-shrink: 0;
}

.stat-cards {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 14px 20px;
    min-width: 130px;
    box-shadow: 0 2px 8px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 10px 10px 0 0;
}

.stat-card.total::before { background: var(--primary-color); }
.stat-card.progress::before { background: #f39c12; }
.stat-card.done::before { background: #2ecc71; }
.stat-card.overdue::before { background: #e74c3c; }

.stat-card .stat-icon {
    font-size: 20px;
    margin-top: 4px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Weekly Chart */
.chart-container {
    flex: 1;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 1;
    padding-top: 4px;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 4px;
}

.chart-bar {
    width: 100%;
    max-width: 36px;
    min-height: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.chart-bar:hover {
    opacity: 0.85;
    transform: scaleX(1.1);
}

.chart-bar-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

.chart-bar-label {
    font-size: 10px;
    color: var(--text-secondary);
}

/* --- Dashboard Content --- */
.dashboard-content {
    flex: 1;
    padding: 16px 30px 20px;
    overflow-y: auto;
}

.task-board {
    display: flex;
    gap: 20px;
    height: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
}

.priority-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin-top: 55px; /* Align vertically with the first card */
    margin-right: -5px;
    width: 20px;
    height: 300px; /* Shorter fixed length */
    flex-shrink: 0;
    align-self: flex-start;
}

.priority-text {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 4px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    text-transform: uppercase;
}

.priority-text.high {
    color: #e74c3c;
}

.priority-text.low {
    color: #3498db;
}

.priority-bar {
    flex-grow: 1;
    width: 5px;
    margin: 15px 0;
    border-radius: 3px;
    background: linear-gradient(to bottom, #e74c3c, #f39c12, #2ecc71, #3498db);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.task-column {
    flex: 1;
    min-width: 200px;
    background-color: var(--column-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.column-header h3 {
    font-size: 16px;
    color: var(--text-color);
}

.add-task-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.add-task-btn:hover {
    color: var(--primary-color);
}

.task-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-card {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px var(--shadow-color);
    border-left: 4px solid var(--primary-color);
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s, border-width 0.2s;
}

.task-card:active {
    cursor: grabbing;
}

/* Priority visual effect based on order */
.task-list .task-card:nth-child(1) {
    border-left-width: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.task-list .task-card:nth-child(2) {
    border-left-width: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.task-list .task-card:nth-child(3) {
    border-left-width: 5px;
}

.task-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color);
}

#col-idea .task-card {
    border-left-color: #f39c12; /* Orange color for Idea Memo */
}

#col-idea .column-header h3 {
    color: #f39c12; /* Orange color for Idea Memo header */
}

#col-meeting .task-card {
    border-left-color: #27ae60; /* Green color for Meeting Schedule */
}

#col-meeting .column-header h3 {
    color: #27ae60; /* Green color for Meeting header */
}

/* --- Priority Badge --- */
.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.priority-badge.urgent {
    background-color: #fde8e8;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

.priority-badge.high {
    background-color: #fff3e0;
    color: #e67e22;
    border: 1px solid #ffd8a8;
}

.priority-badge.normal {
    background-color: #e8f4fd;
    color: #3a7ebf;
    border: 1px solid #b8daff;
}

.priority-badge.low {
    background-color: #f0f0f0;
    color: #95a5a6;
    border: 1px solid #d5d5d5;
}

/* --- Category Badge --- */
.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-right: 5px;
    line-height: 1.4;
    color: #fff;
    border: 1px solid rgba(0,0,0,0.1);
}

[data-theme="dark"] .priority-badge.urgent {
    background-color: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.4);
}

[data-theme="dark"] .priority-badge.high {
    background-color: rgba(243, 156, 18, 0.2);
    border-color: rgba(243, 156, 18, 0.4);
}

[data-theme="dark"] .priority-badge.normal {
    background-color: rgba(58, 126, 191, 0.2);
    border-color: rgba(58, 126, 191, 0.4);
}

[data-theme="dark"] .priority-badge.low {
    background-color: rgba(149, 165, 166, 0.2);
    border-color: rgba(149, 165, 166, 0.4);
}

/* Priority-based border-left colors on task cards */
.task-card.priority-urgent {
    border-left-color: #e74c3c !important;
}

.task-card.priority-high {
    border-left-color: #f39c12 !important;
}

.task-card.priority-normal {
    border-left-color: var(--primary-color);
}

.task-card.priority-low {
    border-left-color: #95a5a6 !important;
}

/* Priority select in task card actions */
.priority-select {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--input-border);
    font-size: 11px;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    margin-left: 5px;
}

.task-card h4 {
    font-size: 15px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.task-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.task-actions select {
    padding: 4px;
    border-radius: 4px;
    border: 1px solid var(--input-border);
    font-size: 12px;
    background: var(--input-bg);
    color: var(--text-color);
}

.delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.delete-btn:hover {
    transform: scale(1.2);
}

/* --- Modal --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 10% auto; 
    padding: 20px 30px 30px;
    border-radius: 8px;
    width: 400px;
    position: relative;
    box-shadow: 0 10px 30px var(--shadow-strong);
}

.close-btn {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

#modal-title {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Priority option colors in select */
.priority-option-urgent { color: #e74c3c; }
.priority-option-high { color: #e67e22; }
.priority-option-normal { color: #3a7ebf; }
.priority-option-low { color: #95a5a6; }

/* Category List Styles */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}
.category-item:last-child {
    border-bottom: none;
}
.category-item .category-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}
.category-item .category-name {
    flex: 1;
    color: var(--text-color);
}

/* --- View Toggle Buttons --- */
.view-toggle-group {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.25s ease;
}

.view-toggle-btn:hover {
    color: var(--primary-color);
    background: var(--hover-bg);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* --- Calendar View --- */
.calendar-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.calendar-nav h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    min-width: 160px;
    text-align: center;
}

.cal-nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s;
}

.cal-nav-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.cal-today-btn {
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.cal-today-btn:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

/* Calendar Grid */
.calendar-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cal-weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 4px;
}

.cal-weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cal-weekday.sun { color: #e74c3c; }
.cal-weekday.sat { color: #3498db; }

.cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 3px;
    flex: 1;
    min-height: 0;
}

/* Day Cell */
.cal-day {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    min-height: 80px;
    overflow: hidden;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: default;
}

.cal-day:hover {
    border-color: var(--primary-color);
}

.cal-day.other-month {
    opacity: 0.35;
    background: transparent;
}

.cal-day.today {
    border: 2px solid var(--primary-color);
    background: rgba(58, 126, 191, 0.06);
}

[data-theme="dark"] .cal-day.today {
    background: rgba(93, 173, 226, 0.1);
}

.cal-day.drag-over {
    border-color: var(--secondary-color);
    background: rgba(43, 158, 99, 0.08);
    box-shadow: inset 0 0 0 2px rgba(43, 158, 99, 0.2);
}

.cal-day-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cal-day.today .cal-day-number {
    color: var(--primary-color);
}

.cal-day-number .today-badge {
    font-size: 9px;
    background: var(--primary-color);
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

/* Sunday/Saturday day numbers */
.cal-day:nth-child(7n+1) .cal-day-number { color: #e74c3c; }
.cal-day:nth-child(7n) .cal-day-number { color: #3498db; }
.cal-day.other-month:nth-child(7n+1) .cal-day-number,
.cal-day.other-month:nth-child(7n) .cal-day-number { opacity: 0.5; }

.cal-day-tasks {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Task Chip on Calendar */
.cal-task-chip {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    font-weight: 500;
    border-left: 3px solid;
}

.cal-task-chip:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 6px var(--shadow-color);
}

.cal-task-chip:active {
    cursor: grabbing;
    opacity: 0.7;
}

.cal-task-chip.dragging {
    opacity: 0.4;
}

/* Chip colors by type */
.cal-task-chip.meeting {
    background: rgba(39, 174, 96, 0.12);
    color: #27ae60;
    border-left-color: #27ae60;
}

.cal-task-chip.priority-urgent {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
    border-left-color: #e74c3c;
}

.cal-task-chip.priority-high {
    background: rgba(243, 156, 18, 0.12);
    color: #e67e22;
    border-left-color: #f39c12;
}

.cal-task-chip.priority-normal {
    background: rgba(58, 126, 191, 0.12);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.cal-task-chip.priority-low {
    background: rgba(149, 165, 166, 0.12);
    color: #95a5a6;
    border-left-color: #95a5a6;
}

[data-theme="dark"] .cal-task-chip.meeting {
    background: rgba(39, 174, 96, 0.2);
}
[data-theme="dark"] .cal-task-chip.priority-urgent {
    background: rgba(231, 76, 60, 0.2);
}
[data-theme="dark"] .cal-task-chip.priority-high {
    background: rgba(243, 156, 18, 0.2);
}
[data-theme="dark"] .cal-task-chip.priority-normal {
    background: rgba(93, 173, 226, 0.2);
}
[data-theme="dark"] .cal-task-chip.priority-low {
    background: rgba(149, 165, 166, 0.2);
}

/* More tasks indicator */
.cal-more-indicator {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    padding: 1px;
    cursor: pointer;
    font-weight: 600;
}

.cal-more-indicator:hover {
    color: var(--primary-color);
}

/* Calendar Legend */
.cal-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 10px 0 0;
    flex-shrink: 0;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.cal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.cal-legend-dot.meeting { background: #27ae60; }
.cal-legend-dot.urgent { background: #e74c3c; }
.cal-legend-dot.high { background: #f39c12; }
.cal-legend-dot.normal { background: #3a7ebf; }
.cal-legend-dot.low { background: #95a5a6; }

/* Tooltip for calendar chips */
.cal-task-chip[title] {
    position: relative;
}

/* --- Timeline & Comments --- */
.timeline-container {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.timeline-list {
    position: relative;
    padding-left: 20px;
    margin-top: 15px;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 15px;
    padding-left: 15px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--modal-bg);
}

.timeline-item.history::before {
    background: #95a5a6;
}

.timeline-content {
    background: var(--hover-bg);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-color);
    box-shadow: 0 1px 2px var(--shadow-color);
}

.timeline-item.history .timeline-content {
    background: transparent;
    padding: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    box-shadow: none;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}

.timeline-author {
    font-weight: 600;
    color: var(--primary-color);
}

/* --- List View (Search & Filter) --- */
.list-view-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar-container {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-bar-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-bar-container input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s;
}

.search-bar-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(58, 126, 191, 0.1);
    outline: none;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-group select {
    padding: 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    min-width: 130px;
}

.list-view-body {
    flex: 1;
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    padding: 15px;
}

.list-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--card-bg);
}

.list-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.list-item-status {
    width: 120px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}

.list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.list-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* --- Mobile Responsive Styles --- */
.mobile-bottom-nav {
    display: none;
}

.cal-mobile-badge {
    display: none;
}

@media (max-width: 768px) {
    /* Hide scrollbar for body, allow content to scroll */
    body {
        overflow-y: auto;
    }
    
    /* Login View */
    .login-container {
        width: 90%;
        padding: 30px 20px;
    }

    /* Navbar */
    .navbar {
        padding: 10px;
    }
    .nav-left h2 {
        font-size: 1.2rem;
    }
    .view-toggle-group,
    #category-settings-btn {
        display: none !important; /* Hide desktop toggles on mobile */
    }
    #user-email {
        display: none !important; /* Hide email on mobile to save space */
    }

    /* Stats Dashboard */
    .stat-cards {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .stat-card {
        margin: 0;
        padding: 8px 4px;
        min-width: 0;
    }
    .stat-card .stat-icon {
        font-size: 14px;
        margin-top: 2px;
    }
    .stat-card .stat-value {
        font-size: 18px;
    }
    .stat-card .stat-label {
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        text-align: center;
    }
    .chart-container {
        display: none;
    }

    /* Dashboard Content Padding */
    .dashboard-content {
        padding: 10px;
        padding-bottom: 70px; /* Space for bottom nav */
        height: auto;
        overflow-y: visible;
    }

    /* Board View */
    .task-board {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }
    .task-column {
        width: 100%;
        height: auto;
        min-height: 200px;
    }
    .priority-indicator {
        display: none;
    }
    
    /* Calendar View */
    .calendar-wrapper {
        padding-bottom: 70px;
    }
    .cal-day-tasks {
        display: none !important;
    }
    .cal-mobile-badge {
        display: inline-block !important;
        background-color: var(--primary-color);
        color: white;
        border-radius: 12px;
        padding: 3px 8px;
        font-size: 11px;
        text-align: center;
        margin: auto auto 4px auto;
        width: fit-content;
        font-weight: 600;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    
    /* List View */
    .filter-group {
        flex-wrap: wrap;
    }
    .filter-group select {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    .list-item-status {
        width: 100%;
        font-size: 13px;
        margin-bottom: 2px;
    }
    .list-item-content {
        width: 100%;
    }
    .list-item-meta {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 4px;
    }

    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px var(--shadow-color);
        z-index: 1000;
        justify-content: space-around;
        padding: 10px 0;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    
    .mobile-nav-btn {
        background: none;
        border: none;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        cursor: pointer;
        width: 20%;
    }
    
    .mobile-nav-btn i {
        font-size: 20px;
    }
    
    .mobile-nav-btn.active {
        color: var(--primary-color);
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}
