/* GlowTodo - Emerald Design Theme */
:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease;
    
    /* Emerald Color Palette (Light/Default) */
    --primary: #00875a;          /* Rich Emerald */
    --primary-hover: #006644;
    --primary-light: rgba(0, 135, 90, 0.08);
    --primary-glow: rgba(0, 135, 90, 0.25);
    
    --bg-main: #f4f6f8;
    --sidebar-bg: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    
    /* Priorities */
    --p1-color: #00875a;  /* Emerald */
    --p2-color: #0052cc;  /* Blue */
    --p3-color: #ff8b00;  /* Orange */
    --p4-color: #7a869a;  /* Muted Grey */

    /* Heatmap Levels */
    --hm-0: #ebedf0;
    --hm-1: #c6e48b;
    --hm-2: #7bc96f;
    --hm-3: #239a3b;
    --hm-4: #196127;
}

/* Dark Theme overrides */
body.dark-theme {
    --primary: #3657ff;          /* Sapphire Blue */
    --primary-hover: #2546e5;
    --primary-light: rgba(54, 87, 255, 0.12);
    --primary-glow: rgba(54, 87, 255, 0.35);

    --bg-main: #090a0f;          /* Deep Ink Black */
    --sidebar-bg: #0c0d14;
    --card-bg: #12131a;          /* Cards & Panels */
    --border-color: #1f222f;     /* Subtle border */
    
    --text-main: #f3f4f6;
    --text-muted: #7e8494;
    --text-inverse: #090a0f;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    
    --hm-0: #141724;
    --hm-1: #1a2a6c;
    --hm-2: #273fa0;
    --hm-3: #3657ff;
    --hm-4: #5b86f5;
}

/* Reset and Core Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling (GlowTodo Style) */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 10;
    transition: var(--transition-smooth);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background: var(--primary-light);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
}

.sidebar-section {
    margin-top: 32px;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 14px 8px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}
.project-item:hover, .project-item.active {
    color: var(--text-main);
    background: var(--primary-light);
}
.project-item.dragging {
    opacity: 0.4;
}
.project-item.drag-over {
    border-top: 2px solid var(--primary);
    background: var(--primary-light);
}

.project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.profile-plan {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: uppercase;
}

/* Sidebar Button (Backup/Restore) */
.sidebar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.sidebar-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.sidebar-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.footer-info {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Topbar Header (GlowTodo Style) */
.content-header {
    height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
}

.search-bar-wrapper {
    position: relative;
    width: 300px;
}

.search-bar-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

input[type="text"].search-input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid transparent;
    padding: 8px 12px 8px 36px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

input[type="text"].search-input:focus {
    background: var(--card-bg);
    border-color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-icon-btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Main Viewport */
.view-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.view-section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* List View & Filters */
.task-filters {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.custom-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.task-list-wrapper {
    position: relative;
    min-height: 200px;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    gap: 16px;
}
.empty-state svg {
    width: 60px;
    height: 60px;
    stroke-width: 1.2;
    opacity: 0.5;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Task Item Row Restyling */
.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}
.task-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.task-checkbox-wrapper {
    flex-shrink: 0;
}

.task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.task-checkbox::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: var(--transition-fast);
}

.task-checkbox:checked::after {
    background: currentColor;
}

.task-item[data-priority="1"] .task-checkbox { border-color: var(--p1-color); color: var(--p1-color); }
.task-item[data-priority="2"] .task-checkbox { border-color: var(--p2-color); color: var(--p2-color); }
.task-item[data-priority="3"] .task-checkbox { border-color: var(--p3-color); color: var(--p3-color); }
.task-item[data-priority="4"] .task-checkbox { border-color: var(--p4-color); color: var(--p4-color); }

.task-item.completed {
    opacity: 0.55;
}
.task-item.completed .task-checkbox {
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}
.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.task-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    margin-top: 6px;
    color: var(--text-muted);
}

.task-meta svg {
    width: 14px !important;
    height: 14px !important;
    vertical-align: middle;
    flex-shrink: 0;
}

.meta-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.meta-due.overdue {
    color: #de350b;
}
.meta-due.future {
    color: var(--text-muted);
}

.meta-project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.project-tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.edit-task-trigger {
    flex-shrink: 0;
}
.edit-task-trigger svg {
    width: 16px !important;
    height: 16px !important;
}

/* Today Dashboard View Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Minimalist Welcome Section */
.welcome-section-minimal {
    margin-bottom: 24px;
}

.welcome-section-minimal h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 6px;
}

.welcome-subtitle-minimal {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Premium Inline Quick Add Container */
.quick-add-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.quick-add-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-md);
}

.quick-add-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-add-plus-icon {
    color: var(--primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.quick-add-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    outline: none;
    padding: 8px 0;
}

.quick-add-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.quick-add-options {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.quick-add-date {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    outline: none;
    height: 30px;
    cursor: pointer;
}

.quick-add-priority {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 24px 4px 8px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    outline: none;
    height: 30px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px;
}

.quick-add-btn {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-add-btn:hover {
    background: var(--primary-hover);
}

/* Today's Tasks Section */
.today-tasks-section {
    grid-column: span 2;
}

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

.today-tasks-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.view-all-link {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.today-tasks-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Beautiful task items in Emerald Dashboard */
.dashboard-task-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-left: 4px solid var(--p4-color);
}

.dashboard-task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dashboard-task-item.completed {
    opacity: 0.6;
}

.dashboard-task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.dashboard-task-item[data-priority="1"] { border-left-color: var(--p1-color); }
.dashboard-task-item[data-priority="2"] { border-left-color: var(--p2-color); }
.dashboard-task-item[data-priority="3"] { border-left-color: var(--p3-color); }
.dashboard-task-item[data-priority="4"] { border-left-color: var(--p4-color); }

.task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.task-time-slot {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-check-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.task-check-circle svg {
    width: 14px;
    height: 14px;
    color: transparent;
    transition: var(--transition-fast);
}

.dashboard-task-item.completed .task-check-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.dashboard-task-item.completed .task-check-circle svg {
    color: white;
}

/* Footer Quotes */
.dashboard-footer {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    text-align: center;
}

.footer-quote {
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 500px;
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-social-icons {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
}

/* Floating Action Button (FAB) */
.fab-btn {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 16px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    transition: var(--transition-smooth);
}
body.dark-theme .fab-btn {
    background: linear-gradient(135deg, #5b86f5 0%, #3657ff 100%);
    box-shadow: 0 4px 16px rgba(54, 87, 255, 0.4);
}
.fab-btn:hover {
    transform: rotate(90deg) scale(1.05);
    background: var(--primary-hover);
}
body.dark-theme .fab-btn:hover {
    background: linear-gradient(135deg, #4b76e5 0%, #2647ee 100%);
}

/* Kanban Board View Styling */
.board-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    height: calc(100vh - 160px);
}



/* Buttons in forms */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-main);
    border-color: var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: #ffebe6;
    color: #de350b;
}
.btn-danger:hover {
    background: #ffbdad;
}

/* Custom Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 30, 66, 0.4); /* Jira style overlay */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    width: 100%;
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
}

/* Custom Select & Form Controls */
.custom-select, input[type="text"], input[type="date"], textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    font-family: var(--font-sans);
    transition: var(--transition-fast);
    height: 42px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

textarea {
    height: auto;
    min-height: 80px;
}

.custom-select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* iOS Safari date input text alignment fix */
input[type="date"]::-webkit-date-and-time-value {
    min-height: 1.5em;
    text-align: left;
}

.custom-select:focus, input[type="text"]:focus, input[type="date"]:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Mobile Bottom Navigation (TaskFlow Layout Mode) */
.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    z-index: 98;
    justify-content: space-around;
    align-items: center;
    padding: 0 16px env(safe-area-inset-bottom) 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 6px 12px;
    position: relative;
    height: 100%;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-item.active {
    color: var(--primary);
    background: transparent;
    font-weight: 600;
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* Premium Floating Toast Notifications */
#toast-container {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 320px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}

body.dark-theme .toast {
    background: rgba(26, 32, 44, 0.85);
    border-color: var(--border-color);
    color: var(--text-main);
}

.toast-success i {
    color: var(--primary);
}

.toast-warning i {
    color: #ff8b00;
}

.toast-info i {
    color: #0052cc;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================
 * 📲 MOBILE RESPONSIVE: TASKFLOW MODE
 * ========================================== */
@media (max-width: 768px) {
    .sidebar {
        display: none !important; /* Hide Sidebar completely */
    }
    
    .content-header {
        display: none !important; /* Hide Desktop Header */
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .main-content {
        height: calc(100vh - 64px - env(safe-area-inset-bottom)); /* Leaving room for bottom tabbar + safe area */
    }
    
    .view-viewport {
        padding: calc(20px + env(safe-area-inset-top)) 20px 20px 20px;
    }
    
    /* Display Mobile Navigation */
    .mobile-nav-bar {
        display: flex;
    }
    
    /* Layout shift for Dashboard Cards in Mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .welcome-section-minimal h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-footer {
        padding-top: 24px;
    }
    
    /* Shift FAB position slightly higher to clear bottom navigation + safe area */
    .fab-btn {
        bottom: calc(80px + env(safe-area-inset-bottom));
        right: 20px;
        width: 50px;
        height: 50px;
    }

    /* Form overrides on mobile to prevent iOS zoom and misalignment */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .custom-select, input[type="text"], input[type="date"], textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
        min-height: 42px;
        box-sizing: border-box;
    }
}

/* ==========================================
 * 🎨 Premium Bookshelf / Sapphire Blue Styles
 * ========================================== */

/* Today's Insight Card */
.insight-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

body.dark-theme .insight-container {
    background: #14151e; /* matching screenshot's dark card */
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.insight-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #5b86f5; /* Premium Sapphire blue accent */
    letter-spacing: 0.12em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.insight-content {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-main);
    font-weight: 500;
}

/* Pill Capsule Filters */
.pill-filters {
    display: flex;
    gap: 8px;
    margin: 16px 0 24px 0;
}

.pill-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

body.dark-theme .pill-btn {
    border-color: #1a1c27;
}

.pill-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.pill-btn.active {
    background: linear-gradient(135deg, #5b86f5 0%, #3657ff 100%);
    border: none;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(54, 87, 255, 0.4);
}

/* Empty State Styling (Screenshot Book Case Style) */
#dashboard-tasks-container .empty-state,
#task-list-container .empty-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 20px;
    border: 1px dashed var(--border-color);
    border-radius: 20px;
    text-align: center;
    background: rgba(18, 19, 26, 0.2);
    margin: 16px 0;
    box-sizing: border-box;
}

body.dark-theme .empty-state {
    border-color: #1f222f;
    background: rgba(18, 19, 26, 0.4);
}

.empty-state p {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.empty-state span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Stats view styling */
.stats-summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stats-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* Mobile Scroll & Bounce Prevention */
@media (max-width: 768px) {
    html, body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }
    
    .app-container {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    .main-content {
        height: calc(100% - 64px - env(safe-area-inset-bottom));
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .view-viewport {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: calc(20px + env(safe-area-inset-top)) 20px 20px 20px;
    }
}
