[data-theme="light"] .main-priority-row select {
    margin-bottom: 0;
}

.main-priority-row .checkbox-container {
    display: flex;
    align-items: center;
    height: 100%;
    margin-bottom: 0;
}

.main-priority-row .checkbox-container label {
    margin: 0;
}

.mark-complete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background-color: #10B981;
    color: #fff;
    border: none;
    box-shadow: var(--shadow-sm);
}

.form-actions .mark-complete-btn {
    margin-top: 0;
}

.mark-complete-btn:hover {
    background-color: #059669;
    box-shadow: var(--shadow);
}

[data-theme="dark"] .mark-complete-btn {
    background-color: #059669;
    box-shadow: none;
}

.share-dropdown button i,
.share-dropdown .button-secondary i,
.share-dropdown .button-primary i {
    margin-right: 8px;
}
/* --- Reset Básico & Variáveis --- */
:root {
    --primary-color: #3B82F6; /* Azul mais vibrante */
    --primary-dark: #2563EB;
    --secondary-color: #F3F4F6; /* Cinza muito claro */
    --background-color: #ffffff;
    --text-color: #1F2937; /* Cinza escuro */
    --text-light: #6B7280; /* Cinza médio */
    --border-color: #D1D5DB; /* Cinza claro */
    --sidebar-bg: #F9FAFB; /* Quase branco */
    --hover-bg: #E5E7EB; /* Cinza claro hover */
    --done-color: #10B981; /* Verde esmeralda */
    --working-color: #F59E0B; /* Âmbar */
    --pending-color: #6B7280; /* Cinza médio (igual text-light) */
    --high-priority: #EF4444; /* Vermelho */
    --medium-priority: #F59E0B; /* Âmbar */
    --low-priority: #3B82F6; /* Azul */
    --star-color: #3B82F6; /* Azul - mesma cor primária */
    --overdue-color: #DC2626; /* Vermelho mais escuro para atrasado */
    --working-session-color: #3B82F6; /* Azul para Working Session */
    --modal-bg: #ffffff;
    --input-bg: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius-sm: 0.25rem; /* 4px */
    --border-radius: 0.375rem; /* 6px */
    --border-radius-lg: 0.5rem; /* 8px */
    --transition-speed: 0.2s;
}

#autosave-indicator.floating {
    position: fixed;
    z-index: 2000;
    background: rgba(31, 41, 55, 0.95);
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    backdrop-filter: blur(6px);
    color: #e5e7eb;
}

[data-theme="light"] #autosave-indicator.floating {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
}

.task-form-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    background: var(--secondary-color);
    padding: 6px;
    border-radius: var(--border-radius-lg);
}

.task-tab-button {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--border-radius-lg);
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-color);
    transition: background 0.2s, color 0.2s;
}

.task-tab-button.active {
    background: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .task-form-tabs {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .task-tab-button.active {
    background: var(--primary-dark);
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #60A5FA;
    --primary-dark: #3B82F6;
    --secondary-color: #374151;
    --background-color: #111827;
    --text-color: #F9FAFB;
    --text-light: #9CA3AF;
    --border-color: #4B5563;
    --sidebar-bg: #1F2937;
    --hover-bg: #374151;
    --modal-bg: #1F2937;
    --input-bg: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5; /* Ligeiramente mais compacto */
    font-size: 15px; /* Base um pouco menor */
    -webkit-font-smoothing: antialiased; /* Melhora renderização da fonte */
    -moz-osx-font-smoothing: grayscale;
}

ul {
    list-style: none;
}

/* --- Botões Globais --- */
button {
    cursor: pointer;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.6em 1.2em; /* Padding relativo */
    font-weight: 500;
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
    font-size: 0.9rem;
    line-height: 1.2; /* Garante alinhamento vertical do texto */
}
button:active {
     transform: scale(0.98); /* Efeito de clique */
}


.button-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}
.button-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow);
}

.button-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.button-secondary:hover {
    background-color: var(--hover-bg);
}

.button-danger {
    background-color: #fff;
    color: #DC2626;
    border: 1px solid #DC2626;
}
.button-danger:hover {
    background-color: #FEE2E2;
}

/* --- Inputs & Forms --- */
input[type="text"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background-color: var(--input-bg);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    color: var(--text-color); /* Garante cor do texto */
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); /* Anel de foco azul mais visível */
}
input::placeholder, textarea::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

/* --- Layout Principal --- */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.4rem;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--border-radius);
    margin-right: 12px;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: var(--hover-bg);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* Sidebar close button - only visible on mobile */
.sidebar-close-btn {
    display: none;
}

/* Sidebar collapse button - only visible on desktop */
.sidebar-collapse-btn {
    display: flex;
}

.sidebar {
    width: 280px; /* Um pouco mais largo */
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    flex-shrink: 0; /* Evita que sidebar encolha */
    position: relative; /* For the resize handle */
    min-width: 200px; /* Minimum width */
    max-width: 500px; /* Maximum width */
    overflow-x: hidden; /* Hide horizontal overflow */
    z-index: 999;
}

/* Collapsed sidebar state for desktop */
.sidebar.collapsed {
    width: 0 !important;
    min-width: 0;
    padding: 0;
    border-right: none;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .resize-handle {
    display: none;
}

/* Show expand button when sidebar is collapsed */
.sidebar-expand-btn {
    display: none;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-color);
    margin-right: 12px;
    flex-shrink: 0;
}

.sidebar-expand-btn:hover {
    background: var(--hover-bg);
}

/* Show expand button when sidebar is collapsed (desktop only) */
.sidebar.collapsed ~ .main-content .sidebar-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom resize handle */
.resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    background-color: transparent;
    cursor: ew-resize;
    z-index: 100;
}

.resize-handle:hover, .resize-handle.active {
    background-color: var(--primary-color);
    opacity: 0.5;
}

.sidebar-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Header não encolhe */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    margin: 0;
}

#logout-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

#logout-btn:hover {
    background: var(--secondary-color);
    color: var(--danger-color);
}
.sidebar h1 i {
    margin-right: 12px;
    font-size: 1.6rem;
}

.sidebar-section {
    padding: 15px 15px; /* Padding nos containers das seções */
    flex-shrink: 0; /* Seções não encolhem */
}
.sidebar-section h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 10px;
    padding-left: 10px;
    font-weight: 600;
    letter-spacing: 0.05em; /* Leve espaçamento */
}
#add-category-btn {
    width: 100%;
    margin-bottom: 15px;
    text-align: left;
    background-color: transparent; /* Botão mais sutil */
    border: 1px dashed var(--border-color);
    color: var(--text-light);
    font-weight: 500;
}
#add-category-btn:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-style: solid;
}
#add-category-btn i {
    margin-right: 8px;
}

#category-nav {
    flex-grow: 1; /* Permite que a lista cresça */
    overflow-y: auto; /* Scroll se necessário */
    margin: 0 -15px; /* Remove padding lateral para LIs ocuparem tudo */
    padding: 0 15px;
    /* Custom scrollbar (opcional, webkit) */
    &::-webkit-scrollbar { width: 6px; }
    &::-webkit-scrollbar-track { background: transparent; }
    &::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
    &::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
}

#category-list, .special-views ul {
    padding-left: 0;
}

#category-list li, .special-views li {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 4px; /* Espaço menor */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    font-size: 0.95rem;
    font-weight: 500; /* Mais legível */
    color: var(--text-color);
}
/* Ícone + Texto agrupados para evitar que contador quebre linha */
#category-list li > span:first-child,
.special-views li > span:first-child {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Ocupa espaço */
    margin-right: 8px; /* Espaço antes do contador */
    overflow: hidden; /* Evita que texto longo quebrar layout */
    text-overflow: ellipsis;
    white-space: nowrap;
}

#category-list li i, .special-views li i {
    margin-right: 10px;
    color: var(--text-light);
    width: 1.2em; /* Garante alinhamento dos ícones (fa-fw) */
    text-align: center;
    flex-shrink: 0; /* Ícone não encolhe */
}

#category-list li:hover, .special-views li:hover {
    background-color: var(--hover-bg);
}

/* Enhanced active state for all categories */
#category-list li.active, .special-views li.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600; /* Destaca ativo */
    box-shadow: var(--shadow-sm);
    position: relative;
    /* Add a subtle indicator on the left */
    border-left: 4px solid var(--primary-dark);
}

/* Update icon color for active items */
#category-list li.active i, .special-views li.active i {
    color: white;
}

/* Update counter style for active items */
#category-list li.active .category-count, .special-views li.active .category-count { 
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Special distinctive styling ONLY for smart lists when active */
.sidebar-section.special-views ul li.active {
    background: linear-gradient(to right, #4f46e5, #3730a3); /* Indigo gradient */
    border-left: 4px solid gold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Make sure the icons in smart lists are white when active */
.sidebar-section.special-views ul li.active i {
    color: white;
}

/* Add a subtle animation to smart lists when active */
.sidebar-section.special-views ul li.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* Parent category styling with toggle functionality */
#category-list li.parent-category-item .parent-name {
    font-weight: 700;
}

#category-list li.parent-category-item .toggle-subcategories {
    cursor: pointer;
    color: var(--text-light);
    margin-right: 8px;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

#category-list li.parent-category-item .toggle-subcategories:hover {
    color: var(--primary-color);
}

/* Hide subcategory lists when toggled */
#category-list ul.subcategory-list.hidden {
    display: none;
}

/* Subcategory styling with improved indentation */
#category-list ul.subcategory-list {
    margin-top: 4px;
    margin-bottom: 8px;
    padding-left: 0;
    list-style: none;
    width: 100%;
}

#category-list ul.subcategory-list li.subcategory-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 2px;
    font-size: 0.9rem;
}

/* Add indentation based on level */
#category-list ul.subcategory-list[data-level="1"] li {
    padding-left: 25px;
    margin-left: 10px;
    border-left: 1px dashed var(--border-color);
}

#category-list ul.subcategory-list[data-level="2"] li {
    padding-left: 35px;
    margin-left: 20px;
    border-left: 1px dashed var(--border-color);
}

#category-list ul.subcategory-list[data-level="3"] li {
    padding-left: 45px;
    margin-left: 30px;
    border-left: 1px dashed var(--border-color);
}

#category-list ul.subcategory-list[data-level="4"] li {
    padding-left: 55px;
    margin-left: 40px;
    border-left: 1px dashed var(--border-color);
}

#category-list ul.subcategory-list[data-level="5"] li {
    padding-left: 65px;
    margin-left: 50px;
    border-left: 1px dashed var(--border-color);
}

/* Consistent subcategory icon styling */
#category-list ul.subcategory-list li.subcategory-item .fas.fa-angle-right {
    color: var(--text-light);
    font-size: 0.85rem;
    width: 12px;
    text-align: center;
}

/* Folder icon for parent categories */
#category-list li.parent-category-item .fas.fa-folder {
    color: var(--primary-color);
    opacity: 0.8;
}

/* Remove the connecting line since we're using a consistent icon */
#category-list ul.subcategory-list li.subcategory-item::before {
    display: none;
}

/* Updated Category Counter as Tags - more discrete styling */
.category-count {
    background-color: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-color);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    position: relative;
}

.subtask-main {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

/* Even more discrete styling for parent category counters */
#category-list li.parent-category-item .category-count {
    background-color: transparent;
    color: var(--text-light);
    font-size: 0.65rem;
    padding: 1px 4px;
    opacity: 0.8;
    font-weight: 400;
}

/* Active state counter styling */
#category-list li.active .category-count, 
.special-views li.active .category-count { 
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Parent category active counter */
#category-list li.parent-category-item.active .category-count {
    background-color: transparent;
    color: white;
    opacity: 0.9;
}

/* Special styling for zero counts */
.category-count.empty {
    background-color: var(--border-color);
    color: var(--text-light);
    opacity: 0.5;
}

/* Ensure all category counters are right-aligned */
#category-list li, .special-views li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-content {
    display: flex;
    align-items: center;
    width: 100%;
}

/* --- Conteúdo Principal --- */
.main-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--background-color);
}

/* Content Header with Toolbar */
.content-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.content-header-top {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.content-header h1 {
    font-size: 1.8rem;
    margin: 0;
    color: var(--text-color);
    flex: 1;
}

/* Category Toolbar */
.category-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left, .toolbar-center, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Checkbox styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper label {
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}

/* Sort options */
.sort-options {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.sort-options label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
}

.sort-select {
    background-color: transparent;
    border: none;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    padding-right: 15px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234F46E5%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.2rem center;
    background-size: 0.65em auto;
}

/* Toggle for completed tasks */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-light);
    height: 20px;
}

.toggle-label input[type="checkbox"] {
    margin-right: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    position: relative;
    top: 0;
    display: inline-block;
}

.checkbox-text {
    display: inline-block;
    line-height: 16px;
    vertical-align: top;
    margin-top: 1px;
}

.toggle-label input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Export/Import buttons */
.toolbar-right .button-icon {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}

.toolbar-right .button-icon:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.toolbar-right .button-icon:not(:last-child) {
    margin-right: 8px;
}

/* --- Tarefas --- */
#task-list {
    padding: 20px 25px 80px 25px; /* Mais padding inferior por causa do FAB */
    flex-grow: 1; /* Ocupa espaço restante */
}
.no-tasks {
    color: var(--text-light);
    text-align: center;
    padding: 50px 20px;
    font-size: 1rem;
}
.no-tasks i {
    margin-left: 5px;
}


.task-item {
    background-color: white;
    border: 1px solid var(--border-color);
    /* Borda esquerda colorida via JS: style="border-left: 4px solid [color]" */
    border-radius: var(--border-radius); /* Menos arredondado que lg */
    margin-bottom: 12px; /* Espaço menor */
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-speed) ease, background-color var(--transition-speed) ease;
    padding: 12px 15px; /* Padding interno */
    cursor: pointer; /* Indicar que o item é clicável */
    position: relative; /* For tooltip positioning */
}
.task-item:hover {
     box-shadow: var(--shadow);
     background-color: #fcfdff; /* Leve tom azulado no hover */
     /* transform: translateY(-1px); */ /* Opcional: leve levantamento */
}
.task-item.done-item {
    background-color: var(--secondary-color); /* Fundo diferente para concluídas */
    opacity: 0.8;
}
.task-item.done-item:hover {
    background-color: var(--hover-bg);
    opacity: 1;
}

/* Container para a área clicável principal */
.task-details-clickable {
    flex-grow: 1;
    margin-left: 0; /* Adjusted since status indicator is removed */
    cursor: pointer;
}

.task-item .task-name {
    font-weight: 500; /* Nome normal */
    font-size: 1rem; /* Tamanho padrão */
    margin-bottom: 4px; /* Espaço antes dos metadados */
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Corta nomes longos */
}
.task-item .task-name.done {
    text-decoration: line-through;
    color: var(--text-light);
    font-weight: 400;
}
.task-item.done-item .task-name { /* Garante estilo para item concluído */
     text-decoration: line-through;
     color: var(--text-light);
     font-weight: 400;
}

.task-item .task-meta {
    font-size: 0.8rem; /* Metadados menores */
    color: var(--text-light);
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha se necessário */
    gap: 5px 12px; /* Espaçamento entre itens meta (vertical | horizontal) */
    align-items: center;
    margin-top: 2px;
}
.task-item .task-meta span {
    display: inline-flex;
    align-items: center;
}
.task-item .task-meta i {
    margin-right: 4px;
    font-size: 0.9em; /* Ícones meta um pouco menores */
    vertical-align: middle; /* Alinha melhor com texto */
}
/* Estilo para data atrasada */
.task-meta .overdue {
    color: var(--overdue-color);
    font-weight: 500;
}
.task-meta .overdue i {
    color: var(--overdue-color);
}

.task-tag {
    background-color: var(--secondary-color);
    color: var(--text-light); /* Tag mais sutil */
    padding: 2px 8px;
    border-radius: 10px; /* Tags arredondadas */
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 3px;
    border: 1px solid var(--border-color);
    white-space: nowrap; /* Evita que tags quebrem */
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 2px; /* Ações bem juntas */
    margin-left: 15px; /* Espaço após detalhes */
    flex-shrink: 0; /* Botões não encolhem */
}
.task-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.95rem; /* Tamanho base dos ícones de ação */
    padding: 8px; /* Área de clique maior */
    border-radius: 50%;
    width: 34px; /* Área consistente */
    height: 34px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}
.task-actions button:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}
.task-actions .star-btn.starred i {
     color: #3B82F6 !important; /* Force blue color with !important */
    font-weight: 900; /* Ícone sólido */
}
.task-actions .star-btn:hover i {
    color: #3B82F6 !important; /* Force blue color with !important */
}
.task-actions .timer-btn.working {
    color: var(--working-color);
    background-color: rgba(245, 158, 11, 0.1); /* Fundo sutil quando ativo */
}
.task-actions .timer-btn.working:hover {
    background-color: rgba(245, 158, 11, 0.2);
}
/* Ícone correto já é setado via JS */

.task-actions .delete-btn:hover {
    color: var(--high-priority);
    background-color: rgba(239, 68, 68, 0.1);
}

/* --- FAB --- */
.fab {
    position: fixed; /* Fixo na viewport */
    bottom: 25px;
    right: 25px;
    width: 52px; /* Tamanho padrão */
    height: 52px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem; /* Tamanho do ícone '+' */
    box-shadow: var(--shadow-lg);
    z-index: 20;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.fab:hover {
    background-color: var(--primary-dark);
    transform: scale(1.08); /* Animação mais sutil */
    box-shadow: 0 12px 20px -4px rgb(0 0 0 / 0.15), 0 5px 8px -5px rgb(0 0 0 / 0.15);
}
.fab:active {
     transform: scale(0.95);
}

/* --- Resumo --- */
.summary-container {
    padding: 25px;
}
#summary-chart table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden; /* Para o border-radius funcionar com a tabela */
    border: 1px solid var(--border-color); /* Borda externa sutil */
}
#summary-chart th, #summary-chart td {
    border: none; /* Remove bordas internas */
    border-bottom: 1px solid var(--border-color); /* Linhas horizontais */
    padding: 12px 15px;
    text-align: left;
    font-size: 0.9rem;
}
#summary-chart th {
    background-color: var(--sidebar-bg);
    font-weight: 600;
    color: var(--text-color);
}
#summary-chart tr:last-child td {
    border-bottom: none; /* Remove borda da última linha */
}
#summary-chart tr:hover td { /* Efeito hover na linha */
    background-color: var(--secondary-color);
}
#summary-chart td:last-child { /* Coluna de contagem */
    text-align: right;
    font-weight: 500;
}

/* Resumo Diário (Daily Summary) Styles */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.summary-table th {
  background-color: var(--primary-color);
  color: white;
  text-align: left;
  padding: 12px 15px;
}

.summary-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
}

.date-row {
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.date-row:hover {
  background-color: var(--hover-bg);
}

.date-cell {
  font-weight: 500;
}

.tasks-detail-row.hidden {
  display: none;
}

.tasks-detail-cell {
  padding: 0 !important;
  background-color: var(--secondary-color);
}

.tasks-detail-container {
  padding: 15px;
}

.tasks-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-color);
  margin-bottom: 5px;
  border-radius: var(--border-radius-sm);
}

.task-detail-item:last-child {
  margin-bottom: 0;
}

.task-detail-name {
  font-weight: 500;
}

.task-detail-time {
  color: var(--text-light);
  font-size: 0.9em;
}

/* --- Modais --- */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Permite scroll no modal se conteúdo for grande */
    background-color: rgba(17, 24, 39, 0.6); /* Fundo mais escuro (cinza azulado) */
    backdrop-filter: blur(4px); /* Leve blur no fundo */
    display: flex;
    justify-content: center;
    align-items: center; /* Centraliza verticalmente */
    padding: 20px; /* Espaço nas bordas */
}

.modal-content {
    background-color: #fff;
    padding: 25px 30px; /* Padding ajustado */
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 95%; /* Responsivo */
    max-width: 550px;
    position: relative;
    margin: auto; /* Garante centralização mesmo com overflow */
    animation: fadeInModal 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Animação de entrada suave */
}
.modal-content.large {
     max-width: 750px;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}


.close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    color: var(--text-light);
    font-size: 1.8rem; /* Tamanho adequado */
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    padding: 5px; /* Área de clique */
    transition: color var(--transition-speed) ease, transform 0.1s ease;
}
.close-btn:hover {
    color: var(--text-color);
}
.close-btn:active {
    transform: translateY(-50%) scale(0.9);
}

.modal h3 {
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-color); /* Título normal */
    font-weight: 600;
    font-size: 1.3rem;
}

.modal form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500; /* Labels um pouco menos pesadas */
    font-size: 0.9rem;
    color: var(--text-color);
}
.modal form .checkbox-container { /* Alinhamento checkbox */
    display: flex;
    align-items: center;
    margin-top: 10px; /* Espaço acima */
    margin-bottom: 12px; /* Espaço padrão abaixo */
}
.modal form .checkbox-container input[type="checkbox"] {
    width: auto; /* Tamanho natural */
    margin-right: 8px;
    margin-bottom: 0; /* Remove margem padrão */
    accent-color: var(--primary-color); /* Cor do check */
    height: 16px;
    width: 16px;
    cursor: pointer;
}
.modal form .checkbox-container label {
     margin-bottom: 0;
     font-weight: 400; /* Label normal */
     display: inline-flex;
     align-items: center;
     cursor: pointer; /* Label clicável */
}
.modal form .checkbox-container label i {
    margin-right: 6px;
    color: var(--text-light); /* Ícone estrela sutil */
}
.modal form .checkbox-container input[type="checkbox"]:checked + label i {
    color: var(--star-color); /* Cor quando checado */
    font-weight: 900; /* Sólido */
}


.modal form button[type="submit"] {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 1rem;
}

.form-grid { /* Grid para alinhar campos lado a lado */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsivo */
    gap: 15px 20px; /* Espaçamento grid (linha | coluna) */
    margin-bottom: 12px;
}
.form-grid > div {
    /* Garante que os itens dentro do grid não tenham margem inferior extra */
    & > input, & > select { margin-bottom: 0; }
}

/* --- Formulários --- */
input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color var(--transition-speed);
    margin-bottom: 15px;
}

/* Resizable Quill Editor */
#editor-container {
  position: relative;
  margin-bottom: 20px;
}

#task-description-editor {
  min-height: 150px;
  resize: vertical;
  overflow: auto;
  padding-bottom: 15px; /* Space for the resize handle */
}

.ql-container {
  min-height: 150px;
  border-bottom-left-radius: 0.5em;
  border-bottom-right-radius: 0.5em;
  background: #fff;
}

.ql-toolbar {
  border-top-left-radius: 0.5em;
  border-top-right-radius: 0.5em;
  background: #f8f9fa;
}

/* Custom resize handle */
.editor-resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: #f1f1f1;
  border-top: 1px solid #ccc;
  cursor: ns-resize;
  border-bottom-left-radius: 0.5em;
  border-bottom-right-radius: 0.5em;
  display: flex;
  justify-content: center;
  align-items: center;
}

.editor-resize-handle::after {
  content: "";
  width: 30px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
}

.editor-resize-handle:hover {
  background: #e0e0e0;
}

.editor-resize-handle:hover::after {
  background: #aaa;
}

/* Rich Text Editor Styling */
#editor-container {
    margin-bottom: 15px;
}

#task-description-editor {
    height: 150px;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.ql-toolbar.ql-snow {
    border: 1px solid var(--border-color);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    padding: 8px;
    background-color: var(--secondary-color);
}

.ql-container.ql-snow {
    border: 1px solid var(--border-color);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
}

.ql-editor a {
    color: var(--primary-color);
    text-decoration: underline;
}

input:focus, select:focus, textarea:focus, .ql-container.ql-snow:focus-within {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); /* Anel de foco azul mais visível */
}

/* Task Description Styling */
.task-description {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Rich Text Content Styling */
.task-description a {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

.task-description a:hover {
    text-decoration: none;
    opacity: 0.9;
}

.task-description p {
    margin-bottom: 0.5em;
}

.task-description ul, .task-description ol {
    padding-left: 1.5em;
    margin-bottom: 0.5em;
}

.task-description h1, .task-description h2, .task-description h3 {
    margin-top: 0.5em;
    margin-bottom: 0.3em;
    font-weight: 600;
}

.task-description h1 {
    font-size: 1.2rem;
}

.task-description h2 {
    font-size: 1.1rem;
}

.task-description h3 {
    font-size: 1rem;
}

.task-description img {
    max-width: 100%;
    height: auto;
    margin: 0.5em 0;
    border-radius: var(--border-radius);
}

/* Animation for task updates */
.task-animation {
    animation: task-update-highlight 0.8s ease-in-out;
}

@keyframes task-update-highlight {
    0% { background-color: rgba(59, 130, 246, 0.1); }
    50% { background-color: rgba(59, 130, 246, 0.2); }
    100% { background-color: transparent; }
}

/* Atalhos de Data */
.date-shortcuts {
    display: flex;
    flex-wrap: wrap; /* Quebra linha se necessário */
    gap: 8px;
    margin-top: -8px; /* Aproxima do input */
    margin-bottom: 15px;
}
.date-shortcut-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}
.date-shortcut-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
    border-color: var(--border-color); /* Mantém a borda */
}

/* Upload de Arquivo */
.file-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.hidden-file-input {
    /* Esconde input original mas mantém funcionalidade */
    width: 0.1px;
	height: 0.1px;
	opacity: 0;
	overflow: hidden;
	position: absolute;
	z-index: -1;
}
.file-input-label {
    /* Estilos já vêm de .button-secondary */
    display: inline-flex; /* Para alinhar ícone */
    align-items: center;
    padding: 0.5em 1em; /* Padding menor para este botão */
    cursor: pointer;
}
.file-input-label i {
    margin-right: 6px;
}
#file-name-display {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1; /* Ocupa espaço disponível */
    min-width: 0; /* Permite encolher */
}

/* --- Utilitários --- */
.hidden {
    display: none !important;
}

/* --- Search Bar --- */
.search-container {
    padding: 10px 15px 5px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    border: none;
    overflow: hidden;
}

.search-icon {
    color: var(--text-light);
    font-size: 18px;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 45px;
    border: none;
    outline: none;
    font-size: 16px;
    background-color: #f0f0f0;
    border-radius: 25px;
    text-indent: 25px; /* Add space between text and icon */
}

.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: none;
    padding: 0;
    font-size: 16px;
    z-index: 1;
}

.clear-search-btn:hover {
    color: var(--text-color);
}
.clear-search-btn:active {
    transform: translateY(-50%) scale(0.9);
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 4px;
  color: white;
  font-weight: 500;
  max-width: 300px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s, transform 0.3s;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification.info {
  background-color: #2196F3;
}

.notification.success {
  background-color: #4CAF50;
}

.notification.warning {
  background-color: #FF9800;
}

.notification.error {
  background-color: #F44336;
}

/* Task Shortcuts */
.task-shortcuts {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 10px;
    margin-right: 5px;
    flex-shrink: 0;
}

.task-shortcuts .shortcut-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 6px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.task-shortcuts .shortcut-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

.task-shortcuts .complete-btn:hover {
    color: var(--done-color);
    background-color: rgba(34, 197, 94, 0.1);
}

.task-shortcuts .myday-btn:hover {
    color: var(--star-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.task-shortcuts .today-btn:hover {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Category Display */
.task-meta .task-category {
    display: inline-flex;
    align-items: center;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-meta .task-category:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-meta .task-category i {
    margin-right: 4px;
    font-size: 0.9em;
}

/* Custom HTML Tooltip */
/* Removed */

/* Enhanced Tooltip Styling */
/* Removed */

/* Task animation effect */
@keyframes taskUpdateAnimation {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-sm);
    background-color: transparent;
  }
  30% {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 100, 255, 0.2);
    background-color: rgba(59, 130, 246, 0.1); /* Light blue background */
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 100, 255, 0.2);
    background-color: rgba(59, 130, 246, 0.1); /* Light blue background */
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-sm);
    background-color: transparent;
  }
}

.task-animation {
  animation: taskUpdateAnimation 0.8s ease-in-out;
}

/* Note popup styles */
.note-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.note-popup-overlay.show {
  opacity: 1;
}

.note-popup {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  padding: 20px;
  transform: translateY(20px);
  transition: transform 0.3s ease-in-out;
}

.note-popup.show {
  transform: translateY(0);
}

.note-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.note-popup-header h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--primary-color);
}

.note-popup-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.note-popup-content textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  font-family: inherit;
  resize: vertical;
}

.note-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.note-popup-actions button {
  padding: 8px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
}

.note-popup-actions .cancel-btn {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.note-popup-actions .save-btn {
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  color: white;
}

/* Date-time container styling */
.date-time-container {
  display: flex;
  gap: 10px;
  width: 100%;
}

.date-time-container input[type="date"] {
  flex: 2;
}

.date-time-container input[type="time"] {
  flex: 1;
}

/* Working Session Styles */
.working-session-btn {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.working-session-btn:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.working-session-btn.active {
    background-color: var(--working-session-color);
    color: white;
    border-color: var(--working-session-color);
}

.task-item.in-working-session {
    background-color: rgba(59, 130, 246, 0.05);
}

#working-session-view {
    position: relative;
}

#clear-working-session {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: var(--border-radius-sm);
    opacity: 0.7;
    transition: all var(--transition-speed) ease;
}

#clear-working-session:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

.mini-button {
    background: transparent;
    border: none;
    padding: 2px 5px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
}

.mini-button:hover {
    background-color: var(--hover-bg);
}

/* Search Results Info Styling */
.search-results-info {
  margin: 10px 0 15px;
  padding: 10px 15px;
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.search-info-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-context {
  font-size: 0.9rem;
  color: var(--text-light);
}

.search-count {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
}

.search-count strong {
  color: var(--primary-color);
}

/* Notification Banner Styles */
.notification-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 500px;
  width: calc(100% - 40px);
  animation: slideInDown 0.3s ease-out forwards;
}

.notification-message {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-message i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.notification-actions {
  display: flex;
  gap: 10px;
}

.notification-actions button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-actions .btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.notification-actions .btn-primary:hover {
  background-color: var(--primary-color-dark);
}

.notification-actions .btn-text {
  background: none;
  border: none;
  color: var(--text-light);
}

.notification-actions .btn-text:hover {
  color: var(--text-color);
}

@keyframes slideInDown {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* --- Notification Center --- */
.notification-center {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 320px;
  max-height: 400px;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: none; /* Hidden by default */
  border: 1px solid var(--border-color);
  animation: slideInNotification 0.3s ease;
}

.notification-center.visible {
  display: block;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: var(--primary-color);
  color: white;
}

.notification-header h3 {
  font-size: 1rem;
  margin: 0;
}

.notification-list {
  max-height: 350px;
  overflow-y: auto;
  padding: 0;
}

.in-app-notification {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-color);
  transition: background-color 0.2s;
  cursor: pointer;
}

.in-app-notification:hover {
  background-color: var(--hover-bg);
}

.in-app-notification.unread {
  border-left: 3px solid var(--primary-color);
}

.in-app-notification .notification-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.in-app-notification .notification-message {
  color: var(--text-light);
  font-size: 0.9rem;
}

.in-app-notification .notification-time {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 5px;
  text-align: right;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--high-priority);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
}

@keyframes slideInNotification {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Toast notification styling */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: var(--background-color);
  color: var(--text-color);
  border-left: 4px solid var(--primary-color);
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  animation: fadeInToast 0.3s, fadeOutToast 0.3s 4.7s;
  max-width: 350px;
}

.toast.warning {
  border-left-color: var(--medium-priority);
}

.toast.error {
  border-left-color: var(--high-priority);
}

.toast.success {
  border-left-color: var(--done-color);
}

@keyframes fadeInToast {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOutToast {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

/* Priority group headers */
.priority-group-header {
    padding: 10px 15px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    background-color: var(--bg-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.priority-header-left {
    display: flex;
    align-items: center;
    flex: 0;
    max-width: fit-content;
    margin-right: 5px;
}

.priority-task-count {
    font-size: 0.8rem;
    color: var(--text-light);
    background-color: var(--secondary-bg-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: normal;
    margin-left: 5px;
    text-align: left;
    display: inline-block;
}

.priority-group-header.priority-high i {
    color: var(--high-priority);
}

.priority-group-header.priority-medium i {
    color: var(--medium-priority);
}

.priority-group-header.priority-low i {
    color: var(--low-priority);
}

.priority-group-header.priority-none i {
    color: var(--text-light);
}

.priority-group-header i {
    margin-right: 8px;
    font-size: 1rem;
}

.priority-group-header span {
    font-size: 0.95rem;
}

.priority-group-header:first-child {
    margin-top: 0;
}

/* View task count in title */
.view-task-count {
    font-size: 0.8rem;
    color: var(--text-light);
    background-color: var(--secondary-bg-color);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: normal;
    display: inline-block;
    vertical-align: middle;
}

/* Blue star icon */
.blue-star {
    color: #3B82F6 !important; /* Primary blue color with !important to override any other styles */
}

/* Override for star icon color */
button.shortcut-btn.star-btn.starred i.fas.fa-star {
    color: #3B82F6 !important; /* Primary blue color */
}

button.shortcut-btn.star-btn:hover i {
    color: #3B82F6 !important; /* Primary blue color */
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.form-actions button {
    flex: 1;
    height: 44px;
    min-height: 44px;
    border-radius: var(--border-radius);
}

.form-actions > button,
.form-actions > .share-dropdown,
.form-actions > .task-export-dropdown {
    flex: 1;
}

.form-actions > .share-dropdown button,
.form-actions > .task-export-dropdown button {
    width: 100%;
}

.form-actions .button-label {
    margin-left: 6px;
}

.form-actions button {
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    line-height: 1;
}

.form-actions .button-primary {
    background-color: var(--primary-color);
    color: white;
}

.form-actions .button-primary:hover {
    background-color: var(--primary-color-dark);
}

.form-actions .button-danger {
    background-color: #DC2626;
    color: white;
}

.form-actions .button-danger:hover {
    background-color: #B91C1C;
}

/* Override any button styles that might be causing inconsistencies */
.button-primary, .button-danger {
    box-sizing: border-box;
    font-family: inherit;
    font-weight: normal;
}

/* Deletion notification with undo option */
.deletion-notification {
  background-color: var(--background-color);
  color: var(--text-color);
  border-left: 4px solid #DC2626;
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 350px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInToast 0.3s;
}

.deletion-notification .message {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deletion-notification .message i {
  color: #DC2626;
}

.deletion-notification .countdown {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

.deletion-notification .countdown-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.deletion-notification .countdown-timer {
  font-size: 0.8rem;
  font-weight: bold;
  color: #DC2626;
}

.deletion-notification .undo-button {
  background-color: #DC2626;
  color: white;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: background-color 0.2s;
}

.deletion-notification .undo-button:hover {
  background-color: #B91C1C;
}

/* Task form buttons */
#task-form .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 10px;
    margin-top: 15px;
}

#task-form .form-actions button {
    flex: 1;
    height: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    line-height: 1;
    text-align: center;
    margin: 0;
}

#task-form .form-actions .button-primary {
    background-color: var(--primary-color);
    color: white;
}

#task-form .form-actions .button-primary:hover {
    background-color: var(--primary-color-dark);
}

#task-form .form-actions .button-danger {
    background-color: #DC2626;
    color: white;
}

#task-form .form-actions .button-danger:hover {
    background-color: #B91C1C;
}

/* Due Date Changes Indicator */
.due-date-changes {
    margin-left: 4px;
    font-weight: 500;
    border-radius: 10px;
    padding: 1px 4px;
    font-size: 0.75rem;
}

.due-date-changes.medium-changes {
    color: var(--medium-priority); /* Orange */
}

.due-date-changes.high-changes {
    color: var(--high-priority); /* Red */
}

/* Floating Working Session Container */
.floating-working-session-container {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    max-width: 90%;
    z-index: 1000;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    justify-content: center;
    align-items: center;
  }

[data-theme="dark"] .floating-working-session-container {
    background-color: rgba(30, 41, 59, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
  
  /* Working Session Tag */
  .working-session-tag {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #fff;
    border-radius: 4px;
    border-left: 4px solid #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 180px;
    transition: all 0.2s ease;
    margin: 0;
  }

[data-theme="dark"] .working-session-tag {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
  
  .working-session-tag:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
  }
  
  /* Working Session Counter Tag */
  .working-session-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background-color: #f0f0f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
    font-size: 13px;
    white-space: nowrap;
  }

[data-theme="dark"] .working-session-counter {
    background-color: #111827;
    color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
  
  .working-session-counter:hover {
    background-color: #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
  }
  
  /* Priority Colors */
  .working-session-tag.priority-high {
    border-left-color: #ff4d4f;
  }
  
  .working-session-tag.priority-medium {
    border-left-color: #faad14;
  }
  
  .working-session-tag.priority-low {
    border-left-color: #52c41a;
  }
  
  /* Tag Name */
  .working-session-tag-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 6px;
    cursor: pointer;
    font-size: 13px;
  }
  
  /* Tag Buttons Container */
  .working-session-tag-buttons {
    display: flex;
    gap: 2px;
  }
  
  /* Tag Buttons */
  .working-session-tag-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
    font-size: 12px;
  }

[data-theme="dark"] .working-session-tag-btn {
    color: #d1d5db;
}

[data-theme="dark"] .working-session-tag-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .working-session-tag-btn.done {
    background-color: rgba(34, 197, 94, 0.15);
    color: #34d399;
}

[data-theme="dark"] .working-session-tag-btn.remove {
    background-color: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
  
  .working-session-tag-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  .working-session-tag-btn.done {
    background-color: #f0f0f0;
    color: #52c41a;
  }
  
  .working-session-tag-btn.done:hover {
    background-color: rgba(82, 196, 26, 0.1);
    color: #52c41a;
  }
  
  .working-session-tag-btn.remove {
    background-color: #f0f0f0;
    color: #ff4d4f;
  }
  
  .working-session-tag-btn.remove:hover {
    background-color: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
  }
  
  /* Responsive Adjustments */
  @media (max-width: 768px) {
    .floating-working-session-container {
      max-width: 95%;
      bottom: 10px;
      padding: 6px 10px;
      border-radius: 16px;
    }
    
    .working-session-tag {
      max-width: 150px;
      padding: 2px 4px;
    }
    
    .working-session-tag-name {
      font-size: 12px;
    }
    
    .working-session-tag-btn {
      width: 18px;
      height: 18px;
      font-size: 10px;
    }
    
    .working-session-counter {
      padding: 3px 8px;
      font-size: 12px;
    }
  }

/* ========================================
   V2: Recurrence Styles
   ======================================== */
.recurrence-section {
    margin: 20px 0;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: var(--border-radius-lg);
}

.recurrence-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.recurrence-options.hidden {
    display: none;
}

.interval-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.interval-input input {
    width: 70px;
}

.interval-input span {
    color: var(--text-light);
    font-size: 14px;
}

.weekly-days {
    margin: 15px 0;
}

.weekly-days.hidden {
    display: none;
}

.weekly-days label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-color);
}

.day-buttons {
    display: flex;
    gap: 6px;
}

.day-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.day-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.day-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Recurrence indicator on task item */
.task-recurrence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.task-recurrence-badge i {
    font-size: 10px;
}

/* ========================================
   V2: Plan Your Day Styles
   ======================================== */
.plan-day-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    font-size: 14px;
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

.plan-day-tasks {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.plan-day-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-day-task:hover {
    background: var(--secondary-color);
}

.plan-day-task.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.plan-day-task input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.plan-day-task-info {
    flex: 1;
}

.plan-day-task-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.plan-day-task-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.plan-day-task-date {
    color: var(--overdue-color);
}

.plan-day-task-priority {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.plan-day-task-priority.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--high-priority);
}

.plan-day-task-priority.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--medium-priority);
}

.plan-day-task-priority.low {
    background: rgba(59, 130, 246, 0.1);
    color: var(--low-priority);
}

.plan-day-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.plan-day-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.plan-day-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--done-color);
}

.plan-day-empty p {
    font-size: 16px;
}

/* ========================================
   V2: File Attachments Styles
   ======================================== */
.file-attachments-section {
    margin: 20px 0;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: var(--border-radius-lg);
}

.file-attachments-section > label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-color);
}

.task-files-list {
    margin-bottom: 12px;
}

.task-files-list:empty {
    display: none;
}

.task-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.task-file-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.task-file-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-size: 16px;
    flex-shrink: 0;
}

.task-file-info {
    flex: 1;
    min-width: 0;
}

.task-file-name {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.task-file-name a {
    color: var(--primary-color);
    text-decoration: none;
}

.task-file-name a:hover {
    text-decoration: underline;
}

.task-file-meta {
    font-size: 12px;
    color: var(--text-light);
}

.task-file-actions {
    display: flex;
    gap: 8px;
}

.task-file-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.task-file-btn.download {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

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

.task-file-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.task-file-btn.delete:hover {
    background: var(--danger-color);
    color: white;
}

.file-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-status {
    font-size: 13px;
    color: var(--text-light);
}

.file-upload-status.uploading {
    color: var(--primary-color);
}

.file-upload-status.success {
    color: var(--done-color);
}

.file-upload-status.error {
    color: var(--danger-color);
}

/* File type icons */
.file-icon-pdf { color: #dc2626; }
.file-icon-doc { color: #2563eb; }
.file-icon-xls { color: #16a34a; }
.file-icon-img { color: #8b5cf6; }
.file-icon-zip { color: #f59e0b; }
.file-icon-default { color: var(--text-light); }

/* ========================================
   V2: Task Card Indicators
   ======================================== */
.task-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.task-indicator i {
    font-size: 10px;
}

.files-indicator {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.recurrence-indicator {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* ========================================
   V2: Priority Dropdown
   ======================================== */
.priority-dropdown {
    position: relative;
    display: inline-block;
}

.priority-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 120px;
    padding: 4px 0;
    margin-top: 4px;
}

.priority-menu.open {
    display: block;
}

.priority-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    text-align: left;
    transition: background 0.15s;
}

.priority-option:hover {
    background: var(--secondary-color);
}

.priority-option i {
    font-size: 12px;
}

/* ========================================
   V2.1: Subtasks
   ======================================== */
.subtasks-section {
    margin-top: 8px;
    padding-top: 4px;
    border-top: none;
}

.subtasks-list {
    margin: 4px 0;
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

/* Subtask group - wraps top-level subtask and its children */
.subtask-group {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 4px;
    box-shadow: none;
    transition: all 0.2s ease;
}

.subtask-group:hover {
    border-color: transparent;
    box-shadow: none;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    position: relative;
}

.subtask-item:hover {
    background: rgba(59, 130, 246, 0.04);
}

.subtask-item.done {
    opacity: 0.65;
}

.subtask-item.done .subtask-name {
    text-decoration: line-through;
    color: var(--text-light);
}

/* Toggle Switch Styling */
.subtask-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.subtask-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.subtask-checkbox:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.subtask-checkbox:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.subtask-checkbox:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.subtask-item.done .toggle-slider {
    background-color: #10b981;
}

.subtask-checkbox {
    cursor: pointer;
}

.subtask-name {
    width: 100%;
    min-width: 120px;
    font-size: 13px;
    border: none;
    background: transparent;
    outline: none;
    padding: 2px 4px;
    padding-right: 40px; /* leave room for action buttons overlay */
    border-radius: 4px;
    transition: all 0.2s;
}

.subtask-name:focus {
    background: var(--secondary-color);
    border: 1px solid var(--primary-color);
}

.subtask-name.saved-flash {
    background: #d1fae5;
    border: 1px solid #10b981;
}

[data-theme="dark"] .subtask-name.saved-flash {
    background: #065f46;
    border: 1px solid #10b981;
}

.subtask-date {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    border: 0;
    padding: 0;
}

.subtask-date:hover,
.subtask-date:focus {
    border-color: var(--primary-color);
    background: white;
}

.subtask-time {
    width: 70px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-light);
    padding: 2px 6px;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.subtask-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
    position: absolute;
    right: 2px;
    top: 48%;
    transform: translateY(-50%);
}

.subtask-date-label {
    position: absolute;
    right: 4px;
    bottom: 6px;
    font-size: 10px;
    color: var(--text-light);
    pointer-events: none;
    background: white;
    border-radius: 8px;
    padding: 1px 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    opacity: 0;
}

.subtask-date-label.visible {
    opacity: 1;
}

.subtask-item:hover .subtask-actions {
    opacity: 1;
}

.subtask-action-btn {
    padding: 4px 6px;
    border: none;
    background: var(--secondary-color);
    cursor: pointer;
    color: var(--text-light);
    border-radius: 4px;
    transition: all 0.15s;
    font-size: 12px;
}

.subtask-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.subtask-action-btn.delete:hover {
    background: #ef4444;
    color: white;
}

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

.subtask-action-btn.add-nested:hover {
    background: #10b981;
    color: white;
}

/* Nested subtasks - removed old tree connectors, using left border instead */

/* Visual indicator for nested items - subtle left border only */
.subtask-item[data-depth="1"] {
    border-left: 3px solid #93c5fd;
    padding-left: 12px;
    margin-left: 20px;
}

.subtask-item[data-depth="2"] {
    border-left: 3px solid #60a5fa;
    padding-left: 12px;
    margin-left: 40px;
}

.subtask-item[data-depth="3"] {
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
    margin-left: 60px;
}

.subtask-item[data-depth="4"] {
    border-left: 3px solid #2563eb;
    padding-left: 12px;
    margin-left: 80px;
}

.add-subtask-area {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: stretch;
}

.subtask-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
    height: 44px;
    box-sizing: border-box;
}

.subtask-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#add-subtask-btn {
    padding: 0 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    flex-shrink: 0;
}

#add-subtask-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

#add-subtask-btn:active {
    transform: scale(0.98);
}

.add-nested-subtask {
    margin-left: 24px;
    margin-top: 4px;
    display: none;
}

.subtask-item:hover .add-nested-subtask {
    display: flex;
}

/* ========================================
   V2.1: Share Dropdown
   ======================================== */
.share-dropdown {
    position: relative;
    display: inline-block;
}

.share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 200px;
    padding: 4px 0;
    margin-bottom: 4px;
}

.share-menu.open {
    display: block;
}

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

.share-option:hover {
    background: var(--secondary-color);
}

.share-option i {
    font-size: 16px;
    color: #25D366; /* WhatsApp green */
}

/* ========================================
   V2.1: Export Dropdown
   ======================================== */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 200px;
    padding: 4px 0;
    margin-top: 4px;
}

.export-menu.open {
    display: block;
}

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

.export-option:hover {
    background: var(--secondary-color);
}

.export-option i {
    font-size: 14px;
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

/* ========================================
   V2.1: Context Menu
   ======================================== */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    padding: 4px 0;
}

.context-menu.hidden {
    display: none;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    text-align: left;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: var(--secondary-color);
}

.context-menu-item i {
    font-size: 14px;
    color: var(--text-light);
    width: 16px;
    text-align: center;
}

.context-menu-item.danger {
    color: var(--danger-color);
}

.context-menu-item.danger i {
    color: var(--danger-color);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ========================================
   V2.1: Task Export Dropdown
   ======================================== */
.task-export-dropdown {
    position: relative;
    display: inline-block;
}

.task-export-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 180px;
    padding: 4px 0;
    margin-bottom: 4px;
}

.task-export-menu.open {
    display: block;
}

.task-export-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    text-align: left;
    transition: background 0.15s;
}

.task-export-option:hover {
    background: var(--secondary-color);
}

.task-export-option i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.task-export-option i.fa-file-excel { color: #217346; }
.task-export-option i.fa-file-pdf { color: #dc2626; }
.task-export-option i.fa-file-word { color: #2b579a; }
.task-export-option i.fa-markdown { color: var(--text-color); }

/* ========================================
   Theme Toggle & Dark Mode Support
   ======================================== */
.sidebar-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

#theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    padding: 6px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

#theme-toggle-btn:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

/* Dark theme specific overrides */
[data-theme="dark"] .modal-content {
    background: var(--modal-bg);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .ql-toolbar {
    background: var(--input-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .ql-container {
    background: var(--input-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .ql-editor {
    color: var(--text-color);
}

[data-theme="dark"] .task-item {
    background: #1f2937;
    border-color: var(--border-color);
}

[data-theme="dark"] .task-item:hover {
    background: #2d3748;
}

[data-theme="dark"] .task-item.done-item {
    background: #1a202c;
}

[data-theme="dark"] .export-menu,
[data-theme="dark"] .share-menu,
[data-theme="dark"] .task-export-menu,
[data-theme="dark"] .context-menu {
    background: var(--modal-bg);
    border-color: var(--border-color);
}

/* Dark mode subtasks styling */
[data-theme="dark"] .subtask-group {
    background: #1f2937;
    border-color: var(--border-color);
}

[data-theme="dark"] .subtask-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .subtask-item:hover {
    background: rgba(96, 165, 250, 0.08);
}

[data-theme="dark"] .toggle-slider {
    background-color: #4b5563;
}

[data-theme="dark"] .toggle-slider:before {
    background-color: #e5e7eb;
}

[data-theme="dark"] .subtask-name:focus {
    background: var(--input-bg);
}

[data-theme="dark"] .subtask-date {
    background: var(--input-bg);
    color: var(--text-light);
}

[data-theme="dark"] .subtask-date:hover,
[data-theme="dark"] .subtask-date:focus {
    background: var(--hover-bg);
}

[data-theme="dark"] .subtask-input {
    background: var(--input-bg);
    color: var(--text-color);
}

[data-theme="dark"] .subtask-action-btn {
    background: var(--input-bg);
}

[data-theme="dark"] #add-subtask-btn {
    background: var(--primary-color);
}

[data-theme="dark"] #add-subtask-btn:hover {
    background: var(--primary-dark);
}

/* ========================================
   Theme Contrast Fixes (RNF-001)
   ======================================== */

/* Light theme - ensure proper contrast for labels and hints */
[data-theme="light"] label,
:root label {
    color: var(--text-color);
}

[data-theme="light"] .settings-hint,
:root .settings-hint {
    color: var(--text-light);
}

/* Dark theme - ensure proper contrast for all text elements */
[data-theme="dark"] label {
    color: var(--text-color);
}

[data-theme="dark"] .task-meta {
    color: var(--text-light);
}

[data-theme="dark"] .task-meta span {
    color: var(--text-light);
}

[data-theme="dark"] .task-tag {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-color: var(--border-color);
}

/* Ensure dropdown menus have proper contrast in both themes */
[data-theme="dark"] .export-option,
[data-theme="dark"] .share-option,
[data-theme="dark"] .task-export-option {
    color: var(--text-color);
}

[data-theme="dark"] .export-option:hover,
[data-theme="dark"] .share-option:hover,
[data-theme="dark"] .task-export-option:hover {
    background: var(--hover-bg);
}

/* Fix button-secondary contrast in dark mode */
[data-theme="dark"] .button-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .button-secondary:hover {
    background-color: var(--hover-bg);
}

/* Fix button-danger contrast in dark mode */
[data-theme="dark"] .button-danger {
    background-color: transparent;
    color: #f87171;
    border-color: #f87171;
}

[data-theme="dark"] .button-danger:hover {
    background-color: rgba(248, 113, 113, 0.1);
}

/* Ensure sort options have proper contrast */
[data-theme="dark"] .sort-options {
    background-color: var(--secondary-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .sort-options label {
    color: var(--text-color);
}

[data-theme="dark"] .sort-select {
    color: var(--primary-color);
}

/* Fix checkbox label contrast */
[data-theme="dark"] .checkbox-wrapper label,
[data-theme="dark"] .toggle-label {
    color: var(--text-light);
}

/* Ensure modal titles and form labels are readable */
[data-theme="dark"] .modal h3 {
    color: var(--text-color);
}

[data-theme="dark"] .modal form label {
    color: var(--text-color);
}

/* Fix plan day modal contrast */
[data-theme="dark"] .plan-day-tasks {
    color: var(--text-color);
}

/* Ensure notification center has proper contrast */
[data-theme="dark"] .notification-header h3 {
    color: var(--text-color);
}

[data-theme="dark"] .notification-list {
    color: var(--text-color);
}

/* Fix category count badge contrast in light mode */
[data-theme="light"] .category-count,
:root .category-count {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

/* Ensure Quill editor toolbar icons are visible in dark mode */
[data-theme="dark"] .ql-toolbar button {
    color: var(--text-light);
}

[data-theme="dark"] .ql-toolbar button:hover {
    color: var(--text-color);
}

[data-theme="dark"] .ql-toolbar .ql-stroke {
    stroke: var(--text-light);
}

[data-theme="dark"] .ql-toolbar .ql-fill {
    fill: var(--text-light);
}

[data-theme="dark"] .ql-toolbar button:hover .ql-stroke {
    stroke: var(--text-color);
}

[data-theme="dark"] .ql-toolbar button:hover .ql-fill {
    fill: var(--text-color);
}

[data-theme="dark"] .ql-toolbar .ql-picker-label {
    color: var(--text-light);
}

[data-theme="dark"] .ql-toolbar .ql-picker-options {
    background: var(--modal-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .ql-toolbar .ql-picker-item {
    color: var(--text-color);
}

/* ========================================
   Modal Header & Simplified Form
   ======================================== */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

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

#toggle-advanced-btn {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 16px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

#toggle-advanced-btn:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

#toggle-advanced-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.advanced-mode-fields {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

.advanced-only {
    display: none;
}

.task-form-advanced .advanced-only {
    display: inline-flex;
}

.task-form-advanced .advanced-mode-fields {
    display: block;
}

/* ========================================
   Autosave Status
   ======================================== */
.autosave-status {
    display: flex;
    align-items: center;
    margin-right: auto;
}

#autosave-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--done-color);
    animation: fadeIn 0.3s ease;
}

#autosave-indicator.saving {
    color: var(--text-light);
}

#autosave-indicator.saving i {
    animation: spin 1s linear infinite;
}

#autosave-indicator i {
    font-size: 14px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

#revert-task-btn {
    color: var(--text-light);
}

#revert-task-btn:hover {
    color: var(--primary-color);
}

/* ========================================
   User Menu Dropdown
   ======================================== */
.user-menu-container {
    position: relative;
}

#user-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    font-size: 1.2rem;
}

#user-menu-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    padding: 8px 0;
}

.user-dropdown-menu.hidden {
    display: none;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.user-menu-item:hover {
    background: var(--hover-bg);
}

.user-menu-item.danger {
    color: var(--high-priority);
}

.user-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-menu-item i {
    width: 16px;
    text-align: center;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ========================================
   Settings Modal
   ======================================== */
.settings-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.settings-section {
    background: var(--secondary-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.settings-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.settings-section h4 i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.settings-field {
    margin-bottom: 12px;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.settings-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.settings-field input[type="text"],
.settings-field input[type="email"],
.settings-field input[type="time"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.settings-field input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.settings-field.inline {
    display: inline-block;
    width: calc(50% - 8px);
    margin-right: 16px;
}

.settings-field.inline:last-child {
    margin-right: 0;
}

.settings-times {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.settings-test-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.settings-test-btns button {
    white-space: nowrap;
    flex: 1;
}

.settings-test-btns + .settings-hint {
    margin-top: 8px;
    display: block;
}

/* Toggle Switch */
.settings-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch-label {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 26px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-label input:checked + .switch-slider {
    background-color: var(--primary-color);
}

.switch-label input:checked + .switch-slider:before {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.9rem;
    color: var(--text-color);
}

.settings-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Dark theme adjustments for settings */
[data-theme="dark"] .settings-section {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .settings-field input {
    background: var(--input-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .switch-slider {
    background-color: var(--border-color);
}

[data-theme="dark"] .switch-slider:before {
    background-color: var(--text-color);
}

/* ========================================
   Summary Filters
   ======================================== */

.summary-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    margin-right: 4px;
}

.summary-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.summary-filter:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.summary-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 500;
}

/* ========================================
   Summary Tabs and Charts
   ======================================== */

.summary-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.summary-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -14px;
}

.summary-tab:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.summary-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
    transform: translateY(-2px);
}

.summary-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

.summary-tab i {
    font-size: 0.9rem;
}

/* Chart container */
.summary-chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin-top: 16px;
}

.summary-chart-container canvas {
    max-width: 100%;
}

/* Chart tooltip customization */
.chart-tooltip {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.chart-tooltip-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.chart-tooltip-tasks {
    max-height: 200px;
    overflow-y: auto;
}

.chart-tooltip-task {
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.chart-tooltip-task:last-child {
    border-bottom: none;
}

/* Dark theme chart adjustments */
[data-theme="dark"] .summary-tab {
    background: var(--card-bg);
}

[data-theme="dark"] .summary-tab:hover {
    background: var(--hover-bg);
}

/* ========================================
   Responsive / Mobile First Layout
   ======================================== */

/* Mobile breakpoint: screens narrower than 768px or in portrait orientation */
@media screen and (max-width: 768px), screen and (max-aspect-ratio: 3/4) {
    /* Show hamburger menu button */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Show close button, hide collapse button on mobile */
    .sidebar-close-btn {
        display: flex;
    }
    
    .sidebar-collapse-btn {
        display: none;
    }
    
    /* Sidebar becomes full-screen overlay on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        border-right: none;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Hide resize handle on mobile */
    .resize-handle {
        display: none;
    }
    
    /* Main content takes full width */
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    /* Adjust content header for mobile */
    .content-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .content-header-top {
        width: 100%;
    }
    
    .content-header h1 {
        font-size: 1.2rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Category toolbar adjustments for mobile */
    .category-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    
    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        justify-content: flex-start;
        width: 100%;
    }
    
    .toolbar-right {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Sidebar header adjustments */
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-header h1 {
        font-size: 1.2rem;
    }
    
    /* Sidebar sections */
    .sidebar-section {
        padding: 12px 16px;
    }
    
    /* Category list items larger touch targets */
    #category-list li,
    .special-views li {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    /* Task list adjustments */
    #task-list {
        padding: 8px;
    }
    
    /* Task card mobile layout - shortcuts in footer */
    .task-item {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .task-item .task-details-clickable {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .task-item .task-name {
        white-space: normal;
        word-break: break-word;
    }
    
    .task-item .task-meta {
        flex-wrap: wrap;
    }
    
    /* Task shortcuts as footer */
    .task-item .task-shortcuts {
        width: 100%;
        margin: 0;
        padding-top: 8px;
        border-top: 1px solid var(--border-color);
        justify-content: flex-start;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .task-item .task-shortcuts .shortcut-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    /* Hide less important shortcuts on mobile */
    .task-item .task-shortcuts .today-btn,
    .task-item .task-shortcuts .timer-btn {
        display: none;
    }
    
    /* Priority dropdown adjustments for mobile */
    .task-item .priority-dropdown {
        position: relative;
    }
    
    .task-item .priority-menu {
        left: 0;
        right: auto;
        min-width: 120px;
    }
    
    /* Summary filters scroll horizontally on mobile */
    .summary-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .summary-filter {
        flex-shrink: 0;
    }
    
    /* Summary tabs scroll horizontally on mobile */
    .summary-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .summary-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Chart container height adjustment */
    .summary-chart-container {
        height: 300px;
    }
    
    /* FAB positioning for mobile */
    .fab {
        bottom: 20px;
        right: 20px;
    }
    
    /* Modal adjustments for mobile */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    /* Task form modal full screen on mobile */
    #task-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    /* Task form footer buttons - icons only on mobile */
    #task-modal .form-actions button {
        padding: 8px 12px;
        font-size: 0; /* Hide text */
    }
    
    #task-modal .form-actions button i {
        font-size: 1rem; /* Show icon */
        margin: 0;
    }
    
    #task-modal .form-actions .button-label,
    #task-modal .task-export-dropdown .button-label,
    #task-modal .share-dropdown .button-label {
        display: none !important;
    }
    
    #task-modal .form-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Share and export dropdowns adjustments */
    #task-modal .share-dropdown button,
    #task-modal .task-export-dropdown button {
        padding: 8px 12px;
        font-size: 0;
    }
    
    #task-modal .share-dropdown button i,
    #task-modal .task-export-dropdown button i {
        font-size: 1rem;
        margin: 0;
    }
}

/* Tablet / medium screens - sidebar can be collapsed */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
        min-width: 180px;
    }
}

/* Desktop expand button when sidebar is collapsed */
@media screen and (min-width: 769px) {
    /* No extra padding needed since expand button is inline */
}