/* ==========================================
   HEADER
========================================== */

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.tasks-header h1 {
    margin: 0;
    font-size: 36px;
}

.tasks-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.search-box input {
    width: 260px;
    padding: 13px 18px 13px 40px;
    border-radius: 14px;
    border: 1px solid #f2dce8;
    background: white;
    box-sizing: border-box;
    font-size: 14px;
}

.search-box input::placeholder {
    color: #9297a8;
}

.add-task-btn {
    background: #f45b9b;
    color: white;
    padding: 14px 24px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}


/* ==========================================
   TOOLBAR
========================================== */

.task-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 6px;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .04);
}

.filters a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    padding: 10px 18px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.15s ease;
}

.filters a:hover {
    background: #fff1f7;
    color: #f45b9b;
}

.filters a.active {
    background: #f45b9b;
    color: white;
}

.filter-icon {
    font-size: 13px;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

.sort-select {
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid #f2dce8;
    background: white;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}


/* ==========================================
   SECTIONS
========================================== */

.task-section {
    margin-bottom: 26px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    margin-bottom: 14px;
    background: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
    cursor: default;
    font-family: inherit;
}

.section-header.collapsible {
    cursor: pointer;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.section-icon {
    font-size: 15px;
}

.count-badge {
    background: #fde4ef;
    color: #f45b9b;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.count-badge.is-success {
    background: #e2f6ea;
    color: #21a35c;
}

.expand-all-btn {
    background: none;
    border: none;
    color: #f45b9b;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.chevron.is-open {
    transform: rotate(180deg);
}


/* ==========================================
   TASK GROUP / ROWS
========================================== */

.task-group {
    background: white;
    border-radius: 22px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .05);
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.task-group.is-collapsed {
    display: none;
}

.empty-state {
    margin: 0;
    padding: 24px;
    color: #9297a8;
    font-size: 14px;
    text-align: center;
}

.task-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #f5eef2;
}

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

.task-toggle-form {
    padding-top: 3px;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    accent-color: #f45b9b;
    cursor: pointer;
}

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

.task-main h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.task-main h3.is-done {
    color: #9297a8;
    text-decoration: line-through;
}

.task-meta {
    color: #9297a8;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    font-size: 12px;
}

.subtask-collapse {
    margin-top: 10px;
}

.subtask-count {
    color: #f45b9b;
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}

.subtask-count::-webkit-details-marker {
    display: none;
}

.subtasks {
    margin-top: 10px;
    padding-left: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtask-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #4b5563;
}

.subtask-row .task-completed {
    color: #9297a8;
    text-decoration: line-through;
}

.task-actions {
    position: relative;
}

.menu-btn {
    background: #f7f7fa;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
}

.menu-btn:hover {
    background: #fde4ef;
    color: #f45b9b;
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 38px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .12);
    padding: 8px;
    min-width: 150px;
    z-index: 10;
}

.menu-dropdown.is-open {
    display: flex;
    flex-direction: column;
}

.menu-dropdown a,
.menu-dropdown button {
    background: none;
    border: none;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.menu-dropdown a:hover,
.menu-dropdown button:hover {
    background: #fff1f7;
    color: #f45b9b;
}

.menu-dropdown form {
    display: contents;
}


/* ==========================================
   UPCOMING â€” GROUPED BY DATE
========================================== */

.upcoming-groups {
    background: white;
    border-radius: 22px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .05);
    overflow: hidden;
}

.upcoming-date-group {
    display: flex;
    border-bottom: 1px solid #f5eef2;
}

.upcoming-date-group:last-child {
    border-bottom: none;
}

.upcoming-date-group.is-hidden {
    display: none;
}

.upcoming-date-label {
    width: 130px;
    flex-shrink: 0;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-right: 1px solid #f5eef2;
}

.upcoming-day {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
}

.upcoming-date {
    color: #f45b9b;
    font-weight: 700;
    font-size: 13px;
}

.upcoming-date-tasks {
    flex: 1;
    min-width: 0;
}

.upcoming-date-tasks .task-row {
    padding: 20px 24px;
}

.view-all-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #f45b9b;
    font-weight: 600;
    font-size: 14px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
}
/* Fix search input text visibility */
input[type="text"] {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

input[type="text"]::placeholder {
    color: #9297a8 !important;
    opacity: 1;
}
#taskSearch {
    color: #1f2937 !important;
    background: #ffffff !important;
}

#taskSearch::placeholder {
    color: #9297a8 !important;
    opacity: 1;
}
.expand-all-btn:hover {
    color: #f45b9b !important;
    background: #fff1f7;
}

.expand-all-btn:hover .chevron {
    color: #f45b9b !important;
}
/* Light theme task modal */

#taskModal .modal-content,
.task-modal,
.modal-content {
    background: #ffffff !important;
    color: #172033 !important;
    border-radius: 24px;
}


#taskModal label,
.task-modal label,
.modal-content label {
    color: #172033 !important;
}


#taskModal input,
.task-modal input,
.modal-content input {
    background: #ffffff !important;
    color: #172033 !important;
    border: 1px solid #eadbe4 !important;
}


#taskModal input::placeholder,
.task-modal input::placeholder,
.modal-content input::placeholder {
    color: #9297a8 !important;
}


#taskModal .modal-title,
.task-modal h2,
.modal-content h2 {
    color: #172033 !important;
}


#taskModal .add-subtask,
.task-modal .add-subtask {
    background: #fff1f7 !important;
    color: #f45b9b !important;
}


#taskModal .save-btn {
    background: #f45b9b !important;
    color: white !important;
}


#taskModal .cancel-btn {
    background: #fff1f7 !important;
    color: #f45b9b !important;
}
.completed-header {
    display: flex !important;
    align-items: center;
    width: 100%;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 20px;
    text-align: left;
    color: #172033 !important;
}

.completed-header .section-title {
    font-size: 18px !important;
    font-weight: 700 !important;
}

.completed-header .chevron {
    margin-left: auto;
}
