/* View Controls Sidebar Styles */
.right-sidebar-container {
    position: fixed !important;
    right: 0 !important;
    top: 50% !important;
    transform: translate(48%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem;
    z-index: 1500 !important;
    opacity: 0.55 !important;
    filter: saturate(0.92);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease, filter 0.28s ease;
    will-change: transform, opacity;
}

.right-sidebar-container:hover {
    transform: translate(-12px, -50%) !important;
    opacity: 1 !important;
    filter: saturate(1);
}

.right-sidebar-container:focus-within {
    transform: translate(-12px, -50%) !important;
    opacity: 1 !important;
    filter: saturate(1);
}

.view-controls-sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.view-controls-sidebar::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent var(--border-color) transparent transparent;
}

.view-controls-sidebar .view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.view-controls-sidebar .view-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

.view-controls-sidebar .view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

.view-controls-sidebar .view-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Tooltip for view buttons */
.view-controls-sidebar .view-btn::after {
    content: attr(title);
    position: absolute;
    right: 110%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.view-controls-sidebar .view-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-8px);
}

/* Enhanced Sidebar Styles */
.view-btn-shortcut {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--bg-dark);
    color: var(--text-white);
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    opacity: 0.7;
    font-weight: 600;
}

.sidebar-separator {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
    opacity: 0.5;
}

#theme-toggle .theme-icon-dark,
#theme-toggle .theme-icon-light {
    transition: opacity 0.3s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --bg-tertiary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --border-color: #374151;
    }
}

body.dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
}

/* Search Bar Styles */
.search-section {
    margin-bottom: 1.5rem;
}

.search-container {
    display: flex;
    align-items: center; /* Alignement vertical parfait */
    gap: 1rem;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-stats {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding-left: 2.5rem;
}

/* Enhanced Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%) translateY(-50%);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(-50%);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.view-controls-sidebar {
    animation: slideInRight 0.5s ease-out;
}

.view-btn:active {
    transform: translateX(-2px) scale(0.95);
}

.view-btn.active {
    animation: pulse 2s infinite;
}

/* Enhanced Notifications */
.notification {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

body.dark-mode .notification {
    background: rgba(31, 41, 55, 0.9);
}

/* Priority badges in sidebar */
.urgent-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    animation: pulse 1s infinite;
}

/* Wrapper for todo content to prevent sidebar overlap */
.todo-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto !important;
    padding-left: 0;
    min-height: 400px;
}

.todo-content-wrapper > .container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Large table mode - full width minus sidebar */
.todo-content-wrapper.table-large {
    max-width: calc(100vw - 140px) !important;
    padding-right: 0 !important;
}

.todo-content-wrapper.table-large .todo-list {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 12px !important;
}

.todo-content-wrapper.table-large .todo-table {
    width: 100% !important;
}

.todo-content-wrapper.table-large .todo-table-wrapper {
    padding: 0 !important;
}

.todo-content-wrapper.table-large .container {
    max-width: 100% !important;
    padding: 8px !important;
}

/* Even larger when no sidebar visible */
@media (min-width: 769px) {
    .todo-content-wrapper.table-large {
        width: calc(100vw - 140px) !important;
    }
}

@media (max-width: 768px) {
    .todo-content-wrapper {
        max-width: 100%;
        padding-right: 0;
    }

    .todo-content-wrapper > .container {
        width: 100%;
        max-width: 100%;
    }
    
    .view-controls-sidebar {
        right: 1rem;
        top: auto;
        bottom: 2rem;
        transform: none;
        flex-direction: row;
        padding: 0.5rem;
        gap: 0.25rem;
        border-radius: 2rem;
        margin-right: 0;
        position: fixed;
    }

    .right-sidebar-container {
        right: 1rem !important;
        top: auto !important;
        bottom: 2rem !important;
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
    }
    
    .view-controls-sidebar::before {
        display: none;
    }
    
    .view-controls-sidebar .view-btn {
        width: 36px;
        height: 36px;
    }
    
    .view-btn-shortcut {
        display: none;
    }
    
    .sidebar-separator {
        display: none;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-stats {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .right-sidebar-container {
        transform: translateY(-50%) !important;
        opacity: 1 !important;
        filter: none !important;
        transition: none;
    }
}

/* Progress Indicator Styles */
.completion-progress-container {
    margin-top: 0.5rem;
    text-align: center;
}

.completion-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.progress-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.5s ease;
    border-radius: 3px;
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Urgent Badge Styles */
.urgent-badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    animation: pulse 1s infinite;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.urgent-badge-sidebar {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

/* Enhanced hover effects */
.todo-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.todo-card:hover {
    transform: translateY(-4px) rotate(1deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Smooth transitions for all interactive elements */
.todo-checkbox, .todo-btn, .view-btn, .filter-btn, .priority-filter-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .view-btn, .filter-btn, .priority-filter-btn {
        border-width: 2px;
    }
    
    .todo-item, .todo-card {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .view-controls-sidebar {
        animation: none;
    }
    
    .view-btn.active {
        animation: none;
    }
    
    .todo-item:hover, .todo-card:hover {
        transform: none;
    }
}

/* Todo Table Styles */

/* Table Container */
.todo-table-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    height: auto;
    min-height: auto;
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
}

.todo-calendar-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
    padding: 20px;
}

.todo-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}

.todo-calendar-month-label {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--text-primary);
}

.todo-calendar-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.todo-calendar-quick-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.todo-calendar-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.10);
}

.todo-calendar-mode-switch .btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.todo-calendar-filter {
    min-width: 140px;
    flex-shrink: 0;
}

@media (max-width: 1280px) {
    .todo-calendar-toolbar {
        flex-wrap: wrap;
    }

    .todo-calendar-toolbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .todo-calendar-quick-nav {
        flex-wrap: wrap;
    }
}

.todo-calendar-weekdays,
.todo-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.todo-calendar-weekdays {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.todo-calendar-weekdays span {
    text-align: center;
}

.todo-calendar-day {
    min-height: 132px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.todo-calendar-day.has-todos {
    background: rgba(255, 255, 255, 0.98);
}

.todo-calendar-day:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.todo-calendar-day.is-today {
    border-color: rgba(99, 102, 241, 0.42);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.todo-calendar-day.is-drop-target {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.todo-calendar-day-empty {
    background: transparent;
    border-style: dashed;
}

.todo-calendar-day-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.todo-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex: 1;
}

.todo-calendar-event {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    background: rgba(99, 102, 241, 0.10);
    color: var(--text-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

.todo-calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.14);
}

.todo-calendar-event.priority-urgent { background: rgba(239, 68, 68, 0.14); }
.todo-calendar-event.priority-high { background: rgba(245, 158, 11, 0.16); }
.todo-calendar-event.priority-medium { background: rgba(59, 130, 246, 0.14); }
.todo-calendar-event.priority-low { background: rgba(16, 185, 129, 0.14); }

.todo-calendar-event.schedule-event {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.16), rgba(251, 191, 36, 0.20));
    border: 1px solid rgba(217, 119, 6, 0.18);
}

.todo-calendar-event.schedule-task {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.10));
    border: 1px solid rgba(99, 102, 241, 0.16);
}

.todo-calendar-event.schedule-recurring {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(34, 197, 94, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.18);
}

.todo-calendar-event.schedule-event.priority-urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(251, 146, 60, 0.20));
}

.todo-calendar-event.schedule-event.priority-high {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(250, 204, 21, 0.18));
}

.todo-calendar-event-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.3;
    flex: 1;
}

.todo-calendar-event-text-minimal {
    font-weight: 700;
    letter-spacing: 0.01em;
    -webkit-line-clamp: 1;
    white-space: nowrap;
}

.todo-calendar-event-time {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.todo-calendar-event-time.all-day {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

.todo-calendar-event-time.continuation {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
}

.todo-calendar-event-duration {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-secondary);
    font-size: 0.67rem;
    font-weight: 800;
    line-height: 1;
}

.todo-calendar-event-recurring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    color: #4f46e5;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.todo-calendar-event.multi-day-event {
    min-height: 52px;
    align-items: center;
    gap: 6px;
    overflow: visible;
    flex-wrap: nowrap;
    padding-top: 10px;
    padding-bottom: 10px;
}

.todo-calendar-event.multi-day-event::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.todo-calendar-event.multi-day-event::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: rgba(34, 197, 94, 0.42);
    border-radius: 999px;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.03);
}

.todo-calendar-event.multi-day-event.range-start {
    border-radius: 14px 10px 10px 14px;
}

.todo-calendar-event.multi-day-event.range-start::after {
    left: calc(100% - 4px);
    right: -16px;
}

.todo-calendar-event.multi-day-event.range-middle {
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.todo-calendar-event.multi-day-event.range-middle::after {
    left: -16px;
    right: -16px;
}

.todo-calendar-event.multi-day-event.range-end {
    border-radius: 10px 14px 14px 10px;
}

.todo-calendar-event.multi-day-event.range-end::after {
    left: -16px;
    right: calc(100% - 4px);
}

.todo-calendar-event.multi-day-event.range-middle .todo-calendar-event-text,
.todo-calendar-event.multi-day-event.range-end .todo-calendar-event-text {
    -webkit-line-clamp: 1;
}

.todo-calendar-event.multi-day-event .todo-calendar-event-time {
    order: 3;
}

.todo-calendar-event.multi-day-event .todo-calendar-event-duration {
    order: 2;
}

.todo-calendar-event.multi-day-event.range-middle .todo-calendar-event-duration,
.todo-calendar-event.multi-day-event.range-end .todo-calendar-event-duration {
    display: none;
}

.todo-calendar-event.multi-day-event .todo-calendar-event-recurring {
    width: 18px;
    min-width: 18px;
    height: 18px;
    font-size: 0.72rem;
}

.todo-calendar-event.multi-day-event .todo-calendar-event-text {
    min-width: 0;
    -webkit-line-clamp: 1;
    white-space: nowrap;
}

.todo-calendar-day-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.todo-calendar-day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.todo-calendar-day-pill.urgent {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.todo-calendar-container.week-mode .todo-calendar-day {
    min-height: 180px;
}

.todo-calendar-container.density-compact .todo-calendar-day {
    min-height: 108px;
    gap: 8px;
}

.todo-calendar-container.density-compact .todo-calendar-event {
    padding: 6px 8px;
}

.todo-calendar-container.density-dense .todo-calendar-day {
    min-height: 168px;
}

.calendar-event-menu {
    position: fixed;
    z-index: 10020;
    min-width: 180px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-event-menu.hidden {
    display: none;
}

.calendar-event-menu button {
    border: 0;
    background: rgba(248, 250, 252, 0.95);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.92rem;
    color: var(--text-primary);
    cursor: pointer;
}

.calendar-event-menu button:hover {
    background: rgba(99, 102, 241, 0.12);
}



/* Table Wrapper for horizontal scroll */
.todo-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    position: relative;
    display: block;
    max-width: 100%;
}

/* Main Table */
.todo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
    min-width: 600px;
    max-width: 100%;
    margin: 0 auto;
}

.todo-table * {
    box-sizing: border-box;
}

/* Table Headers */
.todo-table-header {
    background: var(--bg-tertiary);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    position: relative;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Specific column widths - Définitions unifiées */
.checkbox-header {
    width: 50px;
    min-width: 50px;
    text-align: center;
}

.status-header {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

.text-header {
    width: calc(100% - 50px - 80px - 110px - 136px - 124px - 156px - 40px);
    min-width: 200px;
    text-align: left;
}

.created-header {
    width: 136px;
    min-width: 136px;
    text-align: center;
}

.priority-header {
    width: 124px;
    min-width: 124px;
    text-align: center;
}

.date-header {
    width: 156px;
    min-width: 156px;
    text-align: center;
}

.actions-header {
    width: 150px;
    min-width: 150px;
    text-align: center;
}

.history-header {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
}

.history-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
    vertical-align: middle;
}

.history-cell .todo-history-summary {
    margin: 0;
    padding: 2px 4px;
    font-size: 0.7rem;
    min-width: auto;
}

.todo-table-header.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}

.todo-table-header.sortable:hover {
    background: var(--bg-secondary);
}

/* Sort Indicators */
.sort-indicator {
    display: inline-block;
    margin-left: var(--spacing-xs);
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.sort-indicator::before {
    content: '⇅';
    font-size: 0.75em;
}

.todo-table-header.sortable:hover .sort-indicator {
    opacity: 1;
}

.todo-table-header.sort-asc .sort-indicator::before {
    content: '↑';
}

.todo-table-header.sort-desc .sort-indicator::before {
    content: '↓';
}

/* Table Cells - Alignement cohérent avec les headers */
.todo-table td {
    padding: var(--spacing-md);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* Cellules spécifiques avec alignement cohérent */
.checkbox-cell {
    width: 50px;
    min-width: 50px;
    text-align: center !important;
    vertical-align: middle;
}

.checkbox-cell input {
    display: inline-block;
}

.status-cell {
    width: 80px;
    min-width: 80px;
    text-align: center !important;
    vertical-align: middle;
}

.status-cell > * {
    display: inline-block;
}

.text-cell {
    width: calc(100% - 50px - 80px - 110px - 136px - 124px - 156px);
    min-width: 200px;
    text-align: left !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.created-cell {
    width: 136px;
    min-width: 136px;
    text-align: center !important;
    vertical-align: middle;
}

.todo-created-date {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.todo-created-date-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(107, 114, 128, 0.10);
    border: 1px solid rgba(107, 114, 128, 0.18);
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.priority-cell {
    width: 124px;
    min-width: 124px;
    text-align: center !important;
    vertical-align: middle;
}

.priority-cell > * {
    display: inline-block;
}

.date-cell {
    width: 156px;
    min-width: 156px;
    text-align: center !important;
    vertical-align: middle;
}

.date-cell > * {
    display: inline-block;
}

.actions-cell {
    width: 150px;
    min-width: 150px;
    text-align: center !important;
    white-space: nowrap;
    display: table-cell !important;
    vertical-align: middle;
    overflow: hidden;
}

.actions-cell button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    vertical-align: middle;
}

/* Force les boutons d'actions à être visibles */
.actions-cell .todo-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    flex-shrink: 0 !important;
    margin: 0 2px !important;
    padding: 6px !important;
    border: 1px solid #ddd !important;
    background: #f8f9fa !important;
    color: #6c757d !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
}

/* Bouton time-tracking dans la colonne actions : même taille que les autres */
.actions-cell .todo-time-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    margin: 0 2px !important;
    padding: 5px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Masquer le mini-timer dans la vue table (déborde de la cellule) */
.actions-cell .todo-time-btn .tt-mini-timer {
    display: none !important;
}

/* Annuler le box-shadow du bouton is-running dans la cellule actions (déborde) */
.actions-cell .todo-time-btn.is-running {
    box-shadow: none !important;
    animation: none !important;
}

/* Annuler position:relative sur la ligne active en vue table */
.todo-row.time-tracker-active-indicator {
    position: static !important;
}
.todo-row.time-tracker-active-indicator::before {
    display: none !important;
}

/* Force les SVG à être visibles */
.actions-cell .todo-btn svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Table Rows */
.todo-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
}

.todo-table tbody tr:hover {
    background: var(--bg-secondary);
}

.todo-table tbody tr.priority-urgent:hover {
    background-color: rgba(255, 107, 107, 0.12) !important;
    box-shadow: inset 8px 0 0 var(--priority-urgent);
}

.todo-table tbody tr.priority-high:hover {
    background-color: rgba(254, 202, 87, 0.12) !important;
    box-shadow: inset 8px 0 0 var(--priority-high);
}

.todo-table tbody tr.priority-medium:hover {
    background-color: rgba(72, 219, 251, 0.12) !important;
    box-shadow: inset 8px 0 0 var(--priority-medium);
}

.todo-table tbody tr.priority-low:hover {
    background-color: rgba(29, 209, 161, 0.12) !important;
    box-shadow: inset 8px 0 0 var(--priority-low);
}

.todo-table tbody tr.priority-none:hover {
    background-color: rgba(156, 163, 175, 0.06) !important;
    box-shadow: inset 8px 0 0 var(--priority-none);
}

.todo-table tbody tr.completed {
    opacity: 0.6;
}

.todo-table tbody tr.completed:hover {
    opacity: 0.7;
}

/* Suppression des définitions redondantes - déjà définies ci-dessus */

.todo-select-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    accent-color: var(--primary-color);
}

.todo-select-checkbox:hover {
    border-color: var(--primary-light);
    transform: scale(1.1);
}

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

.select-all-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    accent-color: var(--primary-color);
}

.select-all-checkbox:hover {
    border-color: var(--primary-light);
    transform: scale(1.1);
}

.status-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.status-icon-container:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

.status-icon-container.status-interactive {
    cursor: pointer;
}

.status-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Text Cell */
.text-cell {
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
}

.todo-text-wrapper {
    position: relative;
    max-height: 60px;
    overflow: hidden;
}

.todo-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.4;
}

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

/* Priority Cell */
.priority-cell {
    text-align: center;
}

.priority-badge-table {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    min-width: 60px;
    justify-content: center;
    cursor: pointer; /* Indique que c'est cliquable */
    user-select: none; /* Évite la sélection de texte */
    transition: all var(--transition-fast);
}

.priority-badge-table:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

.priority-badge-table.urgent {
    background: var(--priority-urgent-bg);
    color: var(--priority-urgent);
    border: 1px solid var(--priority-urgent-border);
}

.priority-badge-table.high {
    background: var(--priority-high-bg);
    color: #8B6914;
    border: 1px solid var(--priority-high-border);
}

.priority-badge-table.medium {
    background: var(--priority-medium-bg);
    color: var(--priority-medium);
    border: 1px solid var(--priority-medium-border);
}

.priority-badge-table.low {
    background: var(--priority-low-bg);
    color: var(--priority-low);
    border: 1px solid var(--priority-low-border);
}

.priority-badge-table.none {
    background: var(--priority-none-bg);
    color: var(--priority-none);
    border: 1px solid var(--priority-none-border);
}

.todo-date {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.todo-due-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    max-width: 100%;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.todo-due-date:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.todo-due-date.overdue {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.todo-due-date.today {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #b45309;
}

.todo-due-date.upcoming {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
    color: #1d4ed8;
}

.todo-due-date.scheduled,
.todo-due-date.completed {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.24);
    color: #047857;
}

.todo-due-date-empty {
    background: transparent;
    border-style: dashed;
}

/* Actions Cell Buttons */
.todo-btn {
    padding: var(--spacing-xs);
    border: 1px solid transparent;
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 4px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.todo-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

.todo-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.todo-btn.description:hover {
    background: var(--primary-lighter);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.todo-btn.description.has-description {
    color: var(--primary-color);
    background: var(--primary-lighter);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.todo-btn.description.has-description:hover {
    background: var(--primary-light);
    color: var(--text-white);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-colored);
}

.todo-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: var(--danger-color);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

/* Select All Checkbox */
#select-all-todos {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

#select-all-todos:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

#select-all-todos:checked::after {
    content: '✓';
    color: var(--text-white);
    display: block;
    text-align: center;
    line-height: 12px;
    font-size: 12px;
}

/* Empty State for Table */
.todo-table-container .empty-state {
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .todo-table-container {
        overflow-x: auto;
        margin-right: 0;
    }
    
    .todo-table {
        width: 100%;
        min-width: 800px;
        border-collapse: collapse;
        background: var(--bg-primary);
        border-radius: var(--radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }
    
    .todo-table-header {
        padding: var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .todo-table td {
        padding: var(--spacing-sm);
    }
    
    .text-header {
        min-width: 150px;
    }
    
    .priority-header {
        width: 120px;
        min-width: 120px;
    }
    
    .date-header {
        width: 104px;
        min-width: 104px;
    }
    
    .actions-header {
        width: 150px;
        min-width: 150px;
    }
    
    .history-header {
        width: 40px;
        min-width: 40px;
    }
    
    .actions-cell {
        width: 150px;
        min-width: 150px;
    }
}

@media (max-width: 575px) {
    /* Hide table on mobile, show list instead */
    .todo-table-container {
        display: none;
    }
    
    .todo-items {
        display: block !important;
    }
}

/* S'assurer que les boutons d'actions sont visibles sur toutes les tailles d'écran quand le tableau est affiché */
@media (min-width: 576px) {
    .actions-cell .todo-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .priority-badge-table.urgent {
        background: rgba(239, 68, 68, 0.1);
        color: #f87171;
    }
    
    .priority-badge-table.high {
        background: rgba(245, 158, 11, 0.1);
        color: #fbbf24;
    }
    
    .priority-badge-table.medium {
        background: rgba(59, 130, 246, 0.1);
        color: #60a5fa;
    }
    
    .priority-badge-table.low {
        background: rgba(16, 185, 129, 0.1);
        color: #34d399;
    }
    
    .priority-badge-table.none {
        background: rgba(107, 114, 128, 0.1);
        color: #9ca3af;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .todo-table-header {
        border-bottom-width: 3px;
    }
    
    .todo-table td {
        border-bottom-width: 2px;
    }
    
    .todo-table-checkbox,
    .select-all-checkbox {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .todo-table-header,
    .todo-table tbody tr,
    .todo-table-checkbox,
    .todo-table-btn {
        transition: none;
    }
}

/* Loading State */
.todo-table-loading {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.todo-table-loading .spinner {
    margin: 0 auto var(--spacing-md);
}

/* Row Selection */
.todo-table tbody tr.selected {
    background: rgba(79, 70, 229, 0.1);
}

.todo-table tbody tr.selected .todo-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* Grid View Styles */
.todo-items.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.125rem;
    padding: 0;
}

.todo-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.todo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: var(--transition-normal);
}

.todo-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.todo-card:hover::before {
    opacity: 1;
}

.todo-card.completed {
    opacity: 0.7;
    background: var(--bg-secondary);
}

.todo-card.is-favorite {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.todo-favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
    padding: 0;
}

.todo-favorite-btn:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    transform: scale(1.1);
}

.todo-favorite-btn.active {
    color: #f59e0b;
}

.todo-favorite-btn.active svg {
    filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.4));
}

.todo-favorite-btn:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 1px;
}

.todo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.todo-card-content {
    margin-bottom: 1rem;
}

.todo-card-content .todo-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    word-wrap: break-word;
}

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

.todo-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.todo-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.todo-card-actions .todo-btn {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.todo-card-actions .todo-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.todo-card-actions .todo-btn.delete:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* Enhanced priority indicators in cards */
.todo-card .priority-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.875rem;
}

/* Priority hover effects for grid view cards */
.todo-card.priority-urgent:hover {
    box-shadow: inset 8px 0 0 var(--priority-urgent);
}

.todo-card.priority-high:hover {
    box-shadow: inset 8px 0 0 var(--priority-high);
}

.todo-card.priority-medium:hover {
    box-shadow: inset 8px 0 0 var(--priority-medium);
}

.todo-card.priority-low:hover {
    box-shadow: inset 8px 0 0 var(--priority-low);
}

.todo-card.priority-none:hover {
    box-shadow: inset 8px 0 0 var(--priority-none);
}

/* List view improvements */
.todo-items.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
}

.todo-item .todo-text {
    color: #1f2937;
    flex: 1;
}

.todo-list-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.todo-list-main .todo-text {
    min-width: 0;
}

body.dark-mode .todo-item .todo-text {
    color: #f3f4f6;
}

.todo-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.todo-item .priority-indicator {
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
}

/* List view priority colors */
.todo-item.priority-urgent {
    background-color: rgba(255, 107, 107, 0.08) !important;
    border-left: 3px solid var(--priority-urgent);
}

.todo-item.priority-high {
    background-color: rgba(254, 202, 87, 0.08) !important;
    border-left: 3px solid var(--priority-high);
}

.todo-item.priority-medium {
    background-color: rgba(72, 219, 251, 0.08) !important;
    border-left: 3px solid var(--priority-medium);
}

.todo-item.priority-low {
    background-color: rgba(29, 209, 161, 0.08) !important;
    border-left: 3px solid var(--priority-low);
}

.todo-item.priority-none {
    background-color: rgba(156, 163, 175, 0.03) !important;
    border-left: 3px solid var(--priority-none);
}

.todo-item.priority-urgent:hover {
    background-color: rgba(255, 107, 107, 0.12) !important;
}

.todo-item.priority-high:hover {
    background-color: rgba(254, 202, 87, 0.12) !important;
}

.todo-item.priority-medium:hover {
    background-color: rgba(72, 219, 251, 0.12) !important;
}

.todo-item.priority-low:hover {
    background-color: rgba(29, 209, 161, 0.12) !important;
}

.todo-item.priority-none:hover {
    background-color: rgba(156, 163, 175, 0.06) !important;
}

/* Priority badge for list view */
.priority-badge-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.priority-badge-list:hover {
    transform: scale(1.1);
}

.priority-badge-list.priority-urgent {
    background-color: rgba(255, 107, 107, 0.1);
}

.priority-badge-list.priority-high {
    background-color: rgba(254, 202, 87, 0.1);
}

.priority-badge-list.priority-medium {
    background-color: rgba(72, 219, 251, 0.1);
}

.priority-badge-list.priority-low {
    background-color: rgba(29, 209, 161, 0.1);
}

.priority-badge-list.priority-none {
    background-color: rgba(156, 163, 175, 0.1);
}

/* Compact actions for list view */
.todo-item .todo-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.todo-item .todo-btn {
    width: 28px;
    height: 28px;
    padding: 4px;
    margin: 0;
}

.todo-item .status-icon-container {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
}

.todo-item .todo-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.todo-list-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.todo-subtasks-preview {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
    margin-top: 0.2rem;
}

.todo-subtasks-preview.variant-table {
    margin-top: 0.5rem;
}

.todo-subtask-item {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.35;
}

.todo-subtask-item.completed .todo-subtask-text {
    text-decoration: line-through;
    opacity: 0.72;
}

.todo-subtask-checkbox {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.todo-subtask-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.todo-subtask-text-btn {
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: text;
    color: inherit;
    font: inherit;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.todo-subtask-inline-input {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    padding: 0.18rem 0.45rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: inherit;
    line-height: 1.35;
}

.todo-subtask-inline-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.todo-subtasks-more,
.todo-subtasks-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.todo-subtasks-more:hover,
.todo-subtasks-summary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-light);
}

.todo-subtasks-summary-icon {
    font-size: 0.8rem;
}

.text-cell .todo-subtask-item {
    font-size: 0.78rem;
}

body.dark-mode .todo-subtask-item {
    color: #cbd5e1;
}

.todo-recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.todo-recurring-badge:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.35);
}

.todo-tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.todo-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--tag-border, rgba(59, 130, 246, 0.18));
    border-radius: 999px;
    background: var(--tag-bg, rgba(59, 130, 246, 0.08));
    color: var(--tag-fg, #2563eb);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.todo-tag-chip:hover {
    filter: brightness(0.9);
    border-color: var(--tag-fg, rgba(59, 130, 246, 0.35));
}

.todo-tags-more {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border: 1px dashed var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.todo-recurring-select {
    min-width: 170px;
}

.date-cell .todo-recurring-badge {
    margin-top: 0.4rem;
}

/* Responsive Grid View */
@media (max-width: 768px) {
    .todo-items.grid-view {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .todo-card {
        padding: 0.75rem;
    }
    
    .todo-card-actions {
        justify-content: center;
    }

    .todo-subtask-text {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .todo-items.grid-view {
        grid-template-columns: 1fr;
    }
    
    .view-controls-sidebar {
        right: 1rem;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .view-controls-sidebar .view-btn {
        width: 40px;
        height: 40px;
    }
}

.todo-table tbody tr.selected .todo-table-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* Priority Row Colors */
.todo-table tbody tr.priority-urgent {
    border-left: 3px solid var(--priority-urgent);
    background-color: rgba(255, 107, 107, 0.08) !important;
}

.todo-table tbody tr.priority-high {
    border-left: 3px solid var(--priority-high);
    background-color: rgba(254, 202, 87, 0.08) !important;
}

.todo-table tbody tr.priority-medium {
    border-left: 3px solid var(--priority-medium);
    background-color: rgba(72, 219, 251, 0.08) !important;
}

.todo-table tbody tr.priority-low {
    border-left: 3px solid var(--priority-low);
    background-color: rgba(29, 209, 161, 0.08) !important;
}

.todo-table tbody tr.priority-none {
    border-left: 3px solid var(--priority-none);
    background-color: rgba(156, 163, 175, 0.03) !important;
}
