/* ===== 기본 리셋 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; font-size: 14px; background: #f5f6f8; color: #2d3748; }

/* ===== 뷰 전환 ===== */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ===== 로그인 화면 ===== */
#view-login.active {
  display: flex; align-items: center; justify-content: center;
  background: #f5f6f8; min-height: 100vh;
}
.login-card {
  background: #fff; border-radius: 12px; padding: 44px 40px;
  width: 100%; max-width: 460px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.09), 0 0 0 1px rgba(0,0,0,0.04);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { font-size: 40px; margin-bottom: 14px; }
.login-header h1 { font-size: 20px; font-weight: 700; color: #2d3748; margin-bottom: 6px; }
.login-header p { color: #718096; font-size: 13px; line-height: 1.6; }

.login-step { display: none; }
.login-step.active { display: block; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #4a5568; font-size: 13px; }
.input-row { display: flex; gap: 8px; }
.input-row input {
  flex: 1; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 7px;
  font-size: 15px; outline: none; transition: border-color 0.2s; color: #2d3748;
}
.input-row input:focus { border-color: #2b6cb0; }
.phone-display {
  background: #f7faff; border: 1px solid #bee3f8; border-radius: 7px; padding: 10px 14px;
  font-weight: 600; color: #2b6cb0; margin-bottom: 16px; font-size: 14px;
}
.timer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.timer { color: #e53e3e; font-weight: 600; font-size: 13px; }
.btn-link { background: none; border: none; color: #4a5568; cursor: pointer; font-size: 13px; text-decoration: underline; }
.hint { color: #a0aec0; font-size: 12px; margin-top: 10px; }
.error-msg { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; border-radius: 7px; padding: 10px 14px; margin-top: 12px; font-size: 13px; }

/* ===== 버튼 ===== */
.btn {
  padding: 10px 18px; border: none; border-radius: 7px;
  cursor: pointer; font-size: 14px; font-weight: 600; transition: 0.18s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: #2b6cb0; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2c5282; }
.btn-back { background: #fff; color: #4a5568; border: 1.5px solid #cbd5e0; padding: 7px 14px; font-size: 13px; }
.btn-back:hover { background: #f7fafc; }
.btn-outline-sm { background: transparent; color: #4a5568; border: 1.5px solid #cbd5e0; padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-outline-sm:hover { background: #f7fafc; }
.btn-view { background: #2b6cb0; color: #fff; padding: 4px 10px; font-size: 12px; border-radius: 4px; }
.btn-view:hover { background: #2c5282; }

/* ===== 상세 헤더 타이틀 그룹 ===== */
.detail-title-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-title-group h2 { font-size: 16px; font-weight: 700; color: #2d3748; }
.header-subtitle { font-size: 11px; color: #718096; display: block; margin-top: 2px; }

/* ===== 상세 헤더 필터 ===== */
.detail-filters { display: flex; align-items: center; gap: 8px; }
.filter-select-sm {
  padding: 5px 28px 5px 10px; border: 1.5px solid #cbd5e0; border-radius: 6px;
  font-size: 13px; color: #2d3748; background: #fff;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23718096'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  cursor: pointer; max-width: 240px; outline: none;
}
.filter-select-sm:focus { border-color: #2b6cb0; }

/* ===== 연수 정보 바 (상세 화면) ===== */
.training-info-bar {
  background: #fff; border-radius: 8px; padding: 10px 20px; margin-bottom: 14px;
  border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.training-info-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #2d3748; font-weight: 600; }
.training-info-right { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #718096; flex-wrap: wrap; }
.training-info-right .info-value { color: #2d3748; font-weight: 600; }
.info-chip { background: #edf2f7; color: #4a5568; padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.info-sep { color: #cbd5e0; font-size: 12px; }
.info-training-name-wrap .info-value { font-size: 13px; }

/* ===== 페이지 헤더 ===== */
.page-header {
  background: #fff; color: #2d3748;
  padding: 12px 24px; position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1440px; margin: 0 auto; }
.header-inner h2 { font-size: 17px; font-weight: 700; color: #2d3748; }
.header-right { display: flex; align-items: center; gap: 10px; }
.phone-badge {
  background: #edf2f7; color: #4a5568;
  padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
}

/* ===== 페이지 본문 ===== */
.page-body { max-width: 1440px; margin: 0 auto; padding: 20px 24px; }

/* ===== 요약 바 ===== */
.list-summary {
  background: #fff; border-radius: 8px; padding: 12px 20px; margin-bottom: 14px;
  font-size: 13px; color: #718096; border: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
}
.list-summary strong { color: #2d3748; font-weight: 700; }
.list-summary-left { display: flex; align-items: center; gap: 20px; }
.list-summary-right { font-size: 12px; color: #a0aec0; }

/* ===== 조회 조건 필터 ===== */
.filter-bar { margin-bottom: 14px; }
.filter-select {
  padding: 7px 36px 7px 14px;
  border: 1.5px solid #b0bec5; border-radius: 7px;
  background: #fff; -webkit-appearance: none; appearance: none;
  font-size: 14px; font-weight: 600; color: #2d3748; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23546e7a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ===== 섹션 블록 ===== */
.section-block {
  display: flex; background: #fff; border-radius: 8px;
  overflow: hidden; margin-bottom: 14px; border: 1px solid #e2e8f0;
}
.section-label {
  writing-mode: vertical-rl; text-orientation: mixed;
  background: #546e7a; color: #fff; font-size: 11px; font-weight: 700;
  padding: 16px 8px; text-align: center; min-width: 34px; letter-spacing: 3px;
  display: flex; align-items: center; justify-content: center;
}
.section-label.pioneer { background: #78909c; }
.section-table-wrap { flex: 1; overflow-x: auto; }

/* ===== 선도교사 placeholder ===== */
.pioneer-placeholder {
  background: #fff; border-radius: 8px; overflow: hidden;
  margin-bottom: 14px; border: 1px solid #e2e8f0;
}
.pioneer-placeholder-inner {
  display: flex;
}
.pioneer-notice {
  flex: 1; background: #eceff1; display: flex; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.pioneer-notice p {
  color: #546e7a; font-size: 13px; line-height: 1.8; font-weight: 500;
}
.pioneer-notice strong { color: #37474f; display: block; font-size: 14px; margin-bottom: 6px; }

/* ===== 연수 추천 링크 바 ===== */
.recommend-link-bar {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 12px;
  color: #718096;
  text-align: left;
}
.recommend-link-btn {
  display: inline-block;
  padding: 2px 8px;
  background: #ebf4ff;
  color: #2b6cb0 !important;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #bee3f8;
  text-decoration: none !important;
  transition: background 0.18s, color 0.18s;
  vertical-align: middle;
}
.recommend-link-btn:hover {
  background: #2b6cb0;
  color: #fff !important;
  border-color: #2b6cb0;
}

/* ===== 테이블 공통 ===== */
.result-table, .competency-table, .core-table, .detail-table, .summary-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.result-table th, .result-table td,
.competency-table th, .competency-table td,
.core-table th, .core-table td,
.detail-table th, .detail-table td,
.summary-table th, .summary-table td {
  border: 1px solid #e2e8f0; padding: 7px 8px; text-align: center; vertical-align: middle;
}
.result-table thead tr th,
.competency-table thead tr th,
.core-table thead tr th,
.detail-table thead tr th {
  background: #455a64; color: #fff; font-weight: 600;
}
.summary-table thead tr th { background: #546e7a; color: #fff; font-weight: 600; }
.summary-table tbody td { background: #fff; font-weight: 600; font-size: 14px; }
.result-table tbody tr:hover { background: #f7fafc; }
.result-table tbody tr { cursor: pointer; }
/* 같은 연수 묶음 구분선 */
.result-table tbody tr.group-start td { border-top: 2px solid #b0bec5; }
.no-data { color: #a0aec0; padding: 30px !important; font-size: 14px; }

/* 향상도 색상 */
.up { color: #e53e3e; font-weight: 700; }
.down { color: #2b6cb0; font-weight: 700; }
.neutral { color: #718096; }

/* ===== 설문 유형 배지 ===== */
.survey-type-badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.badge-종합  { background: #2b6cb0; }
.badge-핵심  { background: #c05621; }
.badge-역량별 { background: #276749; }
.badge-상세  { background: #6b46c1; }
/* 기존 클래스 호환 */
.survey-type-badge:not([class*="badge-"]) { background: #546e7a; }

/* ===== 상세 화면 ===== */
.training-info-bar {
  background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 14px;
  border: 1px solid #e2e8f0;
}
.training-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.info-label { font-size: 11px; color: #a0aec0; display: block; margin-bottom: 3px; letter-spacing: 0.3px; }
.info-value { font-size: 14px; font-weight: 600; color: #2d3748; }

/* ===== 탭 콘텐츠 ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 결과 요약 박스 ===== */
.result-summary-box {
  background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 14px;
  overflow-x: auto; border: 1px solid #e2e8f0;
}

/* ===== 역량 테이블 ===== */
.competency-table-wrap {
  background: #fff; border-radius: 8px; overflow: hidden;
  margin-bottom: 14px; overflow-x: auto; border: 1px solid #e2e8f0;
}
.competency-table td.col-pre     { background: rgba(144,202,249,0.15); }   /* 하늘색 (연하게) */
.competency-table td.col-post    { background: rgba(154,230,180,0.15); }   /* 연두색 (연하게) */
.competency-table td.col-imp,
.competency-table td.col-imp-pct { background: #fff; }
.competency-table td.col-area { font-weight: 600; background: #fff; color: #4a5568; }
.competency-table td.col-name { text-align: left; padding-left: 10px; background: #fff; }

/* ===== 요약 테이블 사전/사후 색상 통일 ===== */
/* 내 점수: 하늘/연두 — 역량 테이블과 동일 opacity */
.summary-table td.td-pre      { background: rgba(144,202,249,0.15) !important; }
.summary-table td.td-post     { background: rgba(154,230,180,0.15) !important; }
/* 연수 평균: 동일 색상 더 연하게 */
.summary-table td.td-avg-pre  { background: rgba(144,202,249,0.08) !important; }
.summary-table td.td-avg-post { background: rgba(154,230,180,0.08) !important; }

/* ===== 차트 범례 안내 ===== */
.chart-hint {
  font-size: 11px; color: #a0aec0; text-align: center;
  margin-top: 10px; position: relative; z-index: 1;
  display: block; clear: both;
}
/* 선도교사 전용 안내 문구 (역량 표 하단) */
.leader-note {
  font-size: 12px; color: #718096; text-align: left;
  margin: 8px 2px 0; line-height: 1.5; word-break: keep-all;
}
/* 상세탭 소계행 */
.detail-subtotal { background: #f0f4f8 !important; font-weight: 700; color: #2d3748; }
.detail-subtotal td { border-top: 2px solid #b0bec5 !important; }

/* ===== 차트 영역 ===== */
.charts-row { display: flex; gap: 16px; flex-wrap: wrap; }
.chart-box {
  flex: 1; min-width: 320px; background: #fff; border-radius: 8px;
  padding: 16px; border: 1px solid #e2e8f0;
}
.chart-box h4 { font-size: 13px; font-weight: 700; color: #4a5568; margin-bottom: 12px; text-align: center; }
.chart-box.full-width { flex: 0 0 100%; }
.bar-full { width: 100%; box-sizing: border-box; }
.bar-full .chart-wrap-bar { height: 320px; }

/* ===== 상세 탭 상단 레이아웃 ===== */
.detail-top-row { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.detail-summary { margin-bottom: 0 !important; flex: 1; min-width: 0; }
.detail-radar-box { flex: 0 0 270px; }
.chart-wrap-radar { position: relative; height: 300px; width: 100%; overflow: visible; }
.chart-wrap-bar { position: relative; height: 280px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.legend-item { font-size: 11px; display: flex; align-items: center; gap: 4px; color: #718096; }

/* ===== 핵심 차트 섹션 ===== */
.core-charts-section {
  margin-top: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border-radius: 8px; padding: 12px;
  border: 1px solid #e2e8f0;
}
.core-charts-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 10px;
  padding: 0 4px;
}
.core-charts-title { font-size: 13px; font-weight: 700; color: #2d3748; word-break: keep-all; }
.core-charts-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.core-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #4a5568; white-space: nowrap; cursor: pointer; user-select: none; transition: opacity 0.15s; }
.core-legend-item:hover { opacity: 0.7; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }

/* ===== 핵심 차트 그리드 ===== */
.core-charts-grid {
  display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px;
}
/* 핵심 좌우 배치일 때: 차트 2열 */
.core-main-row .core-charts-grid {
  grid-template-columns: repeat(2, 1fr);
}
.core-chart-item {
  background: #fff; border-radius: 8px; padding: 8px;
  border: 1px solid #e2e8f0;
}
.core-chart-item canvas { max-height: 120px; }

/* ===== 역량별 탭 — 표(60%)+차트(40%) 좌우 배치 ===== */
.comp-main-row {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px;
}
.comp-main-row .competency-table-wrap {
  flex: 0 0 60%; min-width: 0; margin-bottom: 0; overflow-x: auto;
}
.comp-side-chart {
  flex: 1; min-width: 220px;
}
.comp-side-chart .chart-wrap-bar { height: 340px; }

/* ===== 핵심 탭 — 표+차트 좌우 배치 ===== */
.core-main-row {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px;
}
/* 핵심 탭 단일 바 차트 높이 */
.core-bar-chart-box .chart-wrap-bar { height: 260px; }
/* 단독일 때(비핵심 탭 등) 기존 스타일 유지 */
.core-table-wrap, .detail-table-wrap {
  background: #fff; border-radius: 8px; overflow: hidden;
  margin-bottom: 14px; overflow-x: auto; border: 1px solid #e2e8f0;
}

/* ===== 로딩 오버레이 ===== */
.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.32); display: flex;
  align-items: center; justify-content: center; z-index: 9999;
}
.spinner {
  width: 44px; height: 44px; border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 반응형 ===== */

/* 태블릿 (≤1024px) */
@media (max-width: 1024px) {
  .core-charts-grid { grid-template-columns: repeat(4, 1fr); }
  .page-body { padding: 16px; }
}

/* 중간 (≤900px) */
@media (max-width: 900px) {
  .core-charts-grid { grid-template-columns: repeat(3, 1fr); }
  .result-summary-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .summary-table { min-width: 560px; }
}

/* 모바일 (≤768px) */
@media (max-width: 768px) {
  /* 로그인 */
  .login-card { padding: 24px 16px; margin: 12px; }
  .login-header h1 { font-size: 17px; }

  /* 헤더 */
  .page-header { padding: 8px 12px; }
  .header-inner { flex-wrap: wrap; gap: 4px; }
  .header-inner > h2 { font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-right { flex-shrink: 0; }
  .phone-badge { font-size: 11px; padding: 3px 8px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-back, .btn-outline-sm { padding: 5px 10px; font-size: 11px; }
  /* 상세 헤더: detail-title-group이 좁아지면 번호 배지 숨김 */
  .detail-title-group { flex: 1; min-width: 0; }
  #detail-phone-badge { display: none; }

  /* 본문 */
  .page-body { padding: 10px; }

  /* 상세 헤더 필터 */
  .detail-title-group { flex-direction: column; align-items: flex-start; gap: 6px; }
  .detail-filters { flex-wrap: wrap; gap: 6px; }
  .filter-select-sm { max-width: 100%; font-size: 12px; }

  /* 연수 리스트 */
  .section-block { flex-direction: column; }
  .section-label {
    writing-mode: horizontal-tb; text-orientation: mixed;
    padding: 6px 12px; min-width: unset; letter-spacing: 1px;
    font-size: 12px;
  }
  .section-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .result-table { min-width: 640px; }

  /* 요약 박스 */
  .result-summary-box { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 10px; }
  .summary-table { min-width: 540px; font-size: 12px; }
  .summary-table tbody td { font-size: 12px; }

  /* 연수 정보 바 */
  .training-info-bar { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
  .training-info-right { flex-wrap: wrap; }
  .training-info-grid { grid-template-columns: 1fr 1fr; }

  /* 역량별/핵심 탭 좌우 → 세로 */
  .comp-main-row { flex-direction: column; }
  .comp-main-row .competency-table-wrap { flex: none; width: 100%; }
  .comp-side-chart { min-width: unset; width: 100%; }
  .core-main-row { flex-direction: column; }
  .core-main-row .core-table-wrap { width: 100%; }

  /* 역량 테이블 */
  .competency-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .competency-table { min-width: 700px; font-size: 12px; }
  .core-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .core-table { min-width: 420px; font-size: 12px; }

  /* 차트 */
  .charts-row { flex-direction: column; }
  .chart-box { min-width: unset; }
  .chart-wrap-radar { height: 240px; }
  .chart-wrap-bar { height: 220px; }
  .core-charts-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .core-chart-item { padding: 6px; }
  .core-chart-item canvas { max-height: 100px; }
  .core-charts-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .core-charts-legend { flex-wrap: wrap; gap: 8px; }

  /* 목록 요약 바 */
  .list-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
  .list-summary-left { flex-wrap: wrap; gap: 10px; }
}

/* 소형 모바일 (≤480px) */
@media (max-width: 480px) {
  .login-card { padding: 20px 12px; margin: 8px; }
  .page-body { padding: 8px; }
  .core-charts-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .summary-table { min-width: 480px; }
  .result-table { min-width: 560px; }
  /* 번호 배지도 숨겨서 헤더 공간 확보 */
  #list-phone-display { display: none; }
}

/* ===== 인쇄 ===== */
/* 페이지 여백 축소 → 가용 폭/높이 확보 (기본 약 25mm → 12mm) */
@page { margin: 12mm; }

@media print {
  /* 배경·색상 그대로 출력 */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body { background: #fff; font-size: 11px; }

  /* 숨길 요소 */
  .btn-print, .filter-bar, .detail-filters,
  .loading-overlay, #btn-logout,
  #btn-back, .recommend-link-bar { display: none !important; }

  /* 뷰 전환 */
  .view { display: none !important; min-height: unset !important; }
  .view.active { display: block !important; }
  .tab-content { display: none !important; }
  .tab-content.active { display: block !important; }

  /* 헤더 */
  .page-header { position: static !important; box-shadow: none !important; }
  .page-body { padding: 8px !important; max-width: 100% !important; }

  /* 페이지 나누기 방지 */
  .result-summary-box,
  .competency-table-wrap,
  .chart-box,
  .core-charts-section,
  .section-block { break-inside: avoid; page-break-inside: avoid; }

  /* 스크롤 컨테이너 해제 → 잘림 방지 */
  .section-table-wrap,
  .competency-table-wrap,
  .core-table-wrap,
  .result-summary-box { overflow: visible !important; }

  /* 차트 행 폭 조정 */
  .charts-row { flex-wrap: wrap !important; gap: 10px !important; }
  .chart-box { min-width: unset !important; flex: 1 1 45% !important; }

  /* 테이블 폭 조정 - min-width 해제, 폰트 축소 */
  .summary-table  { min-width: unset !important; width: 100% !important; font-size: 9px !important;
                    table-layout: fixed !important; }
  .competency-table { min-width: unset !important; width: 100% !important; font-size: 10px !important; }
  .result-table   { min-width: unset !important; width: 100% !important; font-size: 10px !important;
                    table-layout: fixed !important; }
  /* 연수명 열 너비 제한 */
  .result-table th:nth-child(1), .result-table td:nth-child(1) { width: 24% !important; }

  /* 설문 종류 배지 폰트 축소 */
  .survey-type-badge { font-size: 9px !important; padding: 1px 5px !important; }

  /* 전화번호 생략 해제 */
  .phone-badge { max-width: none !important; overflow: visible !important; text-overflow: clip !important; white-space: nowrap !important; }
  .core-table     { min-width: unset !important; width: 100% !important; font-size: 10px !important;
                    table-layout: fixed !important; }
  /* 문항/역량/사전/사후/향상도(점수)/향상도(%) 열 너비 */
  .core-table th:nth-child(1), .core-table td:nth-child(1) { width: 8% !important; }
  .core-table th:nth-child(2), .core-table td:nth-child(2) { width: 40% !important; }
  .core-table th:nth-child(3), .core-table td:nth-child(3) { width: 10% !important; }
  .core-table th:nth-child(4), .core-table td:nth-child(4) { width: 10% !important; }
  .core-table th:nth-child(5), .core-table td:nth-child(5) { width: 16% !important; }
  .core-table th:nth-child(6), .core-table td:nth-child(6) { width: 16% !important; }

  /* competency-table: 역량명 열 넓게, 점수 열 균등 배분 */
  .competency-table {
    table-layout: fixed !important;
  }
  /* ★ table-layout:fixed에서는 첫 행(thead) 셀로 열 너비 결정됨.
     본문 td.col-name 에 width 줘도 무시되므로 헤더 셀(영역/역량)에 지정해야 함.
     영역=6%, 역량=30% → 나머지 64%를 12개 점수열이 균등 배분.
     역량 열 더 넓히려면 아래 30% 값을 키우세요. */
  .competency-table thead tr:first-child th:nth-child(1) { width: 6% !important; }
  .competency-table thead tr:first-child th:nth-child(2) { width: 30% !important; }
  .competency-table td, .competency-table th { font-size: 9px !important; padding: 3px 3px !important; }

  /* 바 차트 가로 잘림 방지: 차트 박스 전체 너비 + overflow 해제 */
  .charts-row { flex-direction: column !important; }
  .chart-box { width: 100% !important; flex: none !important; overflow: visible !important;
               min-width: unset !important; box-sizing: border-box !important; border: none !important; }
  .chart-wrap-bar { width: 100% !important; overflow: hidden !important; height: 220px !important; }
  .chart-wrap-bar canvas { width: 100% !important; max-width: 100% !important; }

  /* 핵심 탭 summary-table: tbody td 폰트 14px → 9px 오버라이드, 패딩 축소 */
  .summary-table tbody td {
    font-size: 9px !important;
    padding: 3px 4px !important;
  }
  .summary-table thead tr th {
    font-size: 8px !important;
    padding: 3px 2px !important;
    word-break: keep-all !important;
  }

  /* 셀 텍스트 잘림 방지 — keep-all: 한국어 단어 단위 줄바꿈 */
  td, th {
    word-break: keep-all !important;
    white-space: normal !important;
    padding: 4px 5px !important;
  }

  /* 레이더 차트: 범례 겹침 방지 + 비율 유지(가로 눌림 방지) */
  .chart-wrap-radar {
    height: 260px !important;
    overflow: hidden !important;
    text-align: center !important;
  }
  /* width:100%로 전체폭 늘리면 원이 납작해짐 → width:auto로 정비율 유지, 가운데 정렬 */
  .chart-wrap-radar canvas { width: auto !important; height: 100% !important; max-width: 100% !important; display: inline-block !important; }

  /* 바 차트 높이: canvas height:100%로 컨테이너에 맞게 스케일 → 잘림 방지 */
  .chart-wrap-bar { height: 240px !important; overflow: hidden !important; }
  .chart-wrap-bar canvas { width: 100% !important; height: 100% !important; max-width: 100% !important; }
  .core-chart-item canvas { max-height: 90px !important; }

  /* 범례 안내 텍스트: 인쇄 시 숨김 (클릭 불가하므로 불필요) */
  .chart-hint { display: none !important; }
}

/* ── 선도교사 섹션 ─────────────────────────────────────────────── */
.pioneer-table-wrap { display: flex; flex-direction: column; gap: 0; }

/* 세로 라벨(선도교사연수)이 테이블보다 높을 때 아래 빈 행처럼 보이는 여백 방지:
   요약 테이블이 섹션 높이를 꽉 채우도록 stretch */
.pioneer-summary-wrap { flex: 1; display: flex; flex-direction: column; }
.pioneer-summary-wrap .result-table thead th { background: #5a7fa8; color: #fff; }
.pioneer-summary-wrap .result-table { flex: 1; height: 100%; margin-bottom: 0; }

.pioneer-class-wrap { position: relative; }
.pioneer-class-table thead th { background: #6d8c6d; color: #fff; }

/* 추후 연동 overlay */
.pioneer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 90, 120, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  min-height: 80px;
}
.pioneer-overlay-text {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* 현업적용도 추후 연동 셀 */
.pioneer-field-pending {
  background: #1e6fa0;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  border-radius: 3px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* ── 차트 overlay (선도교사 미완료 시) ──────────────────────────── */
.chart-lockable { position: relative; }
.chart-locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.88rem;
  color: #555;
  padding: 16px;
  border-radius: 4px;
  z-index: 2;
}
