/* --- 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 */

    --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;
}

* {
    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="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: white;
    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;
}

.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: none; /* Remove transition for resizing */
    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 */
}

/* 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 */
}
.sidebar h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}
.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;
}

/* 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 h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

/* 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;
    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;
}

.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;
  }
  
  /* 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;
  }
  
  .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;
  }
  
  .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;
  }
  
  .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: 3px 6px;
    }
    
    .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;
    }
  }
  