/* mytasks.html 特有樣式 */

.mytasks-container {
    max-width: 900px;
    margin: 0 auto;
}

.task-list-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.badge-overdue {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-today {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-week {
    background-color: var(--success-light);
    color: var(--success);
}

/* Section dot indicator */
.section-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-danger  { background-color: var(--danger); }
.dot-primary { background-color: var(--primary); }
.dot-success { background-color: var(--success); }

.task-list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Personal Task Row */
.personal-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    background-color: white;
}

.personal-task-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.task-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

/* Checkbox Styling */
.task-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0;
    border: 0;
    background: transparent;
    flex: 0 0 auto;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.task-checkbox-wrapper:hover .task-checkbox {
    border-color: var(--primary);
}

.task-checkbox i {
    color: white;
    display: none;
}

.task-checkbox-wrapper.checked .task-checkbox {
    background-color: var(--success);
    border-color: var(--success);
}

.task-checkbox-wrapper.checked .task-checkbox i {
    display: block;
}

.task-main-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-title-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.task-checkbox-wrapper.checked + .task-main-details .task-title-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.project-tag {
    background-color: var(--bg-hover);
    color: var(--text-main);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 550;
}

.task-row-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.task-report-btn {
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
}

#task-report-modal {
    padding: 16px;
    align-items: center;
}

#task-report-modal .modal-container {
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

#task-report-modal .modal-container:has(.searchable-select-wrapper) {
    overflow: hidden;
}

#task-report-form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

#task-report-modal .modal-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

#task-report-modal .modal-container:has(.searchable-select-wrapper) .modal-body {
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
}

#task-report-modal .modal-footer {
    flex-shrink: 0;
    background: white;
    position: relative;
    z-index: 2;
}

#task-report-modal .searchable-select-dropdown {
    z-index: 4;
}

/* Task Quick Status Changer - Consistent Searchable select custom styling */
.personal-task-row .searchable-select-wrapper {
    width: 120px;
    min-width: 120px;
}

.personal-task-row .searchable-select-input {
    padding: 5px 10px;
    font-size: 12px;
    height: 30px;
    font-weight: 500;
}

.personal-task-row .searchable-select-dropdown {
    width: 120px;
}

/* Summary Panel */
.task-summary-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.summary-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.summary-num {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
}

.task-scope-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.task-scope-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.task-scope-control {
    width: min(100%, 360px);
}

/* Modal size variant */
.modal-container-sm {
    max-width: 560px;
}

/* Priority badge small size */
.badge-sm {
    padding: 1px 6px !important;
    font-size: 10px !important;
}

/* Attachment section in report modal */
.attachment-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.attachment-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.attachment-item-info {
    min-width: 0;
}

.attachment-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.attachment-item-empty {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-sidebar);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.mytasks-empty-state {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    background: var(--bg-sidebar);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.mytasks-empty-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--text-muted);
    color: #ffffff;
    font-size: 10px;
}

@media (max-width: 760px) {
    .mytasks-container {
        max-width: none;
    }

    .task-scope-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .task-scope-control {
        width: 100%;
    }

    .task-summary-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .personal-task-row {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .task-row-right {
        justify-content: flex-end;
    }

    .task-meta-info {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
}
