/* ============================================================================
   Todo Lists Workspace - Apple Reminders-like UX
   ============================================================================ */

/* ============================================================================
   Sidebar - Todo Lists
   ============================================================================ */
/* Search Bar */
/* Search Results State */
.todos-search-results-header {
    margin: 8px 16px;
}

/* Sidebar Loading Skeleton */
.todos-sidebar-skeleton {
    padding: 8px;
}

.todos-skeleton-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
}

.todos-skeleton-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--hover) 25%, var(--border-color) 50%, var(--hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.todos-skeleton-text {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--hover) 25%, var(--border-color) 50%, var(--hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    flex: 1;
}

/* Empty State - No List Selected */
.todos-empty-state {
    flex: 1;
    padding: 48px 32px;
    max-width: 400px;
    margin: 0 auto;
}

.todos-empty-state-action {
    margin-top: 24px;
    padding: 12px 24px;
    border-radius: 12px;
}

/* No Lists Empty State - Full workspace empty */
.todos-no-lists-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    text-align: center;
}

.todos-no-lists-illustration {
    position: relative;
    width: 180px;
    height: 160px;
    margin-bottom: 32px;
}

.todos-no-lists-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.todos-no-lists-card {
    position: absolute;
    width: 100px;
    height: 70px;
    border-radius: 12px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 6px;
    transition: transform 0.3s ease;
}

.todos-no-lists-card:nth-child(1) {
    top: 20px;
    left: 0;
    transform: rotate(-8deg);
    z-index: 1;
}

.todos-no-lists-card:nth-child(2) {
    top: 10px;
    left: 40px;
    transform: rotate(4deg);
    z-index: 2;
}

.todos-no-lists-card:nth-child(3) {
    top: 30px;
    right: 0;
    transform: rotate(12deg);
    z-index: 3;
}

@media (hover: hover) and (pointer: fine) {
    .todos-no-lists-state:hover .todos-no-lists-card:nth-child(1) {
        transform: rotate(-12deg) translateY(-4px);
    }
}

@media (hover: hover) and (pointer: fine) {
    .todos-no-lists-state:hover .todos-no-lists-card:nth-child(2) {
        transform: rotate(0deg) translateY(-8px);
    }
}

@media (hover: hover) and (pointer: fine) {
    .todos-no-lists-state:hover .todos-no-lists-card:nth-child(3) {
        transform: rotate(8deg) translateY(-4px);
    }
}

.todos-no-lists-card-line {
    height: 8px;
    border-radius: 4px;
    background: var(--hover);
}

.todos-no-lists-card-line:first-child {
    width: 60%;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary-color) 100%);
    opacity: 0.6;
}

.todos-no-lists-card-line:nth-child(2) {
    width: 80%;
}

.todos-no-lists-card-line:nth-child(3) {
    width: 45%;
}

.todos-no-lists-plus {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb, 59, 130, 246), 0.4);
    z-index: 10;
}

.todos-no-lists-plus svg {
    width: 24px;
    height: 24px;
}

.todos-no-lists-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px;
    line-height: 1.3;
}

.todos-no-lists-text {
    font-size: 14px;
    color: var(--text-color-secondary);
    margin: 0 0 28px;
    line-height: 1.6;
    max-width: 320px;
}

.todos-no-lists-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark, var(--primary-color)) 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb, 59, 130, 246), 0.3);
}

@media (hover: hover) and (pointer: fine) {
    .todos-no-lists-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(var(--primary-rgb, 59, 130, 246), 0.4);
    }
}

.todos-no-lists-btn:active {
    transform: translateY(0);
}

.todos-no-lists-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================================================
   List Header
   ============================================================================ */
.todos-list-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.todos-list-header-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.todos-list-header-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    flex-shrink: 0;
}

.todos-list-header-icon svg {
    width: 24px;
    height: 24px;
}

.todos-list-header-icon .workspace-icon-emoji {
    font-size: 24px;
}

.todos-list-header-info {
    flex: 1;
    min-width: 0;
}

.todos-list-header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 4px;
    line-height: 1.2;
}

.todos-list-header-description {
    font-size: 14px;
    color: var(--text-color-secondary);
    margin: 0;
    line-height: 1.4;
}

/* ============================================================================
   Todos List Container
   ============================================================================ */
.todos-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.todos-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 16px;
}

.todos-list-container::-webkit-scrollbar {
    width: 6px;
}

.todos-list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ============================================================================
   Todo Item - Apple Reminders Style
   ============================================================================ */
.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    transition: background 0.15s ease;
    margin-bottom: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .todo-item:hover {
        background: var(--hover);
    }
}

.todo-item.completed {
    opacity: 0.6;
}

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

/* Checkbox */
.todo-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.todo-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.todo-checkbox-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--background-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
    .todo-checkbox input:hover + .todo-checkbox-visual {
        border-color: var(--primary-color);
    }
}

.todo-checkbox input:focus-visible + .todo-checkbox-visual {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.todo-checkbox input:checked + .todo-checkbox-visual {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.todo-checkbox-visual svg {
    width: 12px;
    height: 12px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.todo-checkbox input:checked + .todo-checkbox-visual svg {
    opacity: 1;
    transform: scale(1);
}

/* Todo Content */
.todo-item-body {
    flex: 1;
    min-width: 0;
}

.todo-item-content {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
    margin: 0;
    word-wrap: break-word;
}

.todo-item-notes {
    font-size: 13px;
    color: var(--text-color-secondary);
    line-height: 1.4;
    margin: 4px 0 0;
    word-wrap: break-word;
}

.todo-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-color-tertiary);
}

.todo-item-due {
    display: flex;
    align-items: center;
    gap: 4px;
}

.todo-item-due.overdue {
    color: var(--error-color);
}

.todo-item-priority {
    display: flex;
    align-items: center;
    gap: 2px;
}

.todo-item-priority.high {
    color: var(--error-color);
}

.todo-item-priority.medium {
    color: var(--pending);
}

/* ============================================================================
   Add Todo Input
   ============================================================================ */
.todos-add-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
}

.todos-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todos-add-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.todos-add-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.todos-add-input {
    flex: 1;
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-color);
    background: transparent;
    border: none;
    outline: none;
}

.todos-add-input::placeholder {
    color: var(--text-color-tertiary);
}

.todos-add-notes {
    padding: 8px 0 8px 34px;
    font-size: 13px;
    color: var(--text-color);
    background: transparent;
    border: none;
    outline: none;
    display: none;
}

.todos-add-notes.visible {
    display: block;
}

.todos-add-notes::placeholder {
    color: var(--text-color-tertiary);
}

.todos-add-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-left: 34px;
    display: none;
}

.todos-add-actions.visible {
    display: flex;
}

.todos-add-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.todos-add-btn.cancel {
    color: var(--text-color-secondary);
    background: var(--hover);
}

@media (hover: hover) and (pointer: fine) {
    .todos-add-btn.cancel:hover {
        background: var(--border-color);
    }
}

.todos-add-btn.submit {
    color: white;
    background: var(--primary-color);
}

@media (hover: hover) and (pointer: fine) {
    .todos-add-btn.submit:hover {
        filter: brightness(1.1);
    }
}

.todos-add-btn.submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   Loading States
   ============================================================================ */
.todos-loading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
}

.todo-skeleton {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
}

.todo-skeleton-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--hover) 25%, var(--border-color) 50%, var(--hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    flex-shrink: 0;
}

.todo-skeleton-body {
    flex: 1;
}

.todo-skeleton-title {
    height: 16px;
    width: 70%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--hover) 25%, var(--border-color) 50%, var(--hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    margin-bottom: 8px;
}

.todo-skeleton-notes {
    height: 12px;
    width: 50%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--hover) 25%, var(--border-color) 50%, var(--hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

/* ============================================================================
   Empty List State
   ============================================================================ */
.todos-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.todos-list-empty-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--hover);
    color: var(--text-color-secondary);
    margin-bottom: 16px;
}

.todos-list-empty-icon svg {
    width: 28px;
    height: 28px;
}

.todos-list-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 6px;
}

.todos-list-empty-text {
    font-size: 13px;
    color: var(--text-color-secondary);
    margin: 0;
}

/* ============================================================================
   Create List Modal
   ============================================================================ */
.todos-create-list-modal {
    width: 100%;
    max-width: 420px;
    background: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.todos-create-list-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-color-secondary);
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .todos-create-list-close:hover {
        background: var(--hover);
    }
}

.todos-create-list-body {
    padding: 20px;
}

.todos-create-list-field {
    margin-bottom: 16px;
}

.todos-create-list-field:last-child {
    margin-bottom: 0;
}

.todos-create-list-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color-secondary);
    margin-bottom: 6px;
}

.todos-create-list-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-color);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease;
}

.todos-create-list-input:focus {
    border-color: var(--primary-color);
}

.todos-create-list-input::placeholder {
    color: var(--text-color-tertiary);
}

.todos-create-list-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-color);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s ease;
}

.todos-create-list-textarea:focus {
    border-color: var(--primary-color);
}

/* ============================================================================
   Icon Picker
   ============================================================================ */
.todos-icon-picker {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.todos-icon-picker-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .todos-icon-picker-trigger:hover {
        border-color: var(--text-color-secondary);
    }
}

.todos-icon-picker-trigger:focus {
    outline: none;
    border-color: var(--primary-color);
}

.todos-icon-picker-preview {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.todos-icon-picker-preview svg {
    width: 20px;
    height: 20px;
    color: white;
}

.todos-icon-picker-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-color);
    text-align: left;
}

.todos-icon-picker-caret {
    width: 16px;
    height: 16px;
    color: var(--text-color-secondary);
    transition: transform 0.2s ease;
}

.todos-icon-picker-caret svg {
    display: block;
    width: 100%;
    height: 100%;
}

.todos-icon-picker.open .todos-icon-picker-caret {
    transform: rotate(180deg);
}

.todos-icon-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    max-height: 360px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 260px;
}

.todos-icon-picker.open-up .todos-icon-picker-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(8px);
}

.todos-icon-picker.align-end .todos-icon-picker-dropdown {
    left: auto;
    right: 0;
}

.todos-icon-picker.open .todos-icon-picker-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .todos-icon-picker-dropdown,
    .todos-icon-picker.open .todos-icon-picker-dropdown,
    .todos-icon-picker.open-up .todos-icon-picker-dropdown {
        transition: none;
        transform: none;
    }
}

.todos-icon-picker-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 12px 0;
}

.todos-icon-picker-tab {
    border: none;
    background: var(--hover);
    color: var(--text-color-secondary);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .todos-icon-picker-tab:hover {
        color: var(--text-color);
    }
}

.todos-icon-picker-tab.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.todos-icon-picker-section {
    padding: 12px;
}

.todos-icon-picker-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.todos-icon-picker-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color-tertiary);
    margin: 0 0 10px;
}

.todos-icon-picker-panel {
    display: none;
}

.todos-icon-picker-panel.active {
    display: block;
}

/* Icon Grid */
.todos-icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.todos-icon-option {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid transparent;
    background: var(--hover);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .todos-icon-option:hover {
        background: var(--border-color);
        transform: scale(1.05);
    }
}

.todos-icon-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.todos-icon-option svg {
    width: 18px;
    height: 18px;
}

.todos-icon-option .workspace-icon-emoji {
    font-size: 22px;
}

.todos-icon-picker-emoji-input-row {
    margin-bottom: 10px;
}

.todos-icon-picker-emoji-input {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    padding: 0 12px;
    font-size: 14px;
}

.todos-icon-picker-emoji-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.todos-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

/* Color Picker Grid */
.todos-color-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.todos-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
    .todos-color-option:hover {
        transform: scale(1.1);
    }
}

.todos-color-option.selected {
    border-color: var(--text-color);
}

.todos-color-option.selected::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
}

/* Updated list item icon with background color */
.todos-list-item-icon.has-color {
    background: var(--icon-bg-color, var(--hover));
}

.todos-list-item-icon.has-color svg {
    color: white;
}

.todos-list-item-icon.has-color .workspace-icon-emoji,
.todos-list-header-icon.has-color .workspace-icon-emoji,
.todo-item-list-icon .workspace-icon-emoji,
.todos-icon-picker-preview .workspace-icon-emoji {
    color: white;
}

.todos-list-header-icon.has-color {
    background: var(--icon-bg-color, var(--primary-light));
}

.todos-list-header-icon.has-color svg {
    color: white;
}

/* ============================================================================
   Sort Selector
   ============================================================================ */
.todos-list-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.todos-sort-selector {
    position: relative;
}

.todos-sort-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color-secondary);
    background: var(--hover);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .todos-sort-trigger:hover {
        color: var(--text-color);
        background: var(--border-color);
    }
}

.todos-sort-trigger:focus {
    outline: none;
    border-color: var(--primary-color);
}

.todos-sort-trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.todos-sort-trigger .caret {
    transition: transform 0.2s ease;
}

.todos-sort-selector.open .todos-sort-trigger .caret {
    transform: rotate(180deg);
}

.todos-sort-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    overflow: hidden;
}

.todos-sort-selector.open .todos-sort-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.todos-sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-color);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
    text-align: left;
}

@media (hover: hover) and (pointer: fine) {
    .todos-sort-option:hover {
        background: var(--hover);
    }
}

.todos-sort-option.selected {
    color: var(--primary-color);
    font-weight: 500;
}

.todos-sort-option-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-tertiary);
}

.todos-sort-option.selected .todos-sort-option-icon {
    color: var(--primary-color);
}

.todos-sort-option-icon svg {
    width: 14px;
    height: 14px;
}

.todos-sort-option-check {
    width: 16px;
    height: 16px;
    margin-left: auto;
    opacity: 0;
}

.todos-sort-option.selected .todos-sort-option-check {
    opacity: 1;
    color: var(--primary-color);
}

.todos-mobile-back-btn {
    margin-right: 8px;
    color: var(--primary-color);
}

/* ============================================================================
   Responsive Design - Mobile Sub-Sidebar Pattern
   ============================================================================ */
@media (max-width: 768px) {
    .todos-icon-picker {
        flex-direction: column;
        gap: 10px;
    }

    .todos-icon-picker-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        min-width: 100%;
    }

    /* Adjust header for back button */
    .todos-list-header {
        padding: 12px 16px;
    }

    .todos-list-header-top {
        flex-wrap: wrap;
    }

    .todos-list-header-title {
        font-size: 18px;
    }

    .todo-item {
        padding: 10px 12px;
    }

    .todos-add-container {
        padding: 10px 12px;
    }

    /* Empty states responsive */
    .todos-empty-state {
        padding: 32px 20px;
    }

    .todos-no-lists-state {
        padding: 32px 20px;
    }

    .todos-no-lists-illustration {
        width: 160px;
        height: 140px;
        margin-bottom: 24px;
    }

    .todos-no-lists-card {
        width: 85px;
        height: 60px;
        padding: 8px;
    }

    .todos-no-lists-plus {
        width: 40px;
        height: 40px;
    }

    .todos-no-lists-plus svg {
        width: 20px;
        height: 20px;
    }

    .todos-no-lists-title {
        font-size: 18px;
    }

    .todos-no-lists-text {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .todos-no-lists-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .todos-sidebar-empty-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .todos-sidebar-empty-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .todos-list-header-icon {
        width: 40px;
        height: 40px;
    }

    .todos-list-header-icon svg {
        width: 20px;
        height: 20px;
    }

    .todos-list-header-title {
        font-size: 16px;
    }

    .todos-list-header-description {
        font-size: 13px;
    }

    .todos-no-lists-illustration {
        width: 140px;
        height: 120px;
    }

    .todos-no-lists-card {
        width: 75px;
        height: 52px;
        padding: 6px;
        gap: 4px;
    }

    .todos-no-lists-card-line {
        height: 6px;
    }
     }

/* ============================================================================
   Todo List Item Menu (Three Dots Dropdown)
   ============================================================================ */

.todos-list-item {
    position: relative;
}

.todos-list-item-menu-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-color-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    z-index: 2;
}

.todos-list-item-menu-btn:focus,
.todos-list-item:has([data-todo-dropdown].open) .todos-list-item-menu-btn {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .todos-list-item:hover .todos-list-item-menu-btn {
        opacity: 1;
    }
}
@media (hover: none), (pointer: coarse) {
    .todos-list-item .todos-list-item-menu-btn {
        opacity: 1;
    }
}

@media (hover: hover) and (pointer: fine) {
    .todos-list-item-menu-btn:hover {
        background: var(--hover);
        color: var(--text-color);
    }
}

.todos-list-item-menu-btn:focus {
    outline: none;
}

.todos-list-item-menu-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.todos-list-item-menu-btn svg {
    width: 16px;
    height: 16px;
}

/* Adjust list item name to make room for menu button */
.todos-list-item-name {
    padding-right: 28px;
}

/* Active state overrides for dropdown visibility */
.todos-list-item:has([data-todo-dropdown].open) {
    background: var(--hover);
}

/* Mobile adjustments for dropdown */
@media (max-width: 768px) {
    .todos-list-item-menu-btn {
        opacity: 1;
    }
    
     }

/* ============================================================================
   Marked Todos Feature
   ============================================================================ */

/* Sidebar divider between marked list and regular lists */
.todos-sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 12px;
}

/* Marked list item styling */
.todos-marked-list-item {
    background: linear-gradient(135deg, rgba(251, 140, 0, 0.08) 0%, rgba(251, 140, 0, 0.04) 100%);
    border: 1px solid rgba(251, 140, 0, 0.15);
}

@media (hover: hover) and (pointer: fine) {
    .todos-marked-list-item:hover {
        background: linear-gradient(135deg, rgba(251, 140, 0, 0.12) 0%, rgba(251, 140, 0, 0.08) 100%);
    }
}

.todos-marked-list-item.active {
    background: linear-gradient(135deg, rgba(251, 140, 0, 0.18) 0%, rgba(251, 140, 0, 0.12) 100%);
    border-color: rgba(251, 140, 0, 0.3);
}

.todos-marked-list-item .todos-list-item-name {
    color: #E65100;
    font-weight: 600;
}

.todos-marked-list-item.active .todos-list-item-name {
    color: #E65100;
}

.todos-marked-list-item .todos-list-item-count {
    background: rgba(251, 140, 0, 0.15);
    color: #E65100;
    font-weight: 600;
}

/* Mark button on todo items */
.todo-mark-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-color-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0;
}

.todo-mark-btn:focus, .todo-mark-btn.active {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .todo-item:hover .todo-mark-btn {
        opacity: 1;
    }
}
@media (hover: none), (pointer: coarse) {
    .todo-item .todo-mark-btn {
        opacity: 1;
    }
}

@media (hover: hover) and (pointer: fine) {
    .todo-mark-btn:hover {
        background: var(--hover);
        color: #FB8C00;
    }
}

.todo-mark-btn:focus {
    outline: none;
}

.todo-mark-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.todo-mark-btn.active {
    color: #FB8C00;
}

@media (hover: hover) and (pointer: fine) {
    .todo-mark-btn.active:hover {
        background: rgba(251, 140, 0, 0.1);
    }
}

.todo-mark-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .todo-mark-btn:hover svg {
        transform: scale(1.1);
    }
}

.todo-mark-btn:active svg {
    transform: scale(0.95);
}

/* Marked todo item styling */
.todo-item.marked {
    background: linear-gradient(135deg, rgba(251, 140, 0, 0.06) 0%, transparent 100%);
    border-left: 3px solid #FB8C00;
    padding-left: 13px;
}

@media (hover: hover) and (pointer: fine) {
    .todo-item.marked:hover {
        background: linear-gradient(135deg, rgba(251, 140, 0, 0.1) 0%, var(--hover) 100%);
    }
}

/* List info in marked view */
.todo-item-list-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px 2px 4px;
    background: var(--hover);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-color-secondary);
    margin-right: 8px;
}

.todo-item-list-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    flex-shrink: 0;
}

.todo-item-list-icon svg {
    width: 10px;
    height: 10px;
    color: white;
}

.todo-item-list-icon .workspace-icon-emoji {
    font-size: 10px;
}

.todo-item-list-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* Mobile adjustments for mark button */
@media (max-width: 768px) {
    .todo-mark-btn {
        opacity: 1;
        width: 28px;
        height: 28px;
    }
    
    .todo-mark-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .todo-item.marked {
        padding-left: 9px;
    }
    
    .todo-item-list-info {
        font-size: 10px;
        padding: 1px 6px 1px 3px;
    }
    
    .todo-item-list-icon {
        width: 16px;
        height: 16px;
    }
    
    .todo-item-list-icon svg {
        width: 8px;
        height: 8px;
    }

    .todo-item-list-icon .workspace-icon-emoji {
        font-size: 8px;
    }
    
    .todo-item-list-name {
        max-width: 70px;
    }
     }

/* Dark mode adjustments for marked todos */
@media (prefers-color-scheme: dark) {
    .todos-marked-list-item .todos-list-item-name {
        color: #FFB74D;
    }
    
    .todos-marked-list-item.active .todos-list-item-name {
        color: #FFB74D;
    }
    
    .todos-marked-list-item .todos-list-item-count {
        color: #FFB74D;
    }
     }

[data-theme="dark"] .todos-marked-list-item .todos-list-item-name,
[data-theme="dark"] .todos-marked-list-item.active .todos-list-item-name,
[data-theme="dark"] .todos-marked-list-item .todos-list-item-count {
    color: #FFB74D;
}

/* ============================================================================
   Sharing Styles
   ============================================================================ */

/* Subscribed list indicator */
.todos-list-item.subscribed {
    border-left: 3px solid #10b981;
}

.todos-list-subscribed-badge {
    display: inline;
    font-size: 11px;
    font-weight: 400;
    color: #10b981;
    margin-left: 6px;
}

.todos-dropdown-button-shared {
    color: var(--primary-color);
}

.todos-dropdown-button-shared svg {
    color: var(--primary-color);
}

/* Share overlay and modal */
.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.share-overlay.active {
    opacity: 1;
    visibility: visible;
}

.share-overlay[hidden] {
    display: none;
}

/* ============================================================================
   Accept Shared Modal Styles
   ============================================================================ */

.share-accept-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.share-accept-overlay.active {
    opacity: 1;
    visibility: visible;
}

.share-accept-overlay[hidden] {
    display: none;
}

.share-accept-modal {
    background: var(--background-color);
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.share-accept-overlay.active .share-accept-modal {
    transform: scale(1);
}

.share-accept-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 16px;
}

.share-accept-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-accept-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.share-accept-header-text {
    flex: 1;
    min-width: 0;
}

.share-accept-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #10b981;
    margin: 0 0 6px;
}

.share-accept-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-accept-owner {
    font-size: 13px;
    color: var(--text-color-secondary);
    margin: 0;
}

.share-accept-modal-body {
    padding: 0 24px 20px;
}

.share-accept-desc {
    font-size: 13px;
    color: var(--text-color-secondary);
    line-height: 1.5;
    margin: 0 0 16px;
}

.share-accept-preview {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9),
        rgba(255, 255, 255, 0.75)
    );
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.share-accept-preview-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color-secondary);
    margin: 0 0 10px;
}

.share-accept-preview-content {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
}

.share-accept-preview-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.share-accept-preview-content li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.share-accept-preview-content li:last-child {
    border-bottom: none;
}

[data-mode="dark"] .share-accept-preview {
    background: linear-gradient(
        135deg,
        rgba(32, 35, 41, 0.95),
        rgba(22, 24, 29, 0.9)
    );
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
}

[data-mode="dark"] .share-accept-preview-label {
    color: rgba(255, 255, 255, 0.7);
}

[data-mode="dark"] .share-accept-preview-content {
    color: rgba(255, 255, 255, 0.9);
}

.share-accept-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.share-accept-cancel-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

@media (hover: hover) and (pointer: fine) {
    .share-accept-cancel-btn:hover {
        background: var(--hover-bg);
        border-color: var(--text-color-secondary);
    }
}

.share-accept-confirm-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

@media (hover: hover) and (pointer: fine) {
    .share-accept-confirm-btn:hover {
        background: var(--primary-hover);
    }
}

.share-accept-confirm-btn:active {
    transform: scale(0.98);
}

.share-accept-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.share-accept-confirm-btn svg {
    width: 16px;
    height: 16px;
}

.todos-add-meta {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 10px 42px;
}

.todos-add-meta.visible {
    display: flex;
}

.todos-add-meta-input,
.todos-add-meta-check {
    min-height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 13px;
}

.todos-add-meta-input {
    padding: 6px 8px;
}

.todos-add-meta-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
}

.todos-view-toolbar,
.todos-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.todos-view-chip,
.todos-bulk-toolbar button,
.todos-board-toggle {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 13px;
    min-height: 32px;
}

.todos-view-chip,
.todos-bulk-toolbar button {
    padding: 6px 10px;
}

.todos-view-chip.active,
.todos-board-toggle.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.todos-board-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
}

.todos-board-toggle svg,
.todo-edit-btn svg,
.todo-history-btn svg {
    width: 16px;
    height: 16px;
}

.todos-bulk-toolbar {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--hover);
}

.todo-select {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    flex: 0 0 22px;
}

.todo-select-input {
    width: 16px;
    height: 16px;
}

.todo-item.selected {
    background: var(--primary-light);
}

.todo-item-tags,
.todo-item-checklist,
.todo-item-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: var(--text-color-secondary);
    font-size: 12px;
}

.todo-item-tags span {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--hover);
    color: var(--text-color-secondary);
}

.todo-edit-btn,
.todo-history-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color-secondary);
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .todo-edit-btn:hover,
    .todo-history-btn:hover,
    .todos-view-chip:hover,
    .todos-bulk-toolbar button:hover,
    .todos-board-toggle:hover {
        background: var(--hover);
    }
}

.todo-history-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.todos-history-preview-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.todos-history-preview-card h4 {
    margin: 0 0 8px;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 650;
}

.todos-history-preview-card p {
    margin: 0 0 14px;
    color: var(--text-color-secondary);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.todos-history-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 0;
}

.todos-history-preview-grid div {
    padding: 10px;
    border-radius: 8px;
    background: var(--hover);
}

.todos-history-preview-grid dt {
    margin: 0 0 4px;
    color: var(--text-color-tertiary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.todos-history-preview-grid dd {
    margin: 0;
    color: var(--text-color);
    font-size: 13px;
    word-break: break-word;
}

.todo-inline-edit-input {
    width: 100%;
    min-height: 30px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-color);
    font: inherit;
    padding: 4px 6px;
}

.todos-kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 12px;
    padding: 12px;
}

.todos-kanban-column {
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
}

.todos-kanban-column-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.todos-kanban-column-body {
    min-height: 160px;
    padding: 8px;
}

.todos-kanban-empty {
    padding: 18px 8px;
    color: var(--text-color-secondary);
    text-align: center;
    font-size: 13px;
}

.todo-item.dragging {
    opacity: 0.55;
}

.todos-command-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.todos-command-palette-overlay.visible {
    display: flex;
}

.todos-command-palette {
    width: min(560px, 100%);
    max-height: min(720px, 90vh);
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.todos-task-details-modal {
    width: min(560px, 100%);
    max-height: min(720px, 90vh);
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.todos-task-details-modal.small {
    width: min(420px, 100%);
}

.todos-task-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.todos-task-details-close {
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 22px;
}

.todos-task-details-body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.todos-task-details-body label {
    display: grid;
    gap: 6px;
    color: var(--text-color-secondary);
    font-size: 13px;
}

.todos-task-details-body input,
.todos-task-details-body textarea,
.todos-task-details-body select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    font: inherit;
    padding: 8px 10px;
}

.todos-task-details-body textarea {
    min-height: 78px;
    resize: vertical;
}

.todos-task-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.todos-task-details-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
}

.todos-command-list button {
    min-height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 7px 12px;
}

.todos-command-palette {
    padding: 14px;
}

.todos-command-palette h3 {
    margin: 0 0 12px;
}

.todos-command-list {
    display: grid;
    gap: 8px;
}

.todos-command-list button {
    text-align: left;
}

@media (max-width: 760px) {
    .todos-kanban-board,
    .todos-task-details-grid {
        grid-template-columns: 1fr;
    }
}
