/* ═══════════════════════════════════════════════════════
   BizFlow — report.css
   보고서 페이지 전용 스타일
   ═══════════════════════════════════════════════════════ */

/* ── 페이지 레이아웃 ── */
#report-main {
  padding: 20px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── 페이지 헤더 ── */
.rp-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.rp-page-title {
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.rp-page-title i { color: var(--accent); }

/* ── 기간 필터 바 ── */
.rp-period-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.rp-unit-group {
  display: flex; gap: 4px;
}
.rp-unit-btn {
  padding: 6px 13px; border-radius: var(--radius-s);
  font-size: 12px; font-weight: 600;
  color: var(--text2); border: 1px solid var(--border);
  transition: all .15s;
}
.rp-unit-btn:hover { color: var(--text); background: var(--bg3); }
.rp-unit-active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* ── 피커 래퍼 ── */
#rp-picker-wrap {
  display: flex; align-items: center; gap: 2px;
}
.rp-picker-nav {
  width: 28px; height: 28px; border-radius: var(--radius-s);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; cursor: pointer; gap: 0;
}
.rp-picker-nav:hover { color: var(--text); border-color: var(--accent); }
.rp-picker-display {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: var(--radius-s);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  min-width: 160px; justify-content: center;
}
.rp-picker-display:hover { border-color: var(--accent); }
.rp-picker-display i { color: var(--accent); font-size: 12px; }

/* ── 달력 팝업 ── */
.rp-cal-popup {
  position: absolute; z-index: 9999;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.45);
  padding: 12px; min-width: 240px;
  animation: rpCalIn .12s ease;
}
@keyframes rpCalIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 달력 헤더 ── */
.rp-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 4px;
}
.rp-cal-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  flex: 1; text-align: center;
}
.rp-cal-nav {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  cursor: pointer; transition: all .12s; flex-shrink: 0;
}
.rp-cal-nav:hover { color: var(--text); border-color: var(--accent); background: rgba(99,102,241,.12); }

/* ── 날짜 달력 테이블 ── */
.rp-cal-table {
  width: 100%; border-collapse: collapse;
  table-layout: fixed;
}
.rp-cal-table th {
  font-size: 10px; color: var(--text2); font-weight: 700;
  text-align: center; padding: 3px 0; width: calc(100%/7);
}
.rp-cal-table th.rp-cal-wknd { color: #ef4444; }
.rp-cal-day {
  text-align: center; padding: 5px 2px;
  font-size: 12px; cursor: pointer;
  border-radius: 6px; transition: background .1s;
  color: var(--text);
}
.rp-cal-day:hover { background: rgba(99,102,241,.18); color: #a5b4fc; }
.rp-cal-other { padding: 5px; }
.rp-cal-today { color: var(--accent) !important; font-weight: 800; }
.rp-cal-sel {
  background: var(--accent) !important;
  color: #fff !important; border-radius: 6px; font-weight: 700;
}

/* ── 주 선택 ── */
.rp-cal-week-row {
  cursor: pointer; border-radius: 6px;
  transition: background .1s;
}
.rp-cal-week-row:hover td { background: rgba(99,102,241,.12); }
.rp-cal-week-row:hover td:first-child { border-radius: 6px 0 0 6px; }
.rp-cal-week-row:hover td:last-child  { border-radius: 0 6px 6px 0; }
.rp-cal-week-sel td {
  background: rgba(99,102,241,.18) !important;
  color: #a5b4fc;
}
.rp-cal-week-sel td:first-child { border-radius: 6px 0 0 6px; }
.rp-cal-week-sel td:last-child  { border-radius: 0 6px 6px 0; }
.rp-cal-week-hint {
  font-size: 10px; color: var(--text3);
  margin-bottom: 6px; display: flex; align-items: center; gap: 4px;
}

/* ── 월 선택 그리드 ── */
.rp-cal-month-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 4px 0;
}
.rp-cal-month-cell {
  text-align: center; padding: 9px 4px;
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text);
  border: 1px solid transparent;
  transition: all .12s;
}
.rp-cal-month-cell:hover { background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.3); color: #a5b4fc; }

/* ── 연도 선택 그리드 ── */
.rp-cal-year-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 4px 0;
}
.rp-cal-year-cell {
  text-align: center; padding: 8px 4px;
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text);
  border: 1px solid transparent;
  transition: all .12s;
}
.rp-cal-year-cell:hover { background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.3); color: #a5b4fc; }

/* 공통 선택/오늘 */
.rp-cal-month-cell.rp-cal-sel,
.rp-cal-year-cell.rp-cal-sel {
  background: var(--accent) !important; color: #fff !important;
  border-color: var(--accent) !important;
}
.rp-cal-month-cell.rp-cal-today,
.rp-cal-year-cell.rp-cal-today {
  border-color: var(--accent); color: var(--accent);
}

.rp-date-sep { color: var(--text2); font-size: 13px; }
.rp-period-label {
  font-size: 12px; color: var(--accent); font-weight: 600;
  margin-left: 4px; white-space: nowrap;
}

/* ── 탭 네비 ── */
.rp-tabs {
  display: flex; gap: 4px;
  margin-bottom: 20px; border-bottom: 2px solid var(--border);
  padding-bottom: 0; flex-wrap: wrap;
}
.rp-tab {
  padding: 10px 18px; border-radius: var(--radius-s) var(--radius-s) 0 0;
  font-size: 13px; font-weight: 600;
  color: var(--text2); border: 1px solid transparent;
  border-bottom: none; transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.rp-tab:hover { color: var(--text); background: var(--bg3); }
.rp-tab-active {
  background: var(--bg2); color: var(--text);
  border-color: var(--border);
  margin-bottom: -2px; border-bottom: 2px solid var(--bg2);
}

/* ── 탭 컨텐츠 ── */
.rp-tab-content { display: none; }
.rp-tab-content.active { display: block; }

/* ── 요약 카드 그리드 ── */
.rp-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.rp-summary-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color .15s;
}
.rp-summary-card:hover { border-color: var(--accent); }
.rp-summary-label {
  font-size: 11px; color: var(--text2); margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.rp-summary-value {
  font-size: 20px; font-weight: 700;
  line-height: 1;
}
.rp-summary-sub {
  font-size: 11px; color: var(--text2); margin-top: 4px;
}

/* ── 색상별 고객유형 섹션 ── */
.rp-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.rp-color-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s;
}
.rp-color-card:hover { border-color: var(--accent); }
.rp-color-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
}
.rp-color-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
}
.rp-color-type-name {
  font-size: 13px; font-weight: 700; flex: 1;
}
.rp-color-count {
  font-size: 11px; color: var(--text2);
  background: var(--bg3); border-radius: 20px;
  padding: 2px 8px;
}
.rp-color-card-body {
  padding: 0 14px 14px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rp-color-stat {
  display: flex; flex-direction: column; gap: 2px;
}
.rp-color-stat-label {
  font-size: 10px; color: var(--text2);
}
.rp-color-stat-value {
  font-size: 14px; font-weight: 700;
}
.rp-color-bar-wrap {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
}
.rp-bar-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 11px;
}
.rp-bar-label { color: var(--text2); width: 50px; flex-shrink: 0; }
.rp-bar-track {
  flex: 1; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden;
}
.rp-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.rp-bar-pct { color: var(--text2); width: 36px; text-align: right; flex-shrink: 0; }

/* ── 유형 카드 프로젝트 리스트 ── */
.rp-color-chevron {
  font-size: 9px; color: var(--text2);
  margin-left: auto; transition: transform .25s;
}
.rp-color-card.expanded .rp-color-chevron { transform: rotate(180deg); }
.rp-color-proj-list {
  display: none;
  border-top: 1px solid var(--border);
  max-height: 320px; overflow-y: auto;
}
.rp-color-card.expanded .rp-color-proj-list { display: block; }

/* ── 테이블 공통 ── */
.rp-table-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.rp-table-title {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.rp-table-title i { color: var(--accent); }
.rp-scroll { overflow-x: auto; max-height: 480px; overflow-y: auto; }
.rp-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.rp-table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg3); color: var(--text2);
  font-size: 11px; font-weight: 600;
  padding: 10px 12px; text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.rp-table th:first-child { text-align: left; }
.rp-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.rp-table tr:last-child td { border-bottom: none; }
.rp-table tr:hover td { background: var(--bg3); }
.rp-table .rp-num { text-align: right; font-family: monospace; }
.rp-table .rp-owner-row td {
  font-weight: 700; cursor: pointer;
  background: var(--bg3);
}
.rp-table .rp-owner-row:hover td { background: var(--bg2); filter: brightness(1.05); }
.rp-table .rp-detail-row { display: none; }
.rp-table .rp-owner-block.expanded .rp-detail-row { display: table-row; }
.rp-chevron { transition: transform .2s; margin-left: 4px; }
.rp-owner-block.expanded .rp-chevron { transform: rotate(180deg); }

/* ── 비율 바 ── */
.rp-ratio-wrap {
  height: 4px; background: var(--bg3); border-radius: 2px;
  overflow: hidden; margin-bottom: 2px;
}
.rp-ratio-bar { height: 100%; background: var(--green); border-radius: 2px; }
.rp-ratio-bar-quote { background: var(--accent); }
.rp-ratio-pct { font-size: 11px; color: var(--text2); }

/* ── 상태 배지 ── */
.rp-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.rp-badge-active    { background: rgba(16,185,129,.12);  color: #10b981; }
.rp-badge-completed { background: rgba(99,102,241,.12);  color: #818cf8; }
.rp-badge-paused    { background: rgba(245,158,11,.12);  color: #f59e0b; }
.rp-badge-dropout   { background: rgba(239,68,68,.12);   color: #f87171; }
.rp-badge-dropout2  { background: rgba(239,68,68,.08);   color: #fca5a5; }

/* ── 연간 그래프 ── */
.rp-chart-section {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.rp-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.rp-chart-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.rp-chart-title i { color: var(--accent); }
.rp-chart-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.rp-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text2);
}
.rp-legend-dot {
  width: 10px; height: 10px; border-radius: 2px;
}
.rp-chart-container {
  position: relative; height: 280px;
}
.rp-chart-year-nav {
  display: flex; align-items: center; gap: 10px;
}
.rp-year-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); color: var(--text2);
  font-size: 12px; transition: all .15s;
}
.rp-year-btn:hover { color: var(--text); background: var(--bg3); }
.rp-year-label { font-size: 14px; font-weight: 700; min-width: 60px; text-align: center; }

/* ── 영업사원 섹션 ── */
.rp-salesperson-row {
  display: flex; align-items: center; gap: 8px;
}
.rp-salesperson-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ── 빈 상태 ── */
.rp-empty {
  text-align: center; padding: 48px 20px; color: var(--text2);
}
.rp-empty i { font-size: 36px; margin-bottom: 12px; display: block; opacity: .4; }
.rp-empty p { font-size: 14px; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .rp-page-header { flex-direction: column; align-items: flex-start; }
  .rp-period-bar { flex-direction: column; align-items: flex-start; }
  .rp-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .rp-color-grid { grid-template-columns: 1fr; }
  .rp-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rp-chart-container { height: 200px; }
}

/* ═══════════════════════════════════════════════════════
   담당자별 월별 계약금액 그래프 (영업팀/공무팀 공용)
   ═══════════════════════════════════════════════════════ */

/* rp-*-wrap 단위로 show/hide — 내부 요소는 display 제어 불필요 */

/* ═══════════════════════════════════════════════════════
   목표 설정 바
   ═══════════════════════════════════════════════════════ */
.rp-goal-bar {
  margin-top: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 22px;
}

.rp-goal-bar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.rp-goal-bar-header i { color: #ef4444; }
.rp-goal-bar-hint {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--text3);
}

/* 3열 그리드 */
.rp-goal-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .rp-goal-items { grid-template-columns: 1fr; }
}

/* 개별 항목 */
.rp-goal-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 레이블 행 */
.rp-goal-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rp-goal-icon { font-size: 13px; flex-shrink: 0; }
.rp-goal-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  flex-shrink: 0;
}
.rp-goal-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  outline: none;
  transition: border-color .15s;
}
.rp-goal-input:focus { border-color: var(--accent); }
.rp-goal-unit {
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}
/* 개인합산 목표바 — 실적 금액 강조 */
.rp-goal-sum-actual {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.3px;
}

/* 진행 바 */
.rp-goal-track {
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.rp-goal-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
  min-width: 2px;
}
.rp-goal-fill.rp-goal-over {
  background: #10b981 !important;
  box-shadow: 0 0 6px rgba(16,185,129,.5);
}

/* 통계 행 */
.rp-goal-stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
}
.rp-goal-actual {
  font-size: 13px;
  font-weight: 700;
}
.rp-goal-pct {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
}
.rp-goal-pct-over { color: #10b981 !important; border-color: #10b981 !important; }
.rp-goal-pct-none {
  margin-left: auto;
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
}
.rp-goal-gap {
  width: 100%;
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}
.rp-goal-gap i { margin-right: 3px; }

/* ═══════════════════════════════════════════════════════
   영업사원별 목표 카드
   ═══════════════════════════════════════════════════════ */
.rp-spgoal-section {
  margin-top: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 22px;
}

/* 사원별 목표 섹션 헤더 */
.rp-spgoal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* 사원 명부 추가 입력 행 */
.rp-staff-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.rp-staff-add-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
}
.rp-staff-add-input:focus { outline: none; border-color: var(--accent); }
.rp-staff-add-btn {
  height: 34px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity .15s;
}
.rp-staff-add-btn:hover { opacity: .85; }

/* 카드 헤더 삭제 버튼 */
.rp-staff-del-btn {
  margin-left: auto;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: var(--text3, #475569);
  cursor: pointer;
  font-size: 11px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.rp-spgoal-card:hover .rp-staff-del-btn { opacity: 1; }
.rp-staff-del-btn:hover { color: #ef4444; }

/* 담당자 카드 그리드 — 최대 4열, 데이터 적으면 자동 조정 */
.rp-spgoal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* 카드 */
.rp-spgoal-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s;
}
.rp-spgoal-card:hover { border-color: var(--accent); }

/* 카드 헤더: 아바타 + 이름 */
.rp-spgoal-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rp-spgoal-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* 지표 목록 */
.rp-spgoal-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 개별 지표 */
.rp-spgoal-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rp-spgoal-metric-top {
  display: flex;
  align-items: center;
  gap: 5px;
}
.rp-spgoal-metric-label {
  font-size: 11px;
  font-weight: 600;
  min-width: 36px;
  flex-shrink: 0;
}
.rp-spgoal-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  outline: none;
  transition: border-color .15s;
}
.rp-spgoal-input:focus { border-color: var(--accent); }
.rp-spgoal-unit {
  font-size: 10px;
  color: var(--text3);
  flex-shrink: 0;
}

/* 통계 행 */
.rp-spgoal-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.rp-spgoal-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
}
.rp-spgoal-pct.rp-goal-pct-over { color: #10b981; border-color: #10b981; }

@media (max-width: 600px) {
  .rp-spgoal-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .rp-spgoal-grid { grid-template-columns: 1fr; }
}

.rp-pmchart-section {
  margin-top: 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 20px 24px;
}

/* 헤더: 제목 + 토글 버튼 */
.rp-pmchart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* 토글 버튼 그룹 */
.rp-pmchart-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 3px;
}
.rp-pmchart-toggle-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rp-pmchart-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}
.rp-pmchart-toggle-btn:not(.active):hover {
  background: rgba(99,102,241,.12);
  color: var(--accent);
}

/* 범례 */
.rp-pmchart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.rp-pmchart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
.rp-pmchart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 꺾은선 범례: 가로선 모양 */
.rp-pmchart-legend-line {
  border-radius: 2px;
  width: 18px;
  height: 3px;
}

/* 캔버스 래퍼 */
.rp-pmchart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}

@media (max-width: 600px) {
  .rp-pmchart-wrap { height: 220px; }
  .rp-pmchart-header { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════
   영업사원별 목표 — 지표 클릭 이동 (미니 모달)
   ═══════════════════════════════════════════════════════ */

/* 클릭 가능한 지표 행 */
.rp-spgoal-metric-click {
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s;
  padding: 4px 6px;
  margin: -4px -6px;
}
.rp-spgoal-metric-click:hover {
  background: rgba(255,255,255,.06);
}
.rp-spgoal-amt-link {
  transition: text-decoration .1s;
}
.rp-spgoal-metric-click:hover .rp-spgoal-amt-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── 오버레이 백드롭 ── */
.rp-sp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: rp-overlay-in .15s ease;
}
@keyframes rp-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 프로젝트 선택 중앙 모달 */
.rp-sp-modal {
  position: relative;
  z-index: 9001;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: var(--bg2, #1e2130);
  border: 1px solid var(--border, #2d3550);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rp-modal-in .18s ease;
}
@keyframes rp-modal-in {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.rp-sp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #f1f5f9);
  border-bottom: 1px solid var(--border, #2d3550);
  flex-shrink: 0;
  gap: 8px;
}
.rp-sp-modal-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rp-sp-modal-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #f1f5f9);
}
.rp-sp-modal-header-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text2, #94a3b8);
}
.rp-sp-modal-close {
  background: var(--bg3, #334155);
  border: 1px solid var(--border, #2d3550);
  cursor: pointer;
  color: var(--text2, #94a3b8);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.rp-sp-modal-close:hover {
  background: var(--bg, #0f172a);
  color: var(--text, #f1f5f9);
}

/* 달성률 요약 바 */
.rp-sp-modal-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--bg3, #334155);
  border-bottom: 1px solid var(--border, #2d3550);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.rp-sp-modal-pct-badge {
  font-size: 18px;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 20px;
  border: 2px solid;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.rp-sp-modal-total {
  flex: 1;
  min-width: 0;
}
.rp-sp-modal-total-label {
  font-size: 11px;
  color: var(--text2, #94a3b8);
  margin-bottom: 3px;
}
.rp-sp-modal-total-bar {
  height: 6px;
  background: var(--bg, #0f172a);
  border-radius: 99px;
  overflow: hidden;
}
.rp-sp-modal-total-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}
.rp-sp-modal-gap-text {
  font-size: 11px;
  color: var(--text2, #94a3b8);
  white-space: nowrap;
  flex-shrink: 0;
}

.rp-sp-modal-list {
  overflow-y: auto;
  padding: 6px 0;
  flex: 1;
}
.rp-sp-modal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 12px;
  color: var(--text, #e2e8f0);
  text-decoration: none;
  transition: background .1s;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.rp-sp-modal-item:last-child { border-bottom: none; }
.rp-sp-modal-item:hover {
  background: var(--bg3, #252a3d);
  color: var(--accent, #6366f1);
}
.rp-sp-modal-item-info {
  flex: 1;
  min-width: 0;
}
.rp-sp-modal-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-sp-modal-item:hover .rp-sp-modal-item-name { color: var(--accent, #6366f1); }
.rp-sp-modal-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.rp-sp-modal-item-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.rp-sp-modal-item-sub {
  font-size: 10px;
  color: var(--text2, #94a3b8);
  margin-top: 2px;
}
.rp-sp-modal-amt-wrap {
  text-align: right;
  flex-shrink: 0;
}
.rp-sp-modal-amt {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.rp-sp-modal-amt-ratio {
  font-size: 10px;
  color: var(--text2, #94a3b8);
  white-space: nowrap;
}
