:root {
    --bg-color: #fcfcfc;
    --sidebar-bg: #f8f8f8;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #888888;
    --accent-color: #555555;
    --accent-hover: #333333;
    --border-color: #eeeeee;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.03);
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 72px; /* Fixed height for header alignment */
    padding: 0 1rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.app-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.app-logo span {
    color: var(--text-secondary);
    font-weight: 400;
}

.sidebar-nav-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-category {
    padding: 0 0 0.5rem 0;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 1.5rem;
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
    color: #a0a0a0;
    transition: color 0.2s;
    display: flex;
    justify-content: center;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    color: var(--text-primary);
}

.nav-drag-handle {
    cursor: grab;
    color: #ccc;
    display: flex;
    align-items: center;
    opacity: 0.4;
    padding: 0.2rem;
}

.nav-item:hover .nav-drag-handle {
    opacity: 1;
}

.nav-item .section-more-btn {
    opacity: 0;
    transition: all 0.2s;
    color: #aaa;
    padding: 0.2rem;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover .section-more-btn {
    opacity: 1;
}

.section-more-btn:hover {
    background: #f0f0f0;
    color: #333;
    border-radius: 4px;
}

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.nav-item.active {
    background-color: #ffffff;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    font-weight: 700;
}

/* Main Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.workspace-header {
    display: none; /* Скрыто по просьбе пользователя */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.workspace-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title-active {
    font-size: 1.5rem;
    font-weight: 700;
    outline: none;
    color: var(--text-primary);
}

.workspace-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.workspace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto; /* Changed from hidden to auto to allow expansion and scrolling */
    padding: 0 2.5rem 2.5rem 2.5rem;
}

/* Notes Area */
.notes-container {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-main);
}

.notes-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    flex: 1;
    margin-right: 1rem;
    padding-bottom: 0.25rem; /* For scrollbar */
}

.note-tab {
    padding: 0.35rem 0.85rem;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
    outline: none;
}

.note-tab:hover {
    background: #f5f5f5;
}

.note-tab.active {
    background: #f8f8f8;
    color: var(--text-primary);
    border-color: #eee;
}

.active-note-box {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.active-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0; 
    height: 72px; /* Identical to sidebar-header */
    box-sizing: border-box;
}

#active-note-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
}

#section-notes-textarea {
    width: 100%;
    height: 0;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#section-notes-textarea:focus,
#section-notes-textarea.has-content {
    height: auto;
    min-height: 80px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#section-notes-textarea.expanded {
    height: 80vh !important;
    min-height: 80vh !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
    overflow-y: auto;
}

/* Kanban */
.kanban-board {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 1rem 1rem 0;
    align-items: flex-start;
    flex: 1;
}

.kanban-column {
    flex: 0 0 280px;
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.add-column-card {
    flex: 0 0 200px;
    height: 100px;
    background: transparent;
    border: 2px dashed #eee;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.add-column-card:hover {
    background: #f8f8f8;
    border-color: #ddd;
    color: #999;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f5f5f5;
}

.column-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.kanban-column:hover .column-actions {
    opacity: 1;
}

/* Хэндл для перетаскивания колонок */
.column-drag-handle {
    cursor: grab;
    color: #ccc;
    display: flex;
    align-items: center;
    padding: 0.1rem 0.25rem 0.1rem 0;
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.kanban-column:hover .column-drag-handle {
    opacity: 1;
}

.column-drag-handle:active {
    cursor: grabbing;
}

.column-quick-add {
    margin-bottom: 0.75rem;
}

.quick-task-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid #ebebeb;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    background-color: #fbfbfb;
}

.quick-task-input:focus {
    border-color: #ddd;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.03);
}

.column-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    outline: none;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    min-height: 40px;
}

.task-card {
    background: #ffffff;
    border-radius: 0.6rem;
    padding: 0.875rem 0.75rem 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    position: relative;
    cursor: grab;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.task-card:hover {
    box-shadow: var(--shadow-sm);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.4rem;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
}

.btn-primary {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.btn-primary:hover {
    background-color: #000;
}

.btn-danger {
    background-color: #ff4d4d;
    color: #fff;
    border-color: #ff4d4d;
}

.btn-danger:hover {
    background-color: #e60000;
}

.btn-icon {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
}

.btn-icon:hover {
    background-color: #eee;
    color: #333;
}

.task-drag-handle {
    cursor: grab;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0;
    margin-right: 0.2rem;
    margin-top: 0.25rem; /* Match checkbox margin-top */
    opacity: 0;
    transition: opacity 0.2s;
    height: 16px;
}

.task-card:hover .task-drag-handle {
    opacity: 1;
}

.task-card:active .task-drag-handle {
    cursor: grabbing;
}

/* Custom Checkbox */
.task-checkbox-wrapper { position: relative; width: 16px; height: 16px; flex-shrink: 0; margin-top: 0.25rem; }
.task-checkbox { position: absolute; opacity: 0; cursor: pointer; height: 100%; width: 100%; z-index: 2; }
.custom-checkbox { position: absolute; height: 15px; width: 15px; border: 1.5px solid #dcdcdc; border-radius: 4px; background: #fff; transition: all 0.2s; }
.task-checkbox:checked ~ .custom-checkbox { background-color: #333; border-color: #333; }
.custom-checkbox:after { content: ""; position: absolute; display: none; left: 4px; top: 1px; width: 3px; height: 7px; border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.task-checkbox:checked ~ .custom-checkbox:after { display: block; }

.task-title { flex: 1; font-weight: 500; font-size: 0.9rem; outline: none; line-height: 1.4; color: #2a2a2a; }
.task-card.done .task-title, 
.scheduled-task-item.done .task-title { 
    text-decoration: line-through; 
    color: #bbb; 
}
.task-note { font-size: 0.75rem; color: #999; outline: none; margin-top: 0.1rem; }

/* New Structured Card Elements */
.task-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.4rem;
}

.task-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.task-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.task-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.task-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.72rem;
}

.task-footer:empty {
    display: none;
}

/* Task More Button */
.task-more-btn {
    opacity: 0;
    transition: all 0.2s;
    color: #aaa;
    padding: 0.2rem;
    margin-left: 0.2rem;
}

.task-card:hover .task-more-btn {
    opacity: 0.8;
}

.task-more-btn:hover {
    opacity: 1 !important;
    background: #f0f0f0;
    color: #333;
}

/* Context Menu Modal styling */
.context-menu-modal {
    max-width: 280px !important;
    padding: 0 !important;
    overflow: hidden;
}

.context-menu-modal .modal-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: none;
}

.context-menu-modal h3 {
    font-size: 1rem;
    color: var(--text-primary);
}

.context-menu-list {
    padding-bottom: 0.5rem;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.context-menu-item:hover {
    background: #f8f8f8;
    color: var(--text-primary);
}

.context-menu-item .menu-icon {
    width: 16px;
    text-align: center;
    color: #999;
}

.context-menu-item.delete {
    color: #ff4d4d;
}

.context-menu-item.delete:hover {
    background: #fff5f5;
}

.context-menu-item.delete .menu-icon {
    color: #ff4d4d;
}

.context-menu-list hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 0.25rem 0;
}

.task-schedule-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #555;
    background: #f2f2f2;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    border: 1px solid #ebebeb;
    width: fit-content;
}

.task-card:hover .task-schedule-badge {
    background: #eaeaea;
}

.task-schedule-info {
    font-size: 0.65rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-group select, .form-group input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    font-family: inherit;
    outline: none;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #fdfdfd;
}

/* Button Group Toggles */
.btn-group-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f5f5f5;
    padding: 0.3rem;
    border-radius: 0.75rem;
}

.btn-group-grid {
    display: grid;
    gap: 0.4rem;
}

.month-selector {
    grid-template-columns: repeat(4, 1fr);
}

.days-grid {
    grid-template-columns: repeat(7, 1fr);
}

.btn-toggle {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle:hover {
    background: rgba(0,0,0,0.05);
}

.btn-toggle.active {
    background: #444;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.flatpickr-input-hidden {
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    border-radius: 0.5rem;
    width: 100%;
    font-family: inherit;
    background: #fff;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* Sortable ghosts */
.sortable-ghost { opacity: 0.2; background: #eee !important; border: 1px dashed #ccc !important; }

/* Mobile Burger & Overlay */
.mobile-burger-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    z-index: 900;
}

/* Mobile */
@media (max-width: 900px) {
    .mobile-burger-btn {
        display: flex;
    }

    .app-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 950;
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.05);
    }

    .sidebar-open .app-sidebar {
        left: 0;
    }

    .sidebar-open .mobile-overlay {
        display: block;
    }

    .app-main {
        padding: 5rem 1rem 1rem 1rem;
    }

    .workspace-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .workspace-actions {
        width: 100%;
        justify-content: space-between;
    }

    .kanban-board {
        gap: 1rem;
    }

    .kanban-column {
        flex: 0 0 85vw;
    }
}

/* Monthly Grid */
.kanban-board.monthly-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    overflow-x: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    padding: 1rem 0;
    align-items: stretch;
}

.kanban-board.monthly-grid .kanban-column {
    flex: none;
    min-height: 150px;
    background: #fff;
    border: 1px solid #eee;
}

@media (max-width: 1200px) {
    .kanban-board.monthly-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .kanban-board.monthly-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Annual Grid */
.kanban-board.annual-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.5rem;
    align-items: stretch;
}

.kanban-board.annual-grid .kanban-column {
    flex: none;
    min-height: 180px;
    background: #fff;
    border: 1px solid #f0f0f0;
}

@media (max-width: 1100px) {
    .kanban-board.annual-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .kanban-board.annual-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kanban-board.annual-grid {
        grid-template-columns: 1fr;
    }
}

.add-note-tab-btn {
    background: #f5f5f5;
    border: 1px solid #eee;
    color: #888;
    border-radius: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.add-note-tab-btn:hover {
    background: #444;
    color: #fff;
    border-color: #444;
}

.active-note-header {
    display: flex;
    align-items: center;
}

/* Note Tabs Styling */
.note-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
    outline: none;
    position: relative;
}

.note-tab-title {
    outline: none;
    min-width: 20px;
}

.note-tab-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.note-tab:hover .note-tab-actions,
.note-tab.active .note-tab-actions {
    opacity: 1;
}

.note-edit-btn, .note-delete-btn {
    background: none;
    border: none;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    cursor: pointer;
    border-radius: 4px;
}

.note-edit-btn:hover { background: #eee; color: #666; }
.note-delete-btn:hover { background: #ffebeb; color: #ff9b9b; }

/* Scheduled/Weekly/Monthly Views Styling */
.weekly-theme-group {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.weekly-theme-header {
    background: #fafafa;
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f5f5f5;
}

.scheduled-task-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s;
    align-items: flex-start;
}

.scheduled-task-item:last-child {
    border-bottom: none;
}

.scheduled-task-item:hover {
    background: #fcfcfc;
}

.scheduled-task-item.mini {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
}

.scheduled-task-meta {
    font-size: 0.7rem;
    color: #bbb;
    margin-top: 0.15rem;
    font-weight: 600;
}

.scheduled-task-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #f0f0f0;
    color: #888;
    border-radius: 4px;
    font-size: 0.65rem;
    margin-right: 0.5rem;
}

.scheduled-list-view {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.5rem 0;
    overflow-x: visible !important;
    overflow-y: visible !important;
    height: auto !important;
}

.scheduled-list-view .scheduled-task-item {
    flex: 0 0 280px;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: #fff;
    transition: box-shadow 0.2s;
}

.scheduled-list-view .scheduled-task-item:hover {
    box-shadow: var(--shadow-sm);
}

/* Footer & Progress Bar */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

.save-progress-bar {
    height: 2px;
    width: 0%;
    background: #555;
    transition: width 0.2s ease, opacity 0.5s;
    opacity: 0;
}

.save-progress-bar.active {
    opacity: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 28px;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #999;
}

.status-icon {
    font-size: 0.8rem;
    transition: color 0.3s;
}

.status-icon.loading i {
    animation: rotate 1s linear infinite;
}

.status-icon.success {
    color: #2ecc71;
}

.version {
    color: #ddd;
    font-weight: 600;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.app-main {
    padding-bottom: 60px !important;
}

/* Tags Styling */
.task-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.task-tag {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tags-selection-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.tag-selection-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #eee;
}

.tag-selection-item:hover {
    background: #f9f9f9;
}

.tag-selection-item.selected {
    border-color: #333;
    background: #f0f0f0;
}

.tag-color-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.tag-selection-item .tag-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.8rem;
}

.add-tag-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.add-tag-form input[type="text"] {
    flex: 1;
    padding: 0.4rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    font-size: 0.8rem;
}

.add-tag-form input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    cursor: pointer;
}

/* Tags Board Grid */
.kanban-board.tags-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem;
    align-items: flex-start;
}

.kanban-board.tags-grid .kanban-column {
    flex: 0 0 300px;
}

/* Auto-expanding notes textarea */
#section-notes-textarea {
    width: 100%;
    height: 0;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#section-notes-textarea.expanded {
    height: calc(100vh - 72px - 5rem) !important; /* Header height + top/bottom padding cushion */
    min-height: calc(100vh - 72px - 5rem) !important;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-lg);
}
.note-tab.active .note-tab-title {
    color: var(--text-primary);
    font-weight: 700;
}

.note-tab.active .note-tab-title:hover {
    text-decoration: underline;
}

/* --- Login Page (Premium Redesign) --- */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #f8faff 0%, #eef2ff 100%);
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.5;
}

.login-page::before {
    background: var(--accent-color);
    top: -100px;
    left: -100px;
}

.login-page::after {
    background: #c7d2fe;
    bottom: -100px;
    right: -100px;
}

.login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3.5rem;
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
    text-align: center;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: loginFadeIn 0.8s ease-out;
}

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

.login-card .app-logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 2rem;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    font-family: inherit;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: center;
    color: var(--text-primary);
}

.login-form input[type="password"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: scale(1.02);
}

.login-btn {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 1rem;
    background: var(--accent-color);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn {
    opacity: 0.6;
    transition: all 0.2s;
}

.logout-btn:hover {
    opacity: 1;
    color: #ef4444;
    transform: rotate(5deg);
}

.login-error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
