/* ===== TASK MANAGEMENT ===== */
.chat-view-tabs { display: none; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; padding: 0 10px; background: #fff; }
.chat-view-tabs.show { display: flex; }
.chat-view-tabs button { padding: 10px 20px; border: none; background: transparent; font-size: 13px; cursor: pointer; color: #999; border-bottom: 2px solid transparent; transition: all 0.2s; margin-bottom: -1px; }
.chat-view-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.tasks-view { display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; background: #f5f3f7; }
.tasks-view.show { display: flex; }
.messages-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.messages-wrap.hidden { display: none; }

.tasks-toolbar { padding: 10px 16px; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; display: flex; gap: 8px; align-items: center; background: #fff; }
.tasks-toolbar .task-add-btn { padding: 8px 16px; border: 2px solid var(--primary); border-radius: 10px; background: #fff; color: var(--primary); cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; flex-shrink: 0; }
.tasks-toolbar .task-add-btn:hover { background: var(--primary); color: #fff; }
.tasks-filters { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.filter-chip { padding: 5px 12px; border-radius: 16px; font-size: 12px; background: #f0e6ff; color: var(--primary); cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.filter-chip.active { background: var(--primary); color: #fff; }
.task-summary { font-size: 11px; color: #999; flex-shrink: 0; }

.tasks-container { flex: 1; overflow-y: auto; padding: 10px 16px; }
.tasks-empty { text-align: center; padding: 40px; color: #999; font-size: 14px; }

/* Task card */
.task-card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; border-left: 4px solid #ddd; cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.task-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.task-card.p-높음 { border-left-color: var(--danger); }
.task-card.p-보통 { border-left-color: var(--warning); }
.task-card.p-낮음 { border-left-color: var(--success); }
.task-card.s-완료 { opacity: 0.55; }
.task-card.s-완료 .task-title { text-decoration: line-through; color: #999; }
.task-card.s-보류 { opacity: 0.5; }

/* 1행: 상태뱃지 + 우선순위 */
.task-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.task-status { padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; flex-shrink: 0; }
.task-status.s-요청 { background: #fff3e0; color: #e65100; }
.task-status.s-진행 { background: #e3f2fd; color: #1565c0; }
.task-status.s-피드백 { background: #f3e5f5; color: #7b1fa2; }
.task-status.s-완료 { background: #e8f5e9; color: #2e7d32; }
.task-status.s-보류 { background: #eceff1; color: #546e6f; }
.task-priority { padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.task-priority.p-높음 { background: #ffebee; color: #c62828; }
.task-priority.p-보통 { background: #fff8e1; color: #f57f17; }
.task-priority.p-낮음 { background: #e8f5e9; color: #2e7d32; }
.task-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 11px; color: #aaa; }

/* 2행: 제목 */
.task-title { font-weight: 600; font-size: 14px; color: #333; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 3행: 설명 미리보기 */
.task-desc { font-size: 12px; color: #888; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }

/* 4행: 하단 메타 */
.task-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #aaa; flex-wrap: wrap; }
.task-meta-item { display: flex; align-items: center; gap: 3px; }
.task-meta-item.overdue { color: var(--danger); font-weight: 600; }
.task-avatars { display: flex; margin-left: auto; }
.task-avatar-sm { width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: bold; margin-left: -5px; border: 2px solid #fff; }
.task-avatar-sm:first-child { margin-left: 0; }

/* Task detail modal */
.task-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 400; align-items: center; justify-content: center; }
.task-modal.show { display: flex; }
.task-detail-box { background: #fff; border-radius: 16px; width: 480px; max-width: 92vw; max-height: 85vh; display: flex; flex-direction: column; }
.task-detail-head { padding: 18px 20px; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.task-detail-head h3 { font-size: 16px; color: #333; flex: 1; margin-right: 10px; word-break: break-word; }
.task-detail-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.task-detail-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.td-section { margin-bottom: 14px; }
.td-label { font-size: 11px; color: #999; font-weight: 600; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.td-select { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; }
.td-select:focus { border-color: var(--primary); }
.td-textarea { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; min-height: 126px; outline: none; line-height: 1.5; }
.td-textarea:focus { border-color: var(--primary); }
.td-input { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; }
.td-input:focus { border-color: var(--primary); }
.td-value { font-size: 13px; color: #555; }
.assignee-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.assignee-chip { display: flex; align-items: center; gap: 4px; background: #f0e6ff; padding: 4px 10px; border-radius: 12px; font-size: 12px; color: #333; }
.assignee-chip button { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 14px; padding: 0 2px; }
.add-assignee-btn { padding: 4px 10px; background: none; border: 1px dashed var(--primary); border-radius: 12px; color: var(--primary); cursor: pointer; font-size: 12px; }
.td-comments { border-top: 1px solid #eee; padding-top: 14px; margin-top: 14px; }
.td-comment { margin-bottom: 10px; padding: 8px 10px; background: #f8f8f8; border-radius: 8px; }
.td-comment-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 12px; }
.td-comment-nick { font-weight: 600; color: #333; }
.td-comment-time { color: #999; font-size: 11px; }
.td-comment-del { margin-left: auto; background: none; border: none; color: #999; cursor: pointer; font-size: 11px; }
.td-comment-del:hover { color: var(--danger); }
.td-comment-text { font-size: 13px; color: #555; word-break: break-word; }
.td-comment-history { background: #f0f4ff; border-left: 3px solid var(--primary); padding-left: 10px; }
.td-comment-history .td-comment-text { color: #666; font-size: 12px; font-style: italic; }
.td-save-btn { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; margin-top: 16px; font-size: 14px; transition: background 0.2s; }
.td-save-btn:hover { background: #663399; }

/* 첨부파일 */
.file-attach-area { margin-top: 8px; }
.file-attach-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; background: #f5f5f5; border: 1px dashed #bbb; border-radius: 8px; cursor: pointer; font-size: 12px; color: #666; transition: all 0.2s; }
.file-attach-btn:hover { background: #eee; border-color: var(--primary); color: var(--primary); }
.file-preview-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-preview-item { display: flex; align-items: center; gap: 4px; padding: 4px 10px; background: #f0e6ff; border-radius: 8px; font-size: 11px; color: #555; max-width: 200px; }
.file-preview-item .fp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-preview-item .fp-remove { background: none; border: none; color: #999; cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }
.file-preview-item .fp-remove:hover { color: var(--danger); }
.attach-list { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.attach-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #f8f5ff; border: 1px solid #e8e0f0; border-radius: 8px; font-size: 12px; color: #555; text-decoration: none; transition: background 0.2s; }
.attach-item:hover { background: #f0e6ff; }
.attach-item img.attach-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }
.attach-icon { font-size: 16px; flex-shrink: 0; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { color: #aaa; font-size: 10px; flex-shrink: 0; }
.td-comment-input { display: flex; gap: 6px; margin-top: 10px; align-items: flex-end; }
.td-comment-input input { flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; }
.td-comment-input input:focus { border-color: var(--primary); }
.td-comment-input button:not(.td-comment-attach-btn) { padding: 8px 14px; background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.td-comment-attach-btn { background: none; border: 1px solid #ddd; border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 16px; color: #999; flex-shrink: 0; line-height: 1; }
.td-comment-attach-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Create task modal */
.create-task-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 400; align-items: center; justify-content: center; }
.create-task-modal.show { display: flex; }
.create-task-box { background: #fff; border-radius: 16px; width: 440px; max-width: 92vw; max-height: 85vh; display: flex; flex-direction: column; }
.ct-header { padding: 18px 20px; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; }
.ct-header h3 { font-size: 16px; color: #333; }
.ct-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.ct-group { margin-bottom: 14px; }
.ct-label { font-size: 12px; font-weight: 600; color: #333; margin-bottom: 5px; display: block; }
.ct-actions { padding: 14px 20px; border-top: 1px solid #e5e5e5; display: flex; gap: 8px; flex-shrink: 0; }
.ct-actions button { flex: 1; padding: 12px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ct-btn-cancel { background: #f0f0f0; color: #666; }
.ct-btn-submit { background: var(--primary-gradient); color: #fff; }
.user-check { display: inline-flex; align-items: center; padding: 6px 10px; background: #f5f5f5; border-radius: 8px; cursor: pointer; font-size: 12px; gap: 4px; transition: all 0.2s; margin: 2px; }
.user-check:hover { background: #e8e8e8; }
.user-check.sel { background: #ede7f6; color: var(--primary); }
.user-check input { margin-right: 2px; }

/* Assignee picker modal */
.assignee-pick-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 500; align-items: center; justify-content: center; }
.assignee-pick-modal.show { display: flex; }
