:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --line: #dbe3ee;
  --text: #121722;
  --muted: #5c6778;
  --blue: #1e4fff;
  --navy: #0e1f47;
  --red: #f03d4f;
  --good: #158a52;
  --bad: #c7364a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
}

.site-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.brand strong {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.menu {
  --menu-side-gap: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  position: relative;
  left: 17px;
}

.menu a {
  text-decoration: none;
  color: #1a1f2d;
  font-size: 18px;
  font-weight: 700;
  padding: 0 var(--menu-side-gap);
  position: relative;
  display: inline-flex;
  align-items: center;
}

.menu a.menu-divider::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.05em;
  border-right: 2px dotted #3f71cd;
}


.icon-btn {
  justify-self: end;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 700;
  font-size: 12px;
  color: #24314a;
}

.header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#adminPageBtn {
  border: 1px solid #2f8e6d;
  background: linear-gradient(180deg, #87d8b5 0%, #4eb38a 100%);
  color: #083a27;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  min-width: 0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 rgba(8, 18, 42, 0.35),
    0 6px 10px rgba(7, 20, 48, 0.22);
  transition: transform 0.12s ease, background-color 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

#adminPageBtn:hover {
  background: linear-gradient(180deg, #9ae0c0 0%, #5ebc97 100%);
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 3px 0 rgba(8, 18, 42, 0.32),
    0 8px 14px rgba(7, 20, 48, 0.24);
}

#adminPageBtn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 0 rgba(8, 18, 42, 0.3),
    0 3px 6px rgba(7, 20, 48, 0.2);
}

#changePasswordBtn {
  border: 1px solid #3d7eb7;
  background: linear-gradient(180deg, #8fc2eb 0%, #5d9ed9 100%);
  color: #0f3154;
  min-width: 0;
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 rgba(8, 18, 42, 0.35),
    0 6px 10px rgba(7, 20, 48, 0.22);
  transition: transform 0.12s ease, filter 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

#changePasswordBtn:hover {
  background: linear-gradient(180deg, #a5cff0 0%, #6ca8de 100%);
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 3px 0 rgba(8, 18, 42, 0.32),
    0 8px 14px rgba(7, 20, 48, 0.24);
}

#changePasswordBtn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 0 rgba(8, 18, 42, 0.3),
    0 3px 6px rgba(7, 20, 48, 0.2);
}

.admin-panel-wrap {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.admin-student-add-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-tabs {
  padding: 12px 14px 0;
  display: flex;
  gap: 8px;
}

.admin-tab-btn {
  border: 1px solid #b7c9e8;
  background: linear-gradient(180deg, #f2f7ff 0%, #e3edff 100%);
  color: #2a4577;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.admin-tab-btn.is-active {
  border-color: #2f5fb7;
  background: linear-gradient(180deg, #5d8fe6 0%, #3f71cd 100%);
  color: #fff;
  box-shadow: 0 4px 0 #2f5fb7;
}

.admin-tab-btn[data-admin-tab="student"].is-active {
  border-color: #238a62;
  background: linear-gradient(180deg, #4ac08f 0%, #2f9e6f 100%);
  box-shadow: 0 4px 0 #238a62;
}

.admin-tab-panels {
  min-height: 0;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.admin-student-tools {
  display: grid;
  gap: 8px;
}

.admin-student-search {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.admin-student-search input {
  flex: 0 1 260px;
  height: 34px;
  border: 1px solid #bfd0ea;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.admin-student-head .reset-all-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}

.admin-student-search #adminStudentSearchBtn,
.admin-student-search #adminStudentRefreshBtn {
  min-width: 74px;
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid #2f5fb7;
  border-radius: 10px;
  background: linear-gradient(180deg, #6a99ea 0%, #3f71cd 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 4px 0 #2f5fb7,
    0 10px 16px rgba(35, 71, 138, 0.24);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.admin-student-search #adminStudentSearchBtn:hover,
.admin-student-search #adminStudentRefreshBtn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.admin-student-search #adminStudentSearchBtn:active,
.admin-student-search #adminStudentRefreshBtn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 2px rgba(17, 33, 69, 0.2),
    0 2px 0 #2f5fb7,
    0 6px 10px rgba(35, 71, 138, 0.2);
}

.admin-student-wrap {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.admin-student-list-wrap {
  border: 1px solid #d5e0f2;
  border-radius: 10px;
  overflow: auto;
  max-height: 420px;
  background: #fff;
}

.admin-student-grade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-student-grade-box {
  border: 1px solid #d5e0f2;
  border-radius: 10px;
  background: #f7fbff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.admin-student-grade-box h4 {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: #27406b;
}

.admin-student-grade-box .admin-student-list-wrap {
  max-height: 360px;
}

.admin-student-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ecf2fc;
  text-align: center;
}

.admin-student-table tbody td {
  text-align: center;
}

.admin-student-table tbody tr {
  cursor: pointer;
}

.admin-student-table tbody tr:hover {
  background: #f3f8ff;
}

.admin-student-table tbody tr.is-selected {
  background: #e6f0ff;
}

.admin-student-form {
  border: 1px solid #d5e0f2;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.admin-student-form h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #223a65;
}

.admin-student-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #365177;
}

.admin-student-form input {
  height: 34px;
  border: 1px solid #bfd0ea;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.admin-student-form .admin-submit-btn {
  justify-self: stretch;
}

.admin-student-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
  justify-content: center;
}

#adminStudentId {
  width: var(--admin-student-control-width) !important;
  max-width: var(--admin-student-control-width);
}

#adminStudentId2 {
  width: var(--admin-student-control-width) !important;
  max-width: var(--admin-student-control-width);
}

#adminStudentName {
  width: var(--admin-student-control-width) !important;
  max-width: var(--admin-student-control-width);
}

#adminStudentName2 {
  width: var(--admin-student-control-width) !important;
  max-width: var(--admin-student-control-width);
}

#adminStudentGrade,
#adminStudentClass,
#adminStudentNumber {
  width: var(--admin-student-control-width) !important;
  max-width: var(--admin-student-control-width);
}

#adminStudentForm.admin-teacher-form,
#adminStudentForm2.admin-teacher-form {
  --admin-student-control-width: 170px;
  grid-template-columns: repeat(2, max-content);
  column-gap: 8px;
  row-gap: 8px;
  justify-content: center;
}

#adminStudentForm.admin-teacher-form label,
#adminStudentForm2.admin-teacher-form label {
  justify-self: center;
}

.admin-student-form-actions .admin-submit-btn,
.admin-student-form-actions .admin-refresh-btn {
  flex: 0 0 var(--admin-student-control-width);
  width: var(--admin-student-control-width);
  max-width: var(--admin-student-control-width);
}

#adminStudentSaveBtn {
  border-color: #2f5fb7;
  background: linear-gradient(180deg, #5d8fe6 0%, #3f71cd 100%);
  box-shadow: 0 4px 0 #2f5fb7;
}

#adminStudentSaveBtn:active {
  box-shadow: 0 3px 0 #2f5fb7;
}

#adminStudentAddBtn {
  border-color: #1f8c5f;
  background: linear-gradient(180deg, #43be86 0%, #2f9e6f 100%);
  box-shadow: 0 4px 0 #1f8c5f;
  color: #fff;
}

#adminStudentAddBtn:active {
  box-shadow: 0 3px 0 #1f8c5f;
}

.admin-panel {
  border: 1px solid #d2deef;
  border-radius: 12px;
  background: #f9fbff;
  padding: 12px;
}

.admin-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #223a65;
}

#adminStudentPanel .admin-panel h3 {
  text-align: center;
}

.admin-teacher-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.admin-teacher-form label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #365177;
}

.admin-teacher-form input,
.admin-teacher-form select {
  height: 34px;
  border: 1px solid #bfd0ea;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.admin-submit-btn,
.admin-refresh-btn,
.admin-toggle-btn {
  border: 1px solid #2f5fb7;
  background: linear-gradient(180deg, #5d8fe6 0%, #3f71cd 100%);
  color: #fff;
  border-radius: 9px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #2f5fb7;
}

.admin-toggle-btn {
  min-width: 84px;
  text-align: center;
  font-size: 14px;
}

.admin-submit-btn:active,
.admin-refresh-btn:active,
.admin-toggle-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #2f5fb7;
}

.admin-toggle-btn.is-activate {
  border-color: #1f8c5f;
  background: linear-gradient(180deg, #43be86 0%, #2f9e6f 100%);
  box-shadow: 0 4px 0 #1f8c5f;
}

.admin-toggle-btn.is-activate:active {
  box-shadow: 0 3px 0 #1f8c5f;
}

.admin-toggle-btn.is-deactivate {
  border-color: #b23b57;
  background: linear-gradient(180deg, #e26b88 0%, #ca4f6d 100%);
  box-shadow: 0 4px 0 #b23b57;
}

.admin-toggle-btn.is-deactivate:active {
  box-shadow: 0 3px 0 #b23b57;
}

.admin-delete-btn {
  border: 1px solid #a63b4e;
  background: linear-gradient(180deg, #e87386 0%, #cf5a6d 100%);
  color: #fff;
  border-radius: 9px;
  height: 34px;
  min-width: 62px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #a63b4e;
}

.admin-delete-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #a63b4e;
}

.admin-edit-btn {
  border: 1px solid #2f5fb7;
  background: linear-gradient(180deg, #5d8fe6 0%, #3f71cd 100%);
  color: #fff;
  border-radius: 9px;
  height: 34px;
  min-width: 62px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #2f5fb7;
}

.admin-edit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #2f5fb7;
}

.admin-manage-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-submit-btn {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 100px;
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-student-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.admin-student-head h3 {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 6px;
  font-size: 24px;
}

.admin-student-head .admin-student-search {
  grid-column: 2;
  justify-self: center;
  margin: 0 auto;
}

.admin-student-head .reset-all-btn {
  grid-column: 3;
  justify-self: end;
}

.admin-backup-row {
  margin: 6px 0 8px;
  display: grid;
  grid-template-columns: 180px 130px 130px;
  gap: 8px;
  align-items: start;
  justify-content: center;
}

.admin-backup-row select {
  min-width: 180px;
  height: 36px;
  border: 1px solid #bfd0ea;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #1f3358;
  background: #fff;
}

.admin-backup-row .admin-refresh-btn {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

#adminBackupSelect {
  grid-column: 1;
  grid-row: 1;
}

#adminBackupRefreshBtn {
  grid-column: 2;
  grid-row: 1;
}

#adminBackupRestoreBtn {
  grid-column: 3;
  grid-row: 1;
}

#adminBackupCreateBtn {
  grid-column: 2;
  grid-row: 2;
}

#adminAutoBackupBtn {
  grid-column: 3;
  grid-row: 2;
}

#adminBackupCreateBtn {
  border-color: #1f8c5f;
  background: linear-gradient(180deg, #43be86 0%, #2f9e6f 100%);
  box-shadow: 0 4px 0 #1f8c5f;
}

#adminBackupCreateBtn:active {
  box-shadow: 0 3px 0 #1f8c5f;
}

#adminAutoBackupBtn {
  border-color: #a66a12;
  background: linear-gradient(180deg, #f0b04c 0%, #d88a2c 100%);
  box-shadow: 0 4px 0 #a66a12;
}

#adminAutoBackupBtn:active {
  box-shadow: 0 3px 0 #a66a12;
}

.admin-status {
  margin: 0 0 8px;
  font-size: 12px;
  color: #556785;
}

#adminBackupStatus {
  font-weight: 800;
  color: #223a65;
  width: 456px;
  max-width: 100%;
  margin: 0 auto 8px;
  text-align: left;
  padding: 0;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #d3deef;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e1e9f5;
  padding: 9px 8px;
  text-align: left;
  font-size: 12px;
}

/* 교사 계정 목록: 아이디/이름 강조 */
.admin-table td:nth-child(1),
.admin-table td:nth-child(2) {
  font-size: 15px;
  font-weight: 700;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  text-align: center;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2),
.admin-table th:nth-child(3),
.admin-table td:nth-child(3),
.admin-table th:nth-child(4),
.admin-table td:nth-child(4),
.admin-table th:nth-child(5),
.admin-table td:nth-child(5),
.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  text-align: center;
}

.admin-table th {
  background: #ecf2fc;
  color: #2b446e;
  font-weight: 800;
}

.admin-student-table thead th {
  font-size: 14px;
}

/* 학생 명단 목록: 상점/벌점 점수 색상 교체 */
.admin-student-table tbody td:nth-child(6) {
  color: #c7364a;
  font-weight: 800;
}

.admin-student-table tbody td:nth-child(7) {
  color: #158a52;
  font-weight: 800;
}

.admin-student-table tbody td:nth-child(8) {
  color: #6b62bf;
  font-weight: 900;
}

.admin-student-table tbody td:nth-child(3),
.admin-student-table tbody td:nth-child(4),
.admin-student-table tbody td:nth-child(5) {
  font-size: 15px;
  font-weight: 700;
}

.admin-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #eef2f7;
  color: #3f516e;
}

.admin-role-badge.admin {
  background: #ffecc5;
  color: #8a5b00;
}

.admin-role-badge.manager {
  background: #e1f3ff;
  color: #0f5d87;
}

.admin-table td.admin-active {
  color: #17895f;
  font-weight: 800;
  font-size: 15px;
}

.admin-table td.admin-inactive {
  color: #b03f56;
  font-weight: 800;
  font-size: 15px;
}

#logoutBtn {
  border: 1px solid #6b62bf;
  background: linear-gradient(180deg, #b0a7ee 0%, #877dd8 100%);
  color: #271f6a;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  min-width: 0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 rgba(8, 18, 42, 0.35),
    0 6px 10px rgba(7, 20, 48, 0.22);
  transition: transform 0.12s ease, background-color 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

#logoutBtn:hover {
  background: linear-gradient(180deg, #c0b8f2 0%, #978ee0 100%);
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 3px 0 rgba(8, 18, 42, 0.32),
    0 8px 14px rgba(7, 20, 48, 0.24);
}

#logoutBtn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 0 rgba(8, 18, 42, 0.3),
    0 3px 6px rgba(7, 20, 48, 0.2);
}

.main {
  min-height: calc(100vh - 62px);
  height: auto;
  padding-top: 8px;
  padding-bottom: 24px;
  display: block;
  flex: 1 0 auto;
}

.view-section {
  display: none;
  min-height: 0;
}

.view-section.is-active {
  display: block;
}

#viewIntro,
#viewTerms,
#viewPrivacy {
  height: 100%;
}

.card {
  background: var(--card);
  border: 1px solid #d5deea;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(11, 21, 48, 0.05);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  height: auto;
  align-items: start;
}

.right-column-stack {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.left-column-stack {
  display: grid;
  gap: 8px;
  min-height: 0;
  align-content: start;
}

.all-class-status-page {
  padding: 14px;
}

.service-intro-page {
  padding: 16px;
  background:
    linear-gradient(180deg, #f8fbff 0%, #ffffff 42%),
    #ffffff;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.service-intro-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.service-intro-hero {
  margin-top: 8px;
  border: 1px solid #c7d7f2;
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 12%, rgba(79, 132, 227, 0.16) 0%, rgba(79, 132, 227, 0) 36%),
    linear-gradient(180deg, #f7fbff 0%, #edf4ff 100%);
  padding: 16px;
  box-shadow: 0 8px 16px rgba(25, 49, 93, 0.1);
}

.service-intro-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2c5fad;
}

.service-intro-hero h3 {
  margin: 0;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #183765;
}

.service-intro-hero > p {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: #314868;
}

.service-intro-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-intro-tags span {
  border: 1px solid #b6ccee;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  color: #2f5a9a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(36, 64, 112, 0.14), 0 6px 10px rgba(22, 42, 79, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.service-intro-tags span:nth-child(1) {
  border-color: #8fb2ea;
  background: linear-gradient(180deg, #f7fbff 0%, #dfeeff 100%);
  color: #224e8f;
}

.service-intro-tags span:nth-child(2) {
  border-color: #9fd9b5;
  background: linear-gradient(180deg, #f3fcf7 0%, #dcf4e6 100%);
  color: #1f6d4b;
}

.service-intro-tags span:nth-child(3) {
  border-color: #f0c38a;
  background: linear-gradient(180deg, #fffaf2 0%, #fdebd3 100%);
  color: #8a5b1f;
}

.service-intro-tags span:nth-child(4) {
  border-color: #b9afea;
  background: linear-gradient(180deg, #f8f6ff 0%, #e8e3ff 100%);
  color: #4b3f95;
}

.service-intro-tags span:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(36, 64, 112, 0.16), 0 10px 14px rgba(22, 42, 79, 0.12);
  filter: brightness(1.02);
}

.service-intro-tags span:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(36, 64, 112, 0.14), 0 4px 8px rgba(22, 42, 79, 0.1);
}

.service-intro-points {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-intro-points article {
  border: 1px solid #d1ddf0;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 12px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.service-intro-points article:nth-child(1) {
  border-left: 4px solid #4f84e3;
}

.service-intro-points article:nth-child(2) {
  border-left: 4px solid #2f9a69;
}

.service-intro-points article:nth-child(3) {
  border-left: 4px solid #d08a2e;
}

.service-intro-points article:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(31, 69, 140, 0.12);
  filter: brightness(1.01);
}

.service-intro-points article:active {
  transform: translateY(1px);
  box-shadow: 0 4px 9px rgba(31, 69, 140, 0.1);
}

.service-intro-points b {
  display: block;
  margin: 0 0 5px;
  font-size: 14px;
  color: #1f3f75;
}

.service-intro-points p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #3a4d6c;
}

.service-intro-block {
  border: 1px solid #d7dfec;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 12px;
  box-shadow: 0 2px 8px rgba(22, 41, 77, 0.06);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.service-intro-block:nth-child(1) { border-top: 3px solid #4f84e3; }
.service-intro-block:nth-child(2) { border-top: 3px solid #3f71cd; }
.service-intro-block:nth-child(3) { border-top: 3px solid #2f9a69; }
.service-intro-block:nth-child(4) { border-top: 3px solid #5b83c8; }
.service-intro-block:nth-child(5) { border-top: 3px solid #9a6f2f; }
.service-intro-block:nth-child(6) { border-top: 3px solid #4b67a8; }

.service-intro-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(31, 69, 140, 0.1);
  filter: brightness(1.01);
}

.service-intro-block:active {
  transform: translateY(1px);
  box-shadow: 0 4px 9px rgba(31, 69, 140, 0.08);
}

.service-intro-block h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #1f3f75;
}

.service-intro-block p,
.service-intro-block li {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #2a3a54;
}

.service-intro-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.service-intro-block a {
  color: #1f4fa8;
  text-decoration: none;
  font-weight: 700;
}

.legal-page {
  padding: 16px;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #f8fbff 0%, #ffffff 40%),
    #ffffff;
}

.legal-head {
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid #d9e4f5;
}

.legal-notice-box {
  margin-top: 8px;
  border: 1px solid #c8d9f3;
  border-left: 5px solid #4f84e3;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff 0%, #edf4ff 100%);
  padding: 13px;
  color: #2a3f61;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 6px 14px rgba(31, 69, 140, 0.08);
}

.legal-article-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.legal-article {
  border: 1px solid #d6e1f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 9px;
  box-shadow: 0 3px 10px rgba(22, 41, 77, 0.06);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.legal-article:nth-child(1) { border-top: 3px solid #4f84e3; }
.legal-article:nth-child(2) { border-top: 3px solid #3f71cd; }
.legal-article:nth-child(3) { border-top: 3px solid #5b83c8; }
.legal-article:nth-child(4) { border-top: 3px solid #2f9a69; }
.legal-article:nth-child(5) { border-top: 3px solid #9a6f2f; }
.legal-article:nth-child(6) { border-top: 3px solid #4f84e3; }
.legal-article:nth-child(7) { border-top: 3px solid #3f71cd; }
.legal-article:nth-child(8) { border-top: 3px solid #5b83c8; }
.legal-article:nth-child(9) { border-top: 3px solid #2f9a69; }
.legal-article:nth-child(10) { border-top: 3px solid #9a6f2f; }
.legal-article:nth-child(11) { border-top: 3px solid #4b67a8; }
.legal-article:nth-child(12) { border-top: 3px solid #3f71cd; }

.legal-article:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(31, 69, 140, 0.1);
  filter: brightness(1.01);
}

.legal-article:active {
  transform: translateY(1px);
  box-shadow: 0 4px 9px rgba(31, 69, 140, 0.08);
}

.legal-article h3 {
  margin: 0 0 3px;
  font-size: 16px;
  color: #1f3f75;
}

#viewPrivacy .legal-article {
  padding: 15px;
}

#viewPrivacy .legal-article h3 {
  margin-bottom: 5px;
}

#viewPrivacy .legal-page {
  height: auto;
  padding-bottom: 12px;
}

#viewPrivacy .legal-article-list {
  margin-bottom: 0;
}

.legal-article p,
.legal-article li {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #2d3f5b;
}

.legal-article ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.legal-article a {
  color: #1f4fa8;
  text-decoration: none;
  font-weight: 700;
}

.all-class-status-page .section-head {
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
  gap: 4px;
}

.all-class-status-page .section-head h2 {
  font-size: 24px;
  font-weight: 800;
}

.grade-tabs {
  margin-top: 25px;
  display: flex;
  gap: 8px;
}

.grade-tab {
  border: 1px solid #c7d6ef;
  background: linear-gradient(180deg, #ffffff 0%, #edf3ff 100%);
  color: #1e3566;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(18, 39, 79, 0.14), 0 6px 12px rgba(20, 41, 78, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.grade-tab:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.grade-tab.is-active {
  background: #1f4fa8;
  border-color: #1f4fa8;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 rgba(18, 39, 79, 0.16);
  transform: translateY(1px);
}

.grade-tab[data-grade="1"] {
  background: #fff8d9;
  border-color: #e2d6a5;
  color: #5b4f1f;
}

.grade-tab[data-grade="1"].is-active {
  background: #fff8d9;
  border-color: #d9c98a;
  color: #4f4319;
}

.grade-tab[data-grade="2"] {
  background: #eaf3ff;
  border-color: #bfd3f1;
  color: #1f416f;
}

.grade-tab[data-grade="2"].is-active {
  background: #eaf3ff;
  border-color: #aac5ea;
  color: #17365e;
}

.grade-tab[data-grade="3"] {
  background: #eafbe9;
  border-color: #bfdcbc;
  color: #24532f;
}

.grade-tab[data-grade="3"].is-active {
  background: #eafbe9;
  border-color: #a9d2a4;
  color: #1b4225;
}

.all-class-grid {
  margin-top: 25px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.all-class-status-page .top-class-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
}

.all-class-status-page .all-class-grid {
  display: block;
}

.all-class-status-page .top-class-grid .class-box {
  min-width: 0;
  aspect-ratio: 1 / 1;
  height: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.all-class-status-page .top-class-grid .class-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 36, 77, 0.14);
}

.all-class-status-page .status-card-name {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
}

.all-class-status-page .status-card-metrics {
  width: 100%;
  margin-top: 25px;
  display: grid;
  gap: 4px;
}

.all-class-status-page .status-card-metrics p {
  margin: 0;
  font-size: 15px;
  color: #4f5f77;
}

.all-class-status-page .status-card-rp-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.all-class-status-page .status-card-rp-row p {
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
}

.all-class-status-page .status-card-net {
  font-size: 21px !important;
  font-weight: 700;
  color: #19263f;
  transform: translateY(-10px);
}

.all-class-status-page .status-card-net b {
  font-size: 21px !important;
}

.all-class-status-page .grade-group {
  width: 100%;
}

.all-class-status-page .grade-group + .grade-group {
  margin-top: 25px;
}

.all-class-status-page .grade-title {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.class-detail-page {
  padding: 14px;
}

.class-detail-top {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.back-btn {
  border: 1px solid #c7d6ef;
  background: linear-gradient(180deg, #f5f9ff 0%, #e7f0ff 100%);
  color: #1d3f77;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 2px 0 rgba(60, 92, 154, 0.2),
    0 8px 14px rgba(28, 53, 103, 0.14);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.batch-btn {
  border: 1px solid #8aa7da;
  background: linear-gradient(180deg, #4a7de0 0%, #2f66c9 100%);
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 0 rgba(27, 58, 120, 0.35),
    0 10px 16px rgba(23, 49, 102, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.pdf-btn {
  border: 1px solid #a84a5b;
  background: linear-gradient(180deg, #ef8d9d 0%, #d7687d 100%);
  color: #5a1122;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(139, 50, 75, 0.35),
    0 3px 0 rgba(138, 52, 73, 0.3),
    0 7px 12px rgba(102, 32, 50, 0.16);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.back-btn:hover,
.batch-btn:hover,
.pdf-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.03);
}

.back-btn:active,
.batch-btn:active,
.pdf-btn:active {
  transform: translateY(1px);
}

.back-btn:active {
  box-shadow:
    inset 0 2px 4px rgba(42, 66, 116, 0.12),
    0 1px 0 rgba(60, 92, 154, 0.18),
    0 4px 8px rgba(28, 53, 103, 0.12);
}

.batch-btn:active {
  box-shadow:
    inset 0 2px 5px rgba(11, 28, 67, 0.26),
    0 1px 0 rgba(27, 58, 120, 0.28),
    0 5px 10px rgba(23, 49, 102, 0.16);
}

.pdf-btn:active {
  box-shadow:
    inset 0 2px 4px rgba(108, 31, 52, 0.2),
    0 1px 0 rgba(138, 52, 73, 0.24),
    0 5px 10px rgba(102, 32, 50, 0.18);
}

.class-detail-head {
  margin-bottom: 10px;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

 .class-detail-head h2 {
  font-size: 34px;
  font-weight: 800;
}

.class-head-pdf-btn {
  position: absolute;
  right: 0;
  top: 34px !important;
}

.reward-export-pdf-btn {
  min-width: 116px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

#classDetailSub {
  font-size: 20px;
  font-weight: 800;
}

#classDetailTitle {
  font-size: 34px !important;
  line-height: 1.15;
}

.class-detail-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.class-detail-empty {
  border: 1px dashed #bfd0e7;
  border-radius: 10px;
  background: #f6f9ff;
  padding: 20px;
  text-align: center;
  color: #4a5a72;
}

.student-detail-card {
  border: 1px solid #d5dfed;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f6ff 100%);
  padding: 12px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 6px 14px rgba(17, 33, 64, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.student-detail-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset, 0 10px 20px rgba(17, 33, 64, 0.16);
}

.student-detail-card:focus-visible {
  outline: 3px solid rgba(77, 118, 216, 0.35);
  outline-offset: 2px;
}

.student-detail-card.grade-1 {
  background: linear-gradient(180deg, #fffdf0 0%, #fff8d9 100%);
  border-color: #e2d6a5;
}

.student-detail-card.grade-2 {
  background: linear-gradient(180deg, #f4f8ff 0%, #eaf3ff 100%);
  border-color: #bfd3f1;
}

.student-detail-card.grade-3 {
  background: linear-gradient(180deg, #f4fff3 0%, #eafbe9 100%);
  border-color: #bfdcbc;
}

.student-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.student-detail-main {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.student-detail-main strong {
  font-size: 21px;
  display: block;
  transform: translateX(15px);
}

.student-detail-main p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #5d6c84;
}

.student-detail-score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  --score-gap: 10px;
  gap: var(--score-gap);
}

.student-detail-score p {
  margin: 0;
  font-size: 15px;
  text-align: center;
  color: #4f5f77;
  position: relative;
}

.student-detail-score p b {
  font-size: 15px;
}

.student-detail-score p + p::before {
  content: "";
  position: absolute;
  left: calc(var(--score-gap) / -2);
  top: 50%;
  transform: translateY(-50%);
  height: 1.25em;
  border-left: 1px dotted #9caac0;
}

.student-detail-score .pos {
  color: #1b8a55;
}

.student-detail-score .neg {
  color: #c4364b;
}

.move-student-btn {
  border: 1px solid #9ab1d8;
  background: #e9f1ff;
  color: #1a3d79;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: auto;
  justify-self: auto;
  margin-left: auto;
  white-space: nowrap;
}

.all-class-item {
  border: 1px solid #d6e0ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
  padding: 12px;
}

.all-class-item.grade-1 {
  background: #fff8d9;
  border-color: #e2d6a5;
}

.all-class-item.grade-2 {
  background: #eaf3ff;
  border-color: #bfd3f1;
}

.all-class-item.grade-3 {
  background: #eafbe9;
  border-color: #bfdcbc;
}

.all-class-item h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.all-class-item p {
  margin: 2px 0;
  font-size: 13px;
  color: #30415f;
}

.all-class-item .net {
  margin-top: 6px;
  font-weight: 800;
  color: #0f2d6c;
}

.featured {
  min-height: 0;
  padding: 14px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(8, 17, 40, 0.05), rgba(8, 17, 40, 0.75)),
    radial-gradient(circle at 15% 20%, #254ca4 0%, #1a2d5f 35%, #0f172e 100%);
  color: #fff;
}

.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.12;
}

.featured > * {
  position: relative;
  z-index: 1;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.pill {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.featured h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.featured p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #e5ebff;
}

.side-news {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.mini {
  padding: 10px 12px;
  min-height: 0;
  overflow: hidden;
}

.mini h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.recent-list,
.class-list,
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list {
  max-height: calc(100% - 24px);
  overflow: auto;
}

.recent-list li {
  padding: 6px 0;
  border-top: 1px solid #e2e8f1;
}

.recent-list li:first-child {
  border-top: 0;
}

.student-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.student-line strong {
  font-size: 13px;
}

.student-reason {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-badge {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
}

.score-badge.good {
  color: var(--good);
  background: #e7f7ee;
}

.score-badge.bad {
  color: var(--bad);
  background: #fdecef;
}

.info-row {
  margin-top: 0;
  width: 100%;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: 0;
}

.info-block {
  min-width: 0;
}

.info-block h2 {
  margin: 0;
  font-size: 18px;
}

.info-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chips-marquee {
  position: relative;
  overflow: hidden;
  margin-top: 25px;
  display: flex;
  gap: 6px;
}

.chips-track {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  min-width: max-content;
  animation: chips-scroll 18s linear infinite;
}

.chips-track span {
  background: #e8edf4;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #3f4c63;
}

@keyframes chips-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - 6px));
  }
}

.intro {
  border-left: 0;
  padding-left: 0;
}

.content-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-height: 0;
  align-items: stretch;
}

.section-card {
  padding: 10px 12px;
  min-height: 0;
  overflow: visible;
}

.input-top {
  overflow: hidden;
  padding-top: 10px;
  min-height: 576px;
}

.input-top .section-head {
  margin-bottom: 0;
}

.input-layout {
  display: grid;
  grid-template-columns: 410px auto;
  gap: 10px;
  align-items: start;
  margin-top: 0;
}

.student-preview {
  grid-column: 1;
  grid-row: 1;
  margin-top: 0;
}

.point-form {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  justify-self: start;
  align-self: start;
}

.quick-reason-panel {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.quick-reason-group {
  border: 1px solid #2a3b66;
  border-radius: 10px;
  background: linear-gradient(180deg, #172447 0%, #0e1a36 100%);
  padding: 36px;
}

.quick-reason-group.reward-group {
  border-color: #6b8ed6;
  background: linear-gradient(180deg, #4e79c6 0%, #2e5ca5 100%);
  padding: 12px 24px 16px;
}

.quick-reason-group.penalty-group {
  border-color: #94aecf;
  background: linear-gradient(180deg, #7fa5cf 0%, #5f86b3 100%);
  padding: 12px 24px 16px;
}

.quick-reason-group h3 {
  margin: 0 0 6px;
  color: #dbe7ff;
  font-size: 16px;
}

.quick-reason-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.quick-reason-head h3 {
  margin: 0;
}

.quick-reason-head .reason-more-btn {
  margin-top: 0;
}

.quick-reason-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-reason-group .penalty-extra {
  display: inline-flex;
}

.quick-reason-group .penalty-mobile-extra {
  display: inline-flex;
}

.quick-reason-group.penalty-group-secondary .penalty-mobile-extra {
  display: none;
}

.quick-reason-group.penalty-group-secondary.is-expanded .penalty-mobile-extra {
  display: inline-flex;
}

.quick-reason-group .reward-extra {
  display: inline-flex;
}

.reason-more-btn {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.1) 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(14, 32, 72, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.reason-more-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.reason-more-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(14, 32, 72, 0.3);
}

.reward-group .reason-more-btn {
  display: none;
}

.penalty-group .reason-more-btn {
  display: none;
}

.penalty-group.penalty-group-secondary .reason-more-btn {
  display: inline-flex;
}




.reason-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
}

.reason-btn {
  border: 1px solid #3a538f;
  border-radius: 8px;
  background: #162a56;
  color: #f2f6ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  padding: 9px 16px;
  cursor: pointer;
}

.reward-group .reason-btn {
  width: 103px;
  text-align: center;
  white-space: nowrap;
}

.student-history-page {
  padding: 14px;
}

.student-history-top {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.student-history-head {
  margin-bottom: 10px;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 4px;
}

.student-history-head h2 {
  font-size: 28px;
  font-weight: 800;
}

.student-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.student-history-mini {
  border: 1px solid #d4def0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
  padding: 10px;
  text-align: center;
}

.student-history-mini-btn {
  cursor: pointer;
  border-width: 1px;
  border-style: solid;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(45, 68, 118, 0.16),
    0 8px 14px rgba(22, 37, 71, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.student-history-mini-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 3px 0 rgba(45, 68, 118, 0.18),
    0 12px 18px rgba(22, 37, 71, 0.16);
}

.student-history-mini-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(29, 44, 70, 0.12),
    0 1px 0 rgba(45, 68, 118, 0.14),
    0 4px 8px rgba(22, 37, 71, 0.1);
}

.student-history-summary #studentHistoryAllBtn {
  order: 3;
  background: linear-gradient(180deg, #f3f7ff 0%, #e7efff 100%);
  border-color: #b7c8ef;
}

.student-history-summary #studentHistoryRewardBtn {
  order: 1;
  background: linear-gradient(180deg, #effcf5 0%, #e0f7ea 100%);
  border-color: #9fd9b5;
}

.student-history-summary #studentHistoryPenaltyBtn {
  order: 2;
  background: linear-gradient(180deg, #fff3f6 0%, #ffe7ee 100%);
  border-color: #efb3c4;
}

.student-history-mini-btn.is-active {
  border-color: #4d76d8;
  box-shadow: 0 4px 10px rgba(52, 89, 175, 0.22);
}

.student-history-summary #studentHistoryAllBtn.is-active {
  background: linear-gradient(180deg, #dce8ff 0%, #cfdfff 100%);
  border-color: #6e90db;
}

.student-history-mini-btn.reward.is-active {
  border-color: #2f9a69;
  background: linear-gradient(180deg, #dff8ea 0%, #ccf0dd 100%);
  box-shadow: 0 4px 10px rgba(47, 154, 105, 0.2);
}

.student-history-mini-btn.penalty.is-active {
  border-color: #c25174;
  background: linear-gradient(180deg, #ffe2ea 0%, #ffd2df 100%);
  box-shadow: 0 4px 10px rgba(194, 81, 116, 0.2);
}

.student-history-mini p {
  margin: 0;
  font-size: 13px;
  color: #4f5f77;
}

.student-history-mini b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: #1d2c46;
}

#studentHistoryAllBtn p {
  font-size: 20px;
  font-weight: 700;
}

#studentHistoryRewardBtn p,
#studentHistoryPenaltyBtn p {
  font-size: 20px;
  font-weight: 700;
}

.student-history-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 2px;
}

.student-history-item {
  border: 1px solid #d4deef;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.student-history-item.is-reward {
  border-color: #9fd9b5;
  background: linear-gradient(180deg, #f2fcf7 0%, #e7f8ee 100%);
}

.student-history-item.is-penalty {
  border-color: #efb3c4;
  background: linear-gradient(180deg, #fff5f8 0%, #ffebf1 100%);
}

.student-history-item.is-reward .student-history-item-top strong {
  color: #1f5e42;
}

.student-history-item.is-penalty .student-history-item-top strong {
  color: #7a2f46;
}

.student-history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.student-history-item-top strong {
  font-size: 18px;
  color: #1d2d49;
}

.student-history-item-top b {
  font-size: 20px;
  font-weight: 800;
}

.student-history-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 180px;
}

.history-delete-btn {
  border: 1px solid #d38a9f;
  background: linear-gradient(180deg, #ffe8ef 0%, #ffd6e2 100%);
  color: #7f2544;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 2px 0 rgba(159, 76, 104, 0.26),
    0 6px 10px rgba(127, 37, 68, 0.14);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.history-delete-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
}

.history-delete-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(88, 22, 46, 0.18),
    0 1px 0 rgba(159, 76, 104, 0.2),
    0 4px 8px rgba(127, 37, 68, 0.12);
}

.history-delete-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.student-history-item-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 15px;
  color: #61708a;
}

.student-history-empty {
  border: 1px dashed #bfd0e7;
  border-radius: 10px;
  background: #f6f9ff;
  padding: 18px;
  text-align: center;
  color: #4a5a72;
}

.reward-dashboard-page {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.reward-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.reward-summary-card {
  border: 1px solid #d7e1f1;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(30, 49, 84, 0.16),
    0 8px 14px rgba(20, 35, 66, 0.12);
}

.reward-summary-card p {
  margin: 0 0 4px;
  color: #436087;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.reward-summary-card b {
  color: #0f2d6c;
  font-size: 21px;
  font-weight: 900;
}

.reward-summary-card.today {
  border-color: #e6c995;
  background: #fff6e4;
}

.reward-summary-card.week {
  border-color: #b8c9ef;
  background: #edf3ff;
}

.reward-summary-card.month {
  border-color: #9fd8b6;
  background: #eaf8f1;
}

.reward-inline-title {
  position: relative;
  margin: 0;
  padding-top: 8px;
}

.reward-inline-title::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -13px;
  border-top: 1px dashed #b7c6df;
}

.reward-inline-title-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}

.reward-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.reward-panel {
  border: 1px solid #d6e0ef;
  border-radius: 10px;
  background: #f9fbff;
  padding: 10px;
}

.reward-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #18335f;
}

.reward-top-panel {
  width: 100%;
  padding: 6px 8px;
}

.reward-top-panel h3 {
  margin-bottom: 4px;
}

.reward-table-wrap {
  overflow: auto;
}

.reward-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

.reward-table th,
.reward-table td {
  border-bottom: 1px solid #dfe7f4;
  padding: 5px 3px;
  font-size: 13px;
  text-align: left;
}

.reward-table th {
  background: #edf3ff;
  color: #27406b;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(86, 106, 142, 0.2),
    0 1px 0 rgba(27, 45, 78, 0.12);
}

.reward-dashboard-grid > .reward-top-panel.reward-grade-1 .reward-table th {
  background: #fff6e4;
  color: #7a5612;
}

.reward-dashboard-grid > .reward-top-panel.reward-grade-2 .reward-table th {
  background: #edf3ff;
  color: #27406b;
}

.reward-dashboard-grid > .reward-top-panel.reward-grade-3 .reward-table th {
  background: #eaf8f1;
  color: #1f6b47;
}

.reward-table td:last-child,
.reward-table td:nth-last-child(2) {
  white-space: nowrap;
}

.reward-top-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.reward-top-table th,
.reward-top-table td {
  white-space: nowrap;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.reward-top-table th:nth-child(1),
.reward-top-table td:nth-child(1) {
  width: 12%;
}

.reward-top-table th:nth-child(2),
.reward-top-table td:nth-child(2) {
  width: 18%;
}

.reward-top-table th:nth-child(3),
.reward-top-table td:nth-child(3) {
  width: 22%;
}

.reward-top-table th:nth-child(4),
.reward-top-table td:nth-child(4),
.reward-top-table th:nth-child(5),
.reward-top-table td:nth-child(5),
.reward-top-table th:nth-child(6),
.reward-top-table td:nth-child(6) {
  width: 16%;
}

.reward-top-table td:nth-child(4) {
  color: #158a52;
  font-weight: 800;
}

.reward-top-table td:nth-child(5) {
  color: #c7364a;
  font-weight: 800;
}

.reward-student-link,
.reward-class-link {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #244f9b;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.reward-student-link:hover,
.reward-class-link:hover {
  color: #173c82;
}

#viewReward .reward-top-table tbody td:nth-child(2) {
  font-size: 13px;
}

#viewReward .reward-student-link {
  font-size: 13px;
}

#viewReward .reward-inline-title-row ~ .reward-panel .reward-class-link {
  font-size: 15px;
}

.penalty-student-row {
  cursor: pointer;
}

.penalty-student-row:hover {
  background: #f3f8ff;
}

#rewardTopTableBody4 td,
#rewardTopTableBody5 td,
#rewardTopTableBody6 td {
  font-size: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
}

#rewardTopTableBody1 td,
#rewardTopTableBody2 td,
#rewardTopTableBody3 td {
  font-size: 14px;
}

#rewardTopTableBody1 td:nth-child(1),
#rewardTopTableBody2 td:nth-child(1),
#rewardTopTableBody3 td:nth-child(1),
#rewardTopTableBody1 td:nth-child(2),
#rewardTopTableBody2 td:nth-child(2),
#rewardTopTableBody3 td:nth-child(2),
#rewardTopTableBody1 td:nth-child(3),
#rewardTopTableBody2 td:nth-child(3),
#rewardTopTableBody3 td:nth-child(3) {
  font-weight: 900;
}

#rewardTopTableBody1 td:nth-child(6),
#rewardTopTableBody2 td:nth-child(6),
#rewardTopTableBody3 td:nth-child(6) {
  color: #1f3f74;
  font-weight: 900;
}

#penaltyTopTableBody1 td:nth-child(1),
#penaltyTopTableBody2 td:nth-child(1),
#penaltyTopTableBody3 td:nth-child(1),
#penaltyTopTableBody4 td:nth-child(1),
#penaltyTopTableBody5 td:nth-child(1),
#penaltyTopTableBody6 td:nth-child(1),
#penaltyTopTableBody1 td:nth-child(2),
#penaltyTopTableBody2 td:nth-child(2),
#penaltyTopTableBody3 td:nth-child(2),
#penaltyTopTableBody4 td:nth-child(2),
#penaltyTopTableBody5 td:nth-child(2),
#penaltyTopTableBody6 td:nth-child(2),
#penaltyTopTableBody1 td:nth-child(3),
#penaltyTopTableBody2 td:nth-child(3),
#penaltyTopTableBody3 td:nth-child(3),
#penaltyTopTableBody4 td:nth-child(3),
#penaltyTopTableBody5 td:nth-child(3),
#penaltyTopTableBody6 td:nth-child(3) {
  font-weight: 900;
}

#penaltyTopTableBody1 td:nth-child(6),
#penaltyTopTableBody2 td:nth-child(6),
#penaltyTopTableBody3 td:nth-child(6),
#penaltyTopTableBody4 td:nth-child(6),
#penaltyTopTableBody5 td:nth-child(6),
#penaltyTopTableBody6 td:nth-child(6) {
  color: #1f3f74;
  font-weight: 900;
}

#penaltyTopTableBody1 td:nth-child(4),
#penaltyTopTableBody2 td:nth-child(4),
#penaltyTopTableBody3 td:nth-child(4),
#penaltyTopTableBody4 td:nth-child(4),
#penaltyTopTableBody5 td:nth-child(4),
#penaltyTopTableBody6 td:nth-child(4) {
  color: #158a52;
  font-weight: 800;
}

#penaltyTopTableBody1 td:nth-child(5),
#penaltyTopTableBody2 td:nth-child(5),
#penaltyTopTableBody3 td:nth-child(5),
#penaltyTopTableBody4 td:nth-child(5),
#penaltyTopTableBody5 td:nth-child(5),
#penaltyTopTableBody6 td:nth-child(5) {
  color: #c7364a;
  font-weight: 800;
}

#rewardTopTableBody4 td:nth-child(3),
#rewardTopTableBody5 td:nth-child(3),
#rewardTopTableBody6 td:nth-child(3) {
  color: #158a52;
  font-weight: 800;
}

#rewardTopTableBody4 td:nth-child(1),
#rewardTopTableBody5 td:nth-child(1),
#rewardTopTableBody6 td:nth-child(1),
#rewardTopTableBody4 td:nth-child(2),
#rewardTopTableBody5 td:nth-child(2),
#rewardTopTableBody6 td:nth-child(2) {
  font-weight: 900;
}

#rewardTopTableBody4 td:nth-child(4),
#rewardTopTableBody5 td:nth-child(4),
#rewardTopTableBody6 td:nth-child(4) {
  color: #c7364a;
  font-weight: 800;
}

#rewardTopTableBody4 td:nth-child(5),
#rewardTopTableBody5 td:nth-child(5),
#rewardTopTableBody6 td:nth-child(5) {
  color: #1f3f74;
  font-weight: 900;
}

.reward-reason-stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.reward-reason-stats li {
  border: 1px solid #dce5f3;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  color: #2d466f;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reward-detail-panel {
  background: #f6f9ff;
}

.reward-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reward-detail-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reward-detail-tools select,
.reward-detail-tools input {
  height: 32px;
  border: 1px solid #bfd0ea;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}

.reward-detail-tools input {
  width: 200px;
}

#rewardExportBtn {
  height: 32px;
  border-radius: 8px;
  border: 1px solid #3d7eb7;
  background: linear-gradient(180deg, #8fc2eb 0%, #5d9ed9 100%);
  color: #0f3154;
  font-weight: 800;
  cursor: pointer;
}

.penalty-group .reason-btn {
  width: 103px;
  text-align: center;
  white-space: nowrap;
}

.reason-btn:disabled {
  cursor: not-allowed;
}

.reason-btn.is-queued {
  border-color: #5f6678;
  background: #4a5263;
  color: #e4e9f3;
}

.reason-btn.is-loading {
  border-color: #707a90;
  background: #556078;
  color: #f3f6fc;
}

.reason-btn.is-loading::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  animation: reason-btn-spin 0.8s linear infinite;
}

@keyframes reason-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.reason-btn.reward:hover {
  background: #1a3878;
}

/* 상점 사유 버튼: 점수대별 색상 구분 + 입체감 */
.reward-group .reason-btn {
  border-width: 1px;
  border-style: solid;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 rgba(8, 18, 42, 0.35),
    0 6px 10px rgba(7, 20, 48, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.reward-group .reason-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 3px 0 rgba(8, 18, 42, 0.32),
    0 8px 14px rgba(7, 20, 48, 0.24);
}

.reward-group .reason-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 0 rgba(8, 18, 42, 0.3),
    0 3px 6px rgba(7, 20, 48, 0.2);
}

.reward-group .reason-btn[data-point="+1"] {
  border-color: #2f8e6d;
  background: linear-gradient(180deg, #87d8b5 0%, #4eb38a 100%);
  color: #083a27;
}

.reward-group .reason-btn[data-point="+2"] {
  border-color: #3d7eb7;
  background: linear-gradient(180deg, #8fc2eb 0%, #5d9ed9 100%);
  color: #0f3154;
}

.reward-group .reason-btn[data-point="+3"] {
  border-color: #6b62bf;
  background: linear-gradient(180deg, #b0a7ee 0%, #877dd8 100%);
  color: #271f6a;
}

.reward-group .reason-btn[data-point]:not([data-point="+1"]):not([data-point="+2"]):not([data-point="+3"]) {
  border-color: #b47c2f;
  background: linear-gradient(180deg, #f1c67d 0%, #dda34f 100%);
  color: #4b2d05;
}

.reason-btn.penalty {
  border-color: #7a2f44;
  background: #4f1d2f;
}

.reason-btn.penalty:hover {
  background: #6a243d;
}

/* 벌점 사유 버튼: 점수대별 색상 구분 */
.penalty-group .reason-btn {
  border-width: 1px;
  border-style: solid;
  color: #4a2330;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 0 rgba(120, 80, 95, 0.22),
    0 6px 10px rgba(90, 60, 75, 0.16);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.penalty-group .reason-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 3px 0 rgba(120, 80, 95, 0.2),
    0 8px 14px rgba(90, 60, 75, 0.18);
}

.penalty-group .reason-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 0 rgba(120, 80, 95, 0.2),
    0 3px 6px rgba(90, 60, 75, 0.14);
}

.penalty-group .reason-btn[data-point="-1"] {
  border-color: #d8b07d;
  background: linear-gradient(180deg, #f9e6cb 0%, #efd2a7 100%);
  color: #5d3f1a;
}

.penalty-group .reason-btn[data-point="-2"] {
  border-color: #dda58e;
  background: linear-gradient(180deg, #f8ddcf 0%, #efc2ab 100%);
  color: #5e2f1d;
}

.penalty-group .reason-btn[data-point="-3"] {
  border-color: #d99595;
  background: linear-gradient(180deg, #f6d4d4 0%, #eeb0b0 100%);
  color: #5c2222;
}

.penalty-group .reason-btn[data-point="-5"] {
  border-color: #c792b2;
  background: linear-gradient(180deg, #f0d4e3 0%, #e2b6cd 100%);
  color: #57243f;
}

.penalty-group .reason-btn[data-point]:not([data-point="-1"]):not([data-point="-2"]):not([data-point="-3"]):not([data-point="-5"]) {
  border-color: #ba8fbf;
  background: linear-gradient(180deg, #e8d4ef 0%, #d7b7e2 100%);
  color: #49224f;
}

.class-status-top .class-list {
  flex: 1;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.class-status-top .top-class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 6px;
  overflow: visible;
  padding-bottom: 0;
  height: 100%;
  align-content: stretch;
}

.class-status-top {
  display: flex;
  flex-direction: column;
  padding-bottom: 15px;
  min-height: 0;
  height: auto;
}

.grade-reward-top .class-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.grade-penalty-top .class-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.grade-reward-top .class-box .pos {
  color: #1e4fff;
}

.grade-reward-top .title-blue {
  color: #1e4fff;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.grade-penalty-top .title-red {
  color: #c7364a;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.featured-bottom {
  min-height: 220px;
}

.side-news-bottom .mini {
  min-height: 0;
}

.side-news-bottom .recent-list {
  max-height: 147px;
}

.recent-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#recentRewardBox,
#recentPenaltyBox {
  margin-top: 0;
  height: 280px;
  min-height: 280px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.section-head a,
.section-head span {
  color: #3158ff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.input-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reset-all-btn {
  border: 1px solid #d9a8b7;
  background: linear-gradient(180deg, #fff0f5 0%, #ffe5ec 100%);
  color: #8a2948;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 2px 0 rgba(143, 63, 90, 0.2),
    0 6px 10px rgba(114, 40, 66, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.reset-all-btn:hover {
  transform: translateY(-1px);
}

.reset-all-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(92, 30, 52, 0.16),
    0 1px 0 rgba(143, 63, 90, 0.18),
    0 3px 7px rgba(114, 40, 66, 0.1);
}

.section-head.sub {
  margin-top: 25px;
  margin-bottom: 5px;
}

.section-head.sub h3 {
  margin: 0;
  font-size: 14px;
}

.keyword-log-head {
  margin-top: 25px;
}

.keyword-log {
  max-height: 64px;
  padding-right: 2px;
}

.class-list {
  display: grid;
  gap: 8px;
}

.class-list li {
  padding: 0;
  border: 0;
}

.class-name {
  font-size: 13px;
  font-weight: 700;
}

.class-score {
  font-size: 11px;
  color: #4f5f77;
}

.grade-group {
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  padding: 5px;
  background: #f8fbff;
  min-height: 58px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.class-status-top .grade-group + .grade-group {
  margin-top: 0;
}

.class-status-top .grade-group {
  height: 100%;
  padding: 10px;
}

.grade-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.top-class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  height: 100%;
}

.class-box {
  border: 1px solid #d6dfec;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 32px;
  height: 100%;
}

.class-status-top .class-box,
.grade-reward-top .class-box,
.grade-penalty-top .class-box {
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 5px 10px rgba(14, 30, 62, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.class-status-top .class-box:hover,
.grade-reward-top .class-box:hover,
.grade-penalty-top .class-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 9px 16px rgba(14, 30, 62, 0.16);
  filter: brightness(1.01);
}

.class-status-top .class-box {
  position: relative;
  grid-template-columns: 2fr 1fr;
  align-items: stretch;
  justify-items: stretch;
  text-align: left;
  gap: 0;
  padding: 8px;
}

.class-status-top .class-box::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(100% / 3);
  border-left: 1px dashed #aebbd0;
}

.class-status-top .class-box::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(200% / 3);
  border-left: 1px dashed #aebbd0;
}

.class-status-left,
.class-status-right {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.class-status-left {
  padding-right: 0;
}

.class-status-right {
  padding-left: 0;
}

.class-status-left p,
.class-status-right p {
  margin: 0;
}

.class-name-split {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 100%;
  align-items: center;
}

.class-name-split .class-main-text {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  text-align: center;
}

.class-name-split .class-main-text b {
  font-size: 13px;
}

.class-name-split .class-net-point,
.class-name-split .class-net-point b {
  font-size: 18px;
}

.class-name-split .class-net-point {
  display: flex;
  align-items: center;
  justify-content: center;
}

.class-right-metrics {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.class-right-metrics p {
  margin: 0;
  font-size: 10px;
  color: #4f5f77;
}

.class-net-point,
.class-net-point b {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  font-family: inherit;
  color: #121722;
  text-align: center;
  justify-self: center;
  align-self: center;
}

.class-main-text {
  font-size: 25px;
  font-weight: 700;
  font-family: inherit;
  color: #121722;
}

.class-name-text {
  font-size: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: center;
  width: 100%;
  height: 100%;
  text-align: center;
  transform: translateX(-5px);
}

.class-name-one-one {
  transform: translateX(-2px);
}

.class-main-text b {
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #121722;
}

.class-box.grade-1 {
  background: #fff8d9;
}

.class-box.grade-2 {
  background: #eaf3ff;
}

.class-box.grade-3 {
  background: #eafbe9;
}

.class-box p {
  margin: 0;
  font-size: 10px;
  color: #4f5f77;
}

.totals-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.totals-row p {
  white-space: nowrap;
}

.totals-row p + p {
  border-left: 1px dashed #aebbd0;
  padding-left: 8px;
}

.class-box .pos {
  color: #1b8a55;
}

.class-box .neg {
  color: #c4364b;
}

.class-box .net {
  margin-top: 1px;
  font-size: 12px;
  color: #202b3f;
  font-weight: 700;
}

.point-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.point-form label {
  display: grid;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
}

.inline-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 110px auto;
  justify-content: start;
  align-items: end;
  gap: 6px;
}

.or-text {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #65748d;
}

.name-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 110px auto;
  justify-content: start;
  align-items: end;
  gap: 6px;
}

.data-status {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 11px;
  color: #5a6b89;
}

.data-status.error {
  color: #c7364a;
}

.inline-fields label,
.name-fields label {
  width: 110px;
}

.point-form input {
  height: 30px;
  border: 1px solid #cfd9e6;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 11px;
}

#studentId {
  width: 100%;
}

#studentName {
  width: 100%;
}

.point-form .wide {
  grid-column: 1 / -1;
}

.point-form button {
  width: 56px;
  padding: 0;
  height: 30px;
  border: 1px solid #173a7a;
  border-radius: 7px;
  background: linear-gradient(180deg, #2f63c8 0%, #1d4aa2 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 3px 0 #173a7a,
    0 7px 14px rgba(18, 47, 102, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.point-form button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.point-form button:active {
  transform: translateY(1px);
  box-shadow:
    0 2px 0 #173a7a,
    0 5px 10px rgba(18, 47, 102, 0.2);
}

.student-preview {
  --preview-panel-height: 200px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
  margin-top: 19px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  justify-content: start;
  align-items: start;
  min-height: 0;
}

.student-photo-wrap {
  width: 100%;
  height: var(--preview-panel-height);
  min-height: var(--preview-panel-height);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cfd8e5;
  background: #e9eff9;
  margin-bottom: 0;
}

.preview-class-box {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  align-self: start;
  width: 100%;
  height: var(--preview-panel-height);
  min-height: var(--preview-panel-height);
  justify-items: stretch;
}

.preview-student-card {
  border: 1px solid #d6dfec;
  border-radius: 8px;
  background: #fff;
  padding: 8px 6px;
  text-align: center;
  align-self: center;
}

.preview-student-card strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #202b3f;
}

.preview-mini-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-self: end;
}

.preview-mini-card {
  border: 1px solid #d6dfec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4px;
}

.preview-mini-card p {
  margin: 0;
  font-size: 10px;
  color: #4f5f77;
}

.preview-mini-card b {
  font-size: 13px;
  color: #202b3f;
}

.preview-mini-grid .preview-mini-card:nth-child(1) {
  background: #e9f8ef;
  border-color: #9edbb3;
}

.preview-mini-grid .preview-mini-card:nth-child(1) p {
  color: #226b3f;
}

.preview-mini-grid .preview-mini-card:nth-child(2) {
  background: #fdeef2;
  border-color: #efb8c8;
}

.preview-mini-grid .preview-mini-card:nth-child(2) p {
  color: #9b2f53;
}

.preview-mini-grid .preview-mini-card:nth-child(3) {
  background: #edf3ff;
  border-color: #b9c9ef;
}

.preview-mini-grid .preview-mini-card:nth-child(3) p {
  color: #2a4a96;
}

.student-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  display: block;
  cursor: pointer;
}

.activity-list {
  max-height: 90px;
  overflow-y: auto;
}

.activity-list li {
  border-top: 1px solid #e2e8f1;
  padding: 5px 0;
  font-size: 11px;
}

.activity-list li:first-child {
  border-top: 0;
}

.activity-time {
  color: var(--muted);
  font-size: 10px;
  margin-left: 5px;
}

.site-footer {
  border-top: 1px solid #cfd8e5;
  background: #e4e9ef;
  margin-top: auto;
  padding: 22px 0 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  justify-items: center;
}

.footer-col {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: center;
  text-align: center;
}


.footer-col h4 {
  margin: 0;
  font-size: 18px;
  text-align: center;
}

.footer-col p,
.footer-col a {
  margin: 0;
  text-decoration: none;
  color: #3f4b5f;
  font-size: 13px;
}

.toast-root {
  position: fixed;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  min-width: 320px;
  max-width: 520px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-align: center;
  color: #eef4ff;
  background: rgba(17, 29, 58, 0.92);
  border: 1px solid rgba(140, 167, 219, 0.55);
  box-shadow: 0 12px 30px rgba(8, 16, 34, 0.28);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: rgba(82, 177, 141, 0.6);
}

.toast.error {
  border-color: rgba(215, 110, 132, 0.7);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 37, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-card {
  width: min(92vw, 380px);
  background: #ffffff;
  border: 1px solid #d5e0f2;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(14, 28, 58, 0.22);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.auth-card h3 {
  margin: 0;
  font-size: 22px;
  color: #183462;
}

.auth-message {
  margin: 0;
  font-size: 13px;
  color: #4d5f7d;
}

.auth-card label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #2c4370;
}

.auth-card input {
  border: 1px solid #c7d6ef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.auth-login-btn {
  border: 1px solid #7ea0dc;
  background: linear-gradient(180deg, #4b7edb 0%, #315fb3 100%);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.change-pw-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.change-pw-cancel-btn {
  border: 1px solid #b8c8e4;
  background: #edf3fd;
  color: #2f4b79;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#previewStudentLabel.is-clickable {
  display: block;
  cursor: pointer;
  border: 1px solid #bcd0ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2f7ff 0%, #e6efff 100%);
  padding: 8px 10px;
  color: #1f3661;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

#previewStudentLabel.is-clickable:hover {
  color: #244f9b;
  background: linear-gradient(180deg, #e8f1ff 0%, #dce9ff 100%);
  border-color: #9fbce8;
}

.toast .toast-point {
  display: inline-block;
  margin: 0 2px;
  font-weight: 900;
}

.toast .toast-point.pos {
  color: #5cf0b0;
  text-shadow: 0 0 8px rgba(92, 240, 176, 0.35);
}

.toast .toast-point.neg {
  color: #ff8eab;
  text-shadow: 0 0 8px rgba(255, 142, 171, 0.35);
}

.toast .toast-login-word {
  color: #8fffd1;
  text-shadow: 0 0 8px rgba(143, 255, 209, 0.35);
}

.toast .toast-logout-word {
  color: #ffd38a;
  text-shadow: 0 0 8px rgba(255, 211, 138, 0.35);
}

.toast .toast-sync-word {
  color: #8fd5ff;
  text-shadow: 0 0 8px rgba(143, 213, 255, 0.35);
}

.toast .toast-user-word {
  color: #ffe08f;
  text-shadow: 0 0 8px rgba(255, 224, 143, 0.35);
}

.toast .toast-student-word {
  color: #a7ffbe;
  text-shadow: 0 0 8px rgba(167, 255, 190, 0.35);
}

.toast .toast-detail-word {
  color: #9dc6ff;
  text-shadow: 0 0 8px rgba(157, 198, 255, 0.35);
}

.toast .toast-digit-word {
  color: #ffd36a;
  text-shadow: 0 0 8px rgba(255, 211, 106, 0.35);
}

.toast .toast-reset-word {
  color: #8fc6ff;
  text-shadow: 0 0 8px rgba(143, 198, 255, 0.35);
}
.toast .toast-print-word {
  color: #ffd6a0;
  text-shadow: 0 0 8px rgba(255, 214, 160, 0.35);
}

.undo-wrap {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%) translateY(8px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.undo-wrap.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.undo-snackbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: min(92vw, 560px);
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 26px rgba(8, 16, 34, 0.3);
}

.undo-message {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.undo-btn {
  border: 1px solid #ff9f3f;
  background: linear-gradient(180deg, #ffb04a 0%, #ff8126 100%);
  color: #ffffff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(255, 126, 28, 0.35);
  white-space: nowrap;
  flex: 0 0 auto;
}

.undo-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.25) 0%, rgba(9, 15, 29, 0.7) 45%, rgba(6, 10, 20, 0.82) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  place-items: center;
  z-index: 10000;
}

.modal-backdrop.is-open {
  display: grid;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(92vw, 500px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #c8d6ee;
  border-radius: 16px;
  box-shadow:
    0 28px 52px rgba(4, 12, 28, 0.34),
    0 6px 16px rgba(31, 76, 151, 0.16);
  padding: 18px 18px 16px;
  display: grid;
  gap: 12px;
  transform-origin: center;
  animation: modal-pop-in 0.18s ease-out;
}

.modal-card h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #0e2142;
}

.modal-sub {
  margin: 0;
  color: #3f5678;
  font-size: 20px;
  font-weight: 600;
  padding: 0 0 2px;
}

.modal-label {
  display: grid;
  gap: 5px;
  font-size: 16px;
  font-weight: 700;
  color: #1b3158;
}

.modal-label input {
  height: 52px;
  border: 1px solid #c3d2ea;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  background: #f7faff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.modal-label input:focus {
  outline: none;
  border-color: #3f7ae0;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(63, 122, 224, 0.18);
}

.modal-preset-group {
  display: grid;
  gap: 8px;
}

.modal-preset-btn {
  border: 1px solid #c5d3eb;
  border-radius: 12px;
  min-height: 46px;
  padding: 0 12px;
  background: linear-gradient(180deg, #f7faff 0%, #eaf1ff 100%);
  color: #1b3764;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
  box-shadow: 0 2px 8px rgba(43, 76, 134, 0.12);
}

.modal-preset-btn:hover {
  transform: translateY(-1px);
  border-color: #9bb6e4;
}

.modal-preset-btn:active {
  transform: translateY(1px);
}

.modal-preset-btn.is-selected {
  border-color: #2f6ff0;
  background: linear-gradient(180deg, #3f7bf3 0%, #2b5ec0 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 73, 152, 0.28);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.modal-btn {
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.modal-btn:hover {
  transform: translateY(-1px);
}

.modal-btn:active {
  transform: translateY(1px);
}

.modal-btn.cancel {
  border: 1px solid #b9c4d6;
  background: linear-gradient(180deg, #f6f8fc 0%, #e6ebf3 100%);
  color: #2f3f5d;
  box-shadow: 0 2px 8px rgba(58, 72, 96, 0.14);
}

.modal-btn.submit {
  border: 1px solid #1f4ea6;
  background: linear-gradient(180deg, #2f6ff0 0%, #1f4fb8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(20, 64, 149, 0.34);
}

.modal-btn.submit:hover {
  filter: brightness(1.05);
}

.modal-btn.cancel:hover {
  filter: brightness(1.02);
}

.modal-processing {
  margin: 0;
  color: #2d5fb9;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-processing::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(45, 95, 185, 0.28);
  border-top-color: #2d5fb9;
  animation: modal-spin 0.8s linear infinite;
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1024px) {
  .admin-student-add-grid {
    grid-template-columns: 1fr;
  }

  .admin-student-grade-grid {
    grid-template-columns: 1fr;
  }

  .main {
    height: auto;
    overflow: visible;
    grid-template-rows: none;
    padding-bottom: 18px;
  }

  .menu {
    display: none;
  }

  .hero-grid,
  .info-row,
  .content-grid,
  .all-class-grid {
    grid-template-columns: 1fr;
  }

  .right-column-stack {
    grid-template-columns: 1fr;
  }


  .info-row {
    width: 100%;
  }

  .hero-grid {
    height: auto;
  }

  .intro {
    border-left: 0;
    border-top: 1px solid #e3e8f1;
    padding-left: 0;
    padding-top: 10px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .top-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-intro-grid {
    grid-template-columns: 1fr;
  }

  .service-intro-points {
    grid-template-columns: 1fr;
  }

  .service-intro-hero h3 {
    font-size: 23px;
  }

  .service-intro-page,
  .legal-page {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .legal-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .legal-article-list {
    grid-template-columns: 1fr;
  }

  .class-status-top .top-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

  .class-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grade-tabs {
    flex-wrap: wrap;
  }

  .input-layout {
    grid-template-columns: 1fr;
  }

  .student-preview,
  .point-form {
    grid-column: auto;
  }

  .student-preview {
    --preview-panel-height: 120px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    justify-content: start;
    align-items: start;
  }

  .student-photo-wrap {
    width: 120px;
    height: var(--preview-panel-height);
    min-height: var(--preview-panel-height);
    margin-bottom: 0;
  }

  .preview-class-box {
    height: var(--preview-panel-height);
    min-height: var(--preview-panel-height);
  }
}

@media (max-width: 768px) {
  #backToClassDetailBtn {
    display: none;
  }

  #studentHistoryAllBtn p,
  #studentHistoryRewardBtn p,
  #studentHistoryPenaltyBtn p {
    width: 2.6em;
    margin: 0 auto;
    line-height: 1.1;
    white-space: normal;
    word-break: keep-all;
  }

  .modal-card {
    width: min(94vw, 420px);
    padding: 14px;
  }

  .modal-card h3 {
    font-size: 22px;
  }

  .modal-sub {
    font-size: 16px;
  }

  .modal-label {
    font-size: 14px;
  }

  .modal-label input {
    height: 46px;
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .side-news {
    grid-template-columns: 1fr;
  }

  .top-class-grid {
    grid-template-columns: 1fr;
  }

  .class-status-top .top-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .class-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    height: 54px;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .brand {
    gap: 6px;
    min-width: 0;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  .brand strong {
    font-size: 17px;
    white-space: nowrap;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .site-footer {
    padding: 18px 0 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer-col {
    justify-items: center;
    text-align: center;
    gap: 6px;
  }

  .footer-col h4 {
    font-size: 16px;
  }

  .footer-col p,
  .footer-col a {
    font-size: 13px;
    line-height: 1.45;
  }

  .footer-col-intro,
  .footer-col-category,
  .footer-col-channel {
    display: none;
  }

  .header-actions {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    gap: 0;
  }

  .header-actions > :not(#logoutBtn) {
    display: none !important;
  }

  #logoutBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .class-status-top,
  .grade-reward-top,
  .grade-penalty-top,
  #recentPenaltyBox,
  .right-column-stack {
    display: none !important;
  }

  .left-column-stack > :not(.input-section) {
    display: none !important;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .left-column-stack {
    width: 100%;
    order: 1;
  }

  .input-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: auto;
    height: auto !important;
    padding: 16px;
  }

  .input-section .input-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .input-section .student-info-card {
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 18px;
    position: static;
    width: 100%;
  }

  .input-section .student-photo-wrap {
    width: 95%;
    height: 190px;
    min-height: 190px;
    padding-top: 6px;
  }

  .input-section .student-photo-wrap img {
    object-fit: contain;
  }

  .input-section .preview-class-box {
    width: 95%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    position: static;
  }

  .input-section .preview-student-card {
    width: 95%;
  }

  .input-section .preview-mini-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .input-section .preview-mini-card {
    aspect-ratio: 1 / 1;
    min-height: 72px;
  }

  .input-section .preview-mini-card p {
    font-size: 12px;
  }

  .input-section .preview-mini-card b {
    font-size: 16px;
  }

  .input-section .point-form {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .input-section .or-text {
    display: none;
  }

  .input-section .inline-fields,
  .input-section .name-fields {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: end;
    gap: 8px;
    justify-content: stretch;
    margin-bottom: 8px;
  }

  .input-section .inline-fields label,
  .input-section .name-fields label {
    flex: 0 0 70%;
    width: 100%;
  }

  .input-section .point-form input {
    width: 100%;
  }

  .input-section .inline-fields button,
  .input-section .name-fields button {
    flex: 0 0 30%;
    width: 30%;
    min-height: 50px;
    font-size: 16px;
    padding: 0 10px;
  }

  .input-section .point-form input {
    min-height: 48px;
    padding: 0 12px;
    font-size: 16px;
  }

  .input-section .point-form button {
    min-height: 50px;
    font-size: 16px;
  }

  .input-section .data-status {
    grid-column: 1 / -1;
    margin-top: 25px;
    margin-bottom: 8px;
  }

  .input-section .quick-reason-panel {
    order: 3;
    display: grid;
    gap: 10px;
  }

  .input-section .quick-reason-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .input-section .quick-reason-head .reason-more-btn {
    width: 70px;
    justify-content: center;
    background: #e9f2ff;
    border-color: #6f98d8;
    color: #1b3f75;
  }

  .input-section .reward-group .reason-more-btn {
    display: inline-flex;
  }

  .input-section .reward-group .reward-extra {
    display: none;
  }

  .input-section .reward-group.is-expanded .reward-extra {
    display: inline-flex;
  }

  .input-section .penalty-group .reason-more-btn {
    display: inline-flex;
  }

  .input-section .penalty-group .quick-reason-buttons .reason-btn.penalty {
    display: none;
  }

  .input-section .penalty-group .quick-reason-buttons .reason-btn.penalty:nth-child(-n+5) {
    display: inline-flex;
  }

  .input-section .penalty-group.is-expanded .quick-reason-buttons .reason-btn.penalty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }

  .input-section .reason-btn {
    width: 100%;
    min-height: 50px;
    font-size: 16px;
  }

  .main,
  .left-column-stack {
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }

  html,
  body {
    scroll-padding-bottom: 130px;
  }

  .all-class-grid {
    grid-template-columns: 1fr;
  }

  .grade-tab {
    flex: 1 1 0;
    text-align: center;
  }

  .undo-snackbar {
    max-width: min(96vw, 540px);
    gap: 8px;
    padding: 9px 10px;
  }

  .undo-message {
    font-size: 12px;
  }

  .undo-btn {
    font-size: 12px;
    padding: 6px 9px;
  }
}

@media (max-width: 1024px) {
  .reward-summary-grid {
    grid-template-columns: 1fr;
  }

  .reward-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .reward-detail-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .reward-detail-tools {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reward-detail-tools input,
  .reward-detail-tools select,
  #rewardExportBtn {
    width: 100%;
  }

  .reward-table {
    min-width: 560px;
  }
}

/* Layout stabilization: footer must stay after content */
html, body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container.main {
  flex: 1 0 auto;
  display: block;
  height: auto;
  min-height: 0;
  overflow: visible;
}

#viewInput {
  height: auto;
  min-height: 0;
  overflow: visible;
  padding-bottom: 32px;
}

#viewInput .hero-grid,
#viewInput .left-column-stack,
#viewInput .right-column-stack,
#viewInput .input-section,
#viewInput .input-top {
  position: static;
  height: auto;
  min-height: 0;
  max-height: none;
}

#viewInput .hero-grid {
  align-items: start;
}

#viewInput .input-top {
  overflow: hidden;
}

footer.site-footer,
.site-footer {
  position: static;
  inset: auto;
  transform: none;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  margin-top: 28px;
  flex-shrink: 0;
  clear: both;
}
.name-match-list {
  display: grid;
  gap: 8px;
  max-height: min(40vh, 220px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.name-match-list::-webkit-scrollbar {
  width: 8px;
}

.name-match-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(28, 44, 78, 0.88);
  background: linear-gradient(180deg, rgba(140, 167, 219, 0.9) 0%, rgba(82, 177, 141, 0.9) 100%);
}

.name-match-btn {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(155, 181, 229, 0.42);
  background: rgba(39, 58, 98, 0.82);
  color: #eef4ff;
  border-radius: 12px;
  padding: 12px 13px 12px 15px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 10px 24px rgba(8, 16, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.name-match-btn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #8fd5ff 0%, #5cf0b0 56%, #ffd38a 100%);
}

.name-match-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.name-match-btn:focus-visible {
  outline: 2px solid rgba(80, 135, 219, 0.35);
  outline-offset: 2px;
}

.name-match-btn small {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #c4d4f0;
}

.name-match-btn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.name-match-student-name {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #eef4ff;
}

.name-match-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(92, 240, 176, 0.16);
  color: #a6ffdc;
  border: 1px solid rgba(92, 240, 176, 0.32);
  font-size: 11px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.name-match-btn-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-match-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid rgba(143, 213, 255, 0.28);
  border-radius: 999px;
  background: rgba(143, 213, 255, 0.12);
  color: #a9ddff;
  font-size: 11px;
  font-weight: 800;
}

.name-match-tip {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #c8d5eb;
}

/* Stylish duplicate-name picker */
#nameMatchOverlay {
  align-items: flex-start;
  padding: clamp(16px, 4vh, 32px) 12px 12px;
  background: rgba(18, 28, 52, 0.34);
  backdrop-filter: blur(6px);
}

#nameMatchOverlay .name-match-card {
  width: min(88vw, 380px);
  border: 1px solid rgba(155, 181, 229, 0.58);
  border-radius: 14px;
  padding: 14px;
  gap: 12px;
  color: #eef4ff;
  background: rgba(31, 47, 84, 0.9);
  box-shadow:
    0 12px 30px rgba(8, 16, 34, 0.22);
  backdrop-filter: blur(6px);
  animation: nameMatchPopIn 0.2s ease;
}

.name-match-hero {
  position: relative;
  overflow: hidden;
  padding: 0 0 2px;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.name-match-hero::after {
  display: none;
}

.name-match-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.name-match-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(143, 213, 255, 0.28);
  background: rgba(143, 213, 255, 0.12);
  color: #a9ddff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.name-match-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(92, 240, 176, 0.16);
  color: #a6ffdc;
  border: 1px solid rgba(92, 240, 176, 0.28);
  font-size: 11px;
  font-weight: 900;
  box-shadow: none;
}

#nameMatchOverlay .auth-card h3 {
  margin: 0 0 6px;
  color: #eef4ff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.1px;
}

#nameMatchOverlay .auth-message {
  margin: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c6d3e8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

#nameMatchOverlay .name-match-list {
  padding: 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

#nameMatchOverlay .name-match-btn {
  border-color: rgba(155, 181, 229, 0.42);
}

#nameMatchOverlay .name-match-btn:hover {
  border-color: rgba(82, 177, 141, 0.6);
  box-shadow:
    0 12px 24px rgba(8, 16, 34, 0.26);
}

#nameMatchOverlay .name-match-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(8, 16, 34, 0.22);
}

#nameMatchOverlay .change-pw-actions.name-match-actions {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#nameMatchOverlay .change-pw-cancel-btn {
  border: 1px solid rgba(155, 181, 229, 0.42);
  background: rgba(143, 213, 255, 0.12);
  color: #eef4ff;
  min-width: 72px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

@keyframes nameMatchPopIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  #nameMatchOverlay .name-match-card {
    width: min(92vw, 340px);
    padding: 12px;
    border-radius: 14px;
  }

  .name-match-hero {
    padding: 0;
    border-radius: 0;
  }

  #nameMatchOverlay .auth-card h3 {
    font-size: 18px;
  }

  .name-match-btn {
    padding: 11px 12px 11px 14px;
    border-radius: 12px;
  }

  .name-match-btn-head {
    align-items: flex-start;
  }

  .name-match-student-name {
    font-size: 15px;
  }

  #nameMatchOverlay .change-pw-actions.name-match-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .name-match-tip {
    width: 100%;
  }

  #nameMatchOverlay .change-pw-cancel-btn {
    width: 100%;
  }
}
