/* ─── 프로젝트 관리 (projects.css) ─── */

/* 검색 */
.proj-search-wrap { position: relative; }
.proj-search {
  width: 200px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--txt);
  font-family: inherit; transition: border-color .15s;
}
.proj-search:focus { border-color: #D97706; outline: none; }

/* 주요 버튼 */
.proj-btn-primary {
  background: #D97706; color: #fff; border: none; padding: 8px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: background .15s;
}
.proj-btn-primary:hover { background: #B45309; }
.proj-btn-secondary {
  background: var(--bg); color: var(--txt2); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.proj-btn-secondary:hover { background: var(--bg3); border-color: var(--txt3); }
.proj-btn-danger {
  background: #fff; color: #D14343; border: 1px solid #D14343;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.proj-btn-danger:hover { background: #FDECEC; }

/* 사용법 배너 */
.proj-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; margin: 0 20px 12px; background: #FEF3DA;
  border-radius: 8px; font-size: 13px; color: #7A4A08;
}

/* 탭 */
.proj-tabs {
  display: flex; gap: 4px; padding: 0 20px 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.proj-tab {
  background: none; border: none; padding: 6px 14px; border-radius: 6px;
  font-size: 13px; color: var(--txt3); cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.proj-tab:hover { background: var(--bg3); }
.proj-tab-active { background: #FEF3DA; color: #D97706; font-weight: 500; }
.proj-tab-count {
  display: inline-block; min-width: 18px; text-align: center;
  background: var(--bg3); border-radius: 10px; padding: 1px 6px;
  font-size: 11px; margin-left: 4px;
}
.proj-tab-active .proj-tab-count { background: rgba(217,119,6,0.15); color: #D97706; }

/* 카드 그리드 */
.proj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px; padding: 0 20px 20px; overflow-y: auto; flex: 1;
  align-content: start;
}
.proj-empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  color: var(--txt3); font-size: 14px;
}

/* 카드 */
.proj-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 0; cursor: pointer; transition: all .15s; overflow: hidden;
  border-left: 4px solid #D97706;
  display: flex; flex-direction: column;
}
.proj-card:hover { border-color: #D97706; box-shadow: 0 2px 12px rgba(217,119,6,0.1); }
.proj-card-bar { display: none; }
.proj-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 0;
}
.proj-card-title {
  font-size: 16px; font-weight: 700; padding: 6px 18px 2px;
  color: #111827; line-height: 1.3;
}
.proj-card-desc {
  font-size: 12px; color: #6B7280; padding: 0 18px 10px; line-height: 1.4;
}
.proj-card-meta {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 18px 14px;
  font-size: 12px; color: #6B7280; border-top: 1px solid #F3F4F6;
}
.proj-meta-item { display: flex; align-items: center; gap: 3px; }
.proj-meta-label { font-size: 11px; color: #9CA3AF; }
.proj-meta-val { font-weight: 600; color: #374151; }
.proj-card-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 18px 14px; }

/* 상태 배지 */
.proj-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
}
.proj-due-warn {
  font-size: 11px; color: #D97706; font-weight: 600;
}

/* 태그 */
.proj-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; background: #F3F4F6; color: #6B7280;
}

/* 진척률 바 */
.proj-progress-wrap {
  display: flex; flex-direction: column; gap: 6px; padding: 4px 18px 14px;
}
.proj-progress-header {
  display: flex; justify-content: space-between; align-items: baseline;
}
.proj-progress-label { font-size: 11px; color: #6B7280; font-weight: 500; }
.proj-progress-bar {
  flex: 1; height: 8px; background: #E5E5E5; border-radius: 4px; overflow: hidden;
}
.proj-progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.proj-progress-text { font-size: 15px; font-weight: 700; min-width: 36px; text-align: right; }

/* ─── 상세 모달 ─── */
.proj-detail-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); display: flex; align-items: center;
  justify-content: center; padding: 20px; z-index: 1000;
}
.proj-detail-modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 680px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.proj-detail-header {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.proj-detail-title { font-size: 18px; font-weight: 600; margin: 4px 0 0; color: var(--txt); }
.proj-detail-desc { font-size: 13px; color: var(--txt3); margin: 6px 0 0; line-height: 1.5; }

/* 요약 카드 */
.proj-detail-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 16px 24px;
}
.proj-stat-card {
  background: var(--bg3); border-radius: 8px; padding: 10px 12px; text-align: center;
}
.proj-stat-label { font-size: 11px; color: var(--txt3); margin-bottom: 4px; }
.proj-stat-val { font-size: 18px; font-weight: 600; }
.proj-stat-sub { font-size: 11px; color: var(--txt3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.proj-detail-progress { padding: 0 24px 12px; }

/* 섹션 */
.proj-detail-section { padding: 12px 24px; border-top: 1px solid var(--border); }
.proj-section-head { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--txt); }
.proj-empty-small { font-size: 13px; color: var(--txt3); padding: 8px 0; }

/* 마일스톤 리스트 */
.proj-ms-list { display: flex; flex-direction: column; gap: 6px; }
.proj-ms-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; transition: background .1s;
}
.proj-ms-item:hover { background: var(--bg3); }
.proj-ms-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: #0F6E56; cursor: pointer; }
.proj-ms-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.proj-ms-dot.done { background: #0F6E56; }
.proj-ms-date { font-size: 12px; color: var(--txt3); min-width: 70px; }
.proj-ms-name { font-size: 13px; color: var(--txt); }
.proj-ms-done { opacity: 0.6; }
.proj-ms-done .proj-ms-name { text-decoration: line-through; }

/* 태스크 리스트 */
.proj-task-list { max-height: 280px; overflow-y: auto; }
.proj-task-group-label { font-size: 11px; color: var(--txt3); font-weight: 600; padding: 8px 0 4px; }
.proj-task-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 6px; font-size: 13px;
}
.proj-task-item:hover { background: var(--bg3); }
.proj-task-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.proj-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-task-assignee { font-size: 11px; color: var(--txt3); flex-shrink: 0; }
.proj-task-done { opacity: 0.5; }
.proj-task-done .proj-task-title { text-decoration: line-through; }

.proj-detail-meta {
  padding: 12px 24px; font-size: 11px; color: var(--txt3);
  border-top: 1px solid var(--border);
}

/* ─── 생성/수정 폼 모달 ─── */
.proj-form-modal { max-width: 580px; }
.proj-form-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.proj-form-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.proj-form-body { padding: 16px 24px; display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; }
.proj-form-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 24px; border-top: 1px solid var(--border);
}

.proj-field { display: flex; flex-direction: column; gap: 4px; }
.proj-field label { font-size: 12px; font-weight: 500; color: var(--txt2); }
.proj-field input[type="text"],
.proj-field input[type="date"],
.proj-field textarea,
.proj-field select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--bg); color: var(--txt); font-family: inherit;
  transition: border-color .15s;
}
.proj-field input:focus, .proj-field textarea:focus, .proj-field select:focus {
  border-color: #D97706; outline: none;
}
.proj-field textarea { resize: vertical; }
.proj-field-row { display: flex; gap: 12px; }

/* 컬러 피커 */
.proj-color-picker { display: flex; gap: 6px; padding: 4px 0; }
.proj-color-chip {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
}
.proj-color-chip:hover { transform: scale(1.15); }
.proj-color-sel { border-color: var(--txt); transform: scale(1.15); }

/* 담당자 칩 */
.proj-member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-member-chip {
  padding: 4px 12px; border-radius: 16px; font-size: 12px;
  background: #F3F4F6; color: #374151; cursor: pointer;
  transition: all .15s; border: 1px solid transparent; font-weight: 500;
}
.proj-member-chip.selected { background: #FEF3DA; color: #D97706; border-color: #D97706; }

/* 마일스톤 행 */
.proj-ms-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.proj-ms-date-input {
  width: 130px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; background: var(--bg); color: var(--txt); font-family: inherit;
}
.proj-ms-name-input {
  flex: 1; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; background: var(--bg); color: var(--txt); font-family: inherit;
}
.proj-ms-date-input:focus, .proj-ms-name-input:focus { border-color: #D97706; outline: none; }
.proj-ms-del {
  background: none; border: none; color: var(--txt3); cursor: pointer;
  font-size: 14px; padding: 4px; border-radius: 4px;
}
.proj-ms-del:hover { background: #FDECEC; color: #D14343; }

/* ─── 캘린더 마일스톤 마커 ─── */
.cal-ms-marker {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 500; padding: 1px 6px;
  border-radius: 4px; margin-top: 2px; cursor: default;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ms-pending {
  background: #FEF3DA; color: #7A4A08;
}
.cal-ms-done {
  background: #E1F5EE; color: #0F6E56;
}
.cal-ms-diamond { font-size: 8px; flex-shrink: 0; }
.cal-ms-pending .cal-ms-diamond { color: #D97706; }
.cal-ms-done .cal-ms-diamond { color: #0F6E56; }
.cal-legend-ms i { color: #D97706; font-style: normal; }

/* 카드 + 버튼 */
.proj-card-add-btn {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--border); background: #fff;
  font-size: 16px; line-height: 1; color: #D97706;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all .15s;
  font-family: inherit;
}
.proj-card-add-btn:hover {
  background: #FEF3DA; border-color: #D97706;
}
