/* =====================================================
   Verdi CRM — 팀 보고서 v4.23
   인원별 집약 카드 + 타임라인 뷰
   ===================================================== */

/* ────────────────────────────────────────────────────
   1. 인원별 카드 그리드 — v4.23.2 5열 기준 이름 가독성
   ──────────────────────────────────────────────────── */
/* style.css의 .rpt-team-gallery 3열 그리드를 해제 — rpt-person-grid가 전체 너비를 써야 함 */
.rpt-team-gallery { display: block; }

.rpt-person-grid {
  display: grid;
  /* 기본: 5열 고정 — 카드 너비 충분히 확보 */
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 4px 2px 24px;
}

/* ── 인원 카드 (컴팩트) ── */
.rpt-person-card {
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rpt-person-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.38);
  border-color: rgba(99,179,237,0.4);
}
.rpt-person-card:focus-visible {
  outline: 2px solid #63b3ed;
  outline-offset: 2px;
}

/* 상단 상태 바 (가로) */
.rpt-pc-status-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.rpt-pc-submitted .rpt-pc-status-bar { background: linear-gradient(90deg, #48bb78, #38a169); }
.rpt-pc-draft     .rpt-pc-status-bar { background: linear-gradient(90deg, #ed8936, #dd6b20); }
.rpt-pc-reviewed  .rpt-pc-status-bar { background: linear-gradient(90deg, #63b3ed, #4299e1); }

/* ── 카드 헤더 — 2행 구조 (이름 항상 전체 표시) ── */
.rpt-pc-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 12px 10px 14px;
}

/* 1행: 이름 + 건수 배지 */
.rpt-pc-head-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 2행: 역할 배지 */
.rpt-pc-head-row2 {
  display: flex;
  align-items: center;
}

/* 아바타 — 인원 카드에서는 미사용 (타임라인 헤더용만 유지) */
.rpt-person-card .rpt-pc-avatar { display: none; }

.rpt-pc-head-info {
  flex: 1;
  min-width: 0;
}
.rpt-pc-name {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.rpt-pc-role {
  margin-top: 0;
}

/* 건수 배지 — 우측 */
.rpt-pc-count-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(99,179,237,0.13);
  border: 1px solid rgba(99,179,237,0.28);
  border-radius: 8px;
  padding: 5px 10px;
  flex-shrink: 0;
  min-width: 40px;
}
.rpt-pc-count-num {
  font-size: 20px;
  font-weight: 800;
  color: #63b3ed;
  line-height: 1;
}
.rpt-pc-count-unit {
  font-size: 9px;
  color: #90cdf4;
  margin-top: 1px;
}

/* ── KPI 3종 (가로 균등 분할) ── */
.rpt-pc-kpi {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rpt-pc-kpi-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rpt-pc-kpi-item i {
  font-size: 11px;
  color: #718096;
}
.rpt-pc-kpi-val {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1;
}
.rpt-pc-kpi-lbl {
  font-size: 9px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.rpt-pc-kpi-sep {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
}

/* ── 상태 진행 바 ── */
.rpt-pc-progress {
  padding: 8px 14px 6px;
}
.rpt-pc-progress-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  gap: 1px;
}
.rpt-pc-prog-reviewed  { background: #4299e1; border-radius: 3px; }
.rpt-pc-prog-submitted { background: #48bb78; border-radius: 3px; }
.rpt-pc-prog-draft     { background: #ed8936; border-radius: 3px; }
.rpt-pc-progress-legend {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.rpt-pc-leg {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #a0aec0;
}
.rpt-pc-leg i { font-size: 9px; }
.rpt-pc-leg-reviewed  i { color: #63b3ed; }
.rpt-pc-leg-submitted i { color: #68d391; }
.rpt-pc-leg-draft     i { color: #fbd38d; }

/* ── 카테고리 칩 ── */
.rpt-pc-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 14px 8px;
}
.rpt-pc-cat-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 카드 푸터 ── */
.rpt-pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}
.rpt-pc-date-range {
  font-size: 11px;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 4px;
}
.rpt-pc-cta {
  font-size: 12px;
  font-weight: 600;
  color: #63b3ed;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}
.rpt-person-card:hover .rpt-pc-cta { gap: 7px; }

/* ────────────────────────────────────────────────────
   2. 인원별 타임라인 뷰 (전체 컨테이너)
   ──────────────────────────────────────────────────── */
.rpt-person-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 40px;
}

/* ── 타임라인 헤더 ── */
.rpt-pt-header {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rpt-pt-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #a0aec0;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.rpt-pt-back-btn:hover {
  background: rgba(99,179,237,0.15);
  color: #63b3ed;
}

.rpt-pt-person-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rpt-pt-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c6ef5, #7c4dff);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(76,110,245,0.4);
}
.rpt-pt-person-text { flex: 1; }
.rpt-pt-name {
  font-size: 20px;
  font-weight: 800;
  color: #e2e8f0;
  margin: 0 0 4px;
}
.rpt-pt-period {
  font-size: 12px;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 5px;
}
.rpt-pt-role-badge { flex-shrink: 0; }

/* KPI 행 */
.rpt-pt-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.rpt-pt-kpi-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.rpt-pt-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: #e2e8f0;
  line-height: 1;
}
.rpt-pt-kpi-lbl {
  font-size: 10px;
  color: #718096;
  margin-top: 3px;
}
.rpt-pt-kv-reviewed  { color: #63b3ed; }
.rpt-pt-kv-submitted { color: #68d391; }
.rpt-pt-kv-draft     { color: #fbd38d; }

/* ────────────────────────────────────────────────────
   3. 타임라인 레이아웃
   ──────────────────────────────────────────────────── */
.rpt-pt-timeline {
  position: relative;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* 세로 선 */
.rpt-pt-tl-line {
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(99,179,237,0.4) 0%,
    rgba(99,179,237,0.08) 100%);
  border-radius: 1px;
}

/* 카드 래퍼 */
.rpt-pt-card-wrap {
  position: relative;
  margin-bottom: 20px;
}

/* 타임라인 도트 */
.rpt-pt-tl-dot {
  position: absolute;
  left: -26px;
  top: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.rpt-pt-tl-dot-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #1a202c;
}
.rpt-gal-submitted .rpt-pt-tl-dot-inner {
  background: #48bb78;
  box-shadow: 0 0 0 3px rgba(72,187,120,0.25);
}
.rpt-gal-draft .rpt-pt-tl-dot-inner {
  background: #ed8936;
  box-shadow: 0 0 0 3px rgba(237,137,54,0.25);
}
.rpt-gal-reviewed .rpt-pt-tl-dot-inner {
  background: #63b3ed;
  box-shadow: 0 0 0 3px rgba(99,179,237,0.25);
}

/* ── 타임라인 카드 ── */
.rpt-pt-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.rpt-pt-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.rpt-gal-submitted.rpt-pt-card { border-left: 3px solid #48bb78; }
.rpt-gal-draft.rpt-pt-card     { border-left: 3px solid #ed8936; }
.rpt-gal-reviewed.rpt-pt-card  { border-left: 3px solid #63b3ed; }

/* 카드 헤더 */
.rpt-pt-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rpt-pt-card-date {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}
.rpt-pt-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rpt-pt-card-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #718096;
}
.rpt-pt-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rpt-cmt-indicator { color: #f6ad55; }
.rpt-supp-indicator { color: #76e4f7; }

/* 카테고리 칩 */
.rpt-pt-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* 업무 항목 목록 */
.rpt-pt-card-items {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 개별 업무 항목 */
.rpt-tl-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.12s;
}
.rpt-tl-item:hover {
  background: rgba(255,255,255,0.06);
}
.rpt-tl-item-left {
  flex-shrink: 0;
  padding-top: 1px;
}
.rpt-tl-item-body {
  flex: 1;
  min-width: 0;
}
.rpt-tl-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.4;
}
.rpt-tl-item-detail {
  font-size: 12px;
  color: #a0aec0;
  margin-top: 2px;
  line-height: 1.4;
}
.rpt-tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.rpt-tl-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(99,179,237,0.12);
  color: #90cdf4;
  border: 1px solid rgba(99,179,237,0.2);
  display: flex;
  align-items: center;
  gap: 3px;
}
.rpt-tl-tag-prod {
  background: rgba(154,102,225,0.12);
  color: #d6bcfa;
  border-color: rgba(154,102,225,0.2);
}
.rpt-tl-item-dur {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #63b3ed;
  background: rgba(99,179,237,0.1);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  align-self: flex-start;
}

/* 내일 계획 */
.rpt-pt-tomorrow {
  margin: 6px 14px 8px;
  padding: 8px 12px;
  background: rgba(246,173,85,0.08);
  border: 1px solid rgba(246,173,85,0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #fbd38d;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.rpt-pt-tomorrow-lbl {
  font-weight: 700;
  flex-shrink: 0;
}

/* 카드 푸터 (상세 보기 버튼) */
.rpt-pt-card-foot {
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: flex-end;
}
.rpt-pt-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(99,179,237,0.1);
  border: 1px solid rgba(99,179,237,0.2);
  color: #63b3ed;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.rpt-pt-detail-btn:hover {
  background: rgba(99,179,237,0.2);
  box-shadow: 0 2px 8px rgba(99,179,237,0.2);
}
.rpt-pt-detail-btn i:last-child {
  font-size: 10px;
  transition: transform 0.15s;
}
.rpt-pt-detail-btn:hover i:last-child {
  transform: translateX(2px);
}

/* 미읽음 도트 */
.rpt-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fc8181;
  box-shadow: 0 0 0 2px rgba(252,129,129,0.3);
  flex-shrink: 0;
}

/* ────────────────────────────────────────────────────
   4. 반응형
   ──────────────────────────────────────────────────── */

/* 1600px 이상 → 최대 6열 허용 (인원 많을 때만) */
@media (min-width: 1600px) {
  .rpt-person-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 1200~1599px → 5열 (기본 타깃) */
@media (min-width: 1200px) and (max-width: 1599px) {
  .rpt-person-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 900~1199px → 4열 */
@media (min-width: 900px) and (max-width: 1199px) {
  .rpt-person-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 640~899px → 3열 */
@media (min-width: 640px) and (max-width: 899px) {
  .rpt-person-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 640px 미만 → 2열 */
@media (max-width: 639px) {
  .rpt-person-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* 타임라인 반응형 */
@media (max-width: 768px) {
  .rpt-pt-kpi-row { gap: 6px; }
  .rpt-pt-kpi-item { padding: 6px 10px; min-width: 50px; }
  .rpt-pt-timeline { padding-left: 22px; }
  .rpt-pt-tl-line  { left: 6px; }
  .rpt-pt-tl-dot   { left: -18px; width: 14px; height: 14px; }
  .rpt-tl-item     { flex-wrap: wrap; }
  .rpt-pt-person-info { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .rpt-pt-card-head { flex-direction: column; align-items: flex-start; }
  .rpt-pc-count-num { font-size: 18px; }
  .rpt-pc-name      { font-size: 14px; }
}
