/* =========================================================
 * 편입N 목업 시안 — P6 관리자 LMS 전용 스타일 (p6- 접두사)
 * 로드: tokens.css → site.css → admin.css → pages/p6.css
 * ========================================================= */

/* ---------- 0. 인강/학원 전환: body[data-p6-mode] 에 따라 [data-p6-show] 표시 ---------- */
body[data-p6-mode="online"] [data-p6-show="academy"],
body[data-p6-mode="academy"] [data-p6-show="online"] { display: none !important; }
.mode-bar .p6-mode-tag { margin-left: auto; }
.mode-bar .p6-only { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 767px) {
  .mode-bar { gap: 8px 10px; }
  .mode-bar .p6-mode-tag { margin-left: 0; }
  .mode-bar > .muted { flex: 1 1 100%; }
}

/* 공용 보조 */
.p6-muted { color: var(--slate-500); }
.p6-num { font-variant-numeric: tabular-nums; }
.p6-gap { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.p6-sec-gap { margin-top: 16px; }
.p6-h4 { font-size: 14px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dt td .p6-prog { min-width: 120px; }
.p6-prog.is-navy b { color: var(--navy); }
.p6-prog.is-mid b { color: var(--amber); }
.p6-prog.is-mid .progress > span { background: var(--amber); }
.p6-prog.is-low b { color: var(--slate-500); }
.p6-prog.is-low .progress > span { background: var(--slate-400); }
.p6-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.p6-up { color: var(--red); font-size: 11px; font-weight: 700; margin-left: 4px; }
.p6-down { color: var(--blue); font-size: 11px; font-weight: 700; margin-left: 4px; }
.p6-sel-count b { color: var(--red); }
.p6-bulk { display: flex; gap: 6px; flex-wrap: wrap; }
.dt-tools .p6-bulk .btn { white-space: nowrap; }
.p6-device { display: inline-flex; align-items: center; }

/* 권한 안내 막대 (JS 가 채움) */
.p6-scope { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--slate-600); margin: -6px 0 14px; }
.p6-scope .badge { height: 20px; font-size: 11px; }

/* 학원 전용 화면에서 인강 모드일 때 */
.p6-only-note { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.p6-only-note .empty { padding: 44px 20px; }
.p6-only-note .empty p { max-width: 520px; margin: 0 auto; line-height: 1.7; }
.p6-only-note .row { justify-content: center; margin-top: 14px; }

/* ---------- 1. 모달 내부 공용 ---------- */
.p6-mfield + .p6-mfield { margin-top: 16px; }
.p6-mfield > .label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.p6-tpl-list { display: grid; gap: 8px; }
.p6-tpl { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--input-line); border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.p6-tpl input { margin-top: 3px; accent-color: var(--navy); flex-shrink: 0; }
.p6-tpl b { display: block; font-size: 14px; color: var(--navy); }
.p6-tpl span { color: var(--slate-500); }
.p6-tpl:has(input:checked) { border-color: var(--navy); background: var(--blue-soft); }
.p6-tpl .st { margin-left: auto; flex-shrink: 0; }
.p6-modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
@media (max-width: 767px) { .p6-modal-grid { grid-template-columns: minmax(0, 1fr); } }
.p6-recip { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; overflow-y: auto; }
.p6-recip .badge { font-weight: 600; }
.p6-quota { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius); background: var(--bg); font-size: 12px; color: var(--slate-600); }
.p6-quota b { color: var(--navy); }
.p6-course-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.p6-course-pick label { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; cursor: pointer; }
.p6-course-pick input { accent-color: var(--navy); margin-top: 2px; flex-shrink: 0; }
.p6-course-pick small { display: block; color: var(--slate-500); font-size: 11px; }
.p6-course-pick label:has(input:checked) { border-color: var(--navy); background: var(--blue-soft); }
@media (max-width: 767px) { .p6-course-pick { grid-template-columns: minmax(0, 1fr); } }
.p6-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.p6-inline .input, .p6-inline .select { width: auto; flex: 1 1 140px; height: 38px; font-size: 13px; }
.p6-inline .select { padding-right: 30px; background-position: right 10px center; }
.modal .check, .modal .radio, .p6-form .check, .p6-form .radio { font-size: 13px; }

/* ---------- 2. 알림톡 미리보기 (휴대폰 모양) ---------- */
.p6-phone { background: #b2c7d9; border-radius: 18px; padding: 14px 12px 16px; border: 6px solid #1b2333; max-width: 300px; margin: 0 auto; }
.p6-phone-top { display: flex; justify-content: space-between; font-size: 10px; color: #2d3a4f; margin-bottom: 10px; padding: 0 4px; }
.p6-kakao { background: #fff; border-radius: 4px 14px 14px 14px; overflow: hidden; font-size: 12px; line-height: 1.6; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.p6-kakao-head { background: var(--kakao); color: #3a1d1d; font-weight: 800; padding: 8px 12px; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.p6-kakao-body { padding: 12px; color: #222; white-space: pre-line; word-break: keep-all; }
.p6-kakao-btn { margin: 0 12px 12px; border: 1px solid var(--line); border-radius: 4px; text-align: center; padding: 7px; font-size: 12px; color: #333; background: #f7f7f7; }
.p6-phone-from { font-size: 11px; color: #2d3a4f; margin: 0 0 4px 4px; font-weight: 700; }
.p6-sms { background: #fff; border-radius: 14px; padding: 12px; font-size: 12px; line-height: 1.6; white-space: pre-line; color: #222; }
.p6-phone.is-sms { background: #f1f2f6; }
.p6-phone-meta { font-size: 11px; color: var(--slate-500); text-align: center; margin-top: 8px; }

/* ---------- 3. 학생 상세 ---------- */
.p6-profile { padding: 22px 18px; text-align: center; }
.p6-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: var(--navy); }
.p6-avatar.is-academy { background: var(--blue); }
.p6-profile h2 { font-size: 20px; font-weight: 800; }
.p6-profile .p6-gap { justify-content: center; margin-top: 6px; }
.p6-profile .kv { text-align: left; margin-top: 16px; font-size: 13px; grid-template-columns: 92px minmax(0, 1fr); }
.p6-profile .kv dt, .p6-profile .kv dd { padding: 9px 10px; }
.p6-profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.p6-memo-list { display: grid; gap: 10px; margin-top: 12px; }
.p6-memo { padding: 10px 12px; border-radius: var(--radius); background: #fffdf5; border: 1px solid #f1e6bf; font-size: 13px; line-height: 1.6; }
.p6-memo small { display: block; color: var(--slate-500); font-size: 11px; margin-top: 2px; }
.p6-course-prog { display: grid; gap: 14px; }
.p6-course-prog li { display: grid; gap: 6px; }
.p6-course-prog .row { justify-content: space-between; gap: 6px; font-size: 13px; }
.p6-course-prog .row b { font-size: 14px; }
.p6-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 11px; text-align: center; }
.p6-month .h { color: var(--slate-500); font-weight: 700; padding-bottom: 2px; }
.p6-month .d { aspect-ratio: 1.3; border-radius: 4px; display: grid; place-items: center; background: var(--bg); color: var(--slate-500); font-weight: 600; }
.p6-month .d.is-ok { background: var(--green-soft); color: var(--green); }
.p6-month .d.is-late { background: var(--amber-soft); color: var(--amber); }
.p6-month .d.is-absent { background: var(--red-soft); color: var(--red); }
.p6-month .d.is-early { background: var(--orange-soft); color: var(--orange); }
.p6-month .d.is-off { background: transparent; color: var(--slate-300); }
.p6-month .d.is-blank { background: transparent; }
.p6-month .d.is-today { box-shadow: inset 0 0 0 2px var(--navy); }
.p6-att-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--slate-600); margin-top: 10px; }
.p6-att-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ---------- 4. 반 배정 (좌우 이동 목록) ---------- */
.p6-dual { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.p6-dual-box { border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; }
.p6-dual-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; background: #fafbfc; }
.p6-dual-head .row { justify-content: space-between; gap: 6px; font-size: 13px; }
.p6-dual-list { height: 300px; overflow-y: auto; padding: 4px 0; }
.p6-dual-list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.p6-dual-list label:hover { background: #fafbfd; }
.p6-dual-list label:has(input:checked) { background: var(--blue-soft); }
.p6-dual-list input { accent-color: var(--navy); width: 16px; height: 16px; flex-shrink: 0; }
.p6-dual-list .sub { margin-left: auto; font-size: 11px; color: var(--slate-500); white-space: nowrap; }
.p6-dual-list .is-new { animation: p6flash 1.2s var(--ease); }
@keyframes p6flash { from { background: #fff3c4; } to { background: transparent; } }
.p6-dual-btns { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.p6-dual-btns .btn { width: 100%; padding: 0; }
@media (max-width: 767px) {
  .p6-dual { grid-template-columns: minmax(0, 1fr); }
  .p6-dual-btns { flex-direction: row; justify-content: center; }
  .p6-dual-btns .btn { width: auto; padding: 0 16px; }
  .p6-dual-btns .btn .ico { transform: rotate(90deg); }
  .p6-dual-list { height: 220px; }
}
.p6-cap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.p6-cap .progress { flex: 1; }
.p6-cap b { font-size: 12px; white-space: nowrap; }

/* ---------- 5. 공지 작성 ---------- */
.p6-target-sub { margin-top: 10px; padding: 12px; border-radius: var(--radius); background: var(--bg); display: grid; gap: 8px; }
.p6-target-sub .check-group { gap: 8px 16px; }
.p6-est { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 16px; background: var(--blue-soft); border-radius: var(--radius); font-size: 13px; color: var(--navy); }
.p6-est b { font-size: 18px; }
.p6-read { min-width: 130px; }
.dt tr[data-open] { cursor: pointer; }

/* ---------- 6. 상담 ---------- */
.p6-type { min-width: 52px; justify-content: center; }
.dt tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.p6-tl .timeline li { padding-bottom: 18px; }
.p6-tl .timeline b { display: block; font-size: 13px; margin: 2px 0; }
.p6-tl .timeline p { color: var(--slate-600); font-size: 12px; line-height: 1.6; }
.p6-tl .timeline li.is-next::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.p6-tl-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.p6-tl-head .p6-avatar { width: 40px; height: 40px; font-size: 15px; margin: 0; }
.p6-tl-head b { display: block; }
.p6-tl-head span { font-size: 12px; color: var(--slate-500); }

/* ---------- 7. 시간표 격자 ---------- */
.p6-tt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.p6-tt { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.p6-tt th { font-size: 12px; font-weight: 700; color: var(--slate-600); padding: 6px; background: #f8f9fb; border-radius: 4px; }
.p6-tt th.p6-tt-time { width: 92px; text-align: left; }
.p6-tt th.p6-tt-time small { display: block; font-weight: 500; color: var(--slate-500); font-size: 11px; }
.p6-tt th.is-today { background: var(--navy); color: #fff; }
.p6-tt td { padding: 0; vertical-align: top; }
.p6-cell { width: 100%; min-height: 78px; text-align: left; padding: 8px 9px; border-radius: 5px; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--slate-600); position: relative; transition: border-color .15s; }
.p6-cell:hover { border-color: var(--navy); }
.p6-cell b { font-size: 13px; color: var(--navy); line-height: 1.35; }
.p6-cell .p6-subj { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 3px; align-self: flex-start; }
.p6-cell.is-eng { border-left: 3px solid var(--navy); }
.p6-cell.is-eng .p6-subj { background: var(--blue-soft); color: var(--navy); }
.p6-cell.is-math { border-left: 3px solid var(--blue); }
.p6-cell.is-math .p6-subj { background: #e6f0ff; color: var(--blue); }
.p6-cell.is-test { border-left: 3px solid var(--orange); }
.p6-cell.is-test .p6-subj { background: var(--orange-soft); color: var(--orange); }
.p6-cell.is-self { background: #fafbfc; border-style: dashed; }
.p6-cell.is-self .p6-subj { background: var(--line-soft); color: var(--slate-500); }
.p6-cell.is-empty { background: transparent; border-style: dashed; color: var(--slate-300); align-items: center; justify-content: center; }
.p6-cell.is-cancel { background: var(--red-soft); border-color: #f3c3c5; }
.p6-cell.is-cancel b { text-decoration: line-through; color: var(--slate-500); }
.p6-cell.is-makeup { background: #eef4ff; border-color: #b8cdf0; }
.p6-cell .p6-flag { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 3px; }
.p6-cell.is-cancel .p6-flag { background: var(--red); color: #fff; }
.p6-cell.is-makeup .p6-flag { background: var(--blue); color: #fff; }
.p6-tt tr.p6-lunch td { font-size: 11px; color: var(--slate-500); text-align: center; background: repeating-linear-gradient(45deg, #f8f9fb, #f8f9fb 6px, #fff 6px, #fff 12px); border-radius: 4px; padding: 4px; }
.p6-week { display: inline-flex; align-items: center; gap: 4px; }
.p6-week b { min-width: 170px; text-align: center; font-size: 14px; }
.p6-change-list li { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.p6-change-list li:first-child { border-top: 0; }
.p6-change-list .st { flex-shrink: 0; }
.p6-change-list p { color: var(--slate-500); font-size: 12px; }

/* ---------- 8. 출석 ---------- */
.p6-att { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.p6-att button { height: 30px; min-width: 46px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--input-line); background: #fff; font-size: 12px; font-weight: 700; color: var(--slate-500); }
.p6-att button:hover { border-color: var(--navy); color: var(--navy); }
.p6-att button.is-on[data-v="ok"] { background: var(--green); border-color: var(--green); color: #fff; }
.p6-att button.is-on[data-v="late"] { background: var(--amber); border-color: var(--amber); color: #fff; }
.p6-att button.is-on[data-v="absent"] { background: var(--red); border-color: var(--red); color: #fff; }
.p6-att button.is-on[data-v="early"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.dt td .input.p6-memo-in { height: 30px; font-size: 12px; min-width: 150px; padding: 0 8px; }
.p6-mtable { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.p6-mtable th, .p6-mtable td { border: 1px solid var(--line-soft); padding: 6px 4px; text-align: center; white-space: nowrap; }
.p6-mtable thead th { background: #f8f9fb; color: var(--slate-600); font-weight: 700; position: sticky; top: 0; }
.p6-mtable thead th.is-sun, .p6-mtable td.is-sun { background: #fafbfc; color: var(--slate-300); }
.p6-mtable thead th.is-today { background: var(--navy); color: #fff; }
.p6-mtable th small { display: block; font-weight: 500; font-size: 10px; color: var(--slate-500); }
.p6-mtable thead th.is-today small { color: var(--slate-300); }
.p6-mtable .p6-mname { position: sticky; left: 0; background: #fff; text-align: left; padding: 6px 10px; z-index: 1; font-weight: 700; color: var(--navy); min-width: 84px; }
.p6-mtable thead .p6-mname { background: #f8f9fb; z-index: 2; }
.p6-mtable td.o { color: var(--green); font-weight: 800; }
.p6-mtable td.l { color: var(--amber); font-weight: 800; background: var(--amber-soft); }
.p6-mtable td.x { color: var(--red); font-weight: 800; background: var(--red-soft); }
.p6-mtable td.e { color: var(--orange); font-weight: 800; background: var(--orange-soft); }
.p6-mtable td.f { color: var(--slate-300); }
.p6-mtable .p6-mrate { font-weight: 800; color: var(--navy); }

/* ---------- 9. 성적 ---------- */
.bar-chart.is-pair .bc-label { left: 50%; transform: translateX(-50%); }
.p6-exam-list li + li { border-top: 1px solid var(--line-soft); }
.p6-exam-list button { width: 100%; text-align: left; display: grid; gap: 4px; padding: 12px 16px; font-size: 13px; }
.p6-exam-list button:hover { background: #fafbfd; }
.p6-exam-list button.is-active { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--navy); }
.p6-exam-list b { font-size: 14px; color: var(--navy); }
.p6-exam-list .p6-gap { font-size: 12px; color: var(--slate-500); }
.dt td .input.p6-sc { width: 64px; height: 32px; padding: 0 8px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.dt td .input.p6-sc.is-error { border-color: var(--danger); background: #fff5f5; }
.dt tfoot td { background: #f8f9fb; font-weight: 800; border-top: 2px solid var(--line); color: var(--navy); }
.p6-rank { display: inline-grid; place-items: center; min-width: 26px; height: 22px; border-radius: 11px; background: var(--bg); font-size: 12px; font-weight: 800; }
.p6-rank.is-top { background: var(--red); color: #fff; }
.p6-report { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
.p6-report-head { background: var(--navy); color: #fff; padding: 12px 14px; }
.p6-report-head b { display: block; font-size: 15px; }
.p6-report-head span { font-size: 11px; color: var(--slate-300); }
.p6-report table { width: 100%; }
.p6-report td, .p6-report th { padding: 7px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.p6-report td:last-child { text-align: right; font-weight: 700; }
.p6-report p { padding: 10px 14px; color: var(--slate-600); font-size: 12px; line-height: 1.6; }

/* ---------- 10. 알림톡 등 채팅 (3단) ---------- */
.p6-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.p6-flow li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; color: var(--slate-600); line-height: 1.55; position: relative; }
.p6-flow li b { display: block; font-size: 13px; color: var(--navy); }
.p6-flow .n { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.p6-flow li:nth-child(2) .n { background: #3a1d1d; color: var(--kakao); }
.p6-flow li:nth-child(3) .n { background: var(--red); }
@media (max-width: 1023px) { .p6-flow { grid-template-columns: minmax(0, 1fr); } }

.p6-msg { display: grid; grid-template-columns: 290px minmax(0, 1fr) 280px; height: 660px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.p6-msg > * { min-width: 0; min-height: 0; }
.p6-msg-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.p6-msg-list-head { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.p6-msg-list-head .input, .p6-msg-list-head .select { height: 36px; font-size: 13px; }
.p6-msg-list-head .select { padding-right: 30px; background-position: right 10px center; }
.p6-msg-items { flex: 1; overflow-y: auto; }
.p6-msg-item { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.p6-msg-item:hover { background: #fafbfd; }
.p6-msg-item.is-active { background: var(--blue-soft); }
.p6-msg-item .p6-ava { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.p6-msg-item .p6-ava.is-parent { background: var(--slate-500); }
.p6-msg-item .p6-ava.is-online { background: var(--blue); }
.p6-msg-item .t { flex: 1; min-width: 0; }
.p6-msg-item .t b { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.p6-msg-item .t small { font-size: 11px; color: var(--slate-500); font-weight: 500; }
.p6-msg-item .t p { font-size: 12px; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.p6-msg-item .m { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--slate-500); flex-shrink: 0; }
.p6-unread { min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.p6-msg-group { padding: 8px 14px; font-size: 11px; font-weight: 800; color: var(--slate-500); background: #fafbfc; border-bottom: 1px solid var(--line-soft); }

.p6-chat { display: flex; flex-direction: column; background: #f6f8fb; }
.p6-chat-head { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.p6-chat-head b { font-size: 15px; }
.p6-chat-head span { font-size: 12px; color: var(--slate-500); }
.p6-chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.p6-day { align-self: center; font-size: 11px; color: var(--slate-500); background: #e9edf3; padding: 3px 10px; border-radius: 10px; }
.p6-bub { max-width: 78%; display: flex; gap: 6px; align-items: flex-end; }
.p6-bub .b { padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; background: #fff; border: 1px solid var(--line); color: var(--navy); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.p6-bub .meta { font-size: 10px; color: var(--slate-500); white-space: nowrap; display: grid; gap: 1px; }
.p6-bub.is-me { align-self: flex-end; flex-direction: row-reverse; }
.p6-bub.is-me .b { background: var(--navy); color: #fff; border-color: var(--navy); border-bottom-right-radius: 4px; }
.p6-bub.is-me .meta { text-align: right; }
.p6-bub.is-st .b { border-bottom-left-radius: 4px; }
.p6-bub .read { color: var(--blue); font-weight: 700; }
.p6-bub .unread { color: var(--amber); font-weight: 700; }
.p6-bub .file { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.12); font-size: 12px; }
.p6-bub.is-st .file { background: var(--bg); }
.p6-sys { align-self: center; font-size: 11px; color: var(--slate-600); background: #fff9db; border: 1px dashed #e6d48a; padding: 5px 10px; border-radius: 6px; text-align: center; max-width: 90%; }
.p6-compose { background: #fff; border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; }
.p6-compose .chips .chip { height: 28px; font-size: 12px; padding: 0 10px; }
.p6-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.p6-compose .textarea { min-height: 64px; height: 64px; font-size: 13px; resize: none; }
.p6-compose-row .btn { height: 64px; flex-shrink: 0; }
.p6-compose-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--slate-500); }
.p6-compose-opt .check { font-size: 12px; color: var(--slate-600); }
.p6-compose-opt .check input { width: 15px; height: 15px; accent-color: var(--navy); }

.p6-info { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.p6-info .p6-avatar { width: 56px; height: 56px; font-size: 20px; margin-bottom: 4px; }
.p6-info-head { text-align: center; }
.p6-info-head b { display: block; font-size: 16px; }
.p6-info-head span { font-size: 12px; color: var(--slate-500); }
.p6-info .kv { font-size: 12px; grid-template-columns: 76px minmax(0, 1fr); }
.p6-info .kv dt, .p6-info .kv dd { padding: 8px; }
.p6-info .btn { width: 100%; }
.p6-info-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p6-info-mini > div { background: var(--bg); border-radius: var(--radius); padding: 10px; text-align: center; font-size: 11px; color: var(--slate-500); }
.p6-info-mini b { display: block; font-size: 18px; color: var(--navy); }

@media (max-width: 1279px) {
  .p6-msg { grid-template-columns: 260px minmax(0, 1fr); height: auto; }
  .p6-msg-list { height: 620px; }
  .p6-chat { height: 620px; }
  .p6-info { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p6-info > * { min-width: 0; }
}
@media (max-width: 1023px) {
  .p6-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .p6-msg { grid-template-columns: minmax(0, 1fr); }
  .p6-msg-list { height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .p6-msg-items { max-height: 250px; }
  .p6-chat { height: 560px; }
  .p6-info { grid-template-columns: minmax(0, 1fr); }
  .p6-bub { max-width: 90%; }
}

.p6-quota-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p6-quota-cards .kpi { padding: 14px; }
.p6-quota-cards .kpi-value { font-size: 22px; }
.p6-hist-fail { color: var(--red); font-weight: 700; }

/* ---------- 11. 보조 레이아웃 ---------- */
.adm-grid.p6-grid-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.adm-grid.p6-grid-grades { grid-template-columns: 280px minmax(0, 1fr); }
@media (max-width: 1279px) { .adm-grid.p6-grid-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) { .adm-grid.p6-grid-grades { grid-template-columns: minmax(0, 1fr); } }
body[data-p6-page] .stack > .panel, body[data-p6-page] .stack > .adm-grid { margin-top: 0; }
body[data-p6-page="student"] .panel-head .seg { flex-wrap: wrap; max-width: 100%; }

/* ---------- F2 보정 ---------- */
/* 1440 에서 공지·상담 표 오른쪽 열(열람률·다음 상담·상태)이 패널 밖으로 밀리던 문제: 셀 여백을 줄이고 날짜는 두 줄로 */
.dt.p6-tight th, .dt.p6-tight td { padding-left: 8px; padding-right: 8px; }
.dt.p6-tight .p6-read { min-width: 112px; }
/* 학습현황 인강 표(10열)가 1440 에서 6px 넘치던 문제 */
@media (min-width: 1024px) { #p6-table th, #p6-table td { padding-left: 9px; padding-right: 9px; } }

/* ---------- 학습 Q&A 답변 (lms-qna, 2026-11-20 추가) ---------- */
.p6-qa-late { color: var(--red) !important; font-weight: 700; }
.p6-qa-head { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.p6-qa-head h4 { font-size: 15px; font-weight: 800; color: var(--navy); margin: 8px 0 10px; line-height: 1.45; }
.p6-qa-kv { font-size: 12px; }
.p6-qa-kv dt, .p6-qa-kv dd { padding: 7px 10px; }
.p6-qa-q, .p6-qa-a { display: flex; gap: 10px; align-items: flex-start; }
.p6-qa-q p, .p6-qa-a p { font-size: 13px; line-height: 1.7; color: var(--navy); min-width: 0; overflow-wrap: anywhere; }
.p6-qa-a { margin-top: 14px; padding: 12px; border-radius: var(--radius); background: var(--blue-soft); }
.p6-qa-a > div { min-width: 0; }
.p6-qa-a b { font-size: 13px; color: var(--navy); margin-right: 6px; }
.p6-qa-a time { font-size: 11px; color: var(--slate-500); }
.p6-qa-mark { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--navy); }
.p6-qa-mark.is-a { background: var(--blue); }
.p6-qa-links { gap: 6px; margin: 10px 0 0 34px; flex-wrap: wrap; }
.p6-qa-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.p6-qa-form .field { margin-bottom: 10px; }
.p6-qa-form .label { font-size: 12px; }
.p6-qa-form .textarea { min-height: 120px; padding: 10px 12px; font-size: 13px; height: auto; }
.p6-qa-form .textarea.is-error { border-color: var(--danger); }
.p6-qa-form .check { font-size: 13px; }
.p6-qa-actions { justify-content: flex-end; gap: 6px; }

/* (EQH 2026-11-20) 좌우 섹션 높이 맞춤 보정 — 공용 규칙은 admin.css 4절 */
.p6-st-wide { margin-top: 16px; }
.p6-st-wide:empty { display: none; }
@media (min-width: 1024px) {
  /* (EQH5) 학생 학습현황: 접속 기록은 격자 밖 전체 폭, 기록이 빈 상태뿐이면 관리 메모를 오른쪽으로(p6.js fitStudent) → 좌우 늘려 맞춤.
     오른쪽 칸 안 인강/학원 상자와 그 마지막 패널을 늘린다 */
  .p6-st-grid:not(.is-top) > .p6-st-main > .stack { flex: 1 0 auto; }
  .p6-st-grid:not(.is-top) > .p6-st-main > .stack > .panel:last-child { flex: 1 0 auto; display: flex; flex-direction: column; }
  .p6-st-grid:not(.is-top) > .p6-st-main > .stack > .panel:last-child > .panel-body { flex-grow: 1; }
  /* 그래도 오른쪽이 250px 넘게 길 때(1024~1279 인강 보기, 학원생 학원 보기)만 is-top: 왼쪽 칸은 아래끝 기준으로 따라온다 */
  .p6-st-grid.is-top > .p6-st-side { position: sticky; bottom: 16px; align-self: end; }
  /* 긴 쪽 패널 안 스크롤 최소 높이 */
  #cs-list > .panel.is-fit { --fit-h: 450px; }   /* (EQH3) 오른쪽 타임라인(약 300~370) 가까이로 줄임. 6번째 줄이 반쯤 걸려 아래에 더 있음이 보이게 */
  #write.panel.is-fit { --fit-h: 560px; }
  .p6-grid-grades > .panel.is-fit { --fit-h: 612px; }   /* 마지막 줄이 반쯤 걸려 아래에 더 있음이 보이게 */
  /* (EQH3) 공지 작성 폼: 스크롤 상자 아래쪽을 흐리게 — 필드가 잘린 게 아니라 아래로 더 있음을 표시. 끝까지 내리면 마지막 필드는 흐림 위로 올라옴 */
  #write.panel.is-fit > .panel-body { padding-bottom: 40px; }
  #write.panel.is-fit > .panel-foot { position: relative; }
  #write.panel.is-fit > .panel-foot::before { content: ""; position: absolute; left: 0; right: 16px; bottom: 100%; height: 36px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 85%); pointer-events: none; }
}
/* (FINAL2) 1024~1279 학원생 학원 보기: 오른쪽 칸이 좁아 '소속 반' kv(120px 이름 칸)의 값이 5줄씩 꺾여 옆 출석 요약 아래 빈칸 →
   이 구간만 소속 반 kv 를 촘촘하게(이름 칸 76px·12px, 반 정보 패널과 같은 크기) */
@media (min-width: 1024px) and (max-width: 1279px) {
  #st-academy > .adm-grid.is-2 .kv { font-size: 12px; grid-template-columns: 76px minmax(0, 1fr); }
  #st-academy > .adm-grid.is-2 .kv dt, #st-academy > .adm-grid.is-2 .kv dd { padding: 8px; }
}
/* (EQH5) 시간표 오른쪽 칸: 반 정보·범례(시간표 머리·필터 바에서 옮김) + 이번 주 변경 사항(늘어남) */
.p6-tt-info { grid-template-columns: 76px minmax(0, 1fr); border-top: 0; font-size: 13px; }
.p6-tt-info dt, .p6-tt-info dd { padding: 10px 12px; }
.p6-tt-info dd:last-of-type, .p6-tt-info dt:last-of-type { border-bottom: 0; }
.p6-tt-legend { flex-direction: column; gap: 10px; font-size: 13px; }
