:root {
  --brand: #2f6fed;
  --brand-dark: #1f4fc4;
  --brand-light: #eaf1ff;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --sidebar-bg: #171b2e;
  --sidebar-text: #b7bcd6;
  --sidebar-text-active: #ffffff;
  --border: #e4e7f0;
  --text: #1c2033;
  --text-muted: #6b7086;
  --danger: #e5484d;
  --danger-light: #fdecec;
  --success: #1f9d55;
  --success-light: #e8f8ee;
  --warn: #c98a13;
  --warn-light: #fdf3e0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 45, 0.06), 0 4px 16px rgba(20, 24, 45, 0.05);
  font-size: 15px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #182242 0%, #2f4dc4 55%, #2f6fed 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(10, 15, 40, 0.35);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand .logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
}

.login-brand h1 {
  font-size: 19px;
  margin: 0;
  color: var(--text);
}

.login-brand p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-block { width: 100%; }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: #f4f6fb; }

.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fbd8d9; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-light); color: var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); }

/* ---------- App shell ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
}

.sidebar-brand .logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 15px;
  display: block;
}
.sidebar-brand span {
  font-size: 11px;
  color: var(--sidebar-text);
  opacity: 0.7;
}

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6d7290;
  padding: 14px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav-link.active {
  background: var(--brand);
  color: var(--sidebar-text-active);
}

.nav-link .icon { font-size: 16px; width: 18px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  font-size: 12px;
  color: var(--sidebar-text);
  padding: 6px 10px 10px;
  opacity: 0.75;
}

.logout-form { padding: 0 10px; }
.logout-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  border: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 62px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar h2 {
  font-size: 17px;
  margin: 0;
}

.branch-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 9px;
}

.branch-switcher a {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.branch-switcher a.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow);
}

.main-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ---------- Dashboard ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-card .label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 700; }
.stat-card .value.brand { color: var(--brand); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warn { color: var(--warn); }
.stat-card .value.danger { color: var(--danger); }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.menu-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,24,45,0.1); }

.menu-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 12px;
}

.menu-card h3 { margin: 0 0 4px; font-size: 15px; }
.menu-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- Page header / toolbar ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 { font-size: 20px; margin: 0; }
.page-header .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar form { display: flex; gap: 8px; }
.toolbar input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  min-width: 220px;
  font-family: inherit;
}

.filter-tabs { display: flex; gap: 6px; }
.filter-tabs a {
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}
.filter-tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Table / card panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warn { background: var(--warn-light); color: var(--warn); }
.badge-info { background: var(--brand-light); color: var(--brand); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-muted { background: #eef0f4; color: #9aa1ae; }
.nowrap { white-space: nowrap; }

/* 폼 안에서 여러 입력을 한 묶음으로 보이게 하는 소제목 */
.field-group-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.02em;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 34px; margin-bottom: 10px; }

.mono { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-muted); }

.reveal-toggle {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  font-family: inherit;
}

/* ---------- Forms ---------- */
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  max-width: 720px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.form-grid .field.full { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ---------- Placeholder ---------- */
.placeholder-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.placeholder-box {
  text-align: center;
  color: var(--text-muted);
}
.placeholder-box .icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.placeholder-box h2 { color: var(--text); margin: 0 0 8px; font-size: 19px; }
.placeholder-box p { margin: 0; font-size: 14px; }

/* ---------- Evaluations ---------- */
.eval-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.eval-main { flex: 2.2; min-width: 0; }
.eval-side {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 28px;
}

.side-card {
  padding: 20px;
}
.side-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text);
}
.side-card .field { margin-bottom: 12px; }
.side-card .field:last-of-type { margin-bottom: 16px; }

.report-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.report-sheet-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.report-sheet-toolbar h2 { margin: 0 0 4px; font-size: 17px; }
.report-sheet-toolbar p { margin: 0; font-size: 12.5px; color: var(--text-muted); max-width: 420px; }
.report-sheet-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

.save-hint-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  max-width: 240px;
  background: var(--warn-light);
  border: 1px solid #f0dfb8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #8a6a1f;
}
.save-hint-icon { font-size: 18px; flex-shrink: 0; }
.save-hint-card strong { color: #6b5116; }

.subject-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 14px;
}
.subject-section-head h3 { margin: 0; font-size: 15px; }

.subject-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fafbff;
}
.subject-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.subject-card-head .subject-name-input {
  flex: 1;
  font-weight: 600;
}
.subject-card .field { margin-bottom: 10px; }
.subject-card .field:last-child { margin-bottom: 0; }

.subject-section {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px dashed var(--border);
}
.subject-section:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }
.subject-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 8px;
}
.field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.field-row .field { flex: 1; margin-bottom: 0; }

.saved-list { display: flex; flex-direction: column; gap: 6px; }
.saved-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 4px 4px 4px 10px;
}
.saved-item.active { background: var(--brand-light); }
.saved-item a {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.saved-item a strong {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-item a span { font-size: 11px; color: var(--text-muted); }
.saved-item form { flex-shrink: 0; }

.btn-icon-delete {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.btn-icon-delete:hover { background: var(--danger-light); color: var(--danger); }

/* ---------- 학생 상세 ---------- */
.student-link { color: var(--brand); font-weight: 600; }
.student-link:hover { text-decoration: underline; }
.student-code-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 6px;
  padding: 3px 9px;
  margin-left: 8px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.detail-layout { display: flex; align-items: flex-start; gap: 20px; }
.detail-side { width: 300px; flex-shrink: 0; position: sticky; top: 28px; }
.detail-main { flex: 1; min-width: 0; }

.info-list { margin: 0; }
.info-list > div {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-list > div:last-child { border-bottom: none; }
.info-list dt { width: 92px; flex-shrink: 0; color: var(--text-muted); margin: 0; }
.info-list dd { margin: 0; flex: 1; word-break: break-word; }

.day-card { margin-bottom: 16px; padding: 0; }
.day-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.day-card-head h3 { margin: 0; font-size: 15px; }
.day-card-head .text-muted { font-size: 12px; }
.day-card .lesson-list th:first-child,
.day-card .lesson-list td:first-child { padding-left: 18px; }
.day-card .lesson-list th:last-child,
.day-card .lesson-list td:last-child { padding-right: 18px; }
.lesson-time-cell { white-space: nowrap; font-weight: 600; }
.teacher-cell { color: var(--brand); font-weight: 600; }

@media (max-width: 1000px) {
  .detail-layout { flex-direction: column; }
  .detail-side { width: 100%; position: static; }
}

/* ---------- 학생 주간 시간표 (화면 + JPG 캡처 공용) ---------- */
.tt-capture {
  background: #fff;
  padding: 26px 28px 20px;
  width: 1040px;
  max-width: 100%;
  box-sizing: border-box;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  color: #1c2033;
}
.tt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 3px solid var(--brand);
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.tt-brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--brand);
  margin-bottom: 6px;
}
.tt-title { font-size: 25px; font-weight: 800; color: #16233d; }
.tt-meta { text-align: right; font-size: 12.5px; color: var(--text-muted); line-height: 1.7; }
.tt-meta .tt-week { font-weight: 700; color: var(--brand); margin-top: 2px; }

.tt-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tt-grid th,
.tt-grid td { border: 1px solid #dfe2ea; }
.tt-grid thead th {
  background: #f4f6fb;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 4px;
  color: #16233d;
}
.tt-time-col {
  width: 96px;
  background: #fafbfd;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tt-time-col .tt-time-end { color: #b3b8c2; }
.tt-empty { background: #fff; height: 34px; }

.tt-lesson { padding: 6px 8px; background: var(--brand-light); vertical-align: middle; }
.tt-lesson .tt-lesson-body + .tt-lesson-body {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #b9c8ea;
}
.tt-subject { font-size: 14px; font-weight: 800; color: var(--brand-dark); line-height: 1.3; }
.tt-detail { font-size: 11.5px; color: #4b5568; margin-top: 2px; }
.tt-range { font-size: 10.5px; color: #8b93a3; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* 과목별 색 (평가 보고서와 동일한 색 체계) */
.tt-lesson.subj-수학 { background: #eaf1ff; }
.tt-lesson.subj-수학 .tt-subject { color: #2f6fed; }
.tt-lesson.subj-국어 { background: #e8f8ee; }
.tt-lesson.subj-국어 .tt-subject { color: #1f9d55; }
.tt-lesson.subj-영어 { background: #fdecec; }
.tt-lesson.subj-영어 .tt-subject { color: #d4595c; }
.tt-lesson.subj-과학,
.tt-lesson.subj-사회 { background: #f1ecfe; }
.tt-lesson.subj-과학 .tt-subject,
.tt-lesson.subj-사회 .tt-subject { color: #7c4ded; }

.tt-foot { margin-top: 12px; font-size: 10.5px; color: #9aa1ae; text-align: right; }

/* ---------- 수업관리 (시간표) ---------- */
.timetable-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.timetable-meta .file-name { font-weight: 600; }

.sheet-picker { margin-bottom: 18px; }
.sheet-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-btn {
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.sheet-btn:hover { background: var(--bg); color: var(--text); }
.sheet-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sheet-btn.unparsed { opacity: 0.55; font-weight: 500; }

.timetable-panel { overflow-x: auto; padding: 0; }
.timetable-grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 900px; }
.timetable-grid th,
.timetable-grid td {
  border: 1px solid var(--border);
  vertical-align: top;
  padding: 6px 8px;
}
.timetable-grid thead th {
  background: #fafbfd;
  text-align: center;
  padding: 10px 8px;
  position: sticky;
  top: 0;
}
.timetable-grid .room-name { font-size: 13px; font-weight: 700; color: var(--text); }
.timetable-grid .teacher-name { font-size: 11.5px; color: var(--brand); margin-top: 3px; font-weight: 600; }
.timetable-grid .time-col {
  width: 108px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  background: #fafbfd;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timetable-grid .empty-cell { background: #fcfdff; }
.timetable-grid .lesson-cell { background: var(--brand-light); }
.timetable-grid .lesson-time {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.lesson-students { display: flex; flex-wrap: wrap; gap: 3px; }
.student-chip {
  display: inline-block;
  background: var(--surface);
  border: 1px solid #cfdcfb;
  color: var(--text);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.4;
}

.lesson-list { width: 100%; border-collapse: collapse; }
.lesson-list th {
  text-align: left;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.lesson-list td {
  padding: 9px 10px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.lesson-list tr:last-child td { border-bottom: none; }

/* ---------- AI 입시 상담 ---------- */
.ai-menu-card { border-color: #cddcff; background: linear-gradient(145deg, #fff 0%, #f7f9ff 100%); }
.ai-menu-card .icon { background: #e6edff; }
.admission-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); gap: 20px; align-items: start; }
.admission-editor { min-width: 0; }
.admission-panel { padding: 22px; margin-bottom: 16px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0 0 4px; font-size: 16px; }
.panel-heading p { margin: 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 130px; padding: 18px; border: 1px dashed #b9c8ec; border-radius: 10px; background: #fafbff; color: var(--text); text-align: center; cursor: pointer; }
.upload-box:hover { border-color: var(--brand); background: var(--brand-light); }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-box strong { font-size: 13px; }
.upload-box small { margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.upload-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.extraction-status { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.extraction-status.running { color: var(--brand); }
.extraction-status.success { color: var(--success); }
.extraction-status.warning { color: var(--warn); }
.extraction-status.error { color: var(--danger, #d64545); }
.file-status { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f5f7fc; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.score-table-wrap { overflow-x: auto; }
.score-table { min-width: 540px; }
.score-table th { text-transform: none; letter-spacing: 0; }
.score-table td { padding: 8px; }
.score-table input { width: 100%; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 13px; }
.score-table td:first-child { width: 28%; }
.score-table td:last-child { width: 34px; }
.score-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.score-summary > div { padding: 10px; border-radius: 8px; background: #f6f8ff; text-align: center; }
.score-summary span { display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 4px; }
.score-summary strong { font-size: 17px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.admission-preview { position: sticky; top: 20px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.report-cover { min-height: 190px; padding: 28px; color: #fff; background: linear-gradient(135deg, #182242 0%, #2f4dc4 58%, #2f6fed 100%); }
.cover-kicker { font-size: 10px; letter-spacing: .14em; opacity: .72; }
.report-cover h2 { margin: 44px 0 8px; font-size: 25px; letter-spacing: -.04em; }
.report-cover p { margin: 0; font-size: 13px; opacity: .9; }
.cover-line { width: 44px; height: 3px; margin: 17px 0 9px; border-radius: 2px; background: #9db9ff; }
.report-cover small { opacity: .75; font-variant-numeric: tabular-nums; }
.preview-section { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.preview-section-title { margin-bottom: 12px; color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.preview-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-title-row .btn { letter-spacing: 0; }
.chatgpt-status { margin-left: auto; color: var(--text-muted); font-size: 10px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.chatgpt-status.connected { color: var(--success); }
.chatgpt-status.unavailable { color: var(--warn); }
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.insight-card { padding: 11px 8px; border-radius: 8px; background: #f7f9ff; text-align: center; }
.insight-card span { display: block; color: var(--text-muted); font-size: 10px; margin-bottom: 4px; }
.insight-card strong { font-size: 18px; color: var(--brand-dark); }
.recommendation { margin-top: 12px; padding: 11px 12px; border-radius: 8px; color: #294678; background: #edf3ff; font-size: 12px; line-height: 1.55; }
.ai-advice { margin-top: 10px; padding: 12px; border: 1px solid #cfe0ff; border-radius: 8px; background: #f8fbff; color: var(--text); white-space: pre-wrap; font-size: 12px; line-height: 1.65; }
.preview-score-list { display: flex; flex-direction: column; gap: 6px; }
.preview-score-row { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 9px; align-items: center; padding: 8px 10px; border-radius: 7px; background: #fafbff; font-size: 11px; color: var(--text-muted); }
.preview-score-row strong { color: var(--text); font-size: 12px; }
.preview-text { margin: 0; white-space: pre-wrap; color: var(--text); font-size: 12.5px; line-height: 1.7; }
.preview-target { margin: 10px 0 0; color: var(--brand); font-size: 12px; font-weight: 600; }
.preview-footer { padding: 14px 20px; color: var(--text-muted); background: #fafbfd; font-size: 10.5px; line-height: 1.5; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .admission-editor { display: none !important; }
  .main-content { padding: 0; overflow: visible; }
  .admission-layout { display: block; }
  .admission-preview { position: static; border: none; box-shadow: none; max-width: 800px; margin: 0 auto; }
  .report-cover { min-height: 210px; }
}

@media (max-width: 900px) {
  .eval-layout { flex-direction: column; }
  .eval-side { position: static; width: 100%; }
  .admission-layout { grid-template-columns: 1fr; }
  .admission-preview { position: static; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-actions { align-items: flex-start; flex-direction: column; }
  .score-summary { grid-template-columns: repeat(2, 1fr); }
  .preview-score-row { grid-template-columns: 1fr 1fr; }
}
