/* ===== 관리자 페이지 — 편의성 우선(데스크톱) ===== */
/* 색상 토큰은 styles.css :root 재사용 */

/* 폰트: 관리자 페이지는 브랜드 폰트 규칙 예외 (PROJECT-RULES.md).
   강사 혼자 쓰는 내부 도구라 브랜드 표현보다 화면 밀도·가독성이 우선이고,
   무거운 로컬 ttf를 불러오지 않아 로딩도 빠름. styles.css의 body 설정을 덮어씀. */
.admin {
  font-family: "Noto Sans KR", sans-serif;
  background: #faf9fc;
  color: var(--ink);
}

/* 상단바 */
.adm-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.adm-topbar__inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.adm-brand { display: flex; align-items: center; gap: 10px; }
.adm-logo { height: 30px; width: auto; display: block; }
.adm-brand__tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--purple);
  background: var(--lav-2);
  padding: 3px 10px;
  border-radius: 999px;
}

/* 탭 내비게이션 */
.adm-tabs {
  position: sticky;
  top: 60px;
  z-index: 15;
  display: flex;
  gap: 4px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px 0;
  background: #faf9fc;
  border-bottom: 1px solid var(--line);
}
.adm-tab {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.adm-tab:hover { color: var(--ink); }
.adm-tab.is-active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

/* 본문 */
.adm-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}
.adm-panel { display: none; }
.adm-panel.is-active { display: block; }

/* 일정 서브탭 */
.adm-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.adm-subtab {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.adm-subtab:hover { color: var(--ink); }
.adm-subtab.is-active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}
.adm-subpanel { display: none; }
.adm-subpanel.is-active { display: block; }

/* 반 관리 (일정 탭) */
.adm-class-mgmt {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.adm-class-mgmt__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.adm-class-mgmt__title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-right: 4px;
}
.adm-class-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.adm-class-editor__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.adm-class-editor__section { margin-bottom: 14px; }
.adm-class-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.adm-class-editor__actions {
  display: flex;
  gap: 8px;
}
.adm-slot-list { display: flex; flex-direction: column; gap: 8px; }
.adm-slot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.adm-class-summary {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adm-class-summary__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}
.adm-class-summary__item strong { font-weight: 600; }

/* 날짜별 일정 리스트 */
.adm-sched-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.adm-sched-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease;
}
.adm-sched-item:hover { border-color: var(--purple-2); background: var(--lav); }
.adm-sched-item.is-selected {
  border-color: var(--purple-2);
  box-shadow: 0 0 0 2px rgba(138, 122, 181, 0.18);
}
.adm-sched-item__date {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 14px;
  background: var(--lav);
  border-bottom: 1px solid var(--line);
}
.adm-sched-item__body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.adm-sched-row { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; flex-wrap: wrap; }

.adm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.adm-panel__title { font-size: 1.15rem; font-weight: 700; }
.adm-hint { font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.adm-toolbar__actions { display: flex; align-items: center; gap: 10px; }

/* 폼 요소 */
.adm-field { display: inline-flex; align-items: center; gap: 8px; }
.adm-field--block { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 14px; }
.adm-field__label { font-size: 0.82rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
/* 라벨이 입력칸 위에 오는 세로 배치에서는 줄바꿈을 허용 — 긴 안내가 붙은 라벨
   (예: '보강 영상 링크 (선택 · 한 줄에 하나씩 …)')이 좁은 화면 밖으로 나가지 않게 */
.adm-field--block > .adm-field__label { white-space: normal; }

.adm-input, .adm-select, .adm-textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  outline: none;
  border-color: var(--purple-2);
  box-shadow: 0 0 0 3px rgba(138, 122, 181, 0.15);
}
.adm-textarea { resize: vertical; line-height: 1.5; }
.adm-select { cursor: pointer; }

/* 버튼 */
.adm-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--purple);
  background: var(--lav-2);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.adm-btn:hover { background: #e6def5; }
.adm-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple-2), var(--purple));
}
.adm-btn--primary:hover { transform: translateY(-1px); background: linear-gradient(135deg, var(--purple-2), var(--purple)); filter: brightness(1.03); }
.adm-form-actions { display: flex; align-items: center; gap: 12px; }
.adm-unlink { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.adm-save-hint { font-size: 0.82rem; color: var(--purple-2); }

.adm-icon-btn {
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--purple);
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  line-height: 1;
}
.adm-icon-btn:hover { background: var(--lav); }

/* 카드 */
.adm-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.adm-card__title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.adm-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.adm-card__head .adm-card__title { margin-bottom: 0; }
.adm-card__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* 테이블 */
.adm-table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.adm-table th, .adm-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.adm-table thead th {
  background: var(--lav);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.82rem;
  position: sticky;
  top: 0;
}
.adm-table tbody tr { cursor: pointer; transition: background 0.1s ease; }
.adm-table tbody tr:hover { background: var(--lav); }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table .col-actions {
  width: 86px;
  text-align: center;
  cursor: default;
}
.adm-cell-actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.adm-table .col-actions .adm-btn { cursor: pointer; }

/* 뱃지 */
.adm-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
}
.adm-badge--on { color: #3d7a4e; background: #e4f3e8; }
/* 한쪽만 연동된 중간 상태 — 색 위계 4단계의 '노랑' 자리 */
.adm-badge--half { color: #8a6a2e; background: #f7eeda; }
.adm-badge--off { color: #9a5f5f; background: #f5e6e6; }
.adm-badge--officer { color: var(--purple); background: var(--lav-2); }

.adm-link {
  color: var(--purple);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 기본정보 그리드 */
.adm-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 20px;
  margin-bottom: 18px;
}
.adm-info__item { display: flex; flex-direction: column; gap: 3px; }
.adm-info__label { font-size: 0.76rem; color: var(--muted); }
.adm-info__value { font-size: 0.92rem; font-weight: 500; }
.adm-consult { border-top: 1px solid var(--line); padding-top: 16px; }
.adm-memo { border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 16px; }

/* 기간 지정 (일자별 기록) */
.adm-input--sm { padding: 5px 8px; font-size: 0.82rem; }
.adm-range { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adm-range__sep { color: var(--muted); }
.adm-btn--ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--purple);
  padding: 5px 12px;
  font-size: 0.8rem;
}
.adm-btn--ghost:hover { background: var(--lav); }

/* 개별 일괄 입력 표 */
.adm-table--entry { min-width: 1180px; }
.adm-table--entry td, .adm-table--entry th { padding: 8px 10px; vertical-align: top; }
.adm-table--entry .col-name { width: 90px; font-weight: 500; white-space: nowrap; }
.adm-table--entry .col-class-att { min-width: 132px; width: 132px; }
.adm-table--entry .col-class-att .adm-cell--sel { min-width: 120px; }
.adm-table--entry .col-note {
  min-width: 240px;
  width: 280px;
  max-width: none;
}
.adm-table--entry tbody tr { cursor: default; }
.adm-table--entry tbody tr:hover { background: transparent; }
.adm-cell {
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  width: 100%;
}
.adm-cell:focus {
  outline: none;
  border-color: var(--purple-2);
  box-shadow: 0 0 0 2px rgba(138, 122, 181, 0.15);
}
.adm-cell--sel { cursor: pointer; min-width: 64px; }
.adm-cell--note {
  min-width: 220px;
  min-height: 52px;
  line-height: 1.45;
  resize: vertical;
}

/* 값별 색상 */
.adm-cell--good { color: #2f9e57; font-weight: 600; }
.adm-cell--warn { color: #c98a2b; font-weight: 600; }
.adm-cell--mid { color: #c26a2b; font-weight: 600; }
.adm-cell--danger { color: #d24b4b; font-weight: 600; }

/* 단어T 입력 (최대 2) */
.adm-word-inputs { display: flex; gap: 8px; }
.adm-word-item { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.adm-cell--word { width: 52px; text-align: center; padding: 6px 4px; }
.adm-word-retry { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.adm-word-retry__box { width: 12px; height: 12px; accent-color: #c98a2b; margin: 0; cursor: pointer; }
.adm-table--entry .col-word { width: 150px; }

/* 리뷰T O/X 토글 */
.adm-table--entry .col-review { min-width: 146px; }
/* 리뷰T: 한 행에 5문항씩 채우고 아래로 행이 늘어남
   (1~5번=1행, 6~10번=2행 …). 버튼의 DOM 순서는 그대로라 저장 순서에 영향 없음 */
.adm-review-grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(5, max-content);
  justify-content: start;
  column-gap: 3px;
  row-gap: 8px; /* 5개 묶음이 구분되도록 행 간격을 넓게 */
}
.adm-review-cell {
  width: 26px;
  height: 26px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.adm-review-cell:hover { border-color: var(--purple-2); }
.adm-review-cell[data-state="O"] {
  background: #e4f3e8;
  color: #2f9e57;
  border-color: #bfe4cb;
}
.adm-review-cell[data-state="O"]::after { content: "O"; }
.adm-review-cell[data-state="X"] {
  background: #f7e3e3;
  color: #d24b4b;
  border-color: #ecc6c6;
}
.adm-review-cell[data-state="X"]::after { content: "X"; }
/* △ = 부분 정답(0.5점) — 색 위계상 O(초록)와 X(빨강) 사이의 노랑 */
.adm-review-cell[data-state="△"] {
  background: #f7f0e3;
  color: #a8895f;
  border-color: #ead9bb;
}
/* 도형 문자라 굵기가 O·X보다 얇게 보여 외곽선으로 맞춤 (이용자 화면과 동일) */
.adm-review-cell[data-state="△"]::after { content: "△"; -webkit-text-stroke: 0.5px currentColor; }
/* 채점된 상태에서는 번호 대신 O/X/△ 표시 */
.adm-review-cell[data-state="O"],
.adm-review-cell[data-state="X"],
.adm-review-cell[data-state="△"] { font-size: 0; }
.adm-review-cell[data-state="O"]::after,
.adm-review-cell[data-state="X"]::after,
.adm-review-cell[data-state="△"]::after { font-size: 0.8rem; }

/* 결석 학생 행 — 숙제·단어T·리뷰T 입력 잠금 (출결·클리닉·개별 안내는 사용 가능) */
.adm-row--absent .adm-cell:disabled,
.adm-row--absent .adm-review-cell:disabled {
  background: #f4f3f6;
  color: var(--muted);
  border-color: var(--line);
  opacity: 0.55;
  cursor: not-allowed;
}
.adm-row--absent .adm-review-cell:disabled:hover { border-color: var(--line); }
.adm-row--absent .adm-word-retry { opacity: 0.55; cursor: not-allowed; }

/* 리뷰T 문항 설정 편집기 */
.adm-review-setup {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 14px;
}
.adm-review-setup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap; /* 좁은 화면: '문항 수' 스테퍼가 아래 줄로 내려감 */
}
.adm-review-setup__head .adm-input--sm { width: 64px; }

/* 문항 수 스테퍼 */
.adm-field--count { align-items: flex-start; }
.adm-count-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.adm-step-btn {
  width: 30px;
  height: 30px;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--purple);
  background: var(--lav-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.adm-step-btn:hover { background: #e6def5; }
.adm-input--count {
  width: 48px;
  text-align: center;
  padding: 6px 4px;
  -moz-appearance: textfield;
}
.adm-input--count::-webkit-inner-spin-button,
.adm-input--count::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.adm-count-quick { display: inline-flex; gap: 4px; margin-left: 6px; }
.adm-quick-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.adm-quick-btn:hover { border-color: var(--purple-2); color: var(--purple); }
.adm-quick-btn.is-active {
  background: var(--lav-2);
  color: var(--purple);
  border-color: var(--purple-2);
}

.adm-review-preset {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.adm-review-preset .adm-select { min-width: 130px; }
/* 반 편집기 — 저장하면 수업일이 다시 만들어진다는 경고 (사라지지 않고 남음) */
.adm-reseed-warn {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdf6e9;
  border: 1px solid #e8d3ac;
  color: #8a5a1e;
  font-size: 0.84rem;
  line-height: 1.6;
}
.adm-reseed-warn b { color: #7a3f10; }

/* 강의계획표 링크 목록 (설정 탭 — 반 이름 + 주소 한 줄) */
.adm-notion-name {
  width: 120px; flex-shrink: 0; font-size: 0.86rem; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adm-notion-url { flex: 1; min-width: 0; }
.adm-review-q {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.adm-review-q__item { display: flex; align-items: center; gap: 6px; }
.adm-review-q__num {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  background: var(--lav-2);
  border-radius: 6px;
}
/* min-width: 0 이 없으면 입력칸의 기본 최소 너비 때문에 칸이 안 줄어들어 격자가 넘침 */
.adm-review-q__label { flex: 1; min-width: 0; }

.adm-hint--block { display: block; margin-top: 14px; font-size: 0.8rem; color: var(--muted); }

/* 일자별 기록 리스트 */
.adm-record-list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.adm-record--click {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.1s ease;
}
.adm-record--click:hover,
.adm-record--click:focus {
  background: var(--lav);
  outline: none;
}
.adm-record-more { font-size: 0.8rem; color: var(--muted); padding: 6px 2px; }
.adm-record {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
/* 체크박스 한 줄 (반 평균 표시 등) */
.adm-check {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.86rem; color: var(--ink); cursor: pointer; margin: 2px 0 4px;
}
.adm-check input { margin-top: 3px; flex-shrink: 0; }
.adm-check b { color: var(--purple); }
/* 같은 종류의 체크박스를 한 줄에 (반 평균 — 리뷰T·단어T·숙제). 좁으면 다음 줄로 접힘 */
.adm-check-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 2px; }
.adm-check-row .adm-check { margin: 0; }

/* 종료된 반 목록 (작은 창) */
.adm-ended-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.adm-ended__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.adm-ended__name { font-size: 0.9rem; font-weight: 600; color: var(--ink); }

/* 저장하지 않은 채 날짜·반·탭을 바꾸려 할 때 뜨는 경고 창 */
.adm-leave__msg { font-size: 0.92rem; color: var(--ink); line-height: 1.6; margin: 0 0 18px; }
.adm-leave__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* 날짜 + 삭제 버튼 한 줄 */
.adm-record__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.adm-record__date { font-size: 0.82rem; font-weight: 600; color: var(--purple); }
.adm-record__body { font-size: 0.85rem; color: var(--ink); line-height: 1.5; }
.adm-record__body span { color: var(--muted); }
.adm-empty { font-size: 0.85rem; color: var(--muted); padding: 8px 0; }

/* 캘린더 / 카드 헤더 */
.adm-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.adm-cal-head .adm-card__title {
  margin-bottom: 0;
  flex-shrink: 0;
  min-width: max-content;
  white-space: nowrap;
}
.adm-cal-nav { display: flex; align-items: center; gap: 10px; }
.adm-cal-label { font-size: 0.9rem; font-weight: 600; min-width: 96px; text-align: center; }
.adm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.adm-cal__dow {
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 0;
}
.adm-cal__cell {
  min-height: 56px;
  min-width: 0; /* 그리드 칸이 내용보다 좁아질 수 있게 → 칩 말줄임 처리로 화면 밖 넘침 방지 */
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 0.78rem;
}
.adm-cal__events { min-width: 0; }
.adm-cal__cell--empty { border-color: transparent; }
.adm-cal__num { color: var(--muted); }
.adm-cal__events { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
.adm-chip {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-chip--class { background: #ece7f8; color: #6f5f97; }
.adm-chip--clinic { background: #f7f0e3; color: #a8895f; }
.adm-chip--other { background: #e8f0ee; color: #4a6f65; }
/* 기본은 다른 칩처럼 말줄임(칸 넘침 방지) — 학생 상세 창의 좁은 캘린더용 */
.adm-clinic-chip { cursor: help; }
/* 일정 탭 캘린더(넓은 칸 + 가로 스크롤)에서만 전체 이름 표시 유지 */
.adm-cal--mgmt .adm-clinic-chip { overflow: visible; }

.adm-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.adm-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.adm-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.adm-dot--class { background: #cbbceb; }
.adm-dot--clinic { background: #e6cf9e; }
.adm-dot--other { background: #a8cfc4; }

/* 클리닉 호버 팝오버 — 날짜별 반 분류 학생 목록 */
.adm-clinic-pop {
  position: fixed;
  z-index: 10000;
  min-width: 180px;
  max-width: 280px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
}
.adm-clinic-pop[hidden] { display: none !important; }
.adm-clinic-pop__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.adm-clinic-pop__group + .adm-clinic-pop__group { margin-top: 8px; }
.adm-clinic-pop__class {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 4px;
}
.adm-clinic-pop__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-clinic-pop__list li {
  font-size: 0.74rem;
  color: var(--ink);
  padding-left: 10px;
  position: relative;
}
.adm-clinic-pop__list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--muted);
}
/* 팝오버·리스트의 클리닉 시간 강조 */
.adm-clinic-pop__time {
  display: inline-block;
  min-width: 38px;
  margin-right: 5px;
  font-weight: 600;
  color: #c26a2b;
}
.adm-sched-time { font-weight: 600; color: #c26a2b; }

/* 강사용 전체 일정 관리 캘린더 */
.adm-card--cal { margin-top: 0; overflow: visible; }
/* 수업 요일 칸을 넓혀 화면보다 커지면 이 래퍼 안에서 가로 스크롤 (오른쪽 끝까지 확인 가능) */
.adm-cal-scroll { overflow-x: auto; padding-bottom: 6px; }
.adm-cal--mgmt .adm-cal__cell { min-height: 74px; overflow: visible; }
.adm-cal--mgmt .adm-cal__events { overflow: visible; }
.adm-cal__cell--click { cursor: pointer; transition: border-color 0.1s ease, background 0.1s ease; }
.adm-cal__cell--click:hover { border-color: var(--purple-2); background: var(--lav); }
.adm-cal__cell.is-selected {
  border-color: var(--purple-2);
  box-shadow: 0 0 0 2px rgba(138, 122, 181, 0.18);
}

.adm-day-editor { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.adm-day-editor__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.adm-day-editor__date { font-size: 0.95rem; font-weight: 700; }
.adm-day-ev-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.adm-day-ev {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.adm-day-ev__name { flex: 1; font-size: 0.86rem; }
.adm-day-ev__actions { display: flex; gap: 6px; }
.adm-day-form {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--lav);
  padding: 12px 14px;
  border-radius: 10px;
}
.adm-day-form .adm-field { flex-direction: column; align-items: flex-start; gap: 5px; }
/* 버튼 묶음: 빈 라벨 자리(&nbsp;)로 입력칸과 상단을 맞춰, 라벨 없이도 정렬이 어긋나지 않게 */
.adm-day-form__btns { display: flex; gap: 8px; align-items: center; }
.adm-day-form .adm-field--grow { flex: 1; min-width: 200px; }
.adm-day-form .adm-field--grow .adm-input { width: 100%; min-width: 220px; }
.adm-day-form__clinic-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 280px;
  flex-wrap: wrap;
}
.adm-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--border, #e4e0ec);
  border-radius: 8px;
}
.adm-chip-row__sep {
  width: 1px;
  height: 20px;
  background: var(--border, #e4e0ec);
  margin: 0 2px;
}
.adm-stu-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px 3px 10px;
  background: #f7f0e3;
  color: #7a6340;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}
.adm-stu-chip--off {
  background: #f3f3f5;
  color: var(--muted, #888);
}
/* 칩 안 클리닉 시간 선택 (학생마다 다른 시간) */
.adm-stu-chip__time {
  margin-left: 4px;
  padding: 1px 2px;
  font-family: inherit;
  font-size: 0.72rem;
  color: #7a6340;
  background: #fff;
  border: 1px solid #e6d9c0;
  border-radius: 6px;
  cursor: pointer;
}
.adm-stu-chip--off .adm-stu-chip__time { display: none; } /* 제외된 학생은 시간 숨김 */
/* 기본 시간 + 전체 적용 */
.adm-clinic-base { display: inline-flex; align-items: center; gap: 6px; }
.adm-stu-chip__btn {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.65;
}
.adm-stu-chip__btn:hover { opacity: 1; }
.adm-stu-chip__btn--add { font-size: 0.9rem; font-weight: 700; }
.adm-ac-wrap { position: relative; }
.adm-ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--border, #e4e0ec);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(60, 40, 90, 0.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
}
.adm-ac-item {
  padding: 8px 12px;
  font-size: 0.84rem;
  cursor: pointer;
}
.adm-ac-item:hover,
.adm-ac-item.is-active { background: var(--lav, #f3effa); }
.adm-ac-empty {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--muted, #888);
}
.adm-btn--xs { padding: 3px 9px; font-size: 0.74rem; }
.adm-btn--danger { color: #d24b4b; border-color: #ecc6c6; }
.adm-btn--danger:hover { background: #f7e3e3; }
/* 삭제 확인 대기 — 한 번 더 누르면 실제로 지워지는 상태 */
.adm-btn.is-armed {
  background: #f7e3e3;
  color: #b93b3b;
  border-color: #dfa9a9;
  font-weight: 600;
}

/* 학생 이름 — 목록에서 누르면 상세 창이 열림 */
.adm-name-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--purple);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s ease;
}
.adm-name-btn:hover { text-decoration-color: currentColor; }

/* 학생별 관리 창 (모달) */
body.is-modal-open { overflow: hidden; }
.adm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.adm-modal[hidden] { display: none; }
.adm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 35, 65, 0.42);
}
.adm-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: 100%;
  background: #faf9fc;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(50, 35, 80, 0.28);
  overflow: hidden;
}
.adm-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
/* 내용이 길면 창 안에서만 스크롤 */
.adm-modal__body { overflow-y: auto; padding: 20px 22px 24px; }
.adm-modal__close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.adm-modal__close:hover { background: var(--lav); color: var(--purple); }
@media (max-width: 720px) {
  .adm-modal { padding: 0; }
  .adm-modal__dialog { border-radius: 0; height: 100%; }
}

/* 상담 기록 보기·수정 창 (학생 상세 위에 겹쳐 열림) */
.adm-modal--stack { z-index: 110; }
.adm-modal__dialog--narrow { width: min(560px, 100%); }

/* 짧은 확인 창(저장 경고 등)은 좁은 화면에서도 전체화면으로 늘리지 않음.
   위 720px 규칙(.adm-modal__dialog { height: 100% })보다 뒤에 두어 덮어씀 */
.adm-modal__dialog--auto {
  height: auto;
  max-height: min(90vh, 100%);
  border-radius: 16px;
  margin: 16px;
}
/* 상담 기록 창은 넓게 (2026-08-18) — 상담 내용이 길어 좁은 창에서는 읽기 어려웠음 */
.adm-modal__dialog--wide { width: min(1280px, 100%); }

.adm-consult-list { display: flex; flex-direction: column; gap: 14px; }
.adm-consult-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.adm-consult-item__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
/* 상담 내용 칸은 **자체 스크롤 없이** 내용 전체가 보이도록 높이를 늘림 (JS: autoGrowConsultNote).
   스크롤은 카드 하나하나가 아니라 목록 전체(.adm-modal__body)에서만 생긴다. */
.adm-consult-note {
  width: 100%;
  resize: none;
  overflow-y: hidden;
  min-height: 64px;
}

/* 설정 탭 (랜딩 페이지 내용) */
#panel-settings .adm-slot-row { margin-bottom: 8px; flex-wrap: nowrap; }
#panel-settings .adm-slot-row:last-child { margin-bottom: 0; }
/* 긴 칸(경력 내용·주소)이 남는 폭을 나눠 갖고, 좁아지면 함께 줄어듦 */
#panel-settings .site-career-desc,
#panel-settings .site-material-title,
#panel-settings .site-material-url,
#panel-settings .site-channel-url { flex: 1 1 0; min-width: 0; }
#panel-settings .site-career-date { flex: 0 0 132px; }
#panel-settings .site-material-date { flex: 0 0 140px; }
#panel-settings .site-channel-handle { flex: 0 0 150px; }
#panel-settings .site-channel-show { accent-color: var(--purple-2, #7463a6); }
/* 채널 이름 폭을 맞춰 입력칸 왼쪽 라인을 정렬 */
#panel-settings #siteChannels .adm-field__label { min-width: 74px; }
#panel-settings .adm-empty { padding: 12px 0; font-size: 0.84rem; color: var(--muted); }
@media (max-width: 720px) {
  #panel-settings .adm-slot-row { flex-wrap: wrap; }
  #panel-settings .site-career-date,
  #panel-settings .site-material-date,
  #panel-settings .site-channel-handle { flex: 1 1 120px; }
}

/* 레포트 미리보기 */
.adm-report-preview { font-size: 0.9rem; line-height: 1.7; }
.adm-report__row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.adm-report__row:last-child { border-bottom: none; }
.adm-report__key { min-width: 130px; color: var(--muted); font-weight: 500; }
.adm-report__val { flex: 1; }
.adm-report__tag {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
}
.adm-report__tag--common { background: var(--lav-2); color: var(--purple); }
.adm-report__tag--indiv { background: #f7f0e3; color: #a8895f; }

/* 반응형 (후순위) */
@media (max-width: 900px) {
  .adm-grid2 { grid-template-columns: 1fr; }
  .adm-info-grid { grid-template-columns: repeat(2, 1fr); }
  /* min-width도 함께 풀어야 함 — max-content가 남으면 줄바꿈을 허용해도 밖으로 나감 */
  .adm-cal-head .adm-card__title { flex: 1 1 100%; white-space: normal; min-width: 0; }
  .adm-range { width: 100%; }
  .adm-table--entry .col-note { min-width: 260px; width: 300px; }
  .adm-cell--note { min-width: 240px; }
}

/* 좁은 화면(스마트폰) — 레포트 탭이 화면 밖으로 나가지 않게 */
@media (max-width: 640px) {
  .adm-review-q { grid-template-columns: 1fr; } /* 문항 입력칸 2열 → 1열 */
  .adm-field--count { flex-wrap: wrap; }        /* '문항 수' 라벨과 스테퍼가 접힘 */
  .adm-count-quick { margin-left: 0; }
  .adm-review-preset { flex-wrap: wrap; }
}

/* 설정 탭 — 수업 시간표 배치 편집기 */
.adm-timetable-edit-wrap { overflow-x: auto; margin-top: 12px; }
.adm-timetable-edit {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  text-align: center;
}
/* 요일 칸 최소 너비 — 좁으면 표가 가로로 스크롤됨 (랜딩과 같은 규칙) */
.adm-timetable-edit th:not(.adm-tt-time),
.adm-timetable-edit td:not(.adm-tt-time) { min-width: 60px; }
.adm-timetable-edit th {
  background: var(--lav, #f2eefa);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 6px;
  border-radius: 8px;
}
/* 한 블록을 반 칸 2줄로 그리므로 한 줄은 블록 높이의 절반 */
.adm-timetable-edit td {
  height: 29px;
  padding: 3px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px dashed transparent;
  vertical-align: middle;
}
.adm-timetable-edit td.is-drop { border-color: var(--purple-2, #7463a6); background: #f4f0fb; }
.adm-timetable-edit .adm-tt-time {
  background: var(--lav, #f2eefa);
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  width: 52px;
  min-width: 52px;
  min-height: 60px;
  padding: 10px 2px;
  line-height: 1.35;
}
/* 시각 / - / 시각 세 줄 (랜딩 시간표와 동일) */
.adm-timetable-edit .col-time__t { display: block; }
.adm-timetable-edit .col-time__d { display: block; opacity: 0.5; }
.adm-tt-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  height: 100%;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
}
.adm-tt-item:active { cursor: grabbing; }
.adm-tt-item.is-dragging { opacity: 0.45; }
.adm-tt-item + .adm-tt-item { margin-top: 4px; }
.adm-tt-item__name { font-size: 0.8rem; font-weight: 500; }
.adm-tt-item__academy { font-size: 0.68rem; opacity: 0.7; }
.adm-tt-resize {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  font-size: 11px;
  line-height: 1;
  opacity: 0.55;
  cursor: ns-resize;
  padding: 2px 6px;
}
.adm-tt-resize:hover { opacity: 1; }
/* 랜딩과 같은 반 색상 (styles.css의 .lesson--*와 동일 팔레트) */
.adm-tt-item.lesson--lav   { background: #ece7f8; color: #6f5f97; }
.adm-tt-item.lesson--pink  { background: #f7e9f2; color: #a85f88; }
.adm-tt-item.lesson--blue  { background: #e7eef8; color: #5f7ba8; }
.adm-tt-item.lesson--amber { background: #f7f0e3; color: #a8895f; }
.adm-tt-item.lesson--green { background: #e7f1e9; color: #5f8f6f; }
.adm-tt-item.lesson--teal  { background: #e2eff0; color: #4f8a8f; }

/* 드래그앤드롭 순서 변경 — 시험 일정(D-Day)·설정 탭 경력 공용 */
.ce-exam-handle,
.site-career-handle {
  align-self: center;
  cursor: grab;
  user-select: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}
.ce-exam-handle:active,
.site-career-handle:active { cursor: grabbing; }
.adm-slot-row.is-dragging { opacity: 0.45; }
.adm-slot-row.is-drop-above { box-shadow: inset 0 3px 0 var(--purple-2); border-radius: 4px; }
.adm-slot-row.is-drop-below { box-shadow: inset 0 -3px 0 var(--purple-2); border-radius: 4px; }
